Remove unwanted backing bean binding

Hi All,
My JSFX page has around 200 fields and I have to manipulate only a few fields in the backing bean. When I use this method to bind the UI components with the backing bean Design--> Page Properties ---> Component Binding ---> Auto Bind, all the page UI components get bound. This creates unnecssary binding and my backing bean java files becomes quite messy and runs into 5000 lines. Is it possible to remove the unwanted ones manually without causing any harm. What's the best practice by the way.
Thanks
Edited by: user5108636 on Mar 10, 2011 8:38 PM

Hi,
This creates unnecssary binding and my backing bean java files becomes quite messy and runs into 5000 lines
This exactly is why the auto-generate option for backing beans is disabled by default in JDeveloper. There is no functionality in the IDE to remove unneeded bindings (how would the tool be able to tell what you need and what you don't need given that managed beans can be referenced from other managed beans and are referenced from EL in the component binding property).
Best practices for working with backing beans is to not create them by default and instead use managed bean that you turn into backing beans (which is when they have a page component binding reference) only when needed. This way you stay in control
Sorry, I have no better answer for this
Frank

Similar Messages

  • Removing Automatic Backing Bean Updates in Jdev 11.1.2.2.0

    Hi,
    in the User Guide and in the book "Jdeveloper 11g Handbook" I'm reading:
    Remove Automatic Backing Bean Updates
    1. Click page.jspx file tab. Click the Design tab
    2. Select Design | Page Properties and click the Component Binding tab. Unselect Auto Bind.
    Why I cannot locate Page Properties and the Component Bind tab?
    Where is? Can help me with some print screen?
    Thansk in advice

    Hi,
    Actually first chance to switch it off is when you create a new page: There is a managed bean tab in which you can do this. For existing pages, open the page in the visual editor and choose Design --> Page Properties from teh JDeveloper menu. In the opened dialog there is a "Component Binding" tab you press
    Frank

  • How-to remove a jsf backing bean from session?

    How can I find the reference to a backing bean (with session scope) and then remove the bean?
    I may have painted myself into a corner. When most of my pages are navigated to, they get key info from session and then initially populate the page fields. I populate the fields in the constructor with values from the database based on the keys found in session. So the second time a particular page is called the values may be stale or completely unrelated to the page navigated from because the bean already exists and, naturally, the constructor is never called.
    I'm thinking if I could remove the backing bean, jsf wouldn't find it so it would be recreated on subsequent navigations. Since the constructor would be called with every navigation to the page, the values would not be stale or unrelated.
    Any help would be greatly appreciated.
    TIA,
    Al Malin

    //To reset session bean
    FacesContext
         .getCurrentInstance()
         .getApplication()
         .createValueBinding( "#{yourBeanName}").setValue(FacesContext.getCurrentInstance(), null );
    //To get session bean reference
    Object obj = FacesContext
              .getCurrentInstance()
              .getApplication()
              .createValueBinding("#{yourBeanName}")
              .getValue(FacesContext.getCurrentInstance());
    YourSessionBean bean = (YourSessionBean)obj;

  • Dynamically binding backing bean

    Dynamic binding of backing bean
    Here is a problem that I have been trying to solve. Maybe someone can have a go at it:
    Here is a Search form(Simplified version):
    af:selectOneChoice - to choice a 'class family' e.g., companies, NGO, charity, institution etc
    af:inputText - to enter a name
    af:commandButton – to search
    Here is a User task:
    1.     Choose a 'class family' from the selectOneChoice
    2.     Enter a name in inputText
    3.     Click commandButton to start the search
    Additional information
    1. The number of 'class family' is about 30 and requires different method of search.
    2. I want to use a uniform search user interface and so there is only one page for all.
    3. Each 'class family' has it own managed bean in face-config.xml.
    Scenario:
    Lets say the searchUI.jsp has an initial backing bean called SearchBean.java. The af:selectOneChoice in searchUI.jsp has a valueChangeListener and when the user chooses a 'class family' at step (1), the valueChangeListener in SearchBean.java is triggered.
    Problem:
    The problem is how do I dynamically switch the backing beans, say from SearchBean.java to SearchCompanyBean.java so that when the user next click the search commandButton, it is the searchAction method in the SearchCompanyBean.java and NOT the initial SearchBean.java that handles the action.
    Cheers in advance.

    Hi,
    Assuming you are using ADF BC, have a look at using view criteria. You can define, dynamically apply and remove view criteria on the view object.
    Have a look at the help on oracle.jbo.ViewCriteria and applyViewCriteria from the ViewObject implementation class. Sounds like they might meet your requirements.
    Create a client method on your VO and drag it onto your page as an ADF parameter form and go from there.
    Brenden

  • Need to Add and Remove Columns of ADF Read Only table from Backing bean

    I have a scenario where I am trying to Populate TransientVO which is shown has a ADF Read Only Table in page.
    I have couple of Check Boxes Based on their selection I am trying to render and hide certain Columns.
    But the Issue which I am facing is only the Column Header seems to change where as the Rows and Values doesnt..
    even If I apply the expression language rendering condition on the outputText inside those columns.. ..
    So I am thinking to add and remove VO Attribute columns to the table from backing bean.
    Need some sample code snippet or a better design to achieve this. Its kind of urgent too...having an aggressive deadline :(
    Please chip in People..
    Thanks in Advance .
    TK

    Table Code..
    <af:table value="#{bindings.InventoryGridTrans.collectionModel}"
                                    var="row"
                                    rows="#{bindings.InventoryGridTrans.rangeSize}"
                                    emptyText="#{bindings.InventoryGridTrans.viewable ? 'No data to display.' : 'Access Denied.'}"
                                    fetchSize="#{bindings.InventoryGridTrans.rangeSize}"
                                    rowBandingInterval="0" id="t4"
                                    partialTriggers="::sbcSales ::sbcUsage ::cb1">
                            <af:column sortProperty="Period" sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Period.label}"
                                       id="c38">
                              <af:outputText value="#{row.Period}" id="ot33"/>
                            </af:column>
                            <af:column sortProperty="Past12SalesCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12SalesCount.label}"
                                       id="c29"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                              <af:outputText value="#{row.Past12SalesCount}"
                                             id="ot40"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage != true and backingBeanScope.IndexPageBackingBean.onSales == true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12SalesCount.format}"/>
                              </af:outputText>
                            </af:column>
                            <af:column sortProperty="Past12UsageCount"
                                       sortable="false"
                                       headerText="#{bindings.InventoryGridTrans.hints.Past12UsageCount.label}"
                                       id="c40"
                                       rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                       visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                              <af:outputText value="#{row.Past12UsageCount}"
                                             id="ot47"
                                             rendered="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}"
                                             visible="#{backingBeanScope.IndexPageBackingBean.onUsage == true and backingBeanScope.IndexPageBackingBean.onSales != true}">
                                <af:convertNumber groupingUsed="false"
                                                  pattern="#{bindings.InventoryGridTrans.hints.Past12UsageCount.format}"/>
                              </af:outputText>
                            </af:column>
                            </af:column>
                    </af:table>

  • Binding an object tag value / Creating HTML via a backing bean

    I have a task flow that sets some properties in my backbean. I've bound the "classid" of an <object> tag to one of these values. However, the first time i load the JSFF page, the object tag isnt created, but if i refresh the page, its loaded correctly.
    This would lead me to believe that the binding isn't being done before the JSFF is rendered, so the question is. Does anyone know how to fix this? and if not, i have thought about creating a backing bean that would add the <object> tag to the page with the bind value, but have no idea how i would go about this.
    Does anyone know of any good tutorials on adding HTML via a backing bean before the page is rendered?

    After further investigation and talking to a colleague, It seems it might not be binding related, since if I print out the bind in a text field, it displays correctly. I think the problem is because I am trying to inject an object tag (hosts a .NET control) into a fragment, but this is never picked up and rendered. Thus, when I do a full page refresh, the object tag is added and all goes well.
    If I attempt to bind/add a ADF Faces component this way, it works correctly.
    Do you know how to inject code for a fragment?, I am very stuck at the moment - don't have that much knowledge on ADF, so any links/help would be appreciated.
    My scenario is this:
    I am using a task flow that has 2 fragments.
    Fragment 1: set properties - has two input fields and a next button which are bound to a bean that saves the input fields
    Fragment 2: display object tag using step ones properties.

  • Binding parameters in backing bean

    hey,
    i have a function func1(String str) with a parameter
    in my bb i use code to invoke the function:
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("func1");
    operationBinding.execute();
    how can i bind parameter in backing bean?

    hi user,
    + with,
    here some
    your bean
      public class Login  {
        private RichInputText it2;
        private RichInputText it1;
    public void setIt2(RichInputText it2) {
            this.it2 = it2;
        public RichInputText getIt2() {
            return it2;
        public void setIt1(RichInputText it1) {
                 this.it1 = it1;
        public RichInputText getIt1() {
                   return it1;
    BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("checkLoginCredentials1");
            operationBinding.getParamsMap().put("p_user", it2);    p_user - bind var
            operationBinding.getParamsMap().put("p_pwd", it1);    p_pwd - bind var
    } your method in am:
        public String checkLoginCredentials1(String p_user, String p_pwd) {
            /*set the bind variable value*/
            vo.setNamedWhereClauseParam("p_user", p_user.toUpperCase());
            vo.setNamedWhereClauseParam("p_pwd", p_pwd.toUpperCase());
            return "Welcome" + "  " + p_user.toUpperCase();
        }p_user - say this in vo also
    p_pwd - say this in vo also
    just an references.
    Edited by: Erp on Nov 23, 2011 11:00 PM

  • Feedback requested: in backing bean, use AM svc method or operation binding

    Hello all,
    I'm posting this here to solicit feedback from both Oracle and from the community at large. The basic question is around what is the best/better practice for calling Application Module service methods from a backing bean. One choice is to call the service method directly on the application module; the other is to put an operation binding in the page definition and to execute that binding. The basic code for the two methods:
    ((MyAppModule) getBindings().getDataControl.getApplicationModule()).serviceMethod();or
    getBindings().getOperationBinding("serviceMethod").execute();My question comes up specifically because of differences in how the default error handling works. For testing, we created a simple AM with a single service method that throws a JboException (a kind of RuntimeException). Then, we created a simple ADF Faces page with an af:messages (to see how error handling works) and four af:commandButtons. The four command buttons are as follows (the code is in the backing bean for each of them):
    1). partialSubmit=false, calls application module service method directly
    2). partialSubmit=false, executes service method via operationBinding
    3). partialSubmit=true, calls application module service method directly
    4). partialSubmit=true, executes service method via operationBinding
    None of the backing bean methods catch any exceptions. Note that #2 and #4 could be bound directly to the methodBinding in the pagedef, but we did it via code in the backing bean to more accurately mimic some of the code in our application; in any case, the results were the same using either method for #2 and #4.
    The results when clicking each button:
    1). ugly stack trace in the browser window (yuck!)
    2). the af:messages component displays the JboException (nice)
    3). No stack trace, no error message (even worse than #1, user thinks "success," even though exception occurred)
    4). the af:messages component displays the JboException (nice)
    This leads me to think that perhaps calling via the binding container is the preferred method because the default error handling gives acceptable behaviour, whereas using the AM directly gives unacceptable behaviour.
    Another "benefit" of calling through the binding container is that the technology in the model layer could be changed without having to change the view layer. I say "benefit" in quotes because I personally believe that one should write applications to take full advantage of the technology they choose, not try to strive for technology/database independence (no flames on this one please - that's not the main point here ;).
    Having made the preliminary conclusion that the binding container is the preferred way to go for service methods - that could then ostensibly be extended to view objects as well. Should the view layer use iteratorBindings instead of dealing with view objects directly as well? This is a bit more shaky ground because there are some points in the view/controller layer (namely managed beans not associated with any page) where there is no binding container available. However, in backing beans, for re-executing queries we could make the "best practices" statement to always use iteratorBindings instead of accessing the AM/VO. I just completed a test comparing view object usage vs iterator binding usage (vo.executeQuery() vs myIter.executeQuery()) with similar results to the AM testing - the binding container route gives acceptable error handling, whereas the VO route forces me to implement my own error/exception trapping and message display.
    I am aware of one drawback to using the binding container instead of the AM directly - that is that each page that needs the service method must have something in it's pageDef for that method. Originally, we had some code in a superclass of some backing beans that called the AM directly, and we didn't need to touch the pageDefs of approximately 20 JSF pages - when changing to use the operation binding - we had to add it to a lot of page defs.
    I'm very interested in feedback from the community at large on my conclusions. If the discussion gets to be too big/complicated for here, we can change venues to perhaps the oracle wiki or another forum. I did do a quick review of SRDemo ADFBC and noted that all of the service method calls are done through operation bindings - I never noticed that before! Most of the discussion we see in the forums shows people calling them directly, which is why I thought it important to post here.
    Best regards,
    John

    What we did in our project was that we create a "Headless" pagedefinition, (that was how it was described in SRDemo documentation or in JDeveloper help, its on the latter part about Security).
    You have to create that pagedef manually. and it only has an
    <page id="yourPageDef_Id" path="..."> entry in your Databindings and no
    <page path=".../yourPageDef_id" usageId=".../???.jsp">And then in your faces_config and your managed bean name is backingSystemStateBean and is located at path.to.bean.SystemState add a Session scope bean entry like this:
      <managed-bean>
        <managed-bean-name>backingSystemStateBean</managed-bean-name>
        <managed-bean-class>path.to.bean.SystemState</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
          <property-name>bindings</property-name>
          <value>#{data.yourPageDef_Id}</value>
        </managed-property>

  • How add auto binding backing bean to a jspx page

    A few times during development, I didn't check "automatically expose UI components to in a manage bean" when the jspx page was first created.
    Can someone tell if there is a way to add auto binding backing bean to the page later?
    Thanks

    Hi Deborah,
    when your JSPX page is active, select menu Design -> Page Properties...
    Click Tab Component Binding
    Select Auto Bind and select (or create with New) your Managed Bean
    Regards,
    Didier.

  • How to bind ADF table with a collection of elements using backing bean.

    Hi Experts,
    My JDev version is 11.1.1.6.0.
    I need to bind ADF table with a collection of elements using backing bean.
    My backing bean consists of 6 lists of strings, where each list represents a column of table. How can I populate the entries of table with these lists.
    Thanks
    Gopi

    Hi,
    Create an object representing the row (setter/getter). Then have a list of these objects. Drag and drop the table and point its value to the list and the type to the row object
    Frank

  • How to override the where clause (Bind Variables) in Backing Bean.

    HI
    I am using bind variables in VO and using exeutewithparam to pass the values to bind. Which is working fine.
    But what i want now to override the values pro grammatically from backing_bean of that page.
    How can i pass the values to bind variables from bean.
    M Niaz.

    Hi
    Try this if it works. this is from 10g
    1)create value binding in the backing bean on any action
    FacesContext ctx=FacesContext.getCurrentInstance();
    ValueBinding vb= ctx.getApplication().createValueBinding("#{bindings['account_name1'].inputValue}");
    2) and then set the value for binding
    vb.setValue(ctx,(String)accountInput.getValue());
    Now execute the method with method binding and execute it
    ctx.getApplication().createMethodBinding("#{bindings.ExecuteWithParams.execute}",null).invoke(ctx,null);
    Regards
    Rohit

  • Problem in sending variable to backing bean

    I want to send the data selected by the user that retrieved from the database to the backing bean. I have two questions. First, I don't know why the variable irl, irw, ird cannot display in the inputbox. Second, when the user click the commandbutton, it will throw NullPointerException. Please help. Thanks.
    Code of the JSF
                     <sql:query sql = "SELECT PLI_ITEM_NO,PLI_RD_CODE,PLI_TRNH_LEN,PLI_TRNH_WID,PLI_TRNH_DEP FROM PLI_PLAN_ITEM WHERE PLI_PLAN_ID = ${pid} AND PLI_ITEM_NO = ${iid}" var = "itemresult" dataSource="${db}">
                     </sql:query>
                     <table id="ro-item" cellspacing="0" cellpadding="3" border="0">
                          <c:forEach var="itemrow" items="${itemresult.rows}">
                               <c:set var="irl" value="${itemrow.PLI_TRNH_LEN}"/>
                               <c:set var="irw" value="${itemrow.PLI_TRNH_WID}"/>
                               <c:set var="ird" value="${itemrow.PLI_TRNH_DEP}"/>
                               <tr>
                                    <td>Road Category:</td>
                                    <td></td>
                               </tr>
                               <tr>
                                    <td>Length:</td>
                                    <td>
                                         <h:inputText id="itemlength" value="#{irl}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                               <tr>
                                    <td>Width:</td>
                                    <td>
                                         <h:inputText id="itemwidth" value="#{irw}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                               <tr>
                                    <td>Depth:</td>
                                    <td>
                                         <h:inputText id="itemdepth" value="#{ird}" size="6"></h:inputText>m
                                    </td>
                               </tr>
                          </c:forEach>     
                     </table>
                   <c:if test="${irl==null}"><c:set var="irl" value=""/></c:if>
                     <c:out value="${irl}"/>
                  <h:commandButton id="submit" value="Submit" actionListener="#{planBean.action}">
                      <f:attribute name="attributeName1" value="#{irl}" />
                  </h:commandButton>Code of the backing bean
    public class PlanBean {
        public void action(ActionEvent event) {
            String attributeName1 = FacesUtil.getActionAttribute(event, "attributeName1");
            System.out.println("attributeName1: " + attributeName1);
    }

    Its never advisable to use JSTL and JSF together
    not sure ... but if i were at ur place .. i will never use <c:forEach> and <c:if> etc with JSF
    There are a number of reasons:
    1. Using JSTL actions and JSF actions means using both JSP EL expressions and JSF EL expressions.
    Because of the subtle differences between these two expression types, it's not always obvious what's going on.
    For instance, all variables in a JSP EL expression must refer to existing beans, while beans for variables in a JSF
    value binding expression are created automatically if they don't exist. Another difference is that a JSF EL expression can't access page scope variables.
    2. When you use <c:if> to conditionally include or exclude a JSF action, the corresponding component is physically added
    or removed from the view's component tree. This can lead to strange effects because the component loses its state when
    its removed from the view.
    3. The <c:if> action and the type of conditions used in the EL expressions represent application logic,
    and it's better kept out of the template altogether.
    Intead why r u not using JSF table ...?
    the reason for null pointer may be u are declaring variable in JSTL and using as a parameter as attribute for JSF component
    try using JSF table ... things shud get resolved ...
    [http://myfaces.apache.org/trinidad/devguide/table.html|http://myfaces.apache.org/trinidad/devguide/table.html]
    [http://lavnish.blogspot.com/2007/12/all-about-adf-tables.html|http://lavnish.blogspot.com/2007/12/all-about-adf-tables.html]

  • TP4 / AF:REGION / What is the way to work with af:region and Backing Beans?

    Hello,
    I would be able to use the "af:region" component with a Backing Bean, but all examples I can found googling are with pageDef.
    So, I have been trying with different classes the way to solve this problem and I arrive to this:
    oracle.adf.controller.internal.binding.TaskFlowRegionModel
    Some code:
    task-flow-definition.xml
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <task-flow-definition id="taskDestinationA">
        <default-activity>destinationA</default-activity>
        <view id="destinationA">
          <page>/regionDestinationA.jsff</page>
        </view>
        <use-page-fragments/>
      </task-flow-definition>
    </adfc-config>
    adfc-config.xml
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <managed-bean>
        <managed-bean-name>backing_regionTest</managed-bean-name>
        <managed-bean-class>backing.RegionTest</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1regionTest.jspx-->
      </managed-bean>
    </adfc-config>
    regionTest.jspx
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document binding="#{backing_regionTest.document1}" id="document1">
    <af:form binding="#{backing_regionTest.form1}" id="form1">
        <af:region binding="#{backing_regionTest.region1}" id="region1"
                   value="#{backing_regionTest.regionModel}"/>
    </af:form>
    </af:document>
    </f:view>
    <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_regionTest-->
    </jsp:root>
    RegionTest.java
    import oracle.adf.controller.internal.binding.DCTaskFlowBinding;
    import oracle.adf.controller.internal.binding.TaskFlowRegionModel;
    import oracle.adf.view.rich.component.rich.RichDocument;
    import oracle.adf.view.rich.component.rich.RichForm;
    import oracle.adf.view.rich.component.rich.fragment.RichRegion;
    import oracle.adf.view.rich.model.RegionModel;
    public class RegionTest {
        private RichForm form1;
        private RichDocument document1;
        private RichRegion region1;
        private RegionModel regionModel;
        public RegionTest () {
            /*Here I try to put the same values as the constructor of TaskFlowId*/
            /*THERE IS NO DOCUMENTATION ANYWHERE :P*/
            DCTaskFlowBinding dctfb = TaskFlowRegionModel.getCurrentTaskFlowBinding("/WEB-INF/task-flow-definition.xml","taskDestinationA");
            //And here, dctfb is always NULL.
            /*I try removing the '.xml' extension of the name, but still not works*/
            //Fill the value of regionModel
            this.regionModel = new TaskFlowRegionModel(dctfb);
            /*Perhaps is better create a method to acquire the value,
              but I try in constructor first*/
        public void setForm1(RichForm form1) { this.form1 = form1; }
        public RichForm getForm1() { return form1; }
        public void setDocument1(RichDocument document1) { this.document1 = document1; }
        public RichDocument getDocument1() { return document1; }
        public void setRegion1(RichRegion region1) { this.region1 = region1; }
        public RichRegion getRegion1() { return region1; }
        public void setRegionModel(RegionModel regionModel) { this.regionModel = regionModel; }
        public RegionModel getRegionModel() { return regionModel; }
    regionDestinationA.jsff
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:outputText value="Hello World!"/>
    </jsp:root>So, my problem is in Backing Bean class (RegionTest.java). I don't know how I can acquire 'DCTaskFlowBinding' instance value; well, I don't know if that is the way to acquire the value of TaskFlowRegionModel, and even I don't know if this is the way to set the value of RegionModel. I don't know all of this because there isn't documentation yet :P
    Some oracle-java-guru can help me, please?
    JVN
    PD: Environment: JDev TP4.

    Hi,
    your biggest problem is the use of internal classes that probably will change without further notice and lead to a broken application then
    I don't think that the region model is supposed to work without ADF binding in this release. If you need a page region then the Trinidad region should be helpful (though it doesn't support you with navigation cases as the taskflow does)
    I'l check internally if there is an option to do what you are trying to do. However, as mentioned, if you need to use internal classes then the answer probably is no.
    Frank

  • H:inputText and immediate="true" not updating cached backing bean value

    Hi,
    I am having a problem with h:inputText and immediate="true" when
    returning back to the same page.I looked through the forums but the
    only solution to remove the page from the session works only if I
    don't have to change any button label names in the page I am going back
    to.Unfortunately, I have to change a button name when I go back to the
    same page.The button name change works if i don't remove the page from
    session but then h:inputtext has stale values in it from the backing
    bean.I also need to avoid validation as it is a huge form.
    I have tried looking through the JSF forums but they didn't have any
    answers for a very similar question.
    I am not sure how exactly to use component binding for the input text and update the model values using an actionListener.I have tried puting a binding on an input text field and then used an actionListener instead of immediate="true' in the h:commandLink.But, putting context.renderResponse() in the actionListener method results in the model values not getting updated.
    I have also tried using component.processUpdates(facesContext) as in the UpdateModelValuePhase class -that too doesn't work.
    Thanks for any help,
    Vijay
    Details:
    The <h:inputText ..> does not populate the values back from a backing
    bean when immediate="true" is used when an action is called.
    <h:commandLink id="selectPrincipalId"
    action="#{application.selectPrincipal}" immediate="true">
    Only <h:inputText has the cached values from the first entry.
    <h:inputText id="principalLastName1Id"
    value="#{application.currentPrincipal.lastName}" size="10"/><== this
    has the cached value from the backing bean application.
    <h:outputText gets the new values from the backing bean when the same
    page is reentered.
    <h:outputText value="#{application.currentPrincipal.lastName}"></h:outputText><==
    this refreshes with the new value from the backing bean application.
    Here is the solution to rectify the problem:
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    Map sessionMap = externalContext.getSessionMap();
    sessionMap.remove("/jsp/befg/tc/apply/enterCreditApplication.jsp");
    <== this is the name of the jsf page as defined in the
    faces-config.xml.

    Hi,I have encountered the same problem as you,and I find a solution myself,which is shown as follows,but I don't know if these is any hidden trouble in the code.
    <h:form>
    <h:commandLink action="#{app.action}" immediate="true" actionListener="#{app.update}">xxxx</h:commandLink>
    <h:inputText id="_id" value="#{app.val}" immediate="true"/> //must set immediate="true" else the model will be not updated
    <h:message for="_id"/>
    </h:form>
    public class App{
    public void update(ActionEvent event){
         FacesContext c = FacesContext.getCurrentInstance();
         UIViewRoot root =c.getViewRoot();
         root.processUpdates(c);//to update model and short-circuit the validators
    in such circumstance,the UIViewRoot's processUpdates method will be called in the actionlistener,and the back bean who titled to immediate(true)'s inputText will be updated, but the one who titled to immdiate(false)'s inputText will not be updated,Why?
    Can anyone tell me way?and how to solve?
    Thanks a lot!

  • How to pass object from JSF to backing bean

    Hi,
    I have a JSF page using repeater and RichFace Toolbar:
            <h:form id="professional-profile">
                <a4j:repeat value="#{profilesBean.profiles}" var="lang" binding="#{profilesRepeaterBean.repeater}">
                    <rich:togglePanel styleClass="data-input-panel" switchType="client" stateOrder="closed, opened">
                        <f:facet name="closed">
                            <rich:toolBar>
                                <rich:toggleControl switchToState="opened">
                                    <h:graphicImage style="border-width:0" value="../Images/open_btn.gif" />
                                    <rich:toolTip value="#{pp_msg.tooltipOpensPanel}" direction="top-right" showDelay="${config.toolTipDelay}" styleClass="tool-tip"/>
                                </rich:toggleControl>
                                <h:outputText value="#{lang.language}"/>
                            </rich:toolBar>
                        </f:facet>
                        <f:facet name="opened">
                            <h:panelGrid style="width: 100%" columns="1">
                                <rich:toolBar>
                                    <rich:toolBarGroup location="left">
                                        <rich:toggleControl switchToState="closed"
                                                            onclick="if(!ConfirmUnsavedForAction('#{common_msg.unsavedDataWarning}')){return false;}">
                                            <h:graphicImage style="border-width:0" value="../Images/close_btn.gif" />
                                            <rich:toolTip value="#{pp_msg.tooltipClosesPanel}" direction="top-right" showDelay="${config.toolTipDelay}" styleClass="tool-tip"/>
                                        </rich:toggleControl>
                                        <h:outputText value="#{lang.language}"/>
                                        <font class="counterColor">
                                        (#{pp_msg.remainingChars}:</font><h:outputText class="counterColor" id="charsCounter" value="${config.profestionalProfileMaxLength-fn:length(lang.profile)}"/>
                                        <font class="counterColor">)</font>
                                    </rich:toolBarGroup>
                                    <rich:toolBarGroup location="right">
                                        <a4j:commandLink id="submit"
                                                         action="#{cvData.editUsr}"                           <<<<<<<<<<<<<<<<<< THIS LINE
                                                         value="#{common_msg.buttonSave}"
                                                         messagePlace="textarea"
                                                         onclick="CommandOnClick(#{rich:element('textarea')},'#{common_msg.dataSaving}','#{common_msg.dataSaved}');"
                                                         data="#{facesContext.maximumSeverity.ordinal ge 2}"
                                                         oncomplete="CommandOnComplete(#{rich:element('textarea')},data,1500); DataSaved();">
                                        </a4j:commandLink>
                                    </rich:toolBarGroup>
                                </rich:toolBar>
                                <h:inputTextarea
                                    id="textarea"
                                    rows="10"
                                    styleClass="professional-profile-input-area"
                                    binding="#{profilesRepeaterBean.profileInput}"
                                    value="#{lang.profile}"
                                    label="#{pp_msg.header}"
                                </h:inputTextarea>
                            </h:panelGrid>
                        </f:facet>
                    </rich:togglePanel>
                    <br/>
                </a4j:repeat>
            </h:form>Currently all data are stored for all panels at "Save" button click. I want to change it to save only changed panel. For each toolbar an instance of "lang" object is created which i want to send to backing bean where I planned to merge with JPA.
        public void SaveCVProfile(ICvProfileLang profile) {
            cvData.editChangedProfile(profile);
        }All combinations I try gave me just String as parameter value, not an Object reference.
    Any ideas?

    Thanks BalusC,
    I must have messed up my previous tries.
    I used you hint with "f:setPropertyActionListener ".
    <a4j:commandLink id="submit"
                     value="#{common_msg.buttonSave}"   <<<<<< "action"  - REMOVED
                     messagePlace="textarea"
                     onclick="CommandOnClick(#{rich:element('textarea')},'#{common_msg.dataSaving}','#{common_msg.dataSaved}');"
                     data="#{facesContext.maximumSeverity.ordinal ge 2}"
                     oncomplete="CommandOnComplete(#{rich:element('textarea')},data,1500); DataSaved();">
        <rich:toolTip value="#{pp_msg.tooltipButtonSave}" direction="top-left" showDelay="${config.toolTipDelay}" styleClass="tool-tip"/>
        <f:setPropertyActionListener target="#{profilesBean.saveCVProfile}" value="#{lang}" />
    </a4j:commandLink>I removed "action" from commandLink and passed the object to action listener.
    It works as intended now, even without using UIData#getRowData().

Maybe you are looking for

  • JmenuItem not going away when I click outside of the applet

    Hi guys, I created a swing applet with JMenu and JMenuItem. If I click within the applet area, the JMenuItem will go away. But when I click out side of the applet, the JMenuItem will not disapear. How to fix this problem? Thanks in advance. yj

  • Contract Price Descriptions

    Hello Experts! We are currently displaying materials and services in the same catalog. For services, as you may know, there can be multiple service line items for one contract item. This could then equate to multiple contracts applying to the Contrac

  • Premiere Pro CC crashes when exporting media

    Rendering from a multicam sequence with in/out points set.  Media consists of RED Epic 5K, Canon 7D, GoPro, and BWF sound.  Output is for Vimeo 1080p 23.976.  All cams and sound are set to 23.976.   Can anyone help me? Problem signature:   Problem Ev

  • Bridge/Photoshop Script Example Please

    Does anyone have an example Bridge script that they can share that 1. Runs on a selection of images from Bridge. 2. Calls a simple action in Photoshop (resize and sharpen, for instance) for each image in turn 3. Saves the images into a new folder or

  • How to make iMovie the default for importing from video camera?

    I successfully imported 5 or 6 mini discs from the video camera, then on the next download attempt I saw a pop-up box. The box said something like "what program do you want as the default for downloading?" I was thinking iMovie, but apparently clicke