0 Replies Latest reply on May 23, 2008 9:59 PM by zemanel

    Calling a bean method from an onClick event

    zemanel

      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:

      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* ";");


      Any idea how to get this?
      Thanks