Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

controls:table in jsp

 
Karim eltounsi
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have this control table that i m trying to enhance. it is to be multi grid color such as that each row has a color. using the below code i dont get the full row colored i only get the part where there is text so the cell is not fully colored it has two colors. i tried using a table fro each row and i t worked but my manager doesn't like that idea. anyone can think of another solution to get this table looking right.

here is part of the code for the table to get an idea:

<controls:table tableStyle="table-label-text5" lineStyle="line-row">
<controls:row labelStyle="table-label-text3" dataStyle="table-normal-text3" styleId="name">
<controls:label>
<b><bean:message key="kiosk.name" /></b>
</controls:label>
<controls:data >
<html:text property="name" size="24" styleClass="table-cell-text" />
</controls:data>
<controls:label >
<bean:message key="kiosk.name.desc" />
</controls:label>
</controls:row>

<controls:row labelStyle="table-label-text4" dataStyle="table-normal-text4" styleId="normal">
<controls:label >
<b><bean:message key="kiosk.description" /></b>
</controls:label>
<controls:data >
<html:textarea property="description" cols="26" styleClass="table-cell-text" />
</controls:data>
<controls:label>
<bean:message key="kiosk.description.desc" />
</controls:label>
</controls:row>
</controls:table>

here is what the styling looks like:
.table-label-text3 {
font-size:10pt;
color: #4A4949;
font-weight: normal;
background-color: #FFFFFF;

font-family : Arial, Verdana, Helvetica,
Sans-Serif;
width: 100%;
align:center;
 
Herman Schelti
Ranch Hand
Posts: 387
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mohamed,

can you post (some of) the html that gets generated?

Herman
 
Karim eltounsi
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thisi s the html generated by the table.


<table class="table-label-text5" border="1" cellspacing="0" cellpadding="0" width="100%" >
<tr>
<td scope="row" >
<div align="left" class="table-label-text3"><label for="name"><b>Name</b></label> </div>
</td>
<td >
<div align="left" class="table-normal-text3"><input type="text" name="name" size="24" value="HBADREDDINE-6E9" class="table-cell-text"> </div>
</td>
<td scope="row" >
<div align="left" class="table-label-text3"><label for="name">The machine/DNS name for this kiosk.</label> </div>
</td>
</tr>
<tr>
<td scope="row" >
<div align="left" class="table-label-text4"><label for="normal"><b>Description</b></label> </div>
</td>
<td >
<div align="left" class="table-normal-text4"><textarea name="description" cols="26" class="table-cell-text">Haikel's Machine</textarea> </div>
</td>
<td scope="row" >
<div align="left" class="table-label-text4"><label for="normal">Provide a description or useful notations about this kiosk.</label> </div>
</td>
</tr>
<tr>
<td scope="row" >
<div align="left" class="table-label-text3"><label for="normal"><b>Management Port</b></label> </div>
</td>
<td >
<div align="left" class="table-normal-text3"><input type="text" name="jmxPort" size="24" value="20002" class="table-cell-text"> </div>
</td>
<td scope="row" >
<div align="left" class="table-label-text3"><label for="normal">The port that management applications will use to manage this platform instance.</label> </div>
</td>
</tr>
<tr>
<td scope="row" >
<div align="left" class="table-label-text4"><label for="normal"><b>Remote Agent Port</b></label> </div>
</td>
<td >
<div align="left" class="table-normal-text4"><input type="text" name="remoteAgentPort" size="24" value="20003" class="table-cell-text"> </div>
</td>
<td scope="row" >
<div align="left" class="table-label-text4"><label for="normal">Kiosk's RemoteAgent port of service. The RemoteAgent performs many management tasks and provides managment support for SelfServ kiosks and management applications.</label> </div>
</td>
</tr>
</table>
 
Herman Schelti
Ranch Hand
Posts: 387
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mohamed,

Lots of options here:

if you change ".table-label-text3 {" into:
".table-label-text3, .table-normal-text3 {", then
it will also apply for elements with class="table-normal-text3"

All these classes make it look rather complicated, do you really need them?

Herman
 
Karim eltounsi
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Herman,

can you elaborate more your answer with an example. i m not sure i understood exactly what you meant. if you have nay resources about controls table please feel free to drop them in. i m not really familiar with it.
[ July 04, 2007: Message edited by: Mohamed Badreddine ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this seems to have turned into a CSS discussion, it has been moved to a more appropriate forum.
 
Dan Drillich
Ranch Hand
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mohamed,

The CSS class(es) that you posted are -



Can you please post all the classes?

Regards,
Dan
 
Karim eltounsi
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Karim eltounsi
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i took your advice and i used this stylesheet code:



for the following table:


but i still dont get what i want here is the html generated by the above code:


the middle column looks fine but the first and the third they don't take the full background color. only the area that has text. Any more suggestion would be very appreciated. Thanks
 
Herman Schelti
Ranch Hand
Posts: 387
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

if you want to give a whole row a certain color, you will have to generate something like(I've tried to make your code as simple as possible)

Can you give a row a color with something like
<controls:row rowStyle="table-text3">?

Herman

 
Karim eltounsi
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

thanks for your reply. i have done that table before but the specification requires to have a control table and i still cant get it to look right. any help would be very appreciated.
 
Herman Schelti
Ranch Hand
Posts: 387
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

of course you have to work with this control:table, my question is:
can you assign a stylesheet to a row?

With something like <controls:row rowStyle="table-text3">?

Herman
PS where does this control:table library come from, did you download it?
 
Karim eltounsi
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

rowstyle within <controls:row> is not acceptable i get an error message. i m suppose to use something like : <controls:row labelStyle="table-label3" dataStyle="cellattwhite50" styleId="name">. i m not sure where the control table come from my job is to upgrade new looks new graphics to an existing application
 
Herman Schelti
Ranch Hand
Posts: 387
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

because of the <div> inside the <td> I can't get the colors right with just CSS.

There's a tiny little javascript that alternates rowcolors,
it's at http://www.sitepoint.com/article/background-colors-javascript.

It took me less than 5 minutes to get it working, so you'll be fine.

Herman
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic