myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Aranda <brunoara...@gmail.com>
Subject Re: extended HtmlDataTable and setRowOn events
Date Thu, 24 Nov 2005 20:11:21 GMT
I've just tried and it does work for me, using the latest SVN. I've
created a table like yours in a backing bean (the
table2.getAttributes()... is not needed as you can call directly to
the setters (setRowOnMouseOver, setRowOnMouseOut...). I've just bound
the table generated dynamically in the jsp page

<t:datatable binding="#{yourBean.table2}"  ...>
...
</t:dataTable>

and everything has worked. How are you binding the table with the jsp page?

Regards,

Bruno

2005/11/24, Maris Orbidans <Maris.Orbidans@idega.lv>:
> hi
>
> I am using extended myfaces HtmlDataTable component.   I want to add
> some javascript to RowOn...   events.
> For some reason that doesnt work.  Here is my code
>
>
>         import org.apache.myfaces.component.html.ext.HtmlDataTable;
>         ...
>         HtmlDataTable table2 =
> (HtmlDataTable)facesContext.getApplication().createComponent(HtmlDataTable.COMPONENT_TYPE);
>
>         table2.setStyleClass("person_table_iframe");
>         ...
>         table2.setRowOnClick("this.bgColor='#5683B2'");
>                   // none of those things work
>         table2.setRowOnMouseOver("this.bgColor='#5683B2'");
>         table2.getAttributes().put("rowOnMouseOver",
> "this.bgColor='#5683B2'");
>
> table2.getAttributes().put("rowOnMouseOut","this.bgColor='#5683B2'");
>
>
> And here is the result:
>
> <table cellpadding="0" cellspacing="0" class="person_table_iframe">
> <tbody id="_id0:_id1:tbody_element">
> <tr class="odd"><td class="first">date1</td><td class="middle">unit1</td><td
class="last">prov1</td></tr>
> <tr class="even"><td class="first">date2</td><td class="middle">unit2</td><td
class="last">prov2</td></tr></tbody></table>
>
>
> Can anybody help me please ?
>
> Maris
>

Mime
View raw message