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

Similar Messages

  • 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 Command button Render

    No Renderer found for component {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /template.jsp]} (component-family=javax.faces.ViewRoot, renderer-type=javax.faces.Text)
    what could be the problem. I am a newbe, pls help me..

    <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 page, command buttons does nothing.

    Hi,
    I made a page with some panelform's. In one of those forms I placed a commandButton.
    I added a method in the backingbean that should be executed when the button is clicked. I added the method name as action attribute to the button.
    If I load the page and click the buttom nothing is happening. In the code I made is only a System.out.println();
    What could it be...?

    //button on the page:
                        <af:commandButton text="commandButton 1"
                                          binding="#{backing_upload.sendButton}"
                                          id="sendButton"
                                          textAndAccessKey="&Send to Oracle"
                                          disabled="#{backing_upload.processNotToOracle}"
                                          action="#{backing_upload.sendToOracle}"/>
    //backingbean:
        public String sendToOracle() {    
            System.out.println("test");
            return null;
        }

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

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

    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.

  • 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

  • Problem with command buttons

    i ve command buttons on my jsf page
    and have the bindinng and action attributes to the backing bean of the page
    but the actions are not invoked at all
    here is the code
    <af:commandButton text="Save" binding="#{backing_jsp_logon_UserPermissionPage.btnSave}"
    id="btnSave" action="backing_jsp_logon_UserPermissionPage.btnSave_action"/>
    //the action code
    public String btnSave_action()
    System.out.println("btnSavebtnSavebtnSavebtnSavebtnSavebtnSavebtnSavebtnSavebtnSave");
    return null;
    this action is not invoked at all for all buttons i ve on this page
    but the selectonechoice action invoked right
    thanks for reading
    i'm waiting ????????????

    I'm affraid you posted in the wrong forum. Re-post this question in the JDeveloper forum.
    Francois

  • 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

  • Adf faces command button, bindings and ejb 3.0 persisting problem

    When mapping the persist method to an adf command button it got this error:
    1. JBO-29000: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    2. java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    Is that because Departments are serialized by the container when the session bean is accessed by the data control to catch the data when the form is populating and entities are detached from the persisting context ? or something else ?
    I bind the button to the current row data provider for the departments. Is it correct, isn't ?

    When mapping the persist method to an adf command button it got this error:
    1. JBO-29000: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    2. java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21.; nested exception is: java.lang.IllegalArgumentException: PERSIST impossible sur l'objet détaché : hr.entity.Departments@1b21. -
    Is that because Departments are serialized by the container when the session bean is accessed by the data control to catch the data when the form is populating and entities are detached from the persisting context ? or something else ?
    I bind the button to the current row data provider for the departments. Is it correct, isn't ?

Maybe you are looking for