myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Calling a bean method from an onClick event
Date Sat, 24 May 2008 02:19:37 GMT
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/users@myfaces.apache.org/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/%3c5F3FE6FFFCC6C04FB1D74825AFE2E091B1F7C3@venus.sybit.de%3e


On Fri, May 23, 2008 at 9:46 PM, Nuno Sousa <wizard.night@gmail.com> 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
>

Mime
View raw message