ADF/JSF page loads when any command button is clicked

Hello All,
I am lost in the ADF/JSF page flow (using Jdev 10.1.3). Following are the tags (in order) in my page;
(WHEN THIS PAGE LOADS, IT GOES TO THE DATABASE TO GET VALUES (for the drop down lists that will appear on the page); THIS SHOULD HAPPEN JUST ONCE AND AT THIS POINT)
<f:view>
<afh:body>
<afh:html>
<af:form>
<af:panelpage>
<f:facet name="contextSwitcher">
<af:panelHorizontal> has a af:commandLink </af:panelHorizontal>
</f:facet>
<f:facet name="messages">
<af:messages/>
</f:facet>
<af:panelform>
<h:panelGrid columns="2" cellspacing="14">
has 2 panelgroups (one group has *2 SelectOneChoice lists (that need to be populated by fetching data from database* and the other group has 2 CommandButtons - 'Go' and 'Cancel") (GO BUTTON SETS THE SHOWPANEL() TO TRUE)
(WHEN GO BUTTON IS CLICKED, THE PAGE GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD (action="#{muBean.doWork}" )THAT IS ASSOCIATED WITH GO BUTTON ACTION SHOULD BE CALLED)
</h:panelGrid>
<h:panelGrid columns="2" cellspacing="14" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
has 3 inputText fields
</h:panelGrid>
<af:table var="someTable" rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
has a bunch of af:columns
</af:table>
<af:panelHorizontal rendered="#{myBean.showPanel}"> (THIS ONE IS RENDERED WHEN SHOWPANEL() METHOD IS TRUE)
has 3 af:commandButtons - submit, save, add row
(WHEN submit or save or add row BUTTON IS CLICKED, THE PAGE KIND OF LOADS AND GOES TO THE DATABASE (AS IT DID ON PAGE LOAD). *THIS SHOULD NOT BE HAPPENING*. ONLY THE METHOD THAT IS ASSOCIATED WITH submit/save/add row BUTTON ACTION SHOULD BE CALLED)
</af:panelHorizontal
</af:panelForm>
</af:panelPage>
<!-- Footer -->
<jsp:include page="/pages/includes/footer.jspx"/>
</af:form>
<f:verbatim>
<script type="text/javascript" src="../script/tree.js"></script>
</f:verbatim>
</afh:body>
</afh:html>
</f:view>
</jsp:root>
_*why is it that when the command buttons are clicked, the whole page is loaded? Only the methods associated with the action (action="#{newMapRequestItem.addARow}" ) should be called.*_
_*IS THERE A WAY TO AVOID THIS WITHOUT USING PARTIAL PAGE RENDERING ?*_
_*DOES MY TAG NESTING LOOK OK?*_
Edited by: user12054715 on Mar 24, 2010 12:00 PM

Can somebody please address this?
Thanks,

Similar Messages

  • Af:statusIndicator does not show busy icon when a command button is click

    Hi Guys,
    af:statusIndicator does not show busy icon or motion when a command button is click
    I am working on an excel data upload functionality on .jspx page. I use “af:inputFile” file uploader to upload an excel file then process the data and store it as a list of objects in memory and display it in “af:table” table
    I added “af:statusIndicator” to the page to show the user that the page is progressing while the data is uploading and when it is saving the data to the database.
    In this case, when the “af:inputFile” is clicked to upload the excel file - the status indicator shows a progress icon (movement) which is expected and is good. However, after the data have been display in the table when I click on a command button that saves the data to the database – I expected the status indicator to start its busy motion but that is not happening. Whereas, the command button grayed out and is disable when I clicked the button until the operation is completed.
    Is there any way to start the statusIndicator when a command button is clicked?
    I tried the following options
    *<af:statusIndicator id="si1_uploadStatus" partialTriggers="pc1:cb1 pc1:table"/>*
    Where pc1:cb1 is the command button and pc1:table is the table
    *<af:commandButton text="Submit Uploads" id="cb1"*
    *disabled="#{!viewScope.batchUploadController.allSavable}"*
    *partialTriggers="::infFilePath"*
    *action="#{viewScope.batchUploadController.saveUploadedData}"*
    *blocking="true"/>*
    Thanks,

    Can somebody please address this?
    Thanks,

  • On JSF Page load UI components loading sequence

    Hi All,
    I have some questions about the UI components loading sequence on the JSF page load.
    When a JSF page loads it loads its UI components which have a sequence of getters and setters declared in the backing bean of that jspx page.
    Qustion 1: How these getters and setters in backing bean work in loading the jspx page?
    Question 2: How this backing bean is related to the Page Definition file for the page loading?
    Question 3 (main query): What is the sequence of the getters and setters. Means, if i drop 3 UI components, 1 input text, then a command button and then an output text, then they are accordingly declared in backing bean. On page load first i/p texts getter gets called, then setter, then command button's and theno/p texts, in these sequence.
    But can i manipulate their sequence of loading. If yes then how it can be possible?

    Answer 1: Getters and Setters in bean normally will be bounded to ui component's properties in jspx page, when jspx page loads these getters get called through introspection and setters gets called when a request is submitted.
    Answer 2: Backing bean and page definition are two different entities and they are no way related unless you have a data control for the backing bean and have bindings for those methods in page definition file
    Answer 3: The sequence of getters and setters depends on the order of the components they bounded to in jspx page. components in jsf page gets loaded from top to bottom so the getter bound to the top component gets called first and the getter bound to bottom component gets called last.
    The only way to change the sequence of getter methods getting called is to just change the order of the components they bound to in jspx page.
    Usually, it is not suggested to put business logic inside getters and setters, where you have action and actionlisteners for the same. If you follow that, you don't need to worry of the sequence of getters and setters execution
    Sireesha

  • Method call before visual web jsf page loads

    Hi All.....
    I have written a method in a java class that accesses the mysql backend db to check if a process is still running. If the process is still running, a JOptionPane is produced informing the user of this and offers an <ok> option(to check the process status again) and a <cancel> option(to redirect the user to the homepage). If the process is completed, I want the page to just load as normal. I want this method to be called before the visual web jsf page loads. I have the method call in the super_init() method of the page and everything seemed to be working fine, the problem I have run into is that if I set the value in the db to show the process is running, the JOptionPane is produced(like it should be), and then if I set the value to show the process has completed and choose <ok> from the pane, the page loads.....this is what I want. Now, after the page loads, if I set the value in the db to show the process is running again, the JOptionPane is produced again right after I apply the changes to the db edit!!!!. I don't know why this is happening. Should I be calling the method from somewhere other the super_init()????? I have tried the method call in the prerender(), preprocess(), and destroy() methods all with the same results.
    Anyone have any ideas on what the problem could be??
    Thanks in advance.
    Silgd

    The Java part of a JSP/Servlet based webapplication runs physically at the server machine.
    Only the HTML/CSS/JS part which is generated by the webapplication and sent to the client physically runs at the client machine.
    JOptionPane is a Java Swing component which thus runs at the server machine. So you as client would only see it when both the server and the client runs at physically the same machine. Which is often only the case in development environment and doesn´t occur in real life! There is normally means of two physically different machines connected through the network/internet.
    To solve your actual problem, look for Ajax poll techniques. To display an alert or confirm dialogue in the client side, you use Javascript for this.

  • How to get the page request parameters in Command Button code

    Hi everyone,
    I am new to JSF and working on some Command Buttons. I put my java code via Edit Event, it works fine. But I don't know how to get some parameters from HttpServletRequest.
    Can anyone give some guidance? It would be much appreciated.
    Mike

    Thanks a lot for your tip. Unfortunately I could not open the link you provided due to some network issue.
    Yes, I intend to get some parameters from URL. I did try to put your code and get the parameters predefined in the URL, however I got the null returned. By the way, I put the following code in the page source part and it works. Just don't know how to get the value being passed to the command button event code.
    <%
    String userID = request.getParameter("u");
    System.out.println("this is from head - the userID is :: " + userID);
    %>
    Thanks again and hope you could give me further advice.

  • Invoke secured WS from ADF JSF Page

    Hello,
    How can I invoke secured Web Service from simple adf jsf page?? Service is secured by wss_username_token_service_policy.
    I'll be glad if somebody could give me some tutorial how to build this page. I mean inputs for username and password.
    Best regards,
    MK

    Hi,
    I've read your article: http://www.oracle.com/technology/products/jdev/howtos/1013/protectedws/access_protected_web_services_from_adf.htm I added to the Model - Web Service Data control and as a service give a link to my composite application deployed on soa_server (http://localhost:8001/soa-infra/services/default/registerMyPassComposite/registerMyPassWebService?WSDL). When i click on Define Web Service security I only have a window to add policies and there is no wizard steps as you shown i your article Figure 9. I cannot chose Authentication type but I can only define policies for my dataControl.
    How to resolve it?

  • How can I set a value in a field before create when a New button is clicked

    Hi,
    I am using
    JDeveloper 10.1.3.1.0.3984 and
    JHeadstart 10.1.3.1 release 10.1.3.1.26
    I have one group and there is a detail group under that group.
    From main group to detail group there are 3 field relating those groups.
    field1
    field2
    fieldSEQ (auto-generated by database trigger)
    These 3 fields are PK.
    In the detail group, there is a New button. So, when the New button is clicked, it tries to create the record with those 3 fields value as those are coming from main group. As a result it's giving the duplicate error as that record already exists in the table.
    But I don't want to create the record with that SEQ as that will be created in the trigger.
    How can I set the SEQ temporarily any no. (-1) before create when the New button is clicked?
    Can anybody help?
    Thanks
    Syed Jabbar
    University of Windsor
    Windsor, ON, Canada

    Hello Syad,
    What I would suggest is setting the sequence number at the creation of the entity object (so in the create() method) by using the database sequence. This way it will always be unique.
    So something like:
    protected void create(AttributeList AttributeList) {
    super.create(AttributeList);
    SequenceImpl sequence =
    new SequenceImpl("KCP_SEQ", getDBTransaction());
    setFieldSeq( sequence.getSequenceNumber());
    If this still does not solve it: please go to the ADF Forum since this problem is an ADF problem, not a JHeadstart problem.
    Regards,
    Evert-Jan de Bruin
    JHeadstart Team.

  • Need to show popup when the Submit button is clicked for the second time ..

    Hi guys,
    I have a requirement where i need to show a popup or alert when the submit button is clicked twice . When it is clicked for the first time one method is been called and its process starts. When the user clicks the submit button for the second time they should be shown a popup stating "Submit button already been clicked, please clicked OK to continue".
    Can anyone help with this please , its really urgent requirement ?
    Thanks in advance

    Hi,
    I dont have any sample code to give you now. For quick reference, I can advice some psuedo steps to achieve your requirement. I dont have access to JDEV to test this. If any syntax errors then pls correct yourself.
    1. Extend Controller since it is standard page ( Refer Anil Passi site for steps to extend seeded ontroller)
    2. Write below logic in your Process Request method
    super.processRequest(oaPageContext, oaWebBean);
    pageContext.putSessionValue("status", "notInitiated");
    3. Include below logic in your PFR method
    if(pageContext.getSessionValue("status")!=null){
    if("notInitiated".equals(pageContext.getSessionValue("status")))
    super.processFormRequest(oapagecontext, oawebbean);
    pageContext.putSessionValue("status", "initiated");
    else
    String message = "Display error message as required";
    throw new OAException(message, OAException.ERROR);
    You may need to import required packages ( Related to OAException).
    Remeber, to sumbit the request, user need to refresh the page again so that "status" variable will be refreshed.
    Hope it helps.
    Thanks
    venkat

  • How to switch from different views when a common button is clicked on using View states concept

    Hi
    i have  made a single form for both Login Screen and Registration screen with two states :
    1. BaseState which is the curret state of  state of My application
    2.registrationstate 
    I have a common button for changing from one view to another view .(Not related to any of the state)
    At first the Login screen is loaded , and when the common  button is clicked , i want to switch to Registration Screen .
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
    // Logic for common button needed .
        public function handleMe(event:MouseEvent):void
        ]]>
    </mx:Script>
        <mx:states>
            <mx:State name="registrationstate">
                <mx:SetProperty target="{formitem1}" name="label" value="Email"/>
                <mx:SetProperty target="{button1}" name="label" value="Change state to Login"/>
            </mx:State>
        </mx:states>
        <mx:Form x="248" y="158">
            <mx:FormItem label="User Name" fontWeight="bold" id="formitem1">
                <mx:TextInput/>
            </mx:FormItem>
        </mx:Form>
    <!-- This is my coomon button-->
        <mx:Button
            click="handleMe(event)"  
            x="297" y="261" label="Change state to Registration" id="button1"/>
    </mx:Application>

    Originally I could not get that to work, but now I have it working:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
        <![CDATA[
          import mx.controls.Alert;
          public function handleMe(event:MouseEvent):void{  
            trace(this.currentState); 
            if(currentState=="" || currentState == null){
              mx.controls.Alert.show("base state");
              currentState = "registrationstate"; 
            }else if(currentState=="registrationstate"){
              mx.controls.Alert.show("registrationstate");
              currentState = ""; 
        ]]>
      </mx:Script>
      <mx:states>
        <mx:State name="registrationstate">
          <mx:SetProperty target="{formitem1}" name="label" value="Email"/>
          <mx:SetProperty target="{button1}" name="label" value="Change state to Login"/>
        </mx:State>
      </mx:states>
      <mx:Form x="248" y="158">
        <mx:FormItem label="User Name" fontWeight="bold" id="formitem1">
          <mx:TextInput/>
        </mx:FormItem>
      </mx:Form>
      <mx:Button click="handleMe(event)" x="297" y="261"
        label="Change state to Registration" id="button1"/>
    </mx:Application>
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Execute ViewObject with Parameters at JSF Page Load?  JSF/ADF/BC 10.1.3

    This 'should' be a simple problem, but I'm not seeing an answer, no doubt because I'm not searching for the right thing.
    I have a page that has a grid populated by a view object that has a couple of named parameters. I have the values stored for the parameters based upon actions the user has already taken before they navigate to this page. I need to pass the parameters to the view object and open the query up without any user intervention, preferable before (or at) page load.
    I see I can drag an 'ExecWithParams' from the data control pallette, but it looks like it would default to having the user enter the parameter values, which is what I'd like to avoid.
    In a previous life I had events available like 'OnCreate' where I'd put code like this, but I'm still learning to think in JSF/Java.

    Ok, now I see how it's supposed to work. Pretty straightforward if you know where to look. It raises another question for me though...
    In my process, I've got the user logging in, at which point a series of user preferences are extracted from the database. My first thought was to store them somehow in the users' session, but I didn't see a way to do that, so I created my own implementation of it with a bunch of getter/setter methods, inside the data model of the project. Unfortunately, I can't see a way to surface them without putting them in the ApplicationModule and adding them to the client interface. In the interim, I came across some utilities methods (written by Steve Muench and Duncan Mills) called ADFJSFUtils and JSFUtils. In the JSFUtils there's this method:
    void storeOnSession(String key, Object object) {
    FacesContext ctx = getFacesContext();
    Map sessionState = ctx.getExternalContext().getSessionMap();
    sessionState.put(key, object);
    I assume it's designed to work in the ViewController project (since I haven't been able to call it from my Model project) .
    This has been a long way to ask: What's the best/recommended way to store variable values for the users' session is a way that I can access them for binding to view objects (as you described above)? I'd love to just implement the storeOnSession right in my appplication module, but it lacks the context, apparently.

  • JSF page loading another JSF in iframe from same domain with diff port

    I was wondering if anyone has experienced this issue. I'm using ADF 11g and weblogic 10.3.2. Here's the scenario
    1. two ADF 11g application, app1 and app2
    2. app1 is deployed on managedserver1 running on port 7001
    3. app2 is deployed on managedserver2 running on port 7002
    4. page1 on app1 loads page2 from app2 inside an iframe.
    5. When a button is clicked on page1 that does a ppr or even a complete postback, the following message from the browser appears:
    Because of inactivity, your session has timed out and is no longer active. The page will automatically be reloaded in 10 seconds; if not, click here.
    When i check the log file on managedserver1 its has the following error:
    SEVERE: Could not find saved view state for token <some token>
    I did some research and came across oracle.adf.view.rich.security.FRAME_BUSTING, but this is not the issue here, the iframe loads fine, but after loading when i tried to do something on page1 it seems that the state of the page is messed up.
    Any idea would be helpful.
    Edited by: user8663354 on Jun 20, 2010 7:05 PM

    Hi,
    chances are that the iframe is not isolated as you think it is and the state management of the two overrides each other. I think its best to file a service request with customer support to ensure this scenarion is supposed to work
    Frank

  • Problem with history when ther is page redirection after 'go back' button is clicked.

    Recently I was developing some application which requires request redirection from server when the browser's 'go back' button is clicked. At that time while I was testing implemented behaviour i noticed that when i go one page back forward button is disabled and when I want to go back again I am returned one the same page over and over again. It seems that there is a problem with history and how firefox handles a page redirection.
    In other browsers everything goes as it should and there isn't any such problem with history.
    I hope that this problem will be solved in the next version.

    Hi,
    I found this Terminal command here on the discussion board posted bu Sinzu.
    defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnable d -bool YES
    Dimaxum
    Sorry, everyting is BOLD tekst.

  • JSF Page Load

    Is there such thing as a JSF Init Page Load? the same thing that .net has with Page_Load? How do i init the code behind bean?

    @sdechgan
    I had the same problem. What you can do is the following:
    in your Bean you need all your request parameters as properties with getter and setter.
    additionally add a boolan prepare property. Set this to false at the beans constructor : this.prepare = false;
    in your faces config define your bean this way :
    <managed-bean>
            <managed-bean-name>myBean</managed-bean-name>
            <managed-bean-class>org.you.package.beans.myBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
            <managed-property>
                 <property-name>requestParam01</property-name>
                 <value>#{param.requestParam01}</value>
             </managed-property>
             <managed-property>
                 <property-name>requestParam02</property-name>
                 <value>#{param.requestParam02}</value>
             </managed-property>
             <managed-property>
                 <property-name>prepare</property-name>
                 <value>true</value>
             </managed-property>
        </managed-bean>in your view add such a single line at the beginning ( right under <f:view... > )
    <h:panelGroup rendered="#{myBean.prepare}" />now, tomcat will execute myBean.getPrepare( )
    this method should look like this :
    public boolean getPrepare()
              if (prepare)
                   //do what you want with your request params. they are already set at this point !
              prepare = false;
             return prepare;
         }after loading the view once, the getPrepare Method is executed and the prepare property is set to false.
    I need that, because getPrepare is loaded at any ajax page reload, too. ( I'm using icefaces )
    access your jsf page with : http:localhost:8080/whatever/myPage.iface?requestParam01=hello&requestParam02=World

  • Server timed out while loading the home page.Loads when refreshed.

    Hi All
    I have developed my application in .Net framework. I tried to deploy the application in PlumTree Portal server. The application gets timed out when run for the first time ( i.e, as soon as user logs in). It gets loaded when the page is refreshed. I tried inreasing the portlet timeout in web service, but of no use.
    I have used "Response.Redirect" in my home page to load the screen as per the user. Could this be a problem? Or is there a problem an someother place.
    Any help or suggestion is welcome
    Thanks,
    Karthick

    Hey jennifer,
    Did you ever have this issue solved? If so, please post how did you figured it out. I'm having the same problem.
    Regards,
    Alonso

  • ADF-JSF Page rendering Twice

    Hi,
    I have a JSF page with 5 command links, Each link takes me to a different page(.jspx), based on the "action" attribute of the command link.
    For some reason on clicking on one Link, the contents of the Page are being displayed Twice.
    Can anyone help, why is it so and how can i avoid the diaplying of the contents Twice.
    Thanks
    Vishnu

    Hi,
    its not clear what you mean with "content appears twice". How likely is it that the problem is within your code as you don't mention what you did. If possible, provide a step by step reproducable testcase
    Frank

Maybe you are looking for

  • Too bad mini server won't boot from an external drive

    It won't. Enterprise TEch support confirmed this. I bought thew new mini server to get a good value fast machine with a quad i-7. What's the purpose of Thuderbolt if my apps and doc folders have to reside on a SATA disk? They really should have non s

  • Help in writing  query few schema objects  from another schema.

    Hi Gurus, Could some one help in writing an sql which will give list of all the object of a schema "genp" visible in another schema "genp_v" and "gen_con" there is an dblink and few grants on those schemas . i dont have the password of any of those u

  • How to loop a motion menu... seamlessly

    First off, thanks for all the great info and help I've gotten off this forum lately. I'm just getting into Encore after being more used to Premiere and Photoshop, so while it seems familiar, there are lots of little questions I keep coming up with. T

  • Invoice Number range - Material documents

    Hi, I want to generate Order specific number range during Invoice Verification. Currently the system setup is like. For transaction MIRO, Objects RD & RS are assigned with 01 For 01 Number range object, the interval is defined as No  Year  From Numbe

  • Calendar (Entourage) Not Syncing with BB Curve 8310

    I have a BB Curve 8310, and the BB Desktop Manager for Mac is not syncing my calendar (Entourage) with my BB Curve.  Nothing I do works!  I have used every option on the BB Desktop software, including where the software overwrites the BB. Any ideas?