Multiple command buttons in jsp

Hi
I need a multiple commands buttons (for example 3) in a web page; then I need to call a bean method or another jsp page for every button
Is possible? If yes, could you post a code?
Thanks

change the action through javascript

Similar Messages

  • How to create multiple toolbar buttons in jsp ?

    hi all,
    how to create multiple toolbar buttons in jsp ?
    plz help me

    mgmt
    plzhttp://www.catb.org/~esr/faqs/smart-questions.html#writewell
    How To Ask Questions The Smart Way
    Eric Steven Raymond
    Rick Moen
    Write in clear, grammatical, correctly-spelled language
    We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
    So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal ? in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
    Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
    More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

  • Multiple submit button on jsp

    Hello,
    Can I have multiple submit button on single JSP page?
    if its possible then tell me how?
    And how to call multiple functions in JSP?
    reply me urgent

    I think this code will help you
    <html>
         <head></head>
         <script>
              function submitForm(clickedButton){
                   if(clickedButton.name =="button1"){
                        alert("button1");
                        document.multipleSubmitDemoForm.action="linkToJSPWhenFirstButtonClicked.jsp";
                   }else if(clickedButton.name =="button2"){
                        alert("button2");
                        document.multipleSubmitDemoForm.action="linkToJSPWhenSecondButtonClicked.jsp";
                   }else if(clickedButton.name =="button3"){
                        alert("button3");
                        document.multipleSubmitDemoForm.action="linkToJSPWhenThirdButtonClicked.jsp";
                   document.multipleSubmitDemoForm.submit();
         </script>
         <body>
              <form name="multipleSubmitDemoForm" method="POST" action="" >
                   <input type="button" name="button1" onClick=submitForm(this) />
                   <input type="button" name="button2" onClick=submitForm(this) />
                   <input type="button" name="button3" onClick=submitForm(this) />
              </form>
         </body>
    </html>

  • How to use multiple submit buttons in jsp form

    hello dextors,
    Im using a jsp page which have got some 'n' no submit buttons according to the Iterator ..each iterator display a row contains few fields plus submit button ..ex., If ' n' rows means 'n' respective submit buttons..the problem here is when i click any of the submit button only the value of the first row goes
    to the other jsp page..no matter wat ever button I click only first row goes..
    remember the page displays all the rows correctly and though the values of submit button are also different it gives the same result...
    what could be the reason please help it out...
    my jsp page contains
    <%@ page language="java" import="java.util.*" %>
    <%@ page language="java" import="java.io.*" %>
    <form name="frmChangeCorrection" method="post" target="childwindow" action="popup.jsp" >
    <body>
    <%
    RFTrackerDAOFactory factory = new RFTrackerDAOFactory();
         DailyDataDAO dailyDAO = factory.getDailyDataDAO();
         String month = request.getParameter("month");
         String year = request.getParameter("year");
         String empNo = request.getParameter("empno");          
         Collection coll = dailyDAO.getMonthyEmployeeData(empNo,month,year);
    Iterator iter = coll.iterator();     
    %>
    <div align="center">
    <center>
    <table border="1" width="75%" bgcolor="#B6C7E5">
    <tr>
    <th width="11%">EMPNO</th>
    <th width="30%">EMPLOYEE NAME</th>
    <th width="11%">DATE</th>
    <th width="11%">IN TIME</th>
    <th width="11%" >OUT TIME </th>
    <th width="15%" >TOTAL HRS</th>
    <th width="11%" >MODIFY</th>
    </tr>
    </table>
    </center>
    </div>
    <%
    int count=0;
    while(iter.hasNext())
         EmployeeData data = (EmployeeData)iter.next();
         String str=data.getDuration();
         String str1= str.substring( 0, 5 );
    count++;
    %>
    <div align="center">
    <center>
    <table border="1" width="75%" bgcolor="#B6C7E5">
    <tr>
    <td width="11%"> <%= data.getEmpNo() %> </td>
    <input type="hidden" name="empno" value="<%=data.getEmpNo() %>">
    <td width="30%"> <%= data.getEmpName() %> </td>
    <input type="hidden" name="empname" value="<%= data.getEmpName() %>">
    <td width="11%"><%= data.getDate() %> </td>
    <input type="hidden" name="date" value="<%= data.getDate() %>">
    <td width="11%"><%= data.getInTime() %> </td>
    <td width="11%" > <%= data.getOutTime() %> </td>
    <td width="15%" > <%= str1 %> </td>
    <td width="11%" > <input type="submit" name="Change" value="<% =count%>" onclick="popupResult()" >
    <input type="hidden" name="Change" value="<%=count%>" >
    </td>
    </tr>
    </table>
    </center>
    </div>
    <%
    %>
    </form>          
    </p>
    </table>
    </body>
    <script>
    function popupResult(){
    window.open('about:blank','childwindow', 'height=300,width=300');
    </script>

    It is assumed that one submit button will function for a form..if you want more that one submit form try to build as many forms as u need and put the submit inside that
    that will cure your problem
    and y do you want to create so many submit buttons.. instead you can make use of select button

  • I am attempting to upload multiple photos on a macpro from a cd.  I am used to a pc.  I tried using the command button to select multiples but it does not work.  Please advise

    I am attempting to upload multiple photos on a mac pro from a cd.  I have tried holding the "command"button down to select multiple photos but it does not work.  Please advise.  Thanks,John

    why not sort by (name, date, etc) and Click on 1st and Shift-Click on last.
    Might work better to copy or import to a project folder.
    https://discussions.apple.com/community/ilife/iphoto
    http://www.apple.com/support/iphoto

  • JSP Data table - Rendering for command buttons.

    Hi All,
    We are designing a JSP page where results from table have to be thrown on a data table. (h:dataTable)
    Based on one column value on the data table, we need to render a command button for each row of data table.
    For example, I select the employees from a table and throw it on data table.
    Only for those employees where address is not present, I need to enable an "Update address" command button.
    (Command button "Update address" is also part of data table.)
    Is it possible to accomplish this on a data table?
    If so how should we code the "rendered" tag of the command button in data table.
    Any help would be greatly appreciated.
    Thanks.

    Sounds like the JSF forum would be a closer alignment, but in general
    - retrieve your information from the database into a list of Employee beans.
    - Have your h:dataTable use the list of Employee beans as a datasource
    - have the rendered attribute of your update button depend on the value of employee.address maybe #{empty employee.address}
    cheers,
    evnafets

  • BExAnalyzer: Multiple use of the same Query in a Workbook - Command Button

    Hy Gurus,
    in my Workbook I have in Sheet 1 one Analysis Grid, defined as DP_1
    in Sheet 2 it is an other Analysis Grid defined as DP_2
    Both Data-Provider refer to the same technical BW Query.
    If I add a Button (from the BEx Toolbar) and try to refresh the first query (with commands: PROCESS_VARIABLES and VAR_SUBMIT) both Queries will be refreshed with the same variable value, even if i mention "DP_1" as Data_Provider in the button.
    But I don't want, that the second query is been refreshed too (with the same variable value).
    In the workbook Settings, I already checked on: Allow refresh Function for Individual Queries.
    Can anybody help?
    Regards
    Klaus

    It is not a solution to copy the query. We will need this feature for about 50 Workbooks/Queries and so it is the problem to keep the copied queries consistent
    If I refresh the Queries manual with the the "Change Variable Values" Button I get a pop-up with two fields where i can input two different values - here it works.
    Can I achieve the same with the command buttons?
    The definition of the first command button is like this:
    Name                       Index     Value
    DATA_PROVIDER     1           DP_1
    CMD                           1          PROCESS_VARIABLES
    SUBCMD                    1          VAR_SUBMIT
    Command Range: A2:C5 (there is the Name, Value, Sign and Operator of the Variable).
    The second command Button:
    Name                       Index     Value
    DATA_PROVIDER     1           DP_2
    CMD                           1          PROCESS_VARIABLES
    SUBCMD                    1          VAR_SUBMIT
    Command Range: A12:C15 (with a different Value of the Variable).
    If there is one query in the workbook it works fine, but not for two queries, even if I change the Index of the second button to 2.
    Thank you for your hints.
    Regards
    Klaus

  • 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

  • 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

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

  • Using command button to select query - WAD 7.0

    Hello all
    Can anyone please tell me how to configure a command button (button group) to display a particular query in WAD 7.0?
    Here's what I mean -
    I have a web template with three queries. I have inserted 3 command buttons on the template. I want to assign one button to one query, so that the users can select which of the three they want to view. Which Command do I select in the command wizard to do this? Also, is it possible to hide the other two queries, when one is selected?
    Thanks
    Karen

    Hi,
    Here is one approach - Keep three analysis items in the WT. Assign three different data providers to all three analysis items. If you do not want to show any query when the WT first loads, don't assign any query to the data providers. When a button is pushed, you can use the command SET_DATA_PROVIDER_PARAMATERS to assign a query to a DP so that that query will show up.
    Other commands that will help you would be SET_ITEM_PARAMETERS using which you can hide analysis items and also, you can use the command BACK_TO_INITIAL_DP_STATE on data providers so that they do not show up if they were blank at the start.
    Another way to hide a query is to assign the analysis item to a data provider which is blank.
    For your requirements, you will have to put multiple commands behind each button - you can decide which of the above commands suit you best.

  • Show/Hide Command button in ADF

    I want to hide "Command Button" based on the select of "tableSelectOne". I have tried using the following code but I am not able to do that. So pls suggest some other options.
    <af:panelGroup partialTriggers="DestRulesSelectionId">
    <af:commandButton text="..."
    disabled="false"
    shortDesc="Test"
    partialTriggers="DestRulesSelectionId"/>
    </af:panelGroup>
    <af:tableSelectOne text="Select and" autoSubmit="true"
    id="DestRulesSelectionId"/>

    Hi Didier,
    But I have also developed the same example and it is working, without putting the command button under any parent component.
    Page defination is
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces"
              xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
      <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
                  doctype-system="http://www.w3.org/TR/html4/loose.dtd"
                  doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <afh:html binding="#{backing_ShowHide.html1}" id="html1">
          <afh:head title="ShowHide" binding="#{backing_ShowHide.head1}" id="head1">
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
          </afh:head>
          <afh:body binding="#{backing_ShowHide.body1}" id="body1">
            <h:form binding="#{backing_ShowHide.form1}" id="form1">
              <af:panelPage title="Show Hide" binding="#{backing_ShowHide.panelPage1}"
                            id="panelPage1" partialTriggers="selectOneRadio1">
                <f:facet name="menu1"/>
                <f:facet name="menuGlobal"/>
                <f:facet name="branding"/>
                <f:facet name="brandingApp"/>
                <f:facet name="appCopyright"/>
                <f:facet name="appPrivacy"/>
                <f:facet name="appAbout"/>
                <af:selectOneRadio label="Select "
                                   value="#{backing_ShowHide.radioBtnValue}"
                                   autoSubmit="true"
                                   binding="#{backing_ShowHide.selectOneRadio1}"
                                   id="selectOneRadio1">
                  <af:selectItem label="One" value="one"
                                 binding="#{backing_ShowHide.selectItem1}"
                                 id="selectItem1"/>
                  <af:selectItem label="Two" value="two"
                                 binding="#{backing_ShowHide.selectItem2}"
                                 id="selectItem2"/>
                </af:selectOneRadio>
                <af:commandButton text="commandButton 1"
                                  binding="#{backing_ShowHide.commandButton1}"
                                  id="commandButton1"
                                  partialTriggers="selectOneRadio1"
                                  rendered="#{backing_ShowHide.radioBtnValue =='one'}"/>
              </af:panelPage>
            </h:form>
          </afh:body>
        </afh:html>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_ShowHide-->
    </jsp:root> ~Vikram
    http://kohlivikram.blogspot.com/
    Message was edited by:
    KoVik
    Message was edited by:
    KoVik

  • How to send commands to command button to look like an event

    Hi all
    I am trying to find the proper way to send a software command to a command button.
    For example say you have a simple (OK) command button, within that command button the callback function has multiple lines of code that are run from within that one callback.
    Now what I want to do is call the (OK) button in another function as if the user pushed the button without effectively having the function to wait for all the process in the (OK) callback to finish, I want it to call the (OK) button and get out of its function and continue on.
    What I have seems to work but I am not sure if this is the proper way of coding it.
    Code sample to turn on =1and off 0:    OK Callback (panelnumber =2, controlnumber = 2, event=2 , callback= NULL, event1=0, event2=0)
    if(ON)
    SetCtrlVal(panelmain, PANELMAIN_OK,ON)
    OK(2,2,2,NULL,0,0);
    else
    SetCtrlVal(panelmain, PANELMAIN_OK,OFF)
    OK(2,2,2,NULL,0,0);

    You can call the callback function as any other function, see e.g. here

  • Command Button action is bean method.How to pass parameter or reference ID?

    JDEV11gR1PS1/ADF
    A command button action's is bean method, as follows:
    <af:commandMenuItem id="gbl_cmi_1" action="#{tbBean.action1}"/> Bean code is something like
    public String action1() throws IOException {
    if (id.equals.("gbl_cmi_1"))...
    }Therefore, I'd like to be able to find out what the commandButton's ID is, for use in evaluation, etc.
    The reason being is that multiple commandButtons are actually being built dynamically as well, and the action may be a URL redirect. Therefore, I'm using the id to lookup what URL to redirect to.
    Ideas?
    Thanks.

    Hi,
    I think you can use f:attribute inside your commandButton.
    We use f:attribute inside button or link which hold a name/ value and we can read the value from backing bean as :
    public void addItemToCart(ActionEvent evt) {// this the actionListener of button or link
    Map attributes = evt.getComponent().getAttributes();
    String productId = attributes.get("attributeName");
    } Sameh Nassar

  • Command button action not calling when in subview

    i have a page that is fine when it's in it's own view...
    the command button calls a managed bean's method..
    <af:commandButton text="Call Method"
    action="#{backing_myPage.CallMethod}"
    binding="#{backing_myPage.commandButton1}"
    id="commandButton1"/>
    but when i remove the view tags and include it in a main index.jspx page
    that has a main view and a tabbed panel with showdetailitems and
    for each showdetaileditem i have a subview
    and then an include
    <f:subview id="discovered_subview" rendered="true"
    binding="#{backing_index.mypage_subview}">
    <jsp:include page="/mypage.jspx" />
    </f:subview>
    Mypage renders but the commandbutton's action is not called..
    but is called when run as a standalone page
    tia

    I also have the same problem as above. Changing the dropDown values to String does not fix it.
    I am using Netbeans Visual Web Pack.
    I drag a drop down box onto a brand new page.
    I double click the drop down box and in the processValueChange action i put System.out.println("Hello World");
    In the init() method i add 2 options to the drop down box:
    "option 1", "1"
    "option 2", "2"
    values are Strings
    I press F6 to run
    I notice that the drop down box is correctly populated.
    I change the drop down box selection
    Nothing is printed.

Maybe you are looking for

  • Media Encoder H.264 settings

    I hope someone can help me with this. I created a video in CS4 in HDV, I  need to output using the following specs my client has asked for: fullscreen video at 1920 x 1080 resolution, Quicktime h.264 - best quality / multipass. Sound is 48 KHz 16b. T

  • No.range assignment in billing document

    Hi everyone, Do we assign no. range for billing document some other place besides billing type.

  • How to insert an Active X control in a ABAP form

    Hi All,     I am learner, want to embed an Active X control in ABAP form, and how can i communicate from Active X control to ABAP form. if you refer screen shots it will be great. Thanks & Regards Chandra

  • Communication Channel Monitor status using UDF

    I am writing a UDF to get the JMS adapter type status from "communication channel monitor".. DynamicConfiguration conf = (DynamicConfiguration) container .getTransformationParameters() .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); Dynami

  • Toshiba Satellite C55-B5201 with Windows 8.1 64bit No USB Ports Work

    I have had nothing but problems with USB ports on this laptop. I went from 3 USB ports all working fine, then 2, 1, and now none. Tried all the obvious from chipset drivers, restore points, even did a factory reset. The USB ports do not function rega