Hello,
I found a solution. It is not very nice and it does not work with tables which
have a big border, but for me, it is okay.
With t:column Tag is it possible, to add a javascript function to the td Tag.
With this.parentNode.classname can the css-classname of the parent node (the tr
Tag) accessed. With this construct is it possible to highlight a complete
tablerow. Not very nice is, that the javascript code has to be added to all
t:column tags.
<t:dataTable
var="entry"
value="#{start.tableModel}"
headerClass="..."
rowClasses="tableRowNormal"
styleClass="..."
border="0">
<f:facet name="header">
<h:outputText value="TableHeader" />
</f:facet>
<t:column
headerstyleClass="..."
styleClass="...."
onmouseover="this.parentNode.className='tableRowHighlight'"
onmouseout="this.parentNode.className='tableRowNormal'">
....
</t:column>
<t:column
headerstyleClass="..."
styleClass="...."
onmouseover="this.parentNode.className='tableRowHighlight'"
onmouseout="this.parentNode.className='tableRowNormal'">
....
</t:column>
</t:datatable>
> -----Ursprüngliche Nachricht-----
> Von: "MyFaces Discussion" <[email protected]>
> Gesendet: 15.08.07 14:05:15
> An: MyFaces Discussion <[email protected]>
> Betreff: Re: Hightlight a tableRow onMouseOver
>
> Hi Jochen,
>
> you can try tomahawk's dataList for rendering the table's rows instead,
> it gives you more flexibility. Have a look at
> http://myfaces.apache.org/tomahawk/dataList.html. Though, you have to
> write your own code for rendering the table header and for outputting
> all those TR- and TD-tags.
>
> Cheers,
>
> Christopher
>
>
> Jochen Zink schrieb:
> > Hello,
> >
> > I want to highlight a complete tableRow of a h:dataTable component.
> >
> > With blank HTML I can use JavaScript like this:
> > <table width="100%">
> > <tr class="tableRowNormal" onMouseOver="className='tableRowHighlight'"
> > onMouseOut="className='tableRowNormal'">
> > <td>23232323</td>
> > <td>1000</td>
> > <td>Name1</td>
> > </tr>
> > </table>
> >
> > But I don't find anything to address a single whole tablerow with JSF?
> >
> > The second think is similar. I want to have a whole tableRow as link. With
> > blank HTML:
> > <tr onClick="alert('Submit wird über eine Javascript Methode
> > ausgelöst...');">
> > <td class="fieldvalue">23232323</td>
> > <td>1000</td>
> > <td>Name1</td>
> > </tr>
> >
> > Has anyone some ideas or solutions?
> >
> > Thanks a lot!
> > Regards
> > Jochen
> > _____________________________________________________________________
> > Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> > http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
> >
> >
> >
>
>
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066