Dynamic Update of Combo Boxes with Struts

I need to update one dropdown box based off of the selection of the other. When I select an option I am using an onchange="reload()" to reload the page. The problem with this is as far as I can tell is only refreshing the html in the browser and not sending a new request back to the server. I have the tags bellow. If any one has any Ideas I would appreciate it.
<bean:size id="planCount" name="new_enrollment_newEnrollmentForm" property="newEnrollmentTO.coverages[${status.index}].classPlans" scope="session"/>
<c:choose>
     <c:when test="${planCount > 1}">
          <html:select name="new_enrollment_newEnrollmentForm" property="coverages[${status.index}].classPlanID" styleClass="coveragePlanDropDownSize" onClick="window.location.reload()" >
                    <html:option value=""/>
                    <html:options name="new_enrollment_newEnrollmentForm" property="coverages[${status.index}].classPlans" />     
          </html:select>
     </c:when>
     <c:otherwise>
          <c:out value="${coverage.classPlanID}"/>
     </c:otherwise>
</c:choose>
<bean:size id="volumeCount" name="new_enrollment_newEnrollmentForm" property="newEnrollmentTO.coverages[${status.index}].volumes" scope="session"/>
<c:choose>
     <c:when test="${volumeCount > 1}">
          <html:select property="newEnrollmentTO.coverages[${status.index}].volume" styleClass="volDropDownSize">
               <html:option value=""/>
               <html:options name="new_enrollment_newEnrollmentForm" property="coverages[${status.index}].volumes"/>     
          </html:select>
     </c:when>
     <c:otherwise>
          <c:out value="${coverage.volume}"/>
     </c:otherwise>
</c:choose>

Yes, you are correct. Using the JavaScript reload() function will not submit anything to the JSP. Try something like onchange="document.forms[0].submit()" or something like that. JavaScript isn't my strong suit.
Brian

Similar Messages

  • Strange behaviour with my updating of combo box

    public class EditVideoDialog extends JPanel implements ActionListener{
         JTextField text_Name, text_Price, text_Producer, path_Picture;
         JTextArea textarea_Description;
         public JComboBox combo_Genre, combo_Name;
         String old_VideoName;
         Vector <String> myVideoName = new Vector <String>();
         public EditVideoDialog(){
         public EditVideoDialog(Vector <String> myVideoName){          
              combo_Name = new JComboBox();
              combo_Name.setEditable(false);
              combo_Name.setMaximumRowCount(4);
              combo_Name.setPreferredSize(new Dimension(300,25));
              currentVideoName(myVideoName);
         //Function to set current video name
         public void currentVideoName(Vector <String>videoName){
              combo_Name.removeAllItems();
              combo_Name.addItem("");
              for(int k =0; k<videoName.size(); k++){
                   combo_Name.addItem(videoName.get(k));
    }I tried with the script above, the combo_box first got compiled nicely after retrieving data from the database.
    However, when i tried to do the updating of combo box with function currentVideoName, it fails.
    I also tried puttng a ComboBoxModel inside my function but it fails. It just doesn't get updated...
    ComboBoxModel model = new DefaultComboBoxModel(myVideoName);
    combo_Name.setModel(model);can someone advise me or show me some simple code on this?
    Edited by: diskhub on Mar 16, 2008 11:27 AM

    http://forum.java.sun.com/thread.jspa?threadID=5275345

  • How to fill combo box with list of all SQL server

    Ok, I know how to find all SQL servers that I need, I have code for that task, and I have Array of all servers.
    My problem is ...
    I made setup project and do a huge work, and in the end this task appear!
    I used ORCA tool to change TextBox (A) template in visual studio (2008 by the way), and I transform first TextBox to ComboBox.
    Now, the little part that I'am missing is how to fill this combo box with a result of my function for listin SQL servers?
    Can I somehow send combobox object to myMethod:
    private void FillCombo(ComboBox cmb)
          // do the job
    or
    instanceOfThisCombo.Items.Add(listOfSQLServers);
    please help me to solve this... thanksc#

    Hi Valerij,
    The ComboBox control in an MSI dialog uses the ComboBox table to populate the items in it. To get what you want, you need to update the ComboBox table in the MSI package with your application and run the MSI package. The following KB article describes how to dynamically populate a ListBox control in Windows Installer:
    http://support.microsoft.com/kb/291329
    This method introduced in the above KB article also applies to populating a ComboBox control in Windows Installer.
    I don't think it's possible to run the application as a Custom Action from within the MSI package because the application will modify the content of the MSI package which is currently running. So you need to launch the MSI package from within your application after updating the ComboBox table. In short, when installing, just run your application which updates the ComboBox table and install the MSI package.
    Hope this helps.
    If you have any question, please feel free to let me know.
    Sincerely,
    Linda Liu

  • Populating Database values into a combo box in STRUTS Framework

    Hi Guys,
    I am currently working on a STRUTS Framework project and I can't get much resources related to the problems that I'm facing.
    Currently I need to populate a JSP file's Combo box with database values. What I don't know here is the syntax used to in STRUTS framework to populate the Combo box with database values. Anyone with experience related to this topic, please kindly help me out.

    Struts doesn't define anything about the datab layer. You're free to implement how you will.
    Struts instead guides you into following an MVC pattern.
    You populate a combo box with values from a bean.
    So you need to set up a bean for this page to talk to.
    That bean can be populated from the database - but at that point you're in java/jdbc code - and away from the struts layer.
    My suggestions
    1 - Define a bean to represent the information from the database.
    2 - write a method that queries the database, and copies the data into a List of those beans. This will be your Data access layer.
    3 - in your action, call that method, and then set the list of beans as a request attribute. Or maybe as a property on a form.
    4 - use that list of beans to populate your dropdown box.

  • How I can stop the combo box with list of values from fireing validations

    Hi I'm using Jdeveloper 11.1.2.3.0
    Using Hr Schema employees table
    I Display employees data in af:table
    and I make List Of values on Department_id filed to easy change the employee department
    and another one on Job_id filed
    and Imake them UI Hints as ( combo box with list of values ) in the employeesVO
    the problem is when I Select a value from department or jobs ( combo box with list of values )
    fires the entire filed validations for mandatory atributes
    Note : the af:table Property ( contedelivery) is set to (immediate )
    How I can stop the combo box with list of values from fireing validations

    check it out.,
    http://andrejusb.blogspot.in/2012/09/what-to-do-when-adf-editable-table.html

  • Dynamically populating a combo box in Forms

    I am having a hard time figuring out how to dynamically populate a combo box at run time. Could someone give me any ideas?
    thanks, Robin

    Use the built-in Populate_list. Read help on that and you'll know how to set it up.

  • Tab Component Dynamic Visibility to Combo Boxes

    I am using a Tab component.  I have 3 tabs on my dashboard.  I have 2 Combo boxes that I am using to filter rows of data on 3 Excel sheets.  Both Combo boxes are not used on all the tabs.  How can I pass example: User clicks on Tab 1 and use dynamic visibility for Combo Box 1 and Combo Box 2 are visible.  If the user clicks on Tab 2 I want only Combo Box 1 to be visible.

    Hi Joe,
    This can be achieved in Dynamic visibility.
    On click on Tab,just map to some target(say value "1") and then For Combo box,set target cell mapped for tab to 1,which means when the target cell gets "1",show the Combo box.
    If you are not clear then you can refer the following URL,which will give you more informations about this.
    http://everythingxcelsius.com/2008/08/tip-7-xcelsius-dynamic-visibility-video-tutorial.html
    Rgds,
    Murali

  • Dynamic number of Combo boxes in an applet

    Hi,
    I'm quite new to Java & rite now, i've an reqt to build an applet. The problem is my applet will be having a dynamic number of combo boxes in it. This number is based on the parameter passed to the applet..
    any eg or references to a similar reqt would be very helpful.
    Regards
    -Sree Ram

    Define your combo boxes dynamically and put them in a vector:
    int numberOfComboBoxes = 7;
    Vector comboBoxes = new Vector( numberOfComboBoxes );
    for ( int i = 1; i <= numberOfComboBoxes; i++ ) {
    comboBoxes.add( i - 1, new Choice() );
    Now you can reference the combo boxes any time you like, no matter how many of them there are:
    for ( int j = 1; i < numberOfComboBoxes; i++ ) {
    System.out.println( ((Choice)comboBoxes.get( j - 1 )).getSelectedItem() );
    }

  • EDGE and HTML dynamic text in a "box" with scroll bar

    I'm new to EDGE, a win7pro master collection cs5.5 suite owner. I'm mainly in the Film/Video post production field (mostly AE, PPro, Pshop, IA) but have been branching into web design the last couple of years.  I use Dreamweaver, Fireworks, Flash. While I'm a expert user with all the Film/video apps, I would say I only have intermediate ability with the web apps. While I understand a lot of programing logic bulding blocks I'm not a coder.
    So since we're told "flash is dead",  my interest in Edge is to try to do some of the things that I can currently do in flash in  EDGE. I was excited when Edge first came out but lost interest when it became obvious that Adobe was not going to offer Edge and Muse to "suite owners" but only in their force feeding of the "Cloud". Better known as the "golden goose" for adobe stockholders and a never ending perpetual hole in the pocket for users. Anyway....
    I spent the last couple of days doing some of the tuts and messing with the UI. It's matured a lot since I was here last.
    I've been working on a flash site for a sports team where one of the pages is a player profile page where college recuriters and other interested parties can view recuriting relavent info/stats about players. This is how it works. While on the "Team" page a users clicks on  a button labled "Player Profiles" . (Animation) A "page" flies in and unfurls from the upper right corner (3d page flips effect created in AE played by flash as a frame SEQ). Once it lands filling most of the center of the screen there is a bright flash. As the brightness fades we see the "page" is a bordered box with a BG image of a ball field(End). (Animation) from behind the border in fly small pictures (player head shots with name and jersey number). They stream in and form a circle like a wagon train and the team logo zooms up from infinity to the center of the circle(End). As the user mouses over a player's pic it zooms up a little and gets brighter (like mouseover image nav thumbs for a image slider). If the user clicks on a player's head shot it flips over and scales up to become a text box with a scrollbar. The content of the box is a mix of images, static and dynamic text fields populated from data in an "player info data base" XML file, and some hyperlinks. It's all kept updated dynamicaly with current stats, info and images from the XML file. There is also a "PDF" button that allows the user to open/save/print a PDF of the player's profile (the PDF's are static files for now but the choice of which pdf to retrive is dynamicaly supplied via the XML file.
    So.... Is Edge now able to do something like this?  Would it need to be a collection of small animations? could these be "assembled" and connected as an asset in dreamweaver ?
    I thought I would approach this from the end (ie click on an image and display a box with dynamic TEXT fileds. ) since that is the most important part, ie displaying the dynamicaly updated profile info.  Sooooo....
    Can Edge display a scrolling text box with Images, static text, and html dynamic text in it??
    Joel

    The code is in composition ready. Click the filled {}

  • Dynamically create drop down box with JSP

    Hi,
    I hope this is not a repeat post, I have search the forum and a posting has not jumped out at me. I am making a jsp that dynamically constructs a custom SQL query.
    I have a number of text boxes with an id, my jsp page calls a servlet, the servlet reads the contorl id and the value to build the query - this works great. However, there's a large text input box which receives a number of extra conditions - this text box receives the input in the following format:
    searchAttributeName1,searchAttributeValue1;searchAttributeName2,searchAttributeValue2
    This is functional, however, it's a bit rubbish as the user has to know the special recognised attributeNames. What I would like to have is some sort of criteria control. This would consist of a drop down box populated from the servlet, a text input for the value and a button to add another criteria control. so the user could build up the number of query criteria. The drop down box ensures they cannot select the wrong keyword, pressing the add criteria button adds a new drop down box and text box pair to the screen.
    An example of this I recently saw was at Intel's jobs search web site https://jobs.intel.com/jobs/jobs.iccw - see that for example.
    Has anyone got any ideas on how to achieve this? I initially thought use jsp scripting (there is no restriction against this) but I need to use javascript I'm guessing as the button click triggers adding a new combo box. Another idea was to use styles and tables to hide the other drop down boxes but this seems like a real hack that I'd like to avoid. I can do with with .NET i hope java can deliver!
    Any ideas are much appreciated - I am a novice with java web development so please, any examples thoroughly explain (no need to explain populating the drop down box - there seem to be plenty of posts on this).
    Thanks for any help or ideas on this issue -

    Gina,
    Here is some sample code for using a ComboBox in a JSP from an EditCurrentRecord bean. This particular example uses a query, you can also populate combo boxes, list boxes, radio buttons and checkboxes from a static list. See the JavaDocs for the EditCurrentRecord bean.
    <jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
    <%
    RowEditor.initialize(application, session , request, response, out, "wt_bc_WT_bcModule.WalkthroughEngineSlidesView");
    RowEditor.setTargetUrl("WalkthroughEngineSlidesView_SubmitInsertForm.jsp");
    RowEditor.createNewRow();
    RowEditor.setReleaseApplicationResources(true);
    RowEditor.useComboBox("Presname","select pres_name,pres_name from wt_info","PRES_NAME","PRES_NAME");
    RowEditor.render();
    %>
    </jsp:useBean>
    null

  • Default selection in combo box at struts form

    hi friends..i am new person in struts form..this is my prg.. display combo box value in 18. but i want 20...how to write program....plz anybody help me....thank you............
    <%
    for (int index = 18; index < 56; index++)                                                                           %>
    <html:option value="<%=index + ""%>">
    <%=index + ""%>
    </html:option>
    <% } %>

    what you need is field "value" in the select:
    [http://struts.apache.org/1.2.x/userGuide/struts-html.html#select]
    see "value" property
    (found it easily with "struts option selected" on google)

  • Combo box with bind variable from popup

    Hi.
    I had two comboboxes on a form, one having a bind variable. It works great, with the first one as bind field.
    But i want to have the first LOV to be a POPUP. So, the second LOV (combo box) needs to be refreshed when a user has picked a value from the popup list. When i do that, the second LOV is not refresehed...
    Is there a way to do this?
    (3.0.9.8.3.A)

    Hi,
    This was a bug and is fixed in 30984.
    Thanks,
    Sharmila

  • Combo Box with duplicate data

    Hello All,
    I am creating a form with a combo box but the data from the table is duplicating.  Can anyone provide guidance on how to make the combo box only display only two choices of the data?  For example, when the box is selected the drop down list
    will have multiple/group of  'Yes' and 'No'.  It appears that everytime a record is added to the table, it gets duplicated.  I think I'm overlooking something from working long on this and it maybe something simple/obvious.   Any
    help would be appreciated, thanks.
    Evin

    As Bruce said you can use the DISTINCT predicate to suppress duplicate rows, but if you are getting duplicates in a combo box's list it suggests that you are querying the wrong table as the Control's RowSource property.  If we take a simple example
    of a combo box to list states, then the following would return duplicates of the table contains rows for two or more cities in the same state:
    SELECT State
    FROM Cities
    ORDER BY State;
    You could suppress the duplicates with:
    SELECT DISTINCT State
    FROM Cities
    ORDER BY State;
    but the correct solution would be:
    SELECT State
    FROM States
    ORDER BY State;
    i.e.  in the Cities table State is a foreign key column referencing the primary key of States.  You might ask why have a States table at all as the values are already in Cities?  The answer is that by having a States table you can enforce referential
    integrity in the relationship between Cities and States, preventing the insertion of invalid State values into Cities.  Without protecting the integrity of the database in this way errors in data entry will sooner or later occur (Murphy's Law is infallible
    in this respect!).  I have personal experience which is testament to this, having once found three versions of my own name as author in a table of references to technical articles in my own field of work.  As far as the database is concerned this
    makes me three separate people!  The table should have referenced the key of an Authors table of course.
    Ken Sheridan, Stafford, England

  • Dynamic Update in real time with slider control

    We have requirements to display complex data in a graphical format. So far this has gone well by leveraging ADF and DVT components (dvt:Map, dvt:gauge, dvt:bargraph, af:tables, af:inputNumberSlider, etc.); however, we recently have been asked to add real-time animation of these controls over time. In brief, the user requires the ability to control the on-screen visualization of data by sliding the control on an af:inputNumberSlider (or equivalent) that represents a multi-month time scale. While sliding this control, the user expects to see the data visualization controls dynamically update in real time, keeping up with the rate at which the user moves the slider control. Think of this like a flip book animation where the slider controls the page the user is looking at and they can flip through the pages forwards or backwards at any desired speed. The time slider increments are one hour.
    Our current application architecture:
    Oracle ADF Fusion Web Application (v 11.1.1.5)
    EJB 3.0
    Eclipselink
    Oracle 11g
    Any kind of help is highly appreciated.
    Thanks,
    Mehabub

    Hi,
    the af:inputNumberSlider does not provide this functionality. Your alternative is a custom component (or any component that raises a client JS event) and call an af:serverListener in a custom event to send the notification to the server.
    Frank

  • Dynamic values using combo box

    Hi,
    i have a doubt regarding the combo box.
    do clear it.
    Company [ ]
    bu[ ]
    onselectio of company , i should get bu values....
    i am getting the value in the bu list.......
    but the company name is not getting restored.
    giude me with the code part...
    its urgent...i need it now...
    it would kind enough if some one help me.
    thank u

    Could you provide how ur populating [bu]

Maybe you are looking for

  • How can I listen to a song from itunes and play along with my guitar on ipad2/apogee jam?

    I am trying to utilze my ipad2 for guitar practce but having a hard time getting my technology under control.  I  have garage band as well as the apogee jam and I can easily hook it in and play, create songs etc.  But what I like to do is play along

  • How to Print PDF with no margins !!!??

    I have a word file (office 2011 beta) with almost zero margins. When I save as PDF, the file coming out with margins and white border on the sides which makes my text in the document disappears. I'm new to mac OS and I never faced this issue in the w

  • Need information on BAPI for Sales Process ?

    Hello SAP folks, I am currently involved in Consumer Portal integration with SAP System. I need information about the right kind of BAPI that would help me to enter and retrieve data from SAP database. I have noted down following funtionality in Sale

  • Booting from a SAN

    Hi There, I am booting my V240 server running Solaris 10 from an EVA5000. The system boots fine and there are no issues there. I have created a device alias for each of the 4 ports on the controllers on the eva. These all work fine and the system is

  • Standard function for specified return

    Hi, I have an issue I want your help with. This is only valid if numbers 5 or 6 are in the input. I want to return the last 2 digits from the input parameter. for example. Input: 123456. Output: 56. Or if there's only 12345 I want to return 5. I can'