I've passed el expressions into a function like this on my page code.
I'm using facelets, but I don't think it makes any difference.
rowOnClick="colorizeRow('#{routeSplitReorderPage.routeTableDataOne.uiDataClientId}',
'#{routeSplitReorderPage.routeTableDataOne.selectedRowInputClientId}',
this.id, '#{rowIndex}');"
For more detail:
http://www.mail-archive.com/[email protected]/msg35159.html
If you don't like that approach for some reason, take a look at the
thread named "How to get value from managed bean by JavaScript" from
April 2007 -- there's a number of other approaches mentioned in
response to that question.
http://mail-archives.apache.org/mod_mbox/myfaces-users/200704.mbox/[EMAIL
PROTECTED]
On Fri, May 23, 2008 at 9:46 PM, Nuno Sousa <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have a dataTable with an HtmlInputText on each cell, i want to add
> an onClick event for each inputText, so when i click on it, the values
> changes to a value stored on backbean, and when i clickout the old
> value comes again.
> The inputText have an setOnClick(String) method, but how can i get the
> bean value through a javascript function? i wanted to do something
> like:
>
> [code]dataTable.setVar("myItem");
> dataTableMatriz.setValue(matriz); // ArrayList of ArrayLists
>
> ValueBinding myItem =
> FacesContext.getCurrentInstance().getApplication().createValueBinding("#{myItem.get("
> + i + ").valueX}");
> input.setValueBinding("value", myItem);
>
> inputText.setOnClick("this.value = " + *set to a valueY just while
> selected* ";");
> input.setOnblur("this.value = " + *set again to valueX* ";");[/code]
>
>
> Any idea how to get this?
> Thanks
>
> --
> Ping is just a number timming is everything
>