• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Highlighting a row when it's selected

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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}" >
<h:outputText 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}" >
<h:outputText 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}" >
<h:outputText 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}" >
<h:outputText 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}" >
<h:outputText 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}" >
<h:outputText value="#{rowElement.arrivalAirport}" />
<f:param name="routeDisplayId" value="#{rowElement.routeDisplayId }" />
</h:commandLink>
</t:column>
</t:dataTable>
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic