Bean methods for binding

How should the methods of my TestBean look like when i use the following selectionlist:
<h:selectOneMenu id="choose" binding="#{TestBean.selectList}"/>
when I would like to show a list and preselect one of the values
regards

i am new to jsf and tried to make a selectbox working via binding. Searching through examples and documentation i have found not much information for binding backing beans.
Is my previous post a vague or silly question or is binding generally not used and has nobody experience with binding?
Thanks for any reaction.

Similar Messages

  • Evaluate binding expressions #{...} from Bean methods?

    Hello all,
    is it possible to evaluate the binding expressions that are usually given in the JSP page (e.g. #{someObject.someProperty} ) from a Bean method?
    I am currently searching for a more convenient way of accessing the resource bundle from a validator and could imagine an access over #{msg.someText}.

    Hello all,
    is it possible to evaluate the binding expressions that are usually given in the JSP page (e.g. #{someObject.someProperty} ) from a Bean method?
    I am currently searching for a more convenient way of accessing the resource bundle from a validator and could imagine an access over #{msg.someText}.

  • No getter method for property user of bean Problem

    Hi everyone,
    I am new to this struts. I have a samll application to check login. When I run my application I get this message in my server console
    No getter method for property user of bean org.apache.struts.taglib.html.BEAN
    I saw the previous forum for the same topic. I have checked my property names start with appropriate cases. Here is my code
    %@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html>
    <head><title>Login</title></head>
    <body>
    <html:form action="submit.do">
    <table width="100%" border="0" height=75%>
    <tr>
    <td align="right" >UserName: </td>
    <td><html:text property="user"/></td>
    <tr>
    <tr>
    <td align="right" >Password: </td>
    <td><html:text property="password"/></td>
    </tr>
    <tr>
    <td colspan=2 align="center"><html:submit/></td>
    </tr>
    <tr>
    <td colspan=2 align="center"><html:errors/></td>
    </tr>
    </table>
    </html:form>
    </body>
    </html>
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.*;
    import java.util.*;
    * @author skannan
    * To change this generated comment edit the template variable "typecomment":
    * Window>Preferences>Java>Templates.
    * To enable and disable the creation of type comments go to
    * Window>Preferences>Java>Code Generation.
    public class LoginForm extends ActionForm
    private String user = null;
    private String password = null;
    /* user */
    public String getUser()
    return (this.user);
    public void setUser(String user)
    this.user = user;
    /* password */
    public String getPassword()
    return (this.password);
    public void setPassword(String password)
    this.password = password;
    public ActionErrors validate(ActionMapping mapping,
    HttpServletRequest request) {
    // Log the forms data
    servlet.log("Lastname:" + user);
    servlet.log("Address:" + password);
    // Check for mandatory data
    ActionErrors errors = new ActionErrors();
    if (user == null || user.equals("")) {
    errors.add("User", new ActionError("error.user"));
    if (password == null || password.equals("")) {
    errors.add("Password", new ActionError("error.password"));
    return errors;
    I am missing anything in my config files. Please I need help.
    Thanks!

    I did check my struts-config file
    Here is the part of my file
    <!-- ========== Form Bean Definitions ================= -->
    <form-beans>
    <form-bean name="loginForm"
    type="kannan.struts.trailer.checkin.LoginForm"/>
    <form-bean name="checkInForm"
    type="kannan.struts.trailer.checkin.CheckInForm"/>
    </form-beans>
    <!-- ========== Action Mapping Definitions ============ -->
    <action-mappings>
    <action path="/submit"
    type="kannan.struts.trailer.checkin.LoginAction"
    name="loginForm"
    input="/login.jsp"
    scope="request">
    <forward name="success" path="/checkIn.jsp"/>
    <forward name="failure" path="/login.jsp"/>
    </action>
    Still I am getting the error

  • **URGENT** No getter method for property searchText of bean org.apache.stru

    I'm implementing a query page as described in the HowTo ADF_ComplexMasterDetail.zip
    When running the query page, I'm receiving the error:
    javax.servlet.jsp.JspException: No getter method for property searchText of bean org.apache.struts.taglib.html.BEAN
    I have my searchEmployees writen and 'exposed' (at least I can see it in the Data palette). But seems like something is missing, and can't find this searchText beam property specified in the html:text tag.
    Can someone help in this one?
    Here is the Help description inside the HowTo example:
    Section 3
    queryEmployees
    queryEmployeesInDept provides an interface for entering a simple search criteria for querying a list of
    employees. This does not use the Find mode Query By Example functionality that the other query screens
    use, but rather presents a much simpler search interface. The actual search is carried out using a
    function
    searchEmployees that the underlying view object exposes. (See the EmployeesView view object in the
    model project)
    1. Drop a new Data Page onto the page flow diagram call it queryEmployees
    2. In the page flow diagram, drag the searchEmployees operation from the AllEmployeesView
    collection in the Data Control Palette and drop it on top of the new Data Page. This will cause the
    framework to run a search whenever the page is called.
    3. In the Structure pane, locate the queryEmployees node and expand it, select the child node
    paramNames[0], and change it's value attribute to ${param.searchText}. This will pass the URL
    parameter searchText on to the business method to qualify the query.
    4. Drill down into the page and expand the Data Control Palette to select the AllEmployeesView
    collection. Set the Drag and Drop as: list to Read-OnlyTable. Then drag the collection onto the page.
    This will create a tabular containing the query results.
    5. Select the Struts HTML component palette and drag a Form onto the page above the output table. Set
    the handling action to this Data Page (queryEmployees.do)
    6. Drag a text field from the component palette inside of this new form. Set the property attribute of
    the
    <html:text> tag to searchText (the same value you used in the paramNames[0] for the Data Page)
    7. Create a new submit button in the form to submit the search. Set the property attribute of the button
    to
    event_search.
    8. Finally we need to subclass the data page to prevent the search action from being fired when it is not
    appropriate for the page ( for instance when we first display it). To do this we need to Go to Code on
    the Data Page's context menu, and override the invokeCustomMethod() method:
    * We only want to invoke the custom method i.e. the call to change
    * the Where clause on the collection, if the Action has been called with
    * a search event on the page with a search term supplied.
    * If the user got here via a link or another event, we bypass the model call
    * unless a URL parameter event=search is supplied, in which
    * case the method will also be called.
    protected void invokeCustomMethod(DataActionContext actionContext)
    List events = actionContext.getEvents();
    // If the event is "search" do the custom event call
    if ((events != null) && (events.contains("search")))
    String searchTerm = (String)((DynaActionForm)actionContext.getActionForm())
    Get("searchText");
    if (searchTerm != null)
    super.invokeCustomMethod(actionContext);
    }

    Solved with Oracle JDeveloper HowTo:
    Creating Search Pages with Both Fixed and Dynamic Criteria
    Author: Steve Muench, Oracle ADF Development Team
    Date: September 16, 2004
    http://www.oracle.com/technology/products/jdev/howtos/10g/dynamiccrit/index.html

  • Finder methods for CMP beans

    We do not implement finder method in Bean class for CMP. As such, where do we implement finder methods such as findInRange() method? How does the container implement my custom "find" methods.
    Thanks

    Using CMP 2.x, your custom finder and select methods are implemented by the container based on the EJB QL query you provide in the ejb-jar.xml. In CMP 1.1, there was no portable way to express the semantics of the query, so most vendors had a vendor-specific syntax for describing the query.
    See chapter 27 of the J2EE 1.4 Tutorial for some examples of using EJB QL :
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html
    --ken
    Kenneth Saks
    J2EE SDK Team
    SUN Microsystems

  • JDev 11.1.2.1 Execute method (with bind variable) before page is displayed

    Hi All,
    I have a view object with a query that uses a bind variable. I drag the data control onto my .jsf page to create a table. I create a query method on a view scope bean. The query method uses the contents of one of the bean's attributes to set the bind variable for the query:
    vo.setNamedWhereClauseParam("CraIdBindVar", sessionBean.getCraId());
    I place a button on the page that invokes the query method and it populates the table. This is fine but I don't want the user to have to click on the 'query' button when they navigate to this page. I have found forums that discuss creating an AMImpl.jave method, creating a binding on the page, creating an executable for the binding. This works in that the method is executed before the page is displayed. However, the AMImpl method cannot call sessionBean.getCraid() to get the necessary data item to populate the bind variable.
    Is there a way to execute my view scope bean method before the page is displayed? Or perhaps a way for the AMImpl.java method to access the view scope variable?
    Thanks, Steve

    Steve,
    you can drag a method call activity onto the task flow. Then select the new method call activity and open the property inspector. Here you select the method from your bean in the method property. Now you first navigate to this method call activity and then to the page.
    Timo

  • 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...

  • Message driven beans and object binding

              I want to write a message driven bean, and use javax.naming.Context's "bind(String,
              Object)" method to bind the data to a key and eventually do a unbind(String) to
              look up the data . Is binding/unbinding of object is allowed inside a message
              driven bean or this violates the EJB2.0 spec? Also, does this have any negative
              consequences if I use a Weblogic cluster as opposed to a single instance? Any
              suggestions
              

    Hi Austin,
              - I don't know if it is "legal" in EJB 2.0
              to call bind/unbind within an MDB. I
              would assume so, but I'm not sure. You can try confirming with
              the jndi and ejb newsgroups. Of course, if you don't
              ask, then no one can tell you "no". ;-)
              - Bind/unbind is a relatively expensive call performance-wise. I
              suspect one might want to avoid doing too many of these per
              second (the jndi newsgroup may be able to give pointers here.)
              - Servers in a cluster do not instantly propagate bind/unbind info
              to other servers in cluster, and JNDI may have trouble
              efficiently supporting larger objects: both potential drawbacks
              to using JNDI for data caching purposes.
              Tom, BEA
              Austin P wrote:
              > I want to write a message driven bean, and use javax.naming.Context's "bind(String,
              > Object)" method to bind the data to a key and eventually do a unbind(String) to
              > look up the data . Is binding/unbinding of object is allowed inside a message
              > driven bean or this violates the EJB2.0 spec? Also, does this have any negative
              > consequences if I use a Weblogic cluster as opposed to a single instance? Any
              > suggestions
              

  • 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.

  • ***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

  • ADF Faces Declarative Component onLoad event call Backing Bean Method

    Hello.
    We are trying to implement a declarative component, that will be used as Flex Fields for our application, ie, the components will be created dynamically through a database configuration, and who is responsible for organizing and creating the components, is the declarative components, and its own backing bean.
    The declarative component, will receive a List of custom components, and with this list it is possible to create the components dynamically. We want the components to be created as soon as the page is loaded. The developer could place this declarative component in any region of his page, and even in another tab if he wishes. The problem is, that we cannot register a load event in the declarative component, since it doesn't have a document Object, to call the declarative components backing bean method that is responsible for creating components.
    How could we simulate the onLoad (of the declarative components) so that the backing bean method (responsible for creating component, and putting it in the view tree) could be called ?
    I've tried with a RENDER_RESPONSE phaseListener, but the beforePhase has no objects in the tree, and the afterPhase has already rendered to the client.
    Any ideas on how to achieve this ?
    Thanks a lot.
    Regards,
    John

    Hi Frank, thanks for the response.
    I'm curious about the dynamic declarative component. Any place I could check it out ?
    Back to my scenario. I'll try to be more clear to what we need!
    We have to have dynamic creation of components, based on a database configuration. This will allow our customers to have custom flex fields, without the need of us developing custom pages for each customer.
    One solution we are trying out, is the declarative component. Why ? Because the developer (when developing the page), knows that this specific page, is possible of customization by the client (custom flex fields). With this, the developer would choose where on his page the custom flex fields will be placed. Note that at this point (design time), no component (input, buttrons, etc) is created. The idea of the declarative component, is just so the Developer knows where he wants the custom fields placed in his page (a tab, below the form fields, in a another panel group, and so on). The declarative component, has only a container, PanelFormLayout, and no other component.
    What we want, is a way of calling our managed bean (the managed bean of the declarative component, that now I did configure it in the adfc-config.xml file , thanks for the tip) method, that's responsible for creating the custom components. The declarative component, receives a list of all the custom fields that needs to be created, at design time, through an attribute. The developer is responsible for setting this list when he drags the declarative component on his page.
    Now that I've put the declarative components managed bean in the adfc-config.xml file, the @PostConstruct is called correctly, but I still have a problem. At this moment (postContstruct call), my component PanelFormLayout (that is binded to the managed bean), is null. So I cannot add any component to the PanelFormLayout.
    Am I way out of line here Frank ?
    Really appreciate your comments.
    Thanks a lot.
    John

  • 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 do i popuulate SelectOneMenu by calling a bean method

    I've been trying to populate a selectOneMenu JSF Component with no success. i need to invoke a native C function to get a list to populate comboboxes. there is only one function for me to call, which when given different parameters, will return different list. I'm trying to do the following because there are > 100 lists which i need to get from this C program and i didn't want to create a getXXX for every list that i need.
    <h:selectOneMenu id="CD1" value="#{myBean.cat1}">
    <f:selectItems value="${myOtherBean.getListOfSelect("aaa", "Label", "ID")}" />
    </h:selectOneMenu>
    // this use to be
    <select id="CD1">
    <%
    MyOtherBean myOtherBean = (MyOtherBean)session.getValue("myOtherBean");
    javax.faces.model.SelectItem[] tbl = myOtherBean.getListOfSelect("aaa", "Label", "ID" );
    if ( tbl != null )
              for (int i=0;i<tbl.length;i++)
              tbl.moveTo(i);
              out.print( "<option value=\""+tbl.getValue()+"\">" );
              out.print( tbl.getLabel() );
              out.println( "</option>" );
    %>
    </select>
    // and rendered correctly. but have a hard time to bind to a bean
    MyOtherBean.java
    public javax.faces.model.SelectItem[] getListOfSelect( String s1, String s2, String s3){
    //Call a jni to get data and create an array
    // this part work OK....
    return anArray;
    }

    I don't think you can pass parameters in this manner using EL.
    One solution is to add the parameters s1, s2, s3 as attributes to your backing bean "myotherBean"
    in essence it sould translate into JSP code something like this
    myOtherBean.setParameter1("aaa");
    myOtherBean.setParameter2("Label");
    myOtherBean.setParameter3("ID");and in your bean:
    String param1, param2, param3;
    // get/set methods for the params.
    public javax.faces.model.SelectItem[] getListOfSelect( ){
      return getListOfSelect(param1, param2, param3)
    // and your current getListOfSelect
    public javax.faces.model.SelectItem[] getListOfSelect( String s1, String s2, String s3){
    //Call a jni to get data and create an array
    // this part work OK....
    return anArray;
    } ie you initialize the parameters, and then the el expression: ${myOtherBean.listOfSelect} would return your desired list.
    Yes its a workaround/hack. But that might be what it takes.

  • How to call a bean method through a javascript function

    I dont discover any problems calling the bean method in this maner:
    <%= helpdesk.data() %>
    But, when I use a Button Onclick= to call the script function and which then is going call my bean method
    an error on the page is reported!
    I have include som code which gives you the idea of what Iam searching for. And is it possible to call
    the bean method without doing from a new jsp page?
    If you have any suggestions to why it doesnt work, please let me know.
    I use Apache Tomcat 4.0
    Best regards Micah.
    <jsp:useBean id='helpdesk' scope='application'
    class='helpdesk.testdb'/>
    <html>
    <head>
    <script language="javascript">
    function broadcast()
    helpdesk.data();
    </script>
    </head>
    <body>
    <input type="button" value="Broadcast" onclick= broadcast()>
    </body>
    </html>

    It's actually quite simple:
    Beans run server-side
    Javascript runs client-side
    So you will never be able to run server-side-code thru the client...

  • 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

Maybe you are looking for