You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Clément Maignien <c....@edic-syliance.com> on 2005/08/05 14:55:44 UTC
RE : dataTable> : RowOn attributes
It seems I don't give enought details or that noboby knows what I'm talking about (can't be that ...), So ... more details :
First, here is the JSF code part for the dataTable trying using CSS style :
<x:dataTable id="receptdatatable"
styleClass="dataTable"
headerClass="dataTable_Header"
footerClass="dataTable_Footer"
rowClasses="dataTable_Row"
columnClasses="dataTable_ColumnLeftWhite"
rowOnMouseOver="dataTable_RowOnMouseOver"
rowOnMouseOut="dataTable_RowOnMouseOut"
var="recept"
value="#{receptBean.receptData}"
rows="#{receptBean.nbResParPageInt}"
sortColumn="#{receptBean.sort}"
sortAscending="#{receptBean.ascending}"
preserveSort="true"
preserveDataModel="false"
rowIndexVar="numRow">
<x:column>
...
<x:column/>
...
<x:column>
...
<x:column/>
<x:dataTable>
the CSS styleclass :
.dataTable_RowOnMouseOver {
background-color: #A5CBFF;
}
.dataTable_RowOnMouseOut {
background-color: #FFFFFF;
}
Then , the other solution I tried is like in the MyFaces simple.war example (openDataTable.jsp) :
<x:dataTable id="receptdatatable"
styleClass="dataTable"
headerClass="dataTable_Header"
footerClass="dataTable_Footer"
rowClasses="dataTable_Row"
columnClasses="dataTable_ColumnLeftWhite"
rowOnMouseOver="this.style.backgroundColor='#A5CBFF'"
rowOnMouseOut="this.style.backgroundColor='#FFFFFF'"
var="recept"
value="#{receptBean.receptData}"
rows="#{receptBean.nbResParPageInt}"
sortColumn="#{receptBean.sort}"
sortAscending="#{receptBean.ascending}"
preserveSort="true"
preserveDataModel="false"
rowIndexVar="numRow">
<x:column>
...
<x:column/>
...
<x:column>
...
<x:column/>
<x:dataTable>
The both don't work : the rows of my dataTable stay White.
Finally, what is this type of expression : this.xx.yy='value' (like this.style.backgroundColor='#FFFFFF') ... never seen that before.
Please help, thanks.
Clément.
-----Message d'origine-----
De : Clément Maignien
Envoyé : vendredi 5 août 2005 09:52
À : MyFaces Discussion
Objet : <x:dataTable> : RowOn<event> attributes
Hi,
I trying to use the RowOnMouseOver & RowOnMouseOut attributes of the <x:dataTable> Tomahawk component, but with no result.
I first tried to do it like in the simple.jar tomahawk example : rowOnMouseOver="this.style.backgroundColor='#A5CBFF'", rowOnMouseOut="this.style.backgroundColor='#FFFFE0'" but it didn't work for me. Besides, what is this new kind of expression " this.XX.YY='value' " ?
Then I tried it "the old way" with a CSS style : rowOnMouseOver="dataTable_RowOnMouseOver" , rowOnMouseOut="dataTable_RowOnMouseOut", with CSS style class defining background-color attribute, but it didn't work either.
My dataTable component is quite simple. Let me know if you want to see my JSF code.
Thanks, Clément.
Re: RE : dataTable> : RowOn attributes
Posted by wk...@capesso.de.
Hi,
rowOn... works for me very well.
rowOn.. can not have CSS styles. rowOn.. needs JavaScript.
"this" is the current html-object in JavaScript.
Here is an example which runs ok.
<x:dataTable
rowOnMouseOver="this.bgColor='blue';" rowOnMouseOut="this.bgColor='#5683B2';"
styleClass="standardTable"
headerClass="standardHeader"
columnClasses="standardColumn"
rows="10"
id="data"
border="1"
var="currentRow"
value="#{posBean.pos}">
rowOn.. can not have CSS-Code. rowOn.. needs JavaScript.
"this" is the current html-object in JavaScript.
Hope this helps
Regards
Wolfgang
Clément Maignien sagte:
> It seems I don't give enought details or that noboby knows what I'm
> talking about (can't be that ...), So ... more details :
>
> First, here is the JSF code part for the dataTable trying using CSS style
> :
> <x:dataTable id="receptdatatable"
> styleClass="dataTable"
> headerClass="dataTable_Header"
> footerClass="dataTable_Footer"
> rowClasses="dataTable_Row"
> columnClasses="dataTable_ColumnLeftWhite"
> rowOnMouseOver="dataTable_RowOnMouseOver"
> rowOnMouseOut="dataTable_RowOnMouseOut"
> var="recept"
> value="#{receptBean.receptData}"
> rows="#{receptBean.nbResParPageInt}"
> sortColumn="#{receptBean.sort}"
> sortAscending="#{receptBean.ascending}"
> preserveSort="true"
> preserveDataModel="false"
> rowIndexVar="numRow">
>
> <x:column>
> ...
> <x:column/>
> ...
> <x:column>
> ...
> <x:column/>
> <x:dataTable>
>
> the CSS styleclass :
> .dataTable_RowOnMouseOver {
> background-color: #A5CBFF;
> }
>
> .dataTable_RowOnMouseOut {
> background-color: #FFFFFF;
> }
>
>
> Then , the other solution I tried is like in the MyFaces simple.war
> example (openDataTable.jsp) :
> <x:dataTable id="receptdatatable"
> styleClass="dataTable"
> headerClass="dataTable_Header"
> footerClass="dataTable_Footer"
> rowClasses="dataTable_Row"
> columnClasses="dataTable_ColumnLeftWhite"
> rowOnMouseOver="this.style.backgroundColor='#A5CBFF'"
> rowOnMouseOut="this.style.backgroundColor='#FFFFFF'"
> var="recept"
> value="#{receptBean.receptData}"
> rows="#{receptBean.nbResParPageInt}"
> sortColumn="#{receptBean.sort}"
> sortAscending="#{receptBean.ascending}"
> preserveSort="true"
> preserveDataModel="false"
> rowIndexVar="numRow">
>
> <x:column>
> ...
> <x:column/>
> ...
> <x:column>
> ...
> <x:column/>
> <x:dataTable>
>
> The both don't work : the rows of my dataTable stay White.
>
> Finally, what is this type of expression : this.xx.yy='value' (like
> this.style.backgroundColor='#FFFFFF') ... never seen that before.
>
> Please help, thanks.
> Clément.
>
> -----Message d'origine-----
> De : Clément Maignien
> Envoyé : vendredi 5 août 2005 09:52
> À : MyFaces Discussion
> Objet : <x:dataTable> : RowOn<event> attributes
>
>
> Hi,
>
> I trying to use the RowOnMouseOver & RowOnMouseOut attributes of the
> <x:dataTable> Tomahawk component, but with no result.
> I first tried to do it like in the simple.jar tomahawk example :
> rowOnMouseOver="this.style.backgroundColor='#A5CBFF'",
> rowOnMouseOut="this.style.backgroundColor='#FFFFE0'" but it didn't work
> for me. Besides, what is this new kind of expression " this.XX.YY='value'
> " ?
> Then I tried it "the old way" with a CSS style :
> rowOnMouseOver="dataTable_RowOnMouseOver" ,
> rowOnMouseOut="dataTable_RowOnMouseOut", with CSS style class defining
> background-color attribute, but it didn't work either.
>
> My dataTable component is quite simple. Let me know if you want to see my
> JSF code.
>
> Thanks, Clément.
>
>
>
>
>