Dynamically populating values in 2 dependent select in jsp

hello users
i am confronted with a probelm.
i am having 2 select fields that are dependant on each other. i.e. select one and in the other select, values are automatically populated..
the only problem here is that it has to be dynamically done
i dunno javascript can do it dynamic ally but by hardquoting values, it can be done.(which obviously i dont want)
i can't solve it by using arraylist or vector either. it may be i'm not using the correct method. but aneways, plz reply me asap
thanks a lot in advance
Rajeev

hello sure
thanx for taking the time to reply...i can email u my files there are 2 jsp files and 1 bean file ...u'll have to arrange them in a package (bean) under the folder WEB-INF if you are using tomcat..
give me ur email id , i'll mail u the code in a zip format
thanks once again
Rajeev

Similar Messages

  • Dynamically populated selectonechoice without persisting the selection

    Using jsf/adf bc. I have a situation in which I want a selectonechoice to be populated via a view object (ie table driven). However, when the user selects a value from the selectonechoice, I don't need to persist this value to any other view object. When I try to drag/drop a selectonechoice, the list binding dialog insists on me supplying both the base data source (to be saved back to) and the list data source. I don't have a base data source that I need this value to be saved back to. I just want to show a list of values based on a read only view object. How can I do this? I looked in to using a navigation list, but from what I read the first row of the view object will always be displayed by default in the selectonechoice, which i don't want. Thanks.

    thanks shay. just to reiterate, i want the value <No Selection> to display by default in the selectonechoice when the page first renders. setting the unselectedLabel property to this value on this component doesn't result in <No Selection> being selected by default. while my issue isn't sorting the list as is covered in the link you gave me, it sounds like you're suggesting that i'll need to write some code so that <No Selection> is added to my list of results at the first row position, since the navigation list will display the value in the first row by default? If you have any suggestions on how to do that please share. Thanks

  • Dynamic populating the items in the select boxes

    Hi,
    I need three select boxes on a webpage in such a way that the options in select box 2 should be populated only after selecting some item in "select box 1" and the options in the "select box 3" should be displayed by selecting the options in "the select box2". The data is being retrived from the database. I know that this functionality can be acheived through the "javascript". I am fine until getting the data from the database but not sure how to get it work using javascript.
    I would appreciate if someone can post any snippet of code or give any suggesstions or pointer on how to proceed....
    -coolers

    probably should ask on a javascript forum then. This is for java.

  • How to create  some columns dynamically in the report designer depending upon the input selection

    Post Author: ekta
    CA Forum: Crystal Reports
    how  to create  some columns dynamically in the report designer depending upon the input selection 
    how  export  this dynamic  report in (pdf , xls,doc and rtf format)
    report format is as below:
    Element Codes
    1
    16
    14
    11
    19
    10
    2
    3
    Employee nos.
    Employee Name
    Normal
    RDO
    WC
    Breveavement
    LWOP
    Sick
    Carers leave
    AL
    O/T 1.5
    O/T 2.0
    Total Hours
    000004
    PHAN , Hanh Huynh
    68.40
    7.60
    76.00
    000010
    I , Jungue
    68.40
    7.60
    2.00
    5.00
    76.00
    000022
    GARFINKEL , Hersch
    66.30
    7.60
    2.10
    76.00
    In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
    if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
    Can anybody help me how do I design such report....
    Thanks

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • Date parameter values cleared when dynamically populating string parameter

    Software: Crystal Reports XI Release 1 with SP4, with MS SQL Server 2008
    I've created a report that asks for three parameters, 2 dates, and a string which is dynamically populated. The report has two tables added in the database expert.
    The first table in the database expert is a command object which passes the two date parameters to a stored procedure:
    exec sp_MyStoredProcedure {?startdate},{?enddate}
    The second table in the database expert is a stored procedure object used to populate the string parameter {?_users}. The criteria for the string parameter are:
    Prompt with Description only: False
    Allow multiple values: True
    Allow discrete values: True
    Allow range values: False
    This stored procedure object requires nothing to be passed, it was originally a view in the database, but the same problem occurs whether i dynamically populate the string parameter options from either a view or a stored procedure.
    The string parameter is used for defining the record selection formula:
    IF {Command.user_name} in {?_users} THEN true ELSE false.
    The two table objects are not linked in the database expert, but linking them does not seem to solve the problem I am having with this report, the problem being this:
    No matter which order I set the parameters, it always first displays a form showing only the prompts for the date values. After entering these, it then shows a form prompting for the date values again (the previously selected date information now cleared), along with the list of users from which to select. On this 2nd form, the parameters are displayed in the order I set using the field explorer option presented when I right click on the Paramter Fields heading. After entering the date parameter values a 2nd time, and selecting the users from the dynamically generated list, the report performs as intended. After subsequently running the report  (prompting for new parameter values by pressing F5),  it does not clear the date parameters on the 2nd form's appearance.
    What I need is to be able to enter in these values the first time around, without having the date parameters cleared. Am i going about this incorrectly, or is this a bug?

    What you are experiencing is not a bug... Passing a multi-valued parameter to a Command or SP is not supported in any version of CR prior to CR 2008.
    Your options are #1) Upgrade to CR 2008 or #2) Jump through the necessary hoops to make it work in CR XI
    Check out this link...[SQL Command Parameter - Multiple Value|Re: SQL Command Parameter - Multiple Value]
    It has some good examples a good step by step.
    HTH,
    Jason

  • How to select and store the dynamically clicked values in the checkboxes?

    Hi Gurus
    How to select and store the dynamically clicked values in the checkboxes?
    Scenario:-
    I am having a tree structure but I am not getting that user has clicked the which nodes.
    So how to do it.
    Pls.

    Hi,
    Once again, this is dependent on what your implementation expects. It would seem that your implementation is expecting all of the API to be coded in Java Card so it would make sense that you would load these packages like any other package. Loading an applet is not a special case, it just has an extra step of installing instances of it (and can actually be installed). Any other Java package just needs to be loaded. As such, just load your CAP files for each package of the API before loading any code that depends on it.
    Cheers,
    Shane

  • Populating values dynamically......

    Hi all...
    I have a scenario where i have....States and Selected States..[both are <html:select>].Districts and selectedDistricts[both are <html:select>]
    If at all i select a state say Andhrapradesh....then Selected States should be populate AndhraPradesh as option value...In turn districts should populate districts of
    AndhraPradesh...so that i can select as many districts from districts and the selected districts should be populate in selectedDistricts.
    AND...
    If i select more than one state(say 4 states) , all the states should be populated in Selected States.....If at all i select 1st state in Selected States...corresponding districts should be populated in Districts [ if i select AndhraPradesh in Selected States, Districts should populate all the districts of AndhraPradesh ,if i select Karnataka,..  Districts should populate all the districts of Karnataka].
    and all these states and districts should be generated form DB....
    Any Ideas....help required....

    Use Ajax.
    There's a basic Ajax tutorial at w3schools.com. It is basically simple:
    1) Use Javascript to fire a XML HTTP request.
    2) Let Servlet handle this request and return XML or JSON or plain String response.
    3) Use Javascript to apply the response on the HTML DOM tree.
    There are frameworks which simplifies doing all the stuff, like jQuery. You could use $.ajax or $.getJSON for this.

  • Dynamically populated dropdown values are missing when instances are added

    HI Team
    I have a subform which is repeatable have  a drop down  as one of the field which is dynamically populated from the web service call(short lived process) from the DB.On initialize event of the subform the data connection is executed .Dropown is populated with the values but when an instance of subform is added the dropdown values are missing.
    Only in the first instance of a subform  dropdown values are showing up , when instances of subform is added the drop down values are missing.
    Please let me how can i solve this issue,
    Thanks in Advance
    Bharathi

    I've tried this option by adding some value (hard-coded) during initialize event of the subform and all values are populated in the newly added instances as well.
    Not sure why it's not working for you.. Can you try adding some sample values without calling web service and confirm if it's working?

  • Set Radio Group Default Value Based on a Select List Change Event

    Apex 4.2
    I have a radio group that is source is below. It returns 3 radio group item All,Miv,Courier
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      ORDER BY 1
    The radio group is only populated when :P320_DEPOT gets a value, this is a select list.
    I am trying to set the radio group to  default to this value Miv it would use the statement
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      and type ='Miv'
      ORDER BY 1
    I have tried creating a dynamic action on Select list change to populate the default value of the radio group...no joy I also tried a computation. how can I set this default value on when list changed.
    Thanks
    I have got the default Radio Group Selection working by doing a computation before region on the radio group and calling its select statement and setting the value. But the problem is now I cannot change the radtio group as I do it fire the before region trigger and sets it back to the default value....any help?

    Hi,
    Could you please create example to apex.oracle.com?
    Regards,
    Jari

  • AJAX dependent Select lists

    Can anyone please help me figure out where am going wrong?
    I have 2 regions on page 1. Region 1 is supposed to have 2 drop down lists (cascading i.e values in second drop down Drop List HJ are dependent on value selected in first lov Ajax Select HJ). Region 2 will be a report.
    I am trying to create AJAX cascading lovs based on eg. provided on carl's application so that Region 2 is not refreshed each time I select a value from the drop down's
    [http://apex.oracle.com/pls/apex/f?p=36391:37:1510004986327720::NO:RP::]
    I have downloaded the application and tried to do the exact same steps, but my child lov is not updating its values after I select a value from in Ajax Select HJ.
    My application is available at http://apex.oracle.com/pls/apex/f?p=33829:1:2010637670427735:::::
    Appreciate any help on this
    Thank you
    Deepu

    Thank you Denes !! The example really helped me. Now I am stuck at the next level. I am new to apex and learning and building dashboard for my organization. So, please bear with me.
    I have a page that is divided into 4 regions. Each region displays a chart that is generated dynamically. When I say dynamic, each region has 2 drop down lists.
    First pull down has Org and Year as values, if they wish to view chart by Org or Year. If they choose Org, second drop down defaults to Org. If they choose Year, second drop down displays Year's as 2010, 2009,2008 so on. Depending on which year they choose they should be able to view that Year's chart by month in that region.
    Initially I had used select lists with submit for drop down's but that was refreshing the whole page. But now after using your example with AJAX I was able to accomplish the cascading Lov's stuff. Now, after user selects a value in second drop down, is there a way that I can display the chart and refresh only that region each time user selects a value from the drop down.
    I want to avoid refreshing the page each time, I need each region to refresh based on user selection in drop down's. Is this possible in apex? Is there any example that you could direct me to.
    Thank you so much for all your inputs. Appreciate it very much
    Deepu

  • Dynamically populated parameter clears previously entered parameters

    Software: Crystal Reports XI with MS SQL Server 2008
    I've created a report that asks for three parameters, 2 dates, and a string which is dynamically populated. The report has two tables added in the database expert.
    The first table is a command object which passes the two date parameters to a stored procedure:
    exec sp_MyStoredProcedure {?startdate},{?enddate}
    The second table is a stored procedure object used to populate the string parameter {?_users}. The criteria for the string parameter are:
    Prompt with Description only: False
    Allow multiple values: True
    Allow discrete values: True
    Allow range values: False
    This stored procedure object requires no parameters, and was originally a view in the database, but it the same problem occurs whether i dynamically populate the string parameter options from either a view or a stored procedure. I'd like to go back to using a view, as i do not need to pass any kind of parameters to the stored procedure
    The string parameter is used for defining the record selection formula:
    IF {Command.user_name} in {?_users} THEN true ELSE false.
    The two tables are not linked in the database expert, but linking them does not seem to solve the problem I am having with this report, the problem being this:
    No matter which order I set the  parameters, it always first displays a form showing only the prompts for the date values. After entering these, it then shows a form prompting for the date values again (the previously selected date information now cleared), along with the list of users from which to select. On this 2nd form, the parameters are displayed in the order I set using the field explorer option presented when I right click on the Paramter Fields heading. After entering the date parameter values a 2nd time, and selecting the users from the  dynamically generated list, the report performs as intended.
    Edited by: Duraplex on Nov 12, 2010 6:26 PM
    Edited by: Duraplex on Nov 12, 2010 6:57 PM - After contacting the tech dept of my employer, they are applying a service pack update to my installation, I am hoping this resolves the issue. Will post an update as soon as I know more.
    Edited by: Duraplex on Nov 12, 2010 7:35 PM - After applying SP4 to my installation, the problem persists. I did note however that removing the string parameter and record selection formula, and then recreating them, does somewhat solve the issue temporarily - i still am presented with two forms, but the second form doesn't clear the previously entered date parameters. However,  once i save the report, and reload it, the problem manifests again and the date parameters are cleared when presented on the 2nd form. Has anyone else encountered a similar problem?
    Edited by: Duraplex on Nov 15, 2010 8:38 PM - Problem resolved by upgrading from Release 1 to Release 2.

    Hi,
    Once record status gets change for block you can not populate/repopulate the list item. Keep those list items as non-database item with different names and create different items as database orignal items. Than assign the values in WHEN-LIST-CHANGE trigger to the actual database items.
    -Ammad

  • Dynamically populating List box

    Hello Everyone:
    I need to create a JSP with two combo boxes and submit button.
    Where the first combo box will be updated from database - which is simple.
    but depending on the selection of the first box the second box should be populated and should be able to make multiple selections in it.
    and in the same jsp page should be able to display the results, of what I added by submiting the previous form.
    Please can somebody help me witha sample.
    Thanks
    ASB

    Dear user,
    If you get any response for the asked question on Dynamically populating List box from anybody please forward the reply to the following e-mail id.
    [email protected]
    --SUBIR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Dynamically populating more than one field using xml data binding

    Hi All,<br /><br />I have the following code that works fine to dynaically populate a<br />second drop-down list2 from a choice in drop-down list1 using xml data<br />biding.<br /><br />var tempString = "xfa.record." + this.boundItem(xfa.event.newText);<br />var oItems = xfa.resolveNode(tempString);<br />var nItemsLength = oItems.nodes.length;<br /><br />myinfo.page1.state.clearItems();<br />myinfo.page1.state.rawValue = null;<br /><br />for (var nItemCount = 0; nItemCount < nItemsLength; nItemCount++)<br />{<br />myinfo.page1.state.addItem(oItems.nodes.item(nItemCount).value);<br />}<br /><br />Here is my xml file<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><myinfo><br /><country/><br /><countries><br /><item uiname="United States" token="US"/><br /><item uiname="South Africa" token="SA"/><br /><item uiname="Australia" token="AU"/><br /></countries><br /><state/><br /><AU><br /><item>Australian Capital Territory</item><br /><item>New South Wales</item><br /><item>Northern Territory</item><br /><item>Queensland</item><br /><item>South Australia</item><br /><item>Tasmania</item><br /><item>Victoria</item><br /><item>Western Australia</item><br /></AU><br /><US><br /><item>California</item><br /><item>New York</item><br /><item>Texas</item><br /><item>Michigan</item><br /><item>North Carolina</item><br /><item>South Carolina</item><br /></US><br /><SA><br /><item>Eastern Cape</item><br /><item>Free State</item><br /><item>Gauteng</item><br /><item>KwaZulu-Natal</item><br /><item>Limpopo</item><br /><item>Mpumalanga</item><br /><item>Northern Cape</item><br /><item>North-West</item><br /><item>Western Cape</item><br /></SA><br /></myinfo><br /><br />I have two questions:<br /><br />1) I want to be able to structure my xml in a way that I can populate<br />a third drop-down list3 from a choice in list2. I need to know how to<br />to include the different capital cities of the states in my xml data<br />so that they can get populated in list3 from a selection in list2;<br /><br />2) And be able to script the third list3 to get dynamically populated<br />from a choice in list2.<br /><br />Thanks in advance for your help.

    I would like to ask someone for help.
    I have an XML file a result of the XSLT transformation. A schema was created based on this XML and this schema is bound to a form as a data source.  When I preview my form using a Preview tab with transformed XML as a Data File in LiveCycle Designer 8.1, I can see only the first form data across 3 Text fields on the form. The rest of the forms are not getting displayed. What am I doing wrong?
    Here is the part of the XML file Im trying to display on the form:
        FORM 1
        FORM 1 DESCRIPTION
        $5000
        FORM 2
        FORM 2 DESCRIPTION
        $7000
        FORM 3
        FORM 3 DESCRIPTION
        $4000
    Part of the schema that was created based on the XML file from above:
    Thank you.

  • Trying to set attribute value based on user selection of another attribute

    I am trying to set an attribute value based on the user's selection of another attribute using JSP EditCurrentRecord. When the user chooses the AreaId from the combo box I want to look up the value of the RgnID, preferrably without the user seeing this field at all. Below is my code which does not work. When I run it I get Error Message: null. Any suggestions are appreciated!!
    <jsp:useBean id="RowEditor" class="oracle.jbo.html.databeans.EditCurrentRecord" scope="request">
    <%
    RowEditor.initialize(pageContext, "MyProject2_package1_SRSecurityModule.UsrAreaWhView");
    RowEditor.setTargetUrl("UsrAreaWhView_SubmitInsertForm.jsp");
    RowEditor.createNewRow();
    RowEditor.setDisplayAttributes("OracleId, RgnId, RegionKey, AreaId");
    RowEditor.useEditField("OracleId");
    RowEditor.getFieldRenderer("OracleId").setPromptText("Oracle ID");
    RowEditor.useEditField("AreaId");
    RowEditor.useComboBox("AreaId","AreaWhView","Area","AreaKey");
    RowEditor.getFieldRenderer("AreaId").setPromptText("Area");
    RowEditor.useEditField("RgnId");
    RowEditor.getFieldRenderer("RgnId").setPromptText("Region");
    RowEditor.getRowSet().getViewObject().getCurrentRow().setAttribute("RgnId",RowEditor.getRowSet().getViewObject().getCurrentRow().getAttribute("RegionKey"));
    RowEditor.setReleaseApplicationResources(true);
    RowEditor.render();
    %>
    </jsp:useBean>

    ok, sorry everyone for making it confusing; this is what I am
    trying to acheieve;
    I would like the user to populate my database with thier
    username AND userID. I have a dropdown box with thier username
    dynamicly populated already, what I am trying to achieve, is a way
    of when the user selects thier username either another dropdown or
    a hidden field is automatically populated with the appropiate
    userID (to match thier username). Now I could just have two
    dropdowns and they select both, but i'd rather avoid the
    possibility of mismatches, and that is why I would like it to be
    automatic and based on thier username selection...
    Does that make sense....?

  • How to add a checkbox to dynamic itab  so that i can select some records

    How to add a checkbox to dynamic itab  so that i can select some records in the alv and can display them in another alv using a button
    I have requirement where i have to display the dynamic itab records in an alv ....Some records from this alv output has to be selected through checkbox  provided in the first column .( I will get to know the structure of the itab only at runtime ,so iam using dynamic itab)

    Hi,
       I tried and finally i got it , Just try for it.
    type-pools : slis.
    PARAMETERS : p_tab type dd02l-tabname.
    data : ref_tabletype  type REF TO cl_abap_tabledescr,
           ref_rowtype TYPE REF TO cl_abap_structdescr.
    field-symbols  : <lt_table>  type   standard TABLE ,
           <fwa> type any,
           <field> type abap_compdescr.
    data : lt_fcat type lvc_t_fcat,
           ls_fcat type lvc_s_fcat,
           lt_fldcat type SLIS_T_FIELDCAT_ALV,
           ls_fldcat like line of lt_fldcat.
    data : ref_data type REF TO data,
            ref_wa type ref to  data.
    ref_rowtype ?= cl_abap_typedescr=>DESCRIBE_BY_name( p_name = p_tab ).
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
      EXPORTING
        p_line_type  = ref_rowtype
      receiving
        p_result     = ref_tabletype.
    CATCH cx_sy_table_creation .
    write : / 'Object Not Found'.
    ENDTRY.
    *creating object.
    create data ref_data type handle ref_tabletype.
    create data ref_wa type handle ref_rowtype.
    *value assignment.
    ASSIGN ref_data->* to <lt_table>.
    assign ref_wa->* to <fwa>.
    loop at ref_rowtype->components ASSIGNING <field>.
      ls_fcat-fieldname = <field>-name.
      ls_fcat-ref_table = p_tab.
      append ls_fcat to lt_fcat.
    if lt_fldcat[] is  INITIAL.
        ls_fldcat-fieldname = 'CHECKBOX'.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
        ls_fldcat-seltext_m = 'Checkbox'.
        append ls_fldcat to lt_fldcat.
      endif.
      clear ls_fldcat.
      ls_fldcat-fieldname = <field>-name.
      ls_fldcat-ref_tabname = p_tab.
      append ls_fldcat to lt_fldcat.
    endloop.
    loop at lt_fldcat into ls_fldcat.
      if sy-tabix = 1.
        ls_fldcat-checkbox = 'X'.
        ls_fldcat-edit = 'X'.
    modify lt_fldcat FROM ls_fldcat
        TRANSPORTING checkbox edit.
    endif.
    endloop.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog           = lt_fcat[]
      IMPORTING
        ep_table                  = ref_data.
    assign ref_data->* to <lt_table>.
    select * FROM (p_tab) into table <lt_table>.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       IT_FIELDCAT                       = lt_fldcat[]
      TABLES
        t_outtab                          = <lt_table>.
    Thanks & Regards,
    Raghunadh .K

Maybe you are looking for

  • Installation failed on Windows 7 platform

    I am attempting to install Oracle Enterprise edition on a Windows 7 32 bit platform. During the installation, several errors are displayed stating that certain files could not be found within the installation directory. So I continued from these erro

  • Problem with datechooser

    Hi, I am facing problem while using datechooser in flex. I have an array which contains five dates.I am using this array in a function and this function will call when i click the buttons,previous button and next button.I just want to change the font

  • Lumia 620 Software Problems (Opening Settings and ...

    I've just bought a new unlocked lumia 620 and its great. APART from the fact that I cant open settings. After completing the initial setup, I cant open settings, and when I shut down the phone, it gets stuck on the goodbye screen and I have to take t

  • Safari works only in safe mode

    MacBook Air 2010 When I update my OS X Lion to 10.7.3  Safari instantly stop working. When I open Safari it don't download any sites, just white screen and a colored round. In the same time WebProcess eat all my processor power. If I fully close safa

  • Cisco LMS what is SSH used for?

    Hi - I hope that somebody can help me.... I currently have a subcontractor using CiscoWorks to monitor a 700 site network. The WAN links and associated routers are currently supplied by supplier A but are being transitioned to supplier B. My subcontr