How to handle dynamically created checkboxes in JSP???

Hello everybody,
In a JSP page I would like to create checkbox dynamically on every
result line (detail line), then check in some of them and finally pass the checked lines to a JSP bean which will handle them on a submit button press.
The problem are:
- how to index every checkbox in jsp result line in jsp page in order to avoid solutions like this:
<input type=checkbox" name="value1">
<input type=checkbox" name="value2">
etc
- how to read every checkbox to find the checked ones
Is there anobody who has any experience from case like this?
Please, help me.
Best regards,
Danny

Hi, first off, no need to determine what has been checked or not. If the checkbox is checked, on the post, the value will be submitted as part of the request. If the checkbox is not checked, it will not be submitted (it's value will be null). Depending on what you need, I have approached this a number of different ways. One way is to name all checkboxes the same name. If you need to distinguish between two rows in the form, then in the value field for the checkbox, use some type of distinguishing factor, for example,
<input type=checkbox name=chkName value="1:abc">
<input type=checkbox name=chkName value="1:def">
Now, you only have to make one call on the Servlet/JSP receiving the form post, request.getParameterValues("chkName") which will return an array of the non-null Strings that were checked.

Similar Messages

  • How-to handle dynamically created AppModules with JUApplication, JUMetaobjectManager

    Hi,
    I've got a JClient App, where I want to dynamically create AppModules in the Context of the RootAppModule.
    How can I best do this??? The problem is that I can't really use the JUMetaObjectManager.createApplicationObject method and hence I can't use PanelBindings.....well I can't use the JClient Framework.
    Is there a way to elegantly manage this issue??
    Every solution would be very appreciated! thanks.

    Hi, first off, no need to determine what has been checked or not. If the checkbox is checked, on the post, the value will be submitted as part of the request. If the checkbox is not checked, it will not be submitted (it's value will be null). Depending on what you need, I have approached this a number of different ways. One way is to name all checkboxes the same name. If you need to distinguish between two rows in the form, then in the value field for the checkbox, use some type of distinguishing factor, for example,
    <input type=checkbox name=chkName value="1:abc">
    <input type=checkbox name=chkName value="1:def">
    Now, you only have to make one call on the Servlet/JSP receiving the form post, request.getParameterValues("chkName") which will return an array of the non-null Strings that were checked.

  • How to handle dynamically created row values when get upadted "please help"

    Hi,
    In my application I have requirement to display the data for specific date when user clicks on viewData. (it shows the entries for that specific days . There may be number of entries). For showing this I have created Value Object and I am setting all the entries for particular selection date to value object and (simply one day entry indicates one instance of my VO if there are 10 entries then I am creating 10 instances of VO and passing this to the actionfor)
    On my JSP page I am displaying that data by using <logic:iterate>
    <logic:iterate id=�myid� name =�nameofform� property =�Listproperty�>
    <tr>
    <td><input type=�text� property=�abc� value=<bean:write name=�myid� property=�propertyinVO�></td>
    // and same for other other values as well
    �.
    </logic:itearte>
    Now I have requirement that if user edit these entries and click on SAVEDATA the updated values should go to the DB.
    As I don�t have property mapped separately I am not able to take updated values of those as they are getting dynamically generated
    Is there is any way by which I can get these updated values.
    I am in badly need of that . Urgent help will highly appreciated.
    Thanks
    Sheena

    Hi, first off, no need to determine what has been checked or not. If the checkbox is checked, on the post, the value will be submitted as part of the request. If the checkbox is not checked, it will not be submitted (it's value will be null). Depending on what you need, I have approached this a number of different ways. One way is to name all checkboxes the same name. If you need to distinguish between two rows in the form, then in the value field for the checkbox, use some type of distinguishing factor, for example,
    <input type=checkbox name=chkName value="1:abc">
    <input type=checkbox name=chkName value="1:def">
    Now, you only have to make one call on the Servlet/JSP receiving the form post, request.getParameterValues("chkName") which will return an array of the non-null Strings that were checked.

  • How to Handle dynamic views in mm01 transaction

    Hi ,
           Can any body say me how to handle Dynamic views in MM01 tcode. Since every time new view has to be selected, how can we manage this through our program.
    Regards,

    Hi Nilesh,
    Views will be vary based on the Material Type what u are selectiing , so u have to focus on this settings.
    Regards
    Peram

  • How do i dynamically generate checkboxes in BSP?

    How do i dynamically generate checkboxes in BSP? Each checkbox should have a different name and the checkbox values should be captured at the event oninput processing.

    HI Asha,
    Post here for BSP related queries.
    Business Server Pages (BSP)
    Regards,
    Ravi

  • Cannot check dynamically created Checkbox

    Hi,
    I cannot check a dynamically created Checkbox which is binded to a dynamically created node.
    The same dynamically created Checkbox can be checked when it is binded to a static node.
    Any ideas?

    Hello MK,
    Checkbox UI element`s property "checked" can be binded only to attribute with type "boolean".
    If you create attribute inside the node, check whether node contains any node elements.
    Could you please post a piece of your code with dynamic attribute and UI element creation?
    Best regards, Maksim Rashchynski.

  • Operations on dynamically created checkboxes

    Hi Experts,
                          In my application I have created 10 check boxes dynamically. All check boxes are for selecting different request types which the user can select. Out of these 10 one check box is for "ALL requests". Now I want that if All Check box is clicked all other checkboxes must be checked. I want to use on toggle action of checkboxes on dynamicaaly created checkboxes Is it possible? Or I have to create checkboxes statically and  only then  I can use ontoggle action of checkboxes..
      Please help me in this regard.
      Thanks,
      Pratibha

    Hi Amit,
               I have written following code in wddomodifyview. I have declared mr_view as attribute in my view and in component controller of the type IF_WD_VIEW.
    METHOD wddomodifyview .
      DATA: lr_container TYPE REF TO cl_wd_uielement_container,
            lr_checkbox TYPE REF TO cl_wd_checkbox,
            lr_node TYPE REF TO if_wd_context_node.
      CHECK first_time = abap_true.
    *  lr_container ?= view->get_root_element( ).
      lr_container ?= wd_this->mr_view->get_element( 'TC' ).
      cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
      DATA lo_nd_node TYPE REF TO if_wd_context_node.
      DATA lo_el_node TYPE REF TO if_wd_context_element.
      DATA ls_node TYPE wd_this->element_node.
      DATA lv_str3 LIKE ls_node-str3.
      DATA lv_str1 LIKE ls_node-str1.
      DATA lv_str2 LIKE ls_node-str2.
    * navigate from <CONTEXT> to <NODE> via lead selection
      lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
    * get element via lead selection
      lo_el_node = lo_nd_node->get_element(  ).
    * get single attribute
      lo_el_node->set_attribute(
        EXPORTING
          name =  `STR3`
          value = 'ON_TOGGLE' ).
      lo_el_node->set_attribute(
    EXPORTING
    name =  `STR1`
    value = 'ALL_REQ' ).
      lo_el_node->set_attribute(
    EXPORTING
       name =  `STR2`
       value = 'DYNAMIC.ALL_REQ' ).
    * navigate from <CONTEXT> to <NODE> via lead selection
      lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
    * get element via lead selection
      lo_el_node = lo_nd_node->get_element(  ).
    * get all declared attributes
      lo_el_node->get_static_attributes(
        IMPORTING
          static_attributes = ls_node ).
      ls_node-str1 = lv_str1.
      ls_node-str2 = lv_str2.
      ls_node-str3 = lv_str3.
      lo_el_node->set_static_attributes(
        EXPORTING
          static_attributes = ls_node ).
      lr_checkbox = cl_wd_checkbox=>new_checkbox( bind_checked = ls_node-str2
                                                  bind_text    = ls_node-str1
                                                  on_toggle =    ls_node-str3
                                                  view = wd_this->mr_view   ).
      cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_checkbox ).
      lr_container->add_child( the_child = lr_checkbox ).
    ENDMETHOD.
      I am getting this error : Access via 'NULL' object reference not possible 
    pls help.
    Thanks,
    Pratibha

  • How to delete Dynamically created input field UI Element

    Hi all,
              I want to delete dynamically created input field and label.
    Is there any method please tell.
    Thanks in advance
    Hemalatha

    Hi,
    In the WDEVENT parameter of the action handler you can find the event id.
    ***Variables
      DATA:
        lv_selected  type string.          "Selected tab value
    ***Structure and internal table for the Events and messages
      DATA:
        lt_events type WDR_EVENT_PARAMETER_LIST,
        ls_events type WDR_EVENT_PARAMETER.
    ***Field symbols
      field-symbols: <fs_value> type any.   "Attribute value in events table
    ***Move the event table to lt_events
      lt_events = wdevent->parameters.
      read table  lt_events into ls_events with key name = 'SAVE'.  "Button Id
      if sy-subrc eq 0.
        assign ls_events-value->* to <fs_value>.
        if sy-subrc eq 0.
          lv_selected  = <fs_value>.
        endif.                 "IF sy-subrc eq 0.
      endif.                 "IF sy-subrc eq 0.
    Regards,
    Lekha.

  • How to handle dynamic JMenuItem's actionListener??

    I want to implement a function like "Recent File" in "File" menu.
    But I don't know how to handle their actionListener?
    for (int i=0; i<count; i++)
    JMenuItem miNode = new JMenuItem(fileName);
    mnuFile.add(miNode);
    miNode.addActionListener(...) ///// ----- ????????
    }

    for (int i = 0; i < count; i++) {
        final String fileName = ... // the i-th file name
        JMenuItem miNode = new JMenuItem(fileName);
        mnuFile.add(miNode);
        miNode.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                // do whatever you want using "fileName" variable
                System.out.println("You have selected the '" + fileName + "' file.");
    }Alternatively you can create one ActionListener and add it to all menu items. When event is fired you can use ActionEvent.getActionCommand() - it will return the text of the JMenuItem (the file name on your case) that caused the event provided that you set only JMenuItem text (as you do in your example).

  • How to handle dynamic screens in bdc

    HI SIR,
    i am working on BDC for CA02 in this i have probelm that if operation 10 it doesnot contains any items it showing one  screen and if operation 10 contain some items
    and its item counter increasing automatically in this case it coming to this screen through some other screen.so.plz help me how to handle this dynamic screens in bdc ,plz help.

    hi sir,
              now i am working BDC UPLOAD with tcode CA02 in this in second screen their are some rows like in table control
    opt
    10                x
    20
    30                 x
    like above in this if row one of column contains 'x' then if i want to fill sub item then it display i one screen EX 100 else if it dsplay screen 200(ie item 10 already contains subitems it display  x in one row column(i.e selected check box) else it show unselected check box.plz tell how to know wheather check box is selected or not from screen to .plz tell.
    thanking u

  • How to handle Dynamic Fiscal calendar

    Hi FolksWe have designed our cubes in such a way that the time dimension is actually split into 2 time dimensions "Fiscal Year" and "Fiscal Time". The "Fiscal Time" changes every four years, in that, it has an extra week. So usually the Month February has 4 Weeks WK01, WK02, WK03, WK04, but this year it has an exta week WK05 and usually WK05 falls under March. So we are not sure how to handle this, other than combining the both dimensions, which has a huge impact on our historical data. And also we think the current design is more elegant, if we do not have this problem. Is there any way we can manage this with out comibing the both time dimensions.1. Fiscal Year FY01 FY02 FY032. FY Time Q1 AUG Q1 Wk01 Sep Oct Q2 Q3 Feb Q3 Wk01 Q3 Wk02 Q3 Wk03 Q3 Wk04

    Hi Nilesh,
    Views will be vary based on the Material Type what u are selectiing , so u have to focus on this settings.
    Regards
    Peram

  • Error While Calling action on dynamically created checkboxes

    Hi,
         I am calling on_toggle action on dynamicallly created checkboxes . It is giving me error : " Access Via Null Object Not Possible "
    please help.
    Thanks,
      Pratibha

    Hi,
    Check ur application in debuggermode or go to the transaction ST22 and check the error analysis.
    The error may be because u have not assign any action for on toggle. It may be because of any node is initialized and using it....

  • How do I dynamically  create a pdk:text / field?!!!!!!

    I have a form that is to let the user add multiple rows and I need to be able to dynamically create a text filed and assign the attributes maxlength, size, name,property, and also assign the onkeypress a java script function. the following code will get me a text box but none of the attributes work:
    function add_Row(TLBID)
    var tbody = document.getElementById(TLBID).getElementsByTagName("TBODY")[0];
    var row = document.createElement("TR");
    var tlbTD = document.createElement("TD");
    var txtelement = document.createElement("TEXTAREA");
    tlbTD.colSpan = 2;
    txtelement.cols="25";
    txtelement.rows="2";
    txtelement.name="newDCTResponseText";
    tlbTD.appendChild(txtelement);
    var tlbTD2 = document.createElement("TD");
    tlbTD2.valign="bottom";
    var txtelement2 = document.createElement("input");
    txtelement2.type="text";
    txtelement2.maxlength="5";
    txtelement2.size="2";
    txtelement2.name="dctqeBean";
    txtelement2.property="dctScoreTxtBox";
    txtelement2.onkeypress="do_validate()";
    tlbTD2.appendChild(txtelement2);
    row.appendChild(tlbTD);
    row.appendChild(tlbTD2);
    tbody.appendChild(row);
    }

    Hi Ray,
    Thanks for your response. I do not understand the explanation. Maybe it is because I did not explain what I need or maybe becasue I am new to TS. Here's what I'd like to do.
    Have a predefined list of IO names. Like:
    Nest1 
    K23    "DIO96/port0/line1"
    K24    "DIO96/port0/line2"
    Nest2
    K23    "DIO96/port1/line1"
    K24    "DIO96/port1/line2"
    I will have 2 nests(sockets) in my system running batch model. From what I understand I can have 1 sequence defined and TS that will execute 2 threads with 1 socket per thread. In this sequence I somehow need to pass to my VI the value of K23 which is different for socket1 and 2. I was thinking that I can somehow create the Property Name Dynamically. Sort of like that:
    RunState.Sequence.Parameters.GetPropertyObject("Nest%d",RunState.TestSockets.MyIndex+1).K23
    It would give the sequence running for socket 1 the value "DIO96/port0/line1" and "DIO96/port1/line1" for socket 2
    thanks
    J.

  • How to handle multiple option selected in JSP?

    Hi ,
    Imagine in a jsp page we have 7 check boxes with 7 different option.
    When user selects each chk box data should be fetched from respective table.
    Scenario:
    User can select 1 or more option in jsp page,in osb how to query multiple tables dynamically for the user selected options without using if else in message flow/switch in XQuery as no of combinations will be more .
    Can any of you guide us on this?
    Edited by: Anitha R on Feb 21, 2011 6:21 AM

    Hi Anuj -
    Thanks for the response.
    I understand your point,but thing is-
    For 7 options if we create 7 BS and for single selection based on the option selected we can invoke the respective BS.
    But if user selects more than 1 option ,i need union response of 2 respective business service .How can we achieve this , Do we have option to combine result from 2 DB adapter/2 BS to single result in OSB?
    Current method i try to follow,we have a single db adapter configured to get union response for all 7 options from DB.based on the user option i need to filter data for each eg - meterid i have in my master collection..planned to write query transformation of response data as needed for option user selects.Is this a better approach?Will this cause any performance issue?Because in my XQuery for each master data i'll fetch other details from DB using fn:bea execute sql..
    Kindly suggest any better approach to follow.
    Waiting for your earliest response.

  • How to Handle Dynamic Pivoting with a single SQL?

    I was searching for a single SQL who can dynamically understands the pivoting members in the data, I saw several ways of doing Pivoting depending on the version, some are really hard to understand but just two options upto now seams to be flexable enough to do dynamic pivoting, right?
    1- For this option you have to write PL/SQL block to build up the dynamic single SQL query, I also find this approach very easy to understand. :)
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:766825833740
    2- 11.1 's PIVOT new feature with PIVOT XML and ANY clause, a SINGLE SQL and easy to understand but returns XMLTYPE data, another step to parse to produce the report is needed.
    http://www.oracle-developer.net/display.php?id=506
    Below is a 10g Model Clause example, but here instead of pivoting by A1-A2-A3 staticly I want to have these values by a distinc subquery for example;
    create table test(id varchar2(2), des varchar2(4), t number);
    INSERT INTO test values('A','a1',12);
    INSERT INTO test values('A','a2',3);
    INSERT INTO test values('A','a3',1);
    INSERT INTO test values('B','a1',10);
    INSERT INTO test values('B','a2',23);
    INSERT INTO test values('C','a3',45);
    commit;
    SELECT * FROM test;
    ID DES T
    A a1 12
    A a2 3
    A a3 1
    B a1 10
    B a2 23
    C a3 45
    select distinct i, A1, A2, A3
    from test c
    model
    ignore nav
    dimension by(c.id i,c.des d)
    measures(c.t t, 0 A1, 0 A2, 0 A3)
    rules(
    A1[any,any] = t[cv(i),d = 'a1'],
    A2[any,any] = t[cv(i),d = 'a2'],
    A3[any,any] = t[cv(i),d = 'a3']
    I A1 A2 A3
    C 0 0 45
    B 10 23 0
    A 12 3 1 Any advice is appreciated, thank you.

    Hi,
    You can do dynamic SQL in SQL*Plus, also.
    [Thid thread|http://forums.oracle.com/forums/thread.jspa?messageID=2744039&#2744039] shows how to pivot a table with a dynamic number of columns.

Maybe you are looking for

  • Login to portal from webdynpro application

    I want two input fields in my web dynpro application for userid pwd. after pressing the button i want to retrieve the information of that particular user like assigned Roles to the user. How can i do this?

  • Problem with automatic table of contents Level headings

    I am having trouble with the Table of contents in Adobe Indesign. When I create my automatic table of contents one of the Level headings that is supposed to appear under Chapter 1 instead appears under the Introduction heading. On the actual page whe

  • Passing values to BSP iview in Portal

    Hello, We have a BSP iview created in the portal. We would like to pass a parameter to the end of the url. for example: name of bsp iview: MDM_VEND_REQ start page is:  start.htm parameter: ?mode='create' The first two are fine as there are place hold

  • Oracle Workflow is Down in R12.1.3

    Dear Legends, I'm facing this issue very first time in Oracle Apps R12.1.3 64 bit Linux Environment. Navigation : SystemAdministrator ->Oracle Applications Manager -> workflow and i am seeing that all application components are down. Notification Mai

  • What is this K7N2-V?

    I can't find much information on it, nor can I find the online manual for it. I just want to know if it has the AGP/PCI lock, Vcore and multiplier adjustments. What difference does this board have compared to other K7N2 boards... Thanks!