Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Highlighting a row when it's selected

 
David Mc Dyre
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i want the background colour of a row i select to change colour to yellow when i select it.

I am using 2 dataTables and rendering the second if a certain action is called, i want the second dataTable to to highlight the selected row, the problem is it changes the background colour of all the rows from white to yellow when 1 row is selected.

If anyone has a solution or a suggestion or can help if any way i would really appreciate it.
Thanks in advance.
Here are the dataTables:

<t:dataTable id="routeList" value="#{RouteHandler.routeWithIdList}" var="rowElement" cellspacing="0" cellpadding="3"
border="0" headerClass="listhead" columnClasses="listresults" bgcolor="#FFFFFF" rendered="#{!RouteHandler.selected}">
<t:column width="104">
<h:commandLink id="editLink" action="#{RouteHandler.prepareAddScheduleAction}" >
<hutputText value="#{rowElement.carrierCode}"/>
<f:param name="routeDisplayId" value="#{rowElement.routeDisplayId }"/>
</h:commandLink>
</t:column>
<t:column width="165">
<h:commandLink id="editLink" action="#{RouteHandler.prepareAddScheduleAction}" >
<hutputText value="#{rowElement.departureAirport}"/>
<f:param name="routeDisplayId" value="#{rowElement.routeDisplayId }"/>
</h:commandLink>
</t:column>
<t:column width="920">
<h:commandLink id="editLink" action="#{RouteHandler.prepareAddScheduleAction}" >
<hutputText value="#{rowElement.arrivalAirport}" />
<f:param name="routeDisplayId" value="#{rowElement.routeDisplayId }"/>
</h:commandLink>
</t:column>
</t:dataTable>
<t:dataTable id="routeList" value="#{RouteHandler.routeWithIdList}" var="rowElement" cellspacing="0" cellpadding="3"
border="0" headerClass="listhead" columnClasses="listresults" bgcolor="##FFFF66" rendered="#{RouteHandler.selected}">
<t:column width="104" style="background-color:#FFFF66;">
<h:commandLink id="editLink" action="#{RouteHandler.prepareAddScheduleAction}" >
<hutputText value="#{rowElement.carrierCode}"/>
<f:param name="routeDisplayId" value="#{rowElement.routeDisplayId }" />
</h:commandLink>
</t:column>
<t:column width="165" style="background-color:#FFFF66;">
<h:commandLink id="editLink" action="#{RouteHandler.prepareAddScheduleAction}" >
<hutputText value="#{rowElement.departureAirport}"/>
<f:param name="routeDisplayId" value="#{rowElement.routeDisplayId }" />
</h:commandLink>
</t:column>
<t:column width="920" style="background-color:#FFFF66;">
<h:commandLink id="editLink" action="#{RouteHandler.prepareAddScheduleAction}" >
<hutputText value="#{rowElement.arrivalAirport}" />
<f:param name="routeDisplayId" value="#{rowElement.routeDisplayId }" />
</h:commandLink>
</t:column>
</t:dataTable>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<t:dataTable id=


What is t:dataTable?
Is it your own custom tag or are you using a 3rd party library.
 
David Mc Dyre
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ben,

It's a tomahawk dataTable i'm not sure why it has to be t:dataTable, but it does everything else that it should do expect the outlined problem.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the issue involves a 3rd party library, it's a good idea to mention which one you're using in the first post.

Since the output isn't being build with JSP, I'm going to move this to our Other Open Source Projects forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic