Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-02-2007, 12:03 PM
Member
 
Join Date: Apr 2007
Location: Singapore
Posts: 30
yuchuang is on a distinguished road
Send a message via MSN to yuchuang
Data formatting for the <display:table>
Hi, i would like to ask in struts if we are using <display:table> to display our data, then how do we format our data? meaning how to align the data displayed to be align center instead of the default left?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-02-2007, 02:08 PM
Senior Member
 
Join Date: Mar 2007
Posts: 136
goldhouse is on a distinguished road
Code:
<logic:iterate id="someName" name="a"> <display:table id="row" name="pageScope.someName.resultEntries" class="dptag" pagesize="15" requestURI=""> <display:column title="A Column" > <A HREF='<bean:write name="row" property="url"/ >'> <bean:write name="row" property="propertyName"/></A> </display:column> <display:column title="SomeColumn" > <bean:write name="row" property="propertyName"/> </display:column> </display:table> </logic:iterate>
Then use the CSS to define the classes
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-02-2007, 07:03 PM
Member
 
Join Date: Apr 2007
Location: Singapore
Posts: 30
yuchuang is on a distinguished road
Send a message via MSN to yuchuang
I tried using CSS.
.alignment { text-align: center }
and i placed it here..
<display:column title="SomeColumn" style="alignment">
Is this the correct way to do it? I feel there's something wrong cos it don't seems to work.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 12-14-2007, 11:52 AM
Member
 
Join Date: Dec 2007
Posts: 32
felixtfelix is on a distinguished road
you can use align attribute
Try the following

<display:table name="requestScope.employeeList" pagesize="10">
<display:column property ="employeeName" title="Employee Name"/>
<display:column property ="dateOfBirth" title="Date of Birth"/>
<display:column property ="employeeCode" title="Employee Code"/>
<diaplay:column property ="employeeNumber" title="Employee Number" align="right"/>

where employeeList is a type of ArrayList which contains the formbean of EmployeeBean for each record. EmployeeBean is a class which contains property with only getters and setters.

eg.
class EmployeeBean
{
private String employeeName;


public String getEmployeeName()
{
return this.employeeName
}

public void setEmployeeName(String employeeName)
{
this.employeeName = employeeName

}
}

EmployeeBean bean = null;
List employeeList = new ArrayList();
while(rs.next())
{
bean = new EmployeeBean();
bean.setEmployeeName(rs.getString("employee_name") )
employeeList.add(bean);
}

requestScope.setAttribute("employeeList",employeeL ist);


I think it will help u.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to display the alerts in table geeta_ravikanti Database 4 04-04-2008 07:45 AM
Data from a model class won't show up in the table ayampanggang AWT / Swing 2 03-22-2008 12:15 PM
Modifying data in database table using PreparedStatement Java Tip Java Tips 0 02-09-2008 09:22 PM
how to refresh the table when a new account is added and display instantly sravanthi narra SWT / JFace 4 01-05-2008 08:39 PM
Jsf, Filtering Data In A Table Freddie JavaServer Faces 2 05-11-2007 01:59 AM


All times are GMT +3. The time now is 05:03 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org