Populating InputText with Backing Bean

Hi All,
I'm hoping this is a simple question. I have a backing bean called from a af:serverListener. I get the right value I want as i see the System.out.println. I have attached the binding to my InputText and set the partial trigger. When I click the button my field doesn't get updated.
I have attached the code of my backing bean.
package google;
import oracle.adf.view.rich.component.rich.input.RichInputText;
import oracle.adf.view.rich.render.ClientEvent;
public class backing {
    private RichInputText polygonResponse;
    public backing() {
    public void setPolygonResponse(RichInputText polygonResponse) {
        this.polygonResponse = polygonResponse;
    public RichInputText getPolygonResponse() {
        return polygonResponse;
    public void polygonResponse(ClientEvent clientEvent){
      String polygon = (String) clientEvent.getParameters().get("polygon");
      System.out.println("Polygon: " + polygon);
      this.getPolygonResponse().setValue(polygon);
}

I had tried that without success, so I removed that line. It was good to know that was what I needed to do so it was helpful.
The actual issue was with the line
this.getPolygonResponse().setValue(polygon);I changed it to
getPolygonResponse().setSubmittedValue(polygon);  and it worked, not sure what the difference is between setValue() and setSubmittedValue(), but at least im working.
for those that are interested here is my complete code.
package google;
import oracle.adf.view.rich.component.rich.input.RichInputText;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.render.ClientEvent;
public class backing {
    private RichInputText polygonResponse;
    public backing() {
    public void setPolygonResponse(RichInputText polygonResponse) {
        this.polygonResponse = polygonResponse;
    public RichInputText getPolygonResponse() {
        return polygonResponse;
    public void getPolygonDetails(ClientEvent clientEvent){
      String polygon = (String) clientEvent.getParameters().get("polygon");
      System.out.println("Polygon: " + polygon);
      getPolygonResponse().setSubmittedValue(polygon);
      AdfFacesContext.getCurrentInstance().addPartialTarget(polygonResponse);
}thanks for your help.
cheers
James

Similar Messages

  • Error using selectmany tags with backing beans - Beta 1

    Hi All,
    I'm not having any luck getting any of the selectmany tags working with back-end beans. I've concluded it just doesn't work. My example is derived from the selectmany sample in the tutorial, which also just doesn't work (there are 4 or 5 problems with the sample in the tutorial, including the fact that there's no tag called 'selectmany_checkbox' in Beta 1, it's renames to selectmany_checkboxlist. But I digress).
    Anyway, the following is the relevant JSP snippet:
    <html:selectmany_menu value="#{facesTest.items}">
    <faces:selectitem itemValue="foo" itemLabel="foo" />
    <faces:selectitem itemValue="bar" itemLabel="bar" />
    </html:selectmany_menu>
    Here's the relevant backing bean snippet:
    protected ArrayList items = null;
    public Object[] getItems() {
    System.out.println("getItems():ENTRY");
    if (items != null)
    return items.toArray();
    else
    return null;
    public void setItems(Object[] items)
    System.out.println("setItems():ENTRY");
    int len = 0;
    if (null == items ||(len = items.length) == 0) {
    return;
    if (this.items != null)
    this.items.clear();
    this.items = new ArrayList(len);
    for (int i = 0; i < len; i++) {
    this.items.add(items);
    I've declared the bean as follows in the face-config.xml:
    <managed-bean>
    <managed-bean-name>facesTest</managed-bean-name>
    <managed-bean-class>ipt.faces.FacesTest</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    The errors vary, but basically when I don't select anything from the multi-select menu, all is fine. When I do select something I get one of two messages returned thru the messages tag, either "Conversion Error setting value 'null' for 'expression'" when I select one item or " Conversion Error setting value '[Ljava.lang.String;@397d4e' for 'expression'." when I select two items.
    Turning on 'FINEST', I get the output below:  Any ideas?  I've noticed several posting regarding the selectmany tags, any response on getting these to work?
    thanks!
    Steve
    FINE: Exiting RenderResponsePhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINE: Begin executing lifecycle phases
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: execute(phaseId=RESTORE_VIEW 1)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: Begin execute(phaseId=RESTORE_VIEW 1)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RestoreViewPhase execute
    FINE: Entering RestoreViewPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getMappingForR
    equest
    FINEST: servletPath /hello.jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getMappingForR
    equest
    FINEST: pathInfo null
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getFacesMappin
    g
    FINE: URL pattern of the FacesServlet executing the current request .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl convertViewId
    FINE: viewId after appending the context suffix /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl restoreView
    FINE: Begin restoring view from response /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl restoreView
    FINE: End restoring view from response /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl restoreView
    FINEST: set character encoding on request to ISO-8859-1
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RestoreViewPhase execute
    FINE: Postback: Restored view for /hello.jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RestoreViewPhase execute
    FINE: Exiting RestoreViewPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: End execute(phaseId=RESTORE_VIEW 1)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl hasPostDataOrQuery
    Params
    FINEST: Request Method: POST/PUT
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: execute(phaseId=APPLY_REQUEST_VALUES 2)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: Begin execute(phaseId=APPLY_REQUEST_VALUES 2)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ApplyRequestValuesPhase execute
    FINE: Entering ApplyRequestValuesPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue(ref=facesTest.items)
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.VariableResolverImpl resolveVariable
    FINE: resolveVariable: Resolved variable:ipt.faces.FacesTest@f97d27
    getItems():ENTRY
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue Result:[Ljava.lang.Object;@11fb68f
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINEST: -->Returning [Ljava.lang.Object;@11fb68f
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.VariableResolverImpl resolveVariable
    FINE: resolveVariable: Resolved variable:ipt.faces.FacesTest@f97d27
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getType
    FINE: isReadonly result:class [Ljava.lang.Object;
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue(ref=facesTest.items)
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.VariableResolverImpl resolveVariable
    FINE: resolveVariable: Resolved variable:ipt.faces.FacesTest@f97d27
    getItems():ENTRY
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINE: getValue Result:[Ljava.lang.Object;@1262667
    Jan 9, 2004 10:11:52 AM com.sun.faces.el.ValueBindingImpl getValue
    FINEST: -->Returning [Ljava.lang.Object;@1262667
    Jan 9, 2004 10:11:52 AM com.sun.faces.context.FacesContextImpl addMessage
    FINE: Adding Message[sourceId=_id0:_id7,summary=Conversion Error setting value '
    [Ljava.lang.Object;@1262667' for 'expression'.)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ApplyRequestValuesPhase execute
    FINE: Exiting ApplyRequestValuesPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: End execute(phaseId=APPLY_REQUEST_VALUES 2)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: execute(phaseId=PROCESS_VALIDATIONS 3)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: Begin execute(phaseId=PROCESS_VALIDATIONS 3)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ProcessValidationsPhase execute
    FINE: Entering ProcessValidationsPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.ProcessValidationsPhase execute
    FINE: Exiting ProcessValidationsPhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINEST: End execute(phaseId=PROCESS_VALIDATIONS 3)
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.LifecycleImpl execute
    FINE: Skipping to RenderResponsePhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RenderResponsePhase execute
    FINE: Entering RenderResponsePhase
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RenderResponsePhase execute
    FINE: About to render view /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINE: About to render view /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getFacesMappin
    g
    FINE: URL pattern of the FacesServlet executing the current request .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINE: Found URL pattern mapping to FacesServlet .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINEST: Before dispacthMessage to newViewId /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getFacesMappin
    g
    FINE: URL pattern of the FacesServlet executing the current request .jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl getViewIdPath
    FINEST: viewId after modifications /hello.jsf
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ApplicationImpl createConverte
    r
    FINEST: Created converter of type javax.faces.convert.BooleanConverter
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl writeState
    FINEST: Begin writing state to response for viewId/hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl writeState
    FINEST: End writing state to response for viewId/hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl saveSerialize
    dView
    FINE: Begin creating serialized view for /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.StateManagerImpl saveSerialize
    dView
    FINE: End creating serialized view /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.application.ViewHandlerImpl renderView
    FINEST: After dispacthMessage to newViewId /hello.jsp
    Jan 9, 2004 10:11:52 AM com.sun.faces.lifecycle.RenderResponsePhase execute
    FINE: Exiting RenderResponsePhase

    Could you post your code example? I am having the same problem. And I am wondering how you can set the value, label and description using the String[] return type. I thought the object[] would basically be a SelectItem Array...
    thanx!

  • Problem populating selectOneMenu from backing bean

    i want to populate my selectOneMenu with items from a backing bean, but items never show up.
    jsf code
    <h:selectOneMenu >
                          <c:forEach var="item" items="#{club.list}">
                              <f:selectItem itemLabel="#{item}" itemValue="#{item}"/>
                           </c:forEach>
                          </h:selectOneMenu>
                        faces-config.xml
    <managed-bean>
        <managed-bean-name>club</managed-bean-name>
        <managed-bean-class>entities.ClubController</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
      </managed-bean>bean code. i have omitted the unnecessary code
    public class ClubController {
        public ClubController() {
        private List<String> list;
        public List<String> getList()
             list=new ArrayList();
             list.add("item 1");
             list.add("item 2");
             return list;
    }

    This exception usually appears if your bean throws an exception in initializer/constructor. Try adding log statements top your constructor to see what's wrong.
    I believe getServiceLocator() or getServiceLocator().getAdministracionVirtualService() or getServiceLocator().getAdministracionVirtualService().getAllCategorias() is null.

  • Need help with fillling backing bean w/info

    I am new to JSP and have some very basic questions regarding filling a JSF with data from the database and then allowing the user to edit and save the data back to the database.
    I am using JDeveloper 10.1.3 developer preview
    This is what I have so far (which may be suspect in itself):
    1. A method called DatabaseUtil.getProductApproval(productApprovalNbr) which creates and returns a ProductApprovalBean
    2. A JSF called search.jsp with backing bean Search.java.
    3. Another JSF called productApproval.jsp with backing bean ProductApproval.java
    4. Successful navigation defined from search.jsp to productApproval.jsp
    5. The backing bean Search.java has a SearchButton_action that returns success if productApprovalNbr specified is OK (edit currently hard-coded)
    6. The productApproval.jsp has a component called productApprovalNbr with binding to backing_search.productApprovalNbr
    This is want I want to do but don’t know how:
    1. Make a call to create the ProductApprovalBean and fill the productApproval.jsp backing bean with info from ProductApprovalBean before the productApproval.jsp is displayed to the user.
    2. Allow the user to change values and save them back to the db after clicking on the save command button.
    How do I wire this stuff up?
    Any advice will be greatly appreciated because I am stuck big time.
    Regards,
    Al Malin

    Thanks for the reply Brian.
    I’ve looked at directly binding to the ProductApprovalBean and that looks like a good approach to take in other cases but for the UI design I currently have I am not sure.
    Basically, the ProductApprovalBean is a master entity with several related detail entities. This is so because the user wants to see all of the related data on a single page instead of showing one page for a master, another for a detail, another for another detail, etc. So I am designing a JSF form that consists of multiple sections, each section presenting an entity. Each detail section would have its own command buttons for editing, adding, and deleting rows.
    Since my first post I have figured out how to fire an event in search.jsp and catch it in an event handler in the backing_bean. (This was great progress --- only took me 9 hours to write 6 lines of code. :-) From here I figured I could access the db and load up the fields for the first screen and do updates with the subsequent screens.
    After looking through the documentation, I not sure I’m up to the task. New problem, I don’t know the JSF classes well enough to load up the fields, and after they are loaded, how do I get the data out. (At first, JSF looked really slick but there has been a steep leaning curve associated with it, I'm real close to reverting to JSPs and servlets.)
    If I am on the wrong path and this approach is all wet, please say so.
    Regards,
    Al Malin

  • Backing Beans Object Oriented Design

    Hello,
    Are there any best practices for using Backing Beans?
    How to make managed beans thread-safe for concurrent requests,
    without compromising on efficiency/speed?
    2. How to enforce the J2EE security with backing-beans?
    3. How to decide the scope of these beans to ensure minimal data-storage
    in session?
    4. How to decide the granularity at which a managed-bean should be used
    for example :
    4.1 One bean-per-component
    4.2 One bean-per-form
    4.3 One bean-per-page
    Also i would like to know how to design managed beans from reusability perspective.
    Regards,
    Smita

    It quite hard to give a brief answer on all your questions.
    I think that you should take into account bean's scope when think about thread safety.
    Request scope bean is single threaded while for session scope you should provide locking mechanism because this bean can be accessed from different threads but only in case when one user simultaneously submit request from multiply browser windows.
    As for security you can use standard security API from within bean through javax.faces.context.ExternalContext
    It is convenient to use one backing bean for some or all components in web form.
    Do not mix form component and business data in one bean. Thus it is good design to have one set of beans for presentation logic and another one for business logic.

  • 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

  • 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 can i devlope three JSPX pages & having only one backing bean.

    Hello Team,
    I am working on Jdevloper11g
    I have one form registration in this from user enters the self information in first screen, insurance information in second screen, employment information in third screen
    So I developed the following scenario
    I create one JSPX page & in this page I taken 3 panelGroupLayout n I simply rendering the panelGropuLayout that time its very essay stuff.......
    But now I have to implement the af:train component in that I have to implement above scenario in three JSPX pages & I want only one backing bean for this three JSPX pages.
    SelfInformation.jspx ...... SelfInformation.java
    InsuranceInformation.jspx
    EmploymentInformation.jspx
    I done this too…
    But now I want when
    I adding some components on second screen ex af:inputText its backing bean create in SelfInformation.java
    Is this possible?

    HI..
    I created three jspx pages...& i drag n drop af:train & af:trainButtonBar camponant.... by default Back & next button is created...But my requirment is...Only on first form i dont want to show Back Button...
    How can i do this?
    Edited by: Charu on Nov 22, 2009 9:42 PM

  • Best practice for backing bean population? (also, ActionListener RANT)

    Hello,
    I am about 3/4 of the way through development of a small to medium size JSF application. Sometimes I really like JSF, but much of the time I am left puzzled or frustrated for hours trying to find workarounds to JSF's bugs/glitches and design flaws.
    For example, early on, I was impressed with how easily it was to invoke a method from a page using an actionlistener. Now that I'm actually building things with JSF, the actionlistener funtionality still seems cool, but incredibly half baked. I find myself using request parameters LIKE CRAZY to work around the fact that JSF doesnt support passing parameters directly to backing bean methods. This feels awkward and wrong considering the fact that JSF is intended to abstract the HTTP underpinnings. To add insult to injury, I often have to iterate through ALL of the request parameters looking for one that has an id with an ending matching my desired property name (since JSF appends it's own crap to the beginning). I don't like doing things in a hacky way. This seems very hacky, and I feel dirty doing it.
    So, my first question is, what is the best practice for populating backing beans??? How do others accomplish this. I can think of several other approaches, but none feel less hacky.
    Second, are there plans in the next spec (please say there are) to allow parameters to be passed to backing bean methods? If not, WHY THE HECK NOT?
    Even though JSF expert group people have been conspicuously absent from this forum of late, I'd really appreciate responses from you as well.
    Thank you for your thoughts.

    Hi BrownBear,
    I've been using JSF for about 6 months now and I'd be glade to help as much as I can.
    Concerning parameters, I'm not sure what your issue is but I use the f:param tag to pass them. If you could post an example of what you are trying to do, I could see exactly what your issue is. Maybe the f:param can't help you.
    As for best practice for populating backing beans, I personaly try to let JSF do as much as possible. For example, if I have a backing bean with five properties, I make sure that they all are on the JSP page the bean serves. If one of the property is just there as an Id like, lets say, a Person ID (DB row key), then I put it on my JSP page as a hidden input field. I do the same with the properties that only for display, if I want them to be back in my bean when request comesback.
    Hope this help some how. Please, feel free to ask specific questions related to your specific problem and I monitor this post and trnasfer to you the ;little JSF experience I have.
    I'm pretty happy with JSF as it is but it sure needs improvements. :) What the heck, it's version 1.01 after all, and the next release should be a great one with the integration of JSTL.
    Cheers

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

  • Problem with Commit button When Backing bean is in Request Scope...

    HI Everybody,
    I have a Backing Bean in request scope having over 1000 lines of code, And in my JSPX page I have a table binding with a view object and At run time when user select the row in table and click the edit button so user will be able to edit that selected row in the same table at run time.. but the problem is : when the user enters some data in the Editable inputTexts and then clicks save(Commit), then the save button doesn't work..but when i delete any selected row and then press save then it is working fine..
    And to test it in Session scope i made another sample page where every thing is working very fine..
    Now i want to know What is the difference between Session scope and request scope bean...
    And is there any solution to Save editable input text in Request scope?.
    Also want to know that is it safe to set the scope of my main bean class to session scope without effecting the current running functionality? which is having over 1000 lines of code and lot of component has been placed...
    Please help me to resolve this problem...
    Thanks in Advance to all of you
    Fizzz..

    Hi Frank...
    In my code i used almost same logic as Andrejus Baranovskis has explained in his Editable Table example...
    You can refer that example to see what problem I'm facing...
    http://andrejusb.blogspot.com/2007/04/create-edit-and-delete-operations-in.html
    The Bean Scope in this Example is Session scope...Save button is working fine...
    But as i Change the bean scope to Request scope then Save button is not working for Edit but it is working for Delete Action very well..
    I want that save button should work also for Edit action in Request Scope..
    Please Make me understand that why it is happened like that..
    and help me to find the solution..
    and Also if you have a better document to Explain the life cycle of Application in Different Bean Scope...So please provide me that Doc to me...
    It would be a great help for me to understand the concept of session...
    Thanks Frank
    Fizzz...

  • 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

  • Faces: programmatically creating and populating iterator in a backing bean?

    Rather than relying on bindings in pageDefs, I'm attempting to create and populate a JUIterator binding in a backing bean. The goal is to allow the backing bean accessible to any web page as a session bean without having to hard code the iterator in every page's pageDef file.
    I haven't had any success on finding a demonstration showing how to do this programmatically and have come up with the following code as a hack:
    DCDataControl dataControl = bindingContainer.findDataControl("AppModuleDataControl");
    ApplicationModule appModule = dataControl.getApplicationModule();
    JUIteratorBinding iterator = new JUIteratorBinding(appModule, "SingleRowView1", "SingleRowView1Iterator");
    bindingContainer.addIteratorBinding(iterator);
    iterator.setRangeStart(0); // Exception raised here
    iterator.setRangeSize(1); // Or here
    iterator.executeQuery();  // Or here
    Row row = iterator.getCurrentRow();Note the SingleRowView1 is a VO exposed through my ADF BC AppModule and returns a single row and column.
    At the appropriate line marked "Exception raised here" an exception is thrown. On this line and the next 2 lines, it doesn't matter if I comment out one or the other, any 3 will raise an exception showing I've a problem with the iterator setup I guess?
    Anybody any hints on how we would construct the iterator dynamically? Do I have to create the individual attributes for the iterator? Have I not done something in correctly creating the iterator?
    Any help appreciated.
    Regards,
    CM.

    Chris,
    I don't have an answer for you but in JDeveloper 11 templating allows you to create a pagedef file that then is inherited by all pages. So chances are that what you build today is no longer needed tomorrow
    Frank

  • H:inputText ; How To initialize value Property from back/bean method?

    Hello Guys at Sun Forums.
    I am a newbie at using JSF. and I'm having a bit of a Problem.
    I don't know how to initialize the value property of a h:inputText from a method inside a backing bean that returns a String data type.
    My Method inside the Backing bean is this:
    public String getLastDate()
            Connection con = null;
            Statement stmt = null;
            ResultSet rs = null;
            Date DateCapt = null;
            String DateConv= null;
            try{
                Class.forName("com.sybase.jdbc2.jdbc.SybDrive").newInstance();
                con = DriverManager.getConnection("jdbc:sybase:Tds:localhost/BAN_PRO_SNP", "xxxx", "xxxx");
                if(!con.isClosed()){
                    stmt = con.createStatement();
                    stmt.executeQuery ("SELECT TOP 1 CONVERT(VARCHAR(10), fec_parametro, 103) fec_parametro FROM snp_sei_parametros" +
                    "     WHERE cod_parametro = 'FECHA'" +
                    "     ORDER BY fec_parametro DESC");
                    rs = stmt.getResultSet();
                    while (rs.next())
                                DateCapt = rs.getDate("fec_parametro");
                rs.close();  
                stmt.close(); 
            catch (Exception ex)
                        System.out.println("COULD NOT LOAD THE DRIVER!!!!");
                        System.out.println(ex);
                    DateConv = String.valueOf(DateCapt).toString();
        return DateConv;
    }As you can see the Method returns a String data type, and all I want to know is how put that returned String as the initial value of a h:inputText. when the jsf-jsp page loads.
    Please Help Me.

    You should be able to do
       <h:inputText value="#{bean.lastDate}"/>Where 'bean' is the managed bean name containing
    the method getLastDate().
    When the view is rendered, the getter (getLastDate())
    will be called to display whatever value is returned.

  • Problems with Master / Detail created in backing-bean programmatically

    We are developing with JDeveloper 10.1.3.3 and ADF.
    We have 2 jspx.
    In the fisrt one we select some information and we create the master/detail in the backing-bean programmatically using createRow() and insertRow() in both ViewObject.
    In the second one we have the master/detail table.
    The problem is that when we go to the second jspx only appears the master row, no the detail row.
    Otherwise if we only create a detail row (belonging to an existing master) in the backing bean of the first jspx then the detail rows are shown correctly.
    Thanks in advance.

    Hi,
    you need to give more details on the implatementation. If you use ADF binding then just as a heads up: operation against VOs directly is far away from best practice
    Frank

Maybe you are looking for