Jsf command button navigation

Hey can anyone tell me if this is correct way to go to the back page using the command button.
<navigation-rule>
<from-view-id>/History.xhtml</from-view-id>
<navigation-case>
<from-outcome>admin</from-outcome>
<to-view-id>/Admin.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
History page.xhtml
<input type="submit" jsfc="h:commandButton" name="back" value="Back" onClick="admin"/>
Its getting refreshed in the same page.
Any help?
Thanks

it should be action="admin", but not onClick="admin"

Similar Messages

  • Set JSF Command Button Disabled

    Hello,
    I have a JSF command button, I would like to dynamically change button disabled based on certain condition.
    I tried in the actionListener code in my managedbean
    like
    UIComponent component = event.getComponent();
    component.setRendered(false);However it makes button not visible, couldn't find setDisabled.
    How can I do this?
    Regards

    Hi,
    Basically, you can change the button status: enabled/didasled from JavaScript by changing the button css.
    You can also do this from JSF.
    The commandButton element has the disabled attribute and you can change the status depending on your condition.
    -- <h:commanButton disabled=""
    Please find an example: http://www.roseindia.net/jsf/EnableDisableButton.shtml
    If you use AJAX (ex. a4j) there is the same principle. In backing bean you can check your condition and in jsp you'll change to disabled.
    Hope this helps,
    Sergiu

  • Jsf command button

    hi
    i have a command button as
    <f:view>
    <html>
    <body>
    <h:form id="form1">
    <h:outputText value="BuyerId :" />
         <h:selectOneMenu id="buyerid" value = "#{findprg.buyerid}" onchange = 'buyerOnChange()'>
    <f:selectItems value="#{global.buyersList}" />
    </h:selectOneMenu>
    <h:outputText value="Department :" />
    <h:selectOneMenu id='departmentid' value="#{findprg.deptid}">
    <f:selectItems value="#{global.departmentList}" />
    </h:selectOneMenu>
    <h:commandButton value="Find Program" action="#{findprg.loadData}"/>
    <h:dataTable value="#{findprg.programList}" var="row" border="1" cellspacing="1">
    <h:column><f:facet name="header"><h:outputText value = "programId"/></f:facet><h:outputText value="#{row.programId}"/></h:column>
    <h:column><f:facet name="header"><h:outputText value = "programName"/></f:facet><h:outputText value="#{row.programName}"/></h:column>
    <h:column><f:facet name="header"><h:outputText value = "buyerId"/></f:facet><h:outputText value="#{row.buyerId}"/></h:column>
    <h:column><f:facet name="header"><h:outputText value = "departmentId"/></f:facet><h:outputText value="#{row.departmentId}"/></h:column>
    </h:dataTable>
    </h:form>
    </body>
    </html>
    </f:view>
    Web.xml
    <managed-bean>
    <managed-bean-name>findprg</managed-bean-name>
    <managed-bean-class>com.poc.backingBean.FindProgram</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    My bean is
    public class FindProgram {
         private List<Program> programList = new ArrayList<Program>();
         private int buyerid;
         private int deptid;
         private int seasonid;
         private int brandid;
         private int classid;
         public String loadData() {
              System.out.println("Entering");
              DefineProgramMaintenanceFacade defineprogramfacade = AsConnector.getProgramMaintanenceFacadeBean();
              programList = defineprogramfacade.getProgramList(buyerid,deptid);
              System.out.println("exit");
              return null;
    But the method loadData is not called
    can anyone help me in this regard?
    Regards

    There may be a validation or conversion error occurred. Add <h:messages /> to the page to take note of them. Since JSF RI 1.2 it should also be logged to the stdout, read the application server logs.

  • Jsf command button action bean method call from text fox

    Hai Friends,
    I want call the command button action bean method from textbox entry time.
    because i develop login form that time user enter user name and password if he press enter from password component that time i want to use the commandbutton action

    What's the problem exactly? Won't the commandbutton action be invoked when you press [enter] in the textbox?

  • JSF Command Button and Command Links

    The main page of my JSF application has a Save button and Command Links. After making any changes on the main page the user should click Save before using any of the Links. Most of the time almost all users do this. However, some users are making changes then clicking a Link, thereby losing their changes.
    I could always execute my save method in the backing bean when a link is clicked, but, most of the time this would be doing a lot of processing which usually would not be necessry.
    Is their some way to check if any changes have been made and then doing the save only when necessary?
    Regards,
    Al Malin

    Anybody?
    What would be beneficial is something like this. If somehow it could be determined if any of the JSF fields on the page were modified. Then, in the backing bean method that handles the ActionEvents for the links, I would check if changes were made and, if so, call my save method.
    In other words is it possible to determine, in the backing bean, whether or not JSF fields have changed?
    Regards,
    Al Malin

  • Hiding JSF command button

    How can I hide an h:commandButton on my JSP page?

    Here's one way to do it:
    style="display: none;"
    or
    style="visibility: hidden;"
    Example:
    <h:commandButton value="Submit" action="#{controller.submit}" id="button" style="display: none" />

  • ADF JSF 10.13 how do you reference a binding from a command button?

    I have developed the following code as a model as I am trying to utilise ADF JSF without using a database.
    I have a collection called School. This has the appropriate operations that populate the school with a number of Child. A Child simply has a firstname and a surname.
    I have generated data controls for these collections and created two JSP pages and added a navigation link as follows:
    index.jsp --> goToSchool (navigation) --> school.jsp
    I have then added a command button to the index.jsp page. When the button is then pressed the school.jsp page is displayed. This works correctly.
    I would like to override the action of the button though so that before the navigation is executed I can get a handle on the school collection and populate it so that it will be displayed on the school.jsp page.
    I have previously done this in 10.12 when I had the following setup:
    index.jsp --> getSchool (dataAction) --> school.jsp
    by overriding the getSchool dataAction.
    I have looked through the 10.13 ADF user guides and tried various different things but have not managed to successfully acheive my goal of populating the school collection when the button is pressed prior to navigating to the school.jsp page.
    I would appreciate it if you could offer any advice, and if possible let me know the recommended best practices to acheive this.
    Thanks in advance for your help
    David

    Check out the ADF Tutorial (TopLink edition) chapter 5 has a section called:
    Adding a Drilldown Link
    I think this is what you are looking for.
    http://www.oracle.com/technology/obe/ADF_tutorial_1013/ADF_tutorial.pdf

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

  • I want to refresh my jsf page on the click of command button.

    Hi all,
    i m using JDEV 11.1.2.1.0
    i have created one jsf page with fragment i want to refresh my whole page on the click of command button which is present in fragment page.Besause i want to refresh some field but those are present in jsf page so i cant apply partial trigger because command button property in fragment page backing bean class and those attribute which i want to refresh its property in other class.
    thanks.
    Rafat

    i didnt get you from your content so i go with subject for giving your answer
    refreshing some of the fields
    BindingContainer bindings = getBindings();
    DCIteratorBinding dciter = (DCIteratorBinding)bindings.get("xIterator");
    ViewObject vo = dciter.getViewObject();
    Row row = vo.getCurrentRow();
    vo.executeQuery();or else drop execute operation as button to execute vo.
    to refresh a page
    partial trigger nice options.
    to performs instant refresh
    af:poll component
    so if you don mine give me some scenario using hrschema i may give a liitle try to my small brain :)

  • JSF HTML Command Button: Prevent Page Reload

    I know that for ADF Faces Core Command Buttons, you can set partialSubmit to true to prevent the page from reloading. I need to do the same thing for a JSF HTML Command Button, but there is no such property. I really just want to change properties for the button when it is clicked using javascript. I don't want anything to submit at all. Is there something I could put for the action property to prevent this?
    thanks,
    tim

    Have you tried returning false from your Javascript? If it's a function, you need to make sure you return the function's result, as well.
    Edited by: Avrom Roy-Faderman on Sep 19, 2008 11:31 AM
    Oh, BTW--while I (and I'm sure many others on this forum) are happy to answer generic Java EE (as opposed to ADF or JDeveloper Tooling for J2EE) questions when we can, you'll probably get a better mix of JEE gurus on a JEE forum.

  • Problem with command buttons in jsf

    how to position or allign command buttons inside a page?
    for example if i include reset command button inside my page using,
    <h:commandButton value="#{form.buttonText}" type="reset"/>
    they are placed towards a corner only, how to bring them to the center of a page in jsp? or how to set the location of it?

    Use CSS for layouting and positioning. All JSF HTML components provides at least two attributes where you can set the CSS: the 'style' attribute accepts raw CSS and the 'styleClass' attribute accepts predefinied CSS classes from a stylesheet file (recommended).

  • How can I control the enable/disable of command buttons in ADF JSF

    I have been having a great deal of trouble trying to work out how to control the command button such that if the rowset is null then the button is disabled. The trick is that the rowset is not defined by the view where the command button is located. The rowset is defined by a view which has a "view" command button which displays the specific row selected, then this view has a command button that will display the detail rowset of the selected master row, but if there are no detail records I want the button to be disabled. How can I do this in ADF JSF? If I use a backing bean to make the determination prior to the page rendering then how does the backing mean method set the parameter necessary to disable the command button? Any advice or tutorial that I can use is most appreciated. My goal with using ADF JSF effort was to demonstrate that a complex app could be generated with minimum coding, I would like to keep to this concept if possible. Thanks,
    Michael

    Hi Michael,
    You can probably set the Enabled property of the command button using an EL that would evaluate and return true or false based on your requirement.
    Check out these links for more information on using the EL.
    http://radio.weblogs.com/0118231/2006/11/10.html
    http://database.in2p3.fr/doc/oracle/Oracle_Application_Server_10_Release_3/web.1013/b25947/web_dcp006.htm
    -Arun

  • How to prevent command button in jsf

    Hi,
    I have one problem in my login page in jsf. When i am clicking the command button, the values are erased and again asking username and password, then its called to my actionevents?
    In my command button onclick i called js script for validating client side.
    can you please provide information for how to avoid this??
    Thanks
    MOhan

    HI,
    I am using RAD6.0. Some times its working fine. some times not working.
    I think this is not an server proplem, jsf problem.
    Why do I need to click my action method commandButton twice?
    Any solution to solve the problem , pleae help me

  • JSF Problem: Command Button

    Can you have a Command Button action event take you to a url?
    If you can how do you do this, for me it keeps taking me to some default file on my "C" drive (C:\rave\rave)

    <form action="form_action.asp"
    method="get">
    First name:
    <input type="text" name="fname" value="Mickey" />
    Last name:
    <input type="text" name="lname" value="Mouse" />
    <input type="submit" value="Submit" />
    </form>
    <p>
    If you click the "Submit" button, you will send your input to a new page called form_action.asp.
    </p>
    Above me is the equivalent to what I am trying to do (except in HTML). The input takes in the values from the text and sends you to another page. In this case it is .asp page, I am wanting to send the user to another .jsp page. In my last post I listed the Action Event which is tied to my Command Button. I tested this theory by trying to send the user to google.com, it did not work. Do you understand this?
    Edited by: Natrone on Jul 10, 2008 11:54 AM
    Edited by: Natrone on Jul 10, 2008 11:55 AM

  • JSF in Jdeveloper - navigation case not working

    code in my faces-config.xml:
    <?xml version="1.0" encoding="windows-1252"?>
    <faces-config version="2.0" xmlns="http://java.sun.com/xml/ns/javaee">
    <application>
    <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
    </application>
    <navigation-rule>
    <from-view-id>/here.jsf</from-view-id>
    <navigation-case>
    <from-outcome>goThere</from-outcome>
    <to-view-id>/there.jsf</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/there.jsf</from-view-id>
    <navigation-case>
    <from-outcome>goHere</from-outcome>
    <to-view-id>/here.jsf</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config>
    When I create a command button on the two pages and set the Application Action correctly, when I run the app the button does not take me to the other page. No error messages.

    MSorbera here, thanks - just tried that, still doesn't work, here's the code in adfc-config.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
    <view id="here">
    <page>/here.jsf</page>
    </view>
    <view id="there">
    <page>/there.jsf</page>
    </view>
    <control-flow-rule id="__1">
    <from-activity-id>here</from-activity-id>
    <control-flow-case id="__2">
    <from-outcome>goThere</from-outcome>
    <to-activity-id>there</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <control-flow-rule id="__3">
    <from-activity-id>there</from-activity-id>
    <control-flow-case id="__4">
    <from-outcome>goHere</from-outcome>
    <to-activity-id>here</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    </adfc-config>
    And here's the command button code on one page:
    <h:commandButton value="Go There" id="cb1" action="goThere"/>
    And the other:
    <h:commandButton value="Go Here" id="cb1" action="goHere"/>

Maybe you are looking for

  • Text wrap on Master Page items

    RE:  InDesign CS2 on Windows Vista Hello, I inserted a graphic on both of my master pages and applied a text wrap to them.  However, on my document pages, my text does not wrap around the graphics.  (In the Text Frame Options dialog box, the "Ignore

  • Can no longer publish after latest Muse update (April 2nd 2014)

    Hi all, This issue is two-fold; the first is somewhat minor, but the second is concerning me greatly, particularly as my workload is picking up at the moment... Every time I attempt to publish (having created the site through Muse - as I find this ea

  • Need a good, inexpensive printer

    We are need of a new, inexpensive printer.  We have a Mac OS X 10.6.8.  We are currently using a Canon MX340.  The printer works fine, but there is no option to choose black and white printing...not in Pages, Numbers, or for an internet page.  It doe

  • Feature Request:   Preset Preview on Second Monitor

    Currently, when you have monitor 2 set on "Loupe" mode and it is set for a "Live" view, and then scroll across the filmstrip on monitor 1, you can see the images change on the second monitor. I would like to have the ability to set monitor 2 on "Loup

  • Help with XSD restriction

    Hello, I have an XML field and I have to controlled with and XSD schema that the value is 0, 4 to 511 except 9, 12 and 13 can anyone help me?? I can't figure out a pattern or a restriction to do that...