***How to Invoke backing bean method by DOUBLE-CLICK the table ROW!!***

Hi,
How can I collect the selected row value & navigate to next page by DOUBLE-CLICK the result table row.
My application got searchResult page where I am displaying the list of user in result table. Then selecting any one row and navigating to master details page by clicking the continue button. Button Action method will collect the selected row userID which I am forwarding to the masterDetails page.
Same functionality I want to do by double click the row instead of clicking the button!!. I want to trigger the backing bean method if the user double click the row basically. Please help me in this how to do this?
Current button action method:
*public String userSelected() {*
FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
currentRow = binding.getRow();
selectedNetID = (String) currentRow.getAttribute("netid");
System.out.println("selectedNetID -->"+selectedNetID);
requestContext.getPageFlowScope().put("netid",selectedNetID);
return "continue";
*}*

Puthanampatti ,
Yes, I am using the same. Below is my code. I am trying to get the object of the MAIN jspx page region (where I am displaying the fragments) and refresh the one. But cant able to get the object for the region it is returning null. without refresh seems the navigation wont work.
public void doDbClick(ClientEvent clientEvent) {
FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
currentRow = binding.getRow();
selectedNetID = (String) currentRow.getAttribute("netid");
System.out.println("selectedNetID -->"+selectedNetID);
requestContext.getPageFlowScope().put("netid",selectedNetID);
try{
FacesContext facesCtx = FacesContext.getCurrentInstance();
NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
nh.handleNavigation(facesCtx, "", "continue");
System.out.println("region obj -->" +facesCtx.getViewRoot().findComponent("advse1"));
// Refresh the current region; advse1 is the id of the region component inside jspx page
AdfFacesContext.getCurrentInstance().addPartialTarget(facesCtx.getViewRoot().findComponent("advse1"));
catch(Exception e){
System.out.println("Error is: " +e);
Is this correct coding to get the region object?? actually the "result table" and "Master details" are 2 different fragments which are linked with task-flow and the task flow is part of main jspx page as a region. I am using that region ID to get the obj, but cant able to get so....!!! any idea

Similar Messages

  • How to call backing bean method from java script

    Hi,
    I would like to know how to call backing bean method from java script.
    I am aware of serverListener and [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    but i am running in to some issues with [AjaxAutoSuggest article|http://www.oracle.com/technology/products/jdev/tips/mills/AjaxAutoSuggest/AjaxAutoSuggest.html]
    regarding which i asked for help in other thread with subject ....Question on AjaxAutoSuggest article (Ajax Transactions Using ADF and J...)
    The reason why i posted is ( though i realise both are duplicates) .. that threads looks as a specific question to that article hence i would like to ask the quantified problem is asked in this thread.
    So could any please letme know how to call backing bean method from java script
    Thanks
    Murali
    Edited by: mchepuri on Oct 24, 2009 6:17 PM
    Edited by: mchepuri on Oct 24, 2009 6:20 PM

    Hello,
    May know how to submit a button autoamtically on onload of page with clicking a welcome alert box. the submit button has managed button too to show a message on console using SOP.
    the problem is.
    1. before loading the page a javascript comes on which i clicked ok
    2. the page gets loaded and the button is there which gets automatically clicked and the managed bean associated with prints a message on console using SOP.
    I m trying to do this through server listener and click listener. the code is(adf jspx page)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_check4.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_check4.f1}">
    <af:commandButton text="commandButton 1"
    binding="#{backingBeanScope.backing_check4.cb1}"
    id="cb1" action="#{beanCheck4.submit1}"/>
    <af:clientListener type="click" method="delRow"/>
    <af:serverListener type= "jsServerListener"
    method="#{backingBeanScope.backing_check4.submit1}"/>
    <f:facet name="metaContainer">
    <af:resource type ="javascript">
    x=confirm("hi");
    // if(x){
    delRow = function(event){
    AdfCustomEvent.queue(event.getSource(), "jsServerListener", {}, false);
    return true;
    </af:resource>
    </f:facet>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_check4-->
    </jsp:root>
    the backing bean code is -----
    public class classCheck4 {
    public classCheck4() {
    public String submit1() {
    System.out.println("hello");
    return null;
    }

  • How to distinguish backing bean method invoker like struts *.do

    I want to monitor request and response time of application via access log of httpd . But the urls are the same in one backing bean.
    how should i do about this?

    Hello,
    May know how to submit a button autoamtically on onload of page with clicking a welcome alert box. the submit button has managed button too to show a message on console using SOP.
    the problem is.
    1. before loading the page a javascript comes on which i clicked ok
    2. the page gets loaded and the button is there which gets automatically clicked and the managed bean associated with prints a message on console using SOP.
    I m trying to do this through server listener and click listener. the code is(adf jspx page)
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1" binding="#{backingBeanScope.backing_check4.d1}">
    <af:form id="f1" binding="#{backingBeanScope.backing_check4.f1}">
    <af:commandButton text="commandButton 1"
    binding="#{backingBeanScope.backing_check4.cb1}"
    id="cb1" action="#{beanCheck4.submit1}"/>
    <af:clientListener type="click" method="delRow"/>
    <af:serverListener type= "jsServerListener"
    method="#{backingBeanScope.backing_check4.submit1}"/>
    <f:facet name="metaContainer">
    <af:resource type ="javascript">
    x=confirm("hi");
    // if(x){
    delRow = function(event){
    AdfCustomEvent.queue(event.getSource(), "jsServerListener", {}, false);
    return true;
    </af:resource>
    </f:facet>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_check4-->
    </jsp:root>
    the backing bean code is -----
    public class classCheck4 {
    public classCheck4() {
    public String submit1() {
    System.out.println("hello");
    return null;
    }

  • JSF Problem invoking backing bean method

    I want a backing bean method to be invoked when the submit button is clicked but for some strange reason the method is not getting invoked any Help in this regards would be great.
    I am able to properly get the values from database and display on the page , after the user types in some more additional information like password , hint question the form has to be submitted when clicked on the submit button..
    Register.jsp
    <body>
         <f:view>
         <h:graphicImage url="/header.jpg"></h:graphicImage>
               <br><h:form id="user">
                        <table>
                        <tr>
                             <td>
                                  <h:outputLabel for="" value="uUser Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                                  <h:inputText onblur="JavaScript:doSubmit();" value="#{registerFormBean.userName}" id="userName"></h:inputText>
                             </td>
                        </tr>
                        <tr>     
                             <td>
                             <h:outputLabel for="" value="First Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText value="#{registerFormBean.firstName}" id="firstName"></h:inputText></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Middle Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText id="middleName" value="#{registerFormBean.middleName}"></h:inputText></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Last Name:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText id="lastName" value="#{registerFormBean.lastName}"></h:inputText></td>
                        </tr>
                        <tr>
                             <td>
                                  <h:outputLabel for="" value="Password:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                                  <h:inputText id="password" value="#{registerFormBean.password}"></h:inputText>
                             </td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Re-type Password:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputText></h:inputText></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Password Hint Question:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputTextarea id="hintQuestion" value="#{registerFormBean.hintQuestion}"></h:inputTextarea></td>
                        </tr>
                        <tr>     
                             <td><h:outputLabel for="" value="Password Hint Answer:" styleClass="orderlabelcell"></h:outputLabel></td><td>
                             <h:inputTextarea id="hintAnswer" value="#{registerFormBean.hintAnswer}"></h:inputTextarea></td>
                        </tr>
                        <tr>     
                             <td>
                                  <h:commandButton id="submit" value="Submit" type="submit" action="#{registerFormBean.saveUser}"/>
                                  <h:commandButton id="Reset" value="Reset" type="reset"/>
                                  </td>
                        </tr>
                        </table>
                   </h:form>
         </f:view>
    </body> 
    RegisterFormBean.java
      package services;
    import java.sql.SQLException;
    import java.util.ArrayList;
    import dao.DatabaseHandler;
    import model.User;
    public class RegisterFormBean {
    User selectedUser;
    String userName;
    String firstName;
    String middleName;
    String lastName;
    String password;
    String hintQuestion;
    String hintAnswer;
    String errMsg;
    private DatabaseHandler dbHandle;
    public RegisterFormBean() {
         javax.faces.context.FacesContext context = javax.faces.context.FacesContext.getCurrentInstance();
         javax.faces.application.Application app = context.getApplication();
         dbHandle = (DatabaseHandler)app.createValueBinding("#{databaseHandler}").getValue(context);
    public void setUserDetails() {
         try{
              System.out.println("gettting Details for user: "+userName);
              selectedUser = (User)dbHandle.getUser(userName);
         catch (SQLException e) {
              errMsg = "Problem gettting records";
    public String getUserName() {
         if(null!=userName){
              setUserDetails();
         if(null!=selectedUser)
              return selectedUser.getLoginName();
         else
         return "";
    public void setUserName(String userName){
         this.userName = userName;
    public String getFirstName() {
         if(null!=selectedUser)
              return selectedUser.getFirstName();
         else
         return "";
    public void setFirstName(String firstName) {
         System.out.println("in setFirst name");
         this.firstName = firstName;
    public String getMiddleName() {
         if(null!=selectedUser)
              return selectedUser.getMiddleName();
         else
         return "";
    public void setMiddleName(String middleName) {
         System.out.println("in set middle name...");
         this.middleName = middleName;
    public String getLastName() {
         if(null!=selectedUser)
              return selectedUser.getLastName();
         else
         return "";
    public void setLastName(String lastName) {
         System.out.println("in set last name....");
         this.lastName = lastName;
    public String getPassword() {
         return password;
    public void setPassword(String password) {
         if(null!=password){
              System.out.println("$$$$$$$$$$$$ setting password.."+password);
              selectedUser.setPassword(password);
    public String getHintQuestion() {
         return hintQuestion;
    public void setHintQuestion(String hintQuestion) {
         if(null!=hintQuestion){
              System.out.println("#########  Hint Question "+hintQuestion);
              selectedUser.setHintQuestion(hintQuestion);
    public String getHintAnswer() {
         return hintAnswer;
    public void setHintAnswer(String hintAnswer) {
         if(null!=hintAnswer){
              System.out.println("@@@@@@@  Hint Answer"+hintAnswer);
              selectedUser.setHintQuestion(hintAnswer);
    public String saveUser(){
         String flag = "";
         System.out.println("IN registerUser Method....");
         try{
              if(null!=selectedUser){
                   flag = dbHandle.registerUser(setUserDefaults(selectedUser));
         catch(SQLException se){
         flag="fail";
         System.out.println("FAILED DUE TO THE EXCEPTION :- "+se.getMessage());
         errMsg = "Unable to Register the User...";
         return flag;
    public User setUserDefaults(User user){
         System.out.println("SETTING USER DEFAULTS.....");
         user.setActive(true);
         user.setLoginType("False");
         user.setCreatedUserName("SOMEUSERNAME");
         user.setSecIdFunctionGroup(17);
         user.setChallangeWord("CHANGE IT");
         user.setTrusted(false);
         user.setUserTypeIdTypeOf(1);
         user.setChangePwdNextLogin("False");
         user.setLoginIsDisabled(false);
         user.setPasswordNeverExpires(false);
         user.setThinWorkOrder(false);
         user.setCurrencyTypeId(2);
         return user;
    I am able to fetch the details from Database and display on the page so DAO is working properly hence not copying here
    faces-config.xml
      <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
                                  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
    <managed-bean>
      <managed-bean-name>databaseHandler</managed-bean-name>
      <managed-bean-class>dao.DatabaseHandler</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>
    <managed-bean>
      <managed-bean-name>registerFormBean</managed-bean-name>
      <managed-bean-class>services.RegisterFormBean</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
      <from-view-id>/Register.jsp</from-view-id>
      <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/Success.jsp</to-view-id>
      </navigation-case>
    </navigation-rule>
    </faces-config>

    A conversion or validation error may have been occurred. Add <h:messages/> to the page to note them all. If you're using at least Sun Mojarra 1.2, then you should be able to note them all in the application server logs.

  • ValueChangeListener not invoking backing bean method

    Hi Everybody
    I am using a valueChangeListener attribute with <h:selectOneListbox>. As i am using onChange, the form is getting submitted but the associated backing bean method is not getting invoked.
    My JSP code:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <html>
       <head>
          <title>Song Detail</title>
       </head>
       <body>
          <f:view>   
               <h:form id="songForm">
                       <H4>Select a song to view detail.</H4>
                </Br>
                       <h:selectOneListbox id="songList" value="#{songBean.selectedSong}"
    valueChangeListener="#{songBean.songInformation}" immediate="true" onchange="submit();">
                              <f:selectItems value="#{songBean.songList}"/>
                     </h:selectOneListbox>
                <p>
                 <h:outputText id="result" value="#{songBean.songDetail}"/>
             </p>   
         </h:form>                  
       </f:view>
      </body>
    </html> My Backing bean method:
    public void songInformation(ValueChangeEvent vce) throws AbortProcessingException
              System.out.println("Method invoked");
           } This songInformation() method is not getting invoked.
    Please help.

    I never say to put every bean in session scope.
    I recommend that the following beans are in session scope:
    (1) the value property of h:dataTable
    (2) the value property of f:selectItems
    (3) the rendered property
    They are evaluated before Update Model Values phase.

  • How to call Backing Bean method from href tag in JSF. -- URGENT

    Hi guys,
    i am new to JSF. i want one option. how to call a backing bean method from href.
    I searched a lot. i found one component <commandLink>, but i cann't use <commandLink> i have to use only href which is client instructions.
    If anyone knows pls help me. Its Urgent. If u can, give me the code also.
    Suggestions will be appreciated.
    Thanks
    Rajesh

    You can make use of the constructor of the backing bean or the @PostConstruct annotation if you want to use managed properties.
    You may get some ideas out of this: [http://balusc.blogspot.com/2006/06/communication-in-jsf.html].

  • How to call backing bean method when user tabs out of af:inputListOfValues field

    Hi,
    I am using jdev 11.1.2.4.
    I want to call a backing bean method based on the value selected in the af:inputListOfValues field.
    The requirement is similar as Frank Nimphius-Oracle has demonstrated here  https://blogs.oracle.com/jdevotnharvest/entry/how_to_notify_the_server but with Input List of Values component.
    The fields I want to call method from is
    <af:inputListOfValues id="appealNameId"
                          popupTitle="Search and Select: #{bindings.AppealName.hints.label}"
                          value="#{bindings.AppealName.inputValue}"
                          label="#{bindings.AppealName.hints.label}"
                          model="#{bindings.AppealName.listOfValuesModel}"
                          required="#{bindings.AppealName.hints.mandatory}"
                          columns="#{bindings.AppealName.hints.displayWidth}"
                          shortDesc="#{bindings.AppealName.hints.tooltip}"
                          binding="#{backingBeanScope.backing_Donation.appealNameId}"
                          autoSubmit="true" clientComponent="false">
                          <f:validator binding="#{bindings.AppealName.validator}"/>
                          <af:autoSuggestBehavior suggestedItems="#{backingBeanScope.backing_Donation.onSuggestAppeal}"/>
                          <af:clientListener method="onBlurTxtField" type="blur"/>
    </af:inputListOfValues>
    <af:serverListener type="onBlurNotifyServer"
                       method="#{backingBeanScope.backing_Donation.onBlurNotify}"/>
    as you can see,  af:serverListener is outside the af:inputListOfValues which probably is the reason its not executing this method?
    public void onBlurNotify(ClientEvent clientEvent) {
       // get a hold of the input text component
       RichSelectOneChoice inputTxt =  (RichSelectOneChoice) clientEvent.getComponent();
       //do some work on it here (e.g. manipulating its readOnly state)
       //Get access to the payload
       Map  parameters = clientEvent.getParameters();
       System.out.println("SubmittedValue = "+parameters.get("submittedValue"));
       System.out.println("LocalValue =  "+parameters.get("localValue"));
    I've tried to put serverListener tag inside the <af:inputListOfValues> but getting below error
    "Server Listener is not valid child of Input List of Values"
    any ideas please?
    thanks

    As first, check to see that you are using correct type for af:serverListener (thet one you are queue in the javaScript onBlurTxtField function)
    If still does not work, go to directly to the page source code, and put af:serverListener "by hand", as a child for af:inputListOfValues.
    Because it is possible that these messages are false alarm...

  • Refresh iterator after invoking backing bean method

    Hi guys,
    I 'm using jdev 11.1.1.1.0.
    I have a jspx page which displays a table with data. I've succeedeed on not displaying data of the table on initial rendering with this code (it's my will) :
    <iterator Binds="ProjetsActifsLectureSeule_extend1" RangeSize="25"
    DataControl="AppModuleCodesProjetsDataControl"
    id="ProjetsLectureSeule1Iterator" RefreshCondition="#{!adfFacesContext.postback}"/>
    When i click a button on the page i want the table to display all datas. I've coded a backingbean method for that (named displayall) :
    public void displayAll(ActionEvent actionEvent) {
    ((DCIteratorBinding)getBindings().get("ProjetsLectureSeule1Iterator")).executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(table3); // table3 contains the datas i want to be refreshed
    The method is executed but no datas are displayed like in the initial rendering of the page.
    What is wrong with my code?
    Thanks

    Yes Amseth,
    i want that datas of a query aren't displayed (it's a table component) on the initial rendering of the page.
    But i want there are displayed when i reexecute the query from a backing bean method.

  • SelectOneMenu: How can I fire a backing bean method just when click

    I want that when just I click one option of Dropdown list it fires a backing bean method.
    The method must take the new value of dropdown, to execute a SQL to populate a new (another one) dropdown list and refresh the page.
    My code
                            <h:commandButton id="button1" style="left: 216px; top: 216px; position: absolute" value="Cancelar"/>
                            <h:commandButton id="button2" style="left: 312px; top: 216px; position: absolute" value="Generar"/>
                            <h:outputLabel for="componentLabel5" id="componentLabel5" style="left: 120px; top: 0px; position: absolute">
                                <h:outputText id="componentLabel5Text" value="Título de la Página"/>
                            </h:outputLabel>
                            <h:selectOneMenu immediate="true" value="#{fgstb.ctoId}"  valueChangeListener="#{fgstb.cambiaValorCtos}" id="dropdown1" style="left: 264px; top: 72px; position: absolute; width: 120px">
                                <f:selectItems id="dropdown1SelectItems" value="#{fgstb.ctos}"/>
                            </h:selectOneMenu>
                            <h:selectOneRadio id="radioButtonList1" layout="pageDirection" style="left: 48px; top: 48px; position: absolute" value="#{fgstb.modo}">
                                <f:selectItem id="radioButton1" itemLabel="Generar Campeonato" itemValue="1"/>
                                <f:selectItem id="radioButton2" itemLabel="Generar desde Campeonato" itemValue="2"/>
                                <f:selectItem id="radioButton3" itemLabel="Generar Todos Campeonatos" itemValue="3"/>
                            </h:selectOneRadio>It works fine but when I push a button and I would like it works when I click over dropdown list.
    Thank you

    Hi,
    You can simply add onchange="submit()" attribute to your component to allow form to be submited when the coomponent value is changed, and add also a value change listener to allow JSF to be notiifed for component value change event :
    <h:selectOneMenu onchange="submit()"  valueChangeListener="#{fgstb.cambiaValorCtos}"
                              immediate="true" value="#{fgstb.ctoId}"   id="dropdown1" style="left: 264px; top: 72px; position: absolute; width: 120px">
                                <f:selectItems id="dropdown1SelectItems" value="#{fgstb.ctos}"/>
    </h:selectOneMenu>

  • Navigate to next view activity by double clicking a table row

    Hi,
    I define a simple task flow with two view activilities, View1 ----(showDetail)-----> View2.
    View1 contains a table, when user clicks a row in the table, the task flow should go to View2
    and content displayed in View2 depends on the row selected in View1.
    I define a client listener and server listener to concume the row double click event.
    The server listener is something like this:
    FacesContext fc = FacesContext.getCurrentInstance();
    DashBoard dashBoardBean =
    *(DashBoard)fc.getExternalContext().getSessionMap().get("dashBoardBean");*
    RichRegion contentRegion = dashBoardBean.getTaskf1();
    ExpressionFactory ef = fc.getApplication().getExpressionFactory();
    ELContext elc = fc.getELContext();
    MethodExpression me =
    *ef.createMethodExpression(elc, "#{dashBoardBean.getCurrentScreen}",*
    *String.class, new Class[] { });*
    *contentRegion.queueActionEventInRegion(me, null, null, false, -1, -1,*
    *PhaseId.ANY_PHASE);*
    *contentRegion.refresh(fc);*
    This works fine in the sense that I can navigate to View2.
    The problem is that I register a RegionNavigationListener on the region containing this task flow, when I double click a row in View1
    the RegionNavigationListener is not invoked even though region has navigated from View1 to View2.
    Anyone knows any solution for this or is there an alternative way to implement this functionality?
    Thx
    Colin
    Edited by: user10303309 on May 28, 2009 2:51 AM

    Yes, I think Region.refresh does not fire the Navigation Event, I tried to fire an event manually:
    contentRegion.refresh(fc);
    contentRegion.queueEvent(new RegionNavigationEvent(contentRegion, "oldViewId",  "newViewId"));
    But this does not work either....

  • How to call Backing bean method from JS

    I want to call commandlink action from JS,
    I'm trying document.getElementById('formPageInfo:btnCreateQuote').click() in javascript.
    But it is not working any ideas around?
    Code is for commandlink : <h:commandLink action="#{ManagedController.businessListActions.createNewQuote}" accesskey="C" title="Start Quote" id="btnCreateQuote"> <h:outputText value="Start Quote" /></h:commandLink>
    Any help/Suggestions around?

    I think that not exist a specific way to do it with jsf. Maybe you should ask in other forum more related with javascript, as a tip, if you can use jQuery in your environment, jQuery.trigger() can simulate a click on a button or command link. I have used it with a h:commnadLink and worked fine.

  • How to call a bean method through javascript?

    Hi,
    i want to call a bean method using the javascript.
    thansk in advance.

    hi
    i want to call a backing bean method thought javscript on the button click.
    i am inplementing addition of textbox at runtime.i wrote method and i am calling that on the button click.but the textbox is not created.
    the code is bleow
    public String doAction() {
         tryStuff1();
    return "samplejsf";
    public void tryStuff1()
    System.out.println("Enter the trystuff method");
         FacesContext facesContext = FacesContext.getCurrentInstance();
    UIViewRoot uIViewRoot = facesContext.getViewRoot();
    Application application = facesContext.getApplication();
    UIComponent formComp=uIViewRoot.findComponent("subbody:form1");
    HtmlPanelGrid grid= new HtmlPanelGrid();
    grid.setId("panelgrid2");
    grid.setColumns(2);
    grid.setBorder(2);
    //UIComponent panelGridComp=formComp.findComponent("subbody:panelgrid1");
    //UIComponent panelGroupComp=panelGridComp.findComponent("panelgroup2");
         HtmlOutputText output = new HtmlOutputText();
    output.setValue("dynamic jsf text2");
    System.out.println("hello output text2");
    output.setRendered(true);
    grid.getChildren().add(output);
    HtmlInputText input = new HtmlInputText();
    input.setSize(40);
    input.setValueBinding("value", (ValueBinding) application.createValueBinding("#{sample.text2}"));
    input.setRendered(true);
    grid.getChildren().add(input);
    System.out.println("hello output text1");
    grid.setRendered(true);
    formComp.getChildren().add(grid);
    System.out.println("hello output text3:");
    formComp.getRendersChildren();
    formComp.setRendered(true);
    public boolean getRendersChildren() {
         return true;
    jsp code is
    <h:form id="form1">
    <h:panelGrid columns="2" binding="#{sample.formElements}">
    </h:panelGrid>
    <h:panelGrid id="panelgrid1" columns="1">
    <h:panelGroup id="panelgroup1">
    <h:outputText value="hardcoded jsf text1"/>
    <h:inputText value="#{sample.text1}"/>
    </h:panelGroup>
    </h:panelGrid>
    <h:commandButton id="add" action="#{sample.doAction}" value="add" type="SUBMIT"/>
    </h:form>
    when i click on the button its going into the method and diaplying s.o.p but the text box is not updated to the page.
    why is it so.
    i thought there may be a problem in calling the method directly thru button. i want to try thru javascript calling the bean method.
    why is the page not updated.
    can u help me out
    thanks in advance
    sree

  • About backing bean method's invokation

    Hi,
    I have a backing bean method binded to a component:
    <af:selectOneChoice value="#{bindings.managerId.inputValue}"
    label="Manager" valign="middle"
    binding="#{backing_searchDocuments.managersList}"
    valuePassThru="true" immediate="false"
    rendered="#{bindings.ListManagersIterator.estimatedRowCount > 1}">
    <f:selectItems value="#{bindings.managerId.items}"/>
    When page refreshes component executes his binding method. But in some cases, actually when I press the commandMenuItem leading to the same page where I am it seems that it doesn't get invoked.. how can I manage the invocation of backing bean's methods? I need it invoked every time any request is made.. How to do that?

    Mario,
    this method is executed when the component re-draws. So anything other than a PPR request makes this binding method being called.
    If PPR is used with your commandMenuItem, them make sure the PPR trigger is set to refresh the component.
    I don't know what code it is that you need to execute each time, but maybe putting this on a action listener is a better idea
    Frank

  • How to call the backing bean method through javascript

    Hi
    I have a command button associated with actionListener . Action Listener method associated with backing bean methods.
    I want to fire the event on command button and backing bean method should be invoked from javascript dynamically.
    can anybody help me asap

    JSF<h:form id="formId">
        <h:commandButton id="buttonId" value="submit" actionListener="#{myBean.action}" />
    </h:form>JSdocument.getElementById('formId:buttonId').click();

  • How to set button disabled property based on backing bean method

    JDeveloper 12c
    I have a table and a button on the page. When user selects certain table row I want to enable/disable the button.
    My backing bean (which has backing bean scope in the task flow where the page is) is
    package view.backing;
    public class Studybrowse {
        public Studybrowse() {
        public String b1_action() {
              //Do something here
            return null;
       public boolean b1_user_auth(){
           // Do something here to return true or false
            return true;
    My button is something like this:
    <af:button text="Do something" id="b4" action="#{backingBeanScope.Studybrowse.b1_action}"
                   disabled="#{backingBeanScope.Studybrowse.b1_user_auth THIS DOES NOT WORK}"
                   partialTriggers="t1"/>  
    The first problem is in design time, it says: "Reference backingBeanScope.Studybrowse.b1_user_auth not found"
    and in runtime, desired behavior does not work.
    Any help is appreciated

    Timo:
    I changed my backing bean method like this:
        public Boolean isUserAuthorized(){
            // some code here that will return true or false, hardcode to true for now
            return true;
    and the button disabled property like this:
               <af:button text="Go to Reports!" id="b5" action="#{backingBeanScope.Studybrowse.b1_action}"
                           disabled="#{backingBeanScope.Studybrowse.isUserAuthorized}"
                           partialTriggers="t1"/>                   
    Still same problem in design time there is a warning and 500 error in runtime.
    <Jan 22, 2014 11:36:15 AM CST> <Warning> <oracle.adf.view.rich.component.fragment.UIXRegion> <ADF_FACES-00009> <Error processing viewId: /studyBrowse URI: /studyBrowse.jsf actual-URI: null.
    javax.el.PropertyNotFoundException: //C:/Documents and Settings/rade/Application Data/JDeveloper/system12.1.2.0.40.66.68/o.j2ee/drs/ADFOracleReports/ViewControllerWebApp.war/studyBrowse.jsff @41,46 disabled="#{backingBeanScope.Studybrowse.isUserAuthorized}": The class 'view.backing.Studybrowse' does not have the property 'isUserAuthorized'.
      at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
      at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.getDisabled(ButtonRenderer.java:436)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.encodeAll(ButtonRenderer.java:270)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:455)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1600(PanelGroupLayoutRenderer.java:30)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:761)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:653)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:195)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:326)
      at oracle.adfinternal.view.faces.taglib.region.IncludeTag$FacetWrapper.processFlattenedChildren(IncludeTag.java:683)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:171)
      at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:326)
      at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:291)
      at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:366)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.PageTemplateRenderer.encodeAll(PageTemplateRenderer.java:68)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer._encodeChildren(RegionRenderer.java:417)
      at oracle.adfinternal.view.faces.renderkit.rich.RegionRenderer.encodeAll(RegionRenderer.java:228)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at oracle.adf.view.rich.component.fragment.UIXRegion.encodeEnd(UIXRegion.java:288)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:275)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
      at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3195)
      at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1473)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
      at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:1085)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1786)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:102)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
      at org.apache.myfaces.trinidad.view.ViewDeclarationLanguageWrapper.renderView(ViewDeclarationLanguageWrapper.java:101)
      at org.apache.myfaces.trinidad.view.ViewDeclarationLanguageWrapper.renderView(ViewDeclarationLanguageWrapper.java:101)
      at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:338)
      at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
      at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
      at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:170)
      at oracle.adfinternal.view.faces.lifecycle.ResponseRenderManager.runRenderView(ResponseRenderManager.java:52)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1104)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:389)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:255)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
      at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:478)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:303)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:208)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:137)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:225)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3367)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3333)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
      at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2220)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2146)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2124)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1564)
      at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
    >
    <Jan 22, 2014 11:36:15 AM CST> <Error> <javax.enterprise.resource.webcontainer.jsf.application> <BEA-000000> <Error Rendering View[/studyBrowse]
    javax.el.PropertyNotFoundException: //C:/Documents and Settings/rade/Application Data/JDeveloper/system12.1.2.0.40.66.68/o.j2ee/drs/ADFOracleReports/ViewControllerWebApp.war/studyBrowse.jsff @41,46 disabled="#{backingBeanScope.Studybrowse.isUserAuthorized}": The class 'view.backing.Studybrowse' does not have the property 'isUserAuthorized'.
      at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:111)
      at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.getDisabled(ButtonRenderer.java:436)
      at oracle.adfinternal.view.faces.renderkit.rich.ButtonRenderer.encodeAll(ButtonRenderer.java:270)
      at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1578)
      Truncated. see log file for complete stacktrace
    >

Maybe you are looking for