How to "Performing an Action on Multiple Selected Records" using Struts-JSP

Hi all:
How to do "Performing an Action on Multiple Selected Records" through using Struts/JSP solution that is original MVC/UIX customizing example by Jheadstart.
I know how to reason by analogy through tutorial guide on
Model and Control layer of MVC , but for View layer that is torment to me !
have any idea ?
thanks a lot .

Ting Rung,
In the table in the JSP page you add a checkbox like this:
<td class="fixed">
<input type="checkbox" name="multiselect" value="<%=index%>"/>
</td>
This will render a checkbox in each row, with index number of that row as value.
When you submit the page the request contains the multiselect parameter when at least one row has the checkbox checked.
You can get the value of the multiselect parameter by calling sessionData.getRequestParameterValues("multiselect") in your action. The value is a string array containing the index numbers of the rows that have the checkboc checked.
Steven Davelaar,
JHeadstart Team.

Similar Messages

  • How to apply List box for multiple selection of rows  in ALV report ?

    Hi Exprots,
    1: How to apply List box for multiple selection of rows  in ALV report ?
    Thanking you.
    Subash

    hi,
    check the below program.
    REPORT zalv_dropdowns.
    *Type pools declarations for ALV
    TYPE-POOLS : slis.
    *data declarations for ALV container,ALV grid, Fieldcatalogues & layout
    DATA: g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout TYPE lvc_s_layo.*INTERNAL TABLE AND WA DECLARATIONS FOR t517 A table
    DATA: gt_outtab TYPE STANDARD TABLE OF t517a INITIAL SIZE 0,
          wa_outtab TYPE t517a.
    START-OF-SELECTION.*Call to ALV
      CALL SCREEN 600.*On this statement double click  it takes you to the screen painter SE51.
    *Create a Custom container and name it CCONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.
    PBO of the actual screen , Here we can give a title and customized menus
    Here we also call the subroutine for ALV output.
          MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      PERFORM alv_output.
    ENDMODULE.                    "pbo OUTPUT
          MODULE PAI INPUT                                              *
    MODULE pai INPUT.
    ENDMODULE.                    "pai INPUT
    *&      Form  BUILD_FIELDCAT
    FORM build_fieldcat.
    DATA ls_fcat TYPE lvc_s_fcat.
    *Build the field catalogue
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'T517A'
        CHANGING
          ct_fieldcat      = gt_fieldcat.
    To assign dropdown in the fieldcataogue
      LOOP AT gt_fieldcat INTO ls_fcat.   
    CASE ls_fcat-fieldname.
       WHEN 'SLART'.
    *is the first list box
            ls_fcat-drdn_hndl = '1'.
            ls_fcat-outputlen = 15.
            MODIFY gt_fieldcat FROM ls_fcat.
    is the second list box    
    WHEN 'ABART'.       
            ls_fcat-drdn_hndl = '2'.
            ls_fcat-outputlen = 15.
            MODIFY gt_fieldcat FROM ls_fcat.   
    ENDCASE.
      ENDLOOP.
    ENDFORM.                    "build_fieldcat
    *&      Form  ALV_OUTPUT
    FORM alv_output .*Create object for container
      CREATE OBJECT g_custom_container
             EXPORTING container_name = 'CCONT'.
    *create object for grid
      CREATE OBJECT g_grid
             EXPORTING i_parent = g_custom_container.
    Build fieldcat and set column
    *Assign a handle for the dropdown listbox.
      PERFORM build_fieldcat.
    *Build layout
      PERFORM build_layout.
    Define a drop down table.
      PERFORM dropdown_table.
    *fetch values from the T517A table
      SELECT * FROM t517a INTO TABLE gt_outtab.
    *Display ALV output
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
        CHANGING
          it_fieldcatalog = gt_fieldcat
          it_outtab       = gt_outtab.ENDFORM.                               "ALV_OUTPUT
    *&      Form  dropdown_table
          text
    -->  p1        text
    <--  p2        text
    FORM dropdown_table.*Declarations for drop down lists in ALV.
      DATA: lt_dropdown TYPE lvc_t_drop,
            ls_dropdown TYPE lvc_s_drop.
    First SLART listbox (handle '1').
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '01 Primary school'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '1'.
      ls_dropdown-value = '02 Lower Secondary'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '1'.
      ls_dropdown-value = '03 Upper Secondary'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '04 Professional School'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '05 College'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '06 University'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = '09 Other Establishment'.
      APPEND ls_dropdown TO lt_dropdown.* Second ABART listbox (handle '2').  ls_dropdown-handle = '2'.
      ls_dropdown-value = '10 Primary School certificate'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = '20 Lower secondary/Junior high'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '30 High school diploma(B-levels)'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = '31 Vocational'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '32 Matriculation'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '40 Specialist vocational certificate'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '50 College degree Level1'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '51 College degree Level2'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '52 Masters degree'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '60 Univ Degree level1'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '61 Bachelors degree'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '62 Masters degree'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '63 Licenciate'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '64 Doctors Degree Ph.D'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '89 None'.
      APPEND ls_dropdown TO lt_dropdown.  ls_dropdown-handle = '2'.
      ls_dropdown-value = '90 Unknown'.
      APPEND ls_dropdown TO lt_dropdown.*method to display the dropdown in ALV
      CALL METHOD g_grid->set_drop_down_table
        EXPORTING
          it_drop_down = lt_dropdown.ENDFORM.                               " dropdown_table
    *&      Form  build_layout
          text
    *layout for ALV output
    FORM build_layout .  gs_layout-cwidth_opt = 'X'.
      gs_layout-grid_title = 'ALV DROPDOWN LISTS'.
      gs_layout-no_toolbar = 'X'.ENDFORM.                    " build_layout
    endform.
    Edited by: S.r.v.r.Kumar on Jun 1, 2009 2:48 PM

  • How do I import or move multiple selected photos to an existing album in iPhoto 9.6? In previous versions I could select and drag multiple photos into an album. Now I can only move one photo at a time. Help!

    How do I import or move multiple selected photos to an existing album in iPhoto 9.6? In previous versions I could select and drag multiple photos into an album. Now I can only move one photo at a time. Help!

    Try this general troubleshooting procedure:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete the contents the following folder: User/Library/Containers/com.apple.iPhoto
    3 - reboot, launch iPhoto and try again.
    NOTE: For Mavericks and Yosemite,  go to your Home folder and use the View ➙ Show View Options menu to bring the this window:
    where you can check the Show Library Folder checkbox.

  • How can I get width that multiple selected items?

    How can I get width that multiple selected items? (Not grouped.)
    //---------- source code ----------
    var mm = 2.83464566929134 //unit conversion. (point->milimeter)
    var W = docRef.selection[0].width/mm;
    alert(W);
    //---------- source code ----------

    That's right Carlos
    @kimDino8,
    my script in Carlos link creates a green rectangle around the selected items. If you don't need this rectangle than you can remove this lines:
    var newRGBColor = new RGBColor();
    newRGBColor.red = 0;
    newRGBColor.green = 255;
    newRGBColor.blue = 0;
    and replace this:
    var aRectangle = aDoc.pathItems.rectangle(vBounds_Ob, vBounds_Li, vBounds_Re - vBounds_Li, vBounds_Ob - vBounds_Un);
    aRectangle.strokeColor = newRGBColor;
    aRectangle.strokeWidth= 2;
    aRectangle.filled = false;
    aRectangle.stroked = true;
    aDoc.selection = null;
    with this:
    var mmFactor = 2.83464567;
    alert("width = "+ (vBounds_Re - vBounds_Li)/mmFactor);
    alert("height = "+ (vBounds_Ob - vBounds_Un)/mmFactor);
    Further you only have to do: create a function for rounding of the result.

  • How to retrieve data from a multiple selected listbox?

    In order to get the data from a field, i use:
    String strName = request.getParameter("name");
    But what if the parameter name is a listbox and that listbox is enabled to receive multiple selection?
    How do i do then?
    Thanks

    java.lang.String[] getParameterValues(java.lang.String name)

  • How to create a table with multiple select on???

    Hi all,
            I am  new to webdynpro and my requirement is to create a  table with multiple selection on.I have to add abt 10 rows in the table but only 5 rows should be visible and moreover a verticalscroll should be available to view other rows.Can anybody explain me in detail how to do that.Please reply as if you are explaining  to a newcomer.Reply ASAP as i have to do it today.
                                                                           Thanxs

    Hi,
    1. Create a value node in your context name Table and set its cardinality to 0:n
    2. Create 2 value attributes within the Table node name value1 and value2
    3. Goto Outline view> Right click on TransparentUIContainer>Apply Template> Select Table>mark the node Table and it's attributes.
    you have created a table and binded its value to context
    Table UI properties
    4.Set Selection Mode to Multi
    5.Set Visible Row Count to 5
    6.ScrollableColCount to 5
    In your implemetaion, you can add values to table as follow:
    IPrivate<viewname>.ITableElement ele = wdContext.nodeTable().createTableElement();
    ele.setValue1(<value>);
    ele.setValue2(<value>);
    wdContext.nodeTable().addElement(ele);
    The above code will allow you to add elements to your table node.
    Regards,
    Murtuza

  • How to share one action to multiple UUT test?

    Hi,
    In fact, I don't know how to define the topic exactly.
    My request is like the following :
    For example, I have a signal generator and four UUTs.
    Signal Pattern 1 ON -> batch(4 UUT test...) -> Signal Pattern 1 OFF, Signal Pattern 2 ON -> Batch(4 UUT test...) ...so on...
    I got stuck how to put the action into the teststand and do once instead of 4 times.
    Something similar to the callback of  ProcessSetup, PreBatch, and PreUUTLoop,
    but I wonder if there is a way to call an action once within multiple UUTs in the MainSequence.
    Could someone give me some suggestion? Thanks a lot!
    Solved!
    Go to Solution.

    Hey William,
    You're probably going to want to use the "One Thread Only" option of a batch synchronization section to do this. It sounds like you're already using the Batch process model, so this should be fairly easy to implement. If it's a single step, you can go to the Synchronization tab of the step settings and change the Batch Synchronization setting. If it's multiple steps in a row, you could use the Enter Synchronized Section and Exit Synchronized Section modes of the Batch Synchronization step type.
    Also, we have an example that demonstrates this functionality. You can find it at <TestStand>\Examples\MultiUUT\BatchUUT.seq. If you look at the Set Chamber Temperature step, you will see that it is configured in this way.
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • How to perform TERMINATION action

    Hello experts....
    I am new to SAP... can anybody please let me know how to configure termination action and what type of infortype we will configure for Termination.Thanks in advance...........

    Hi,
    Follow the below mentuion steps:-
    1. Create an action say 'TM' at the img path mention below:-
    Personnel Management->Personnel Administration->Actions->Set up personnel actions
    2. Create action reasons also at the link below:-
    Personnel Management->Personnel Administration->Actions->Create reasons for personnel actions
    3. Add the termintaion action in the Action menu of your country:-
    Personnel Management->Personnel Administration->Actions->Change action menu
    4. Define infogroup for your termination action below:-
    Personnel Management->Personnel Administration->Actions->Define infogroups
    Usually, IT0001, IT0002, IT0014, IT0015, IT0041 are set up in the infogroup action. Also, get the requirements from your customer like which all infotype he will like to delimit.
    5. Most important is to set the Inactive status for the employee
    Go to table T529A and set the status as '0' in the employment field 'STAT2'.
    Thanks & Regards, Swapnil Mishra

  • How to get parameter and add it to hyperlink using struts tag?

    Hi everyone:
    There is a.jsp pass a parameter to b.jsp.How to get the parameter in b.jsp using struts Tag?I also want to add the parameter to a hyperlink in b.jsp.For example in b.jsp <html:link forward=.....>cxxxx</html:link>.How to add the parameter(get from a.jsp) to cXXXX in b.jsp?

    Try this:
    Copy A Request Parameter - You can create a new bean containing the value of a parameter included in this request. If no parameter of the specified name was included, a request time exception will be thrown - therefore, it is common to nest the use of this tag inside a <logic:present parameter="xxx"> tag to ensure that the parameter was really included. If there is the possibility that more than one parameter of the same name was included, specify the "multiple" attribute (and the resulting value bean will be an array of String values, instead of a single String).
    <bean:parameter id="name" name="name"/>
    And then just use <html:link> with paramId. No java code at all.

  • Is there any provision to view the selected record using SYS_REFCURSOR?

    hi friends ,
    I was using SQL Server . now i am shifting to Oracle . so we are changing the Stored Procedures in SQLServer to Oracle SP's. I have given the structure of procedure given below . If possible , i want to see the output of select statement in the TOAD editor . If any body knows please help me
    CREATE OR REPLACE PROCEDURE PS_AON
    P_STATUS OUT VARCHAR2,
    P_CUR OUT SYS_REFCURSOR
    AS
    BEGIN
    OPEN P_CUR FOR
              select colum1,column2,column3 from Table 1;
    EXCEPTION
                   WHEN OTHERS THEN
                   P_STATUS:=SQLERRM;
    END;
    This is one of the model of stored procedures i am using . And the editor i am using is TOAD 7.3.0 and oracle 9i. Is there any provision to view the selected records by running this procedure in TOAD editor
    thanks & regards

    (assuming you have relatively recent version of TOAD).
    Write a small block to call the procedure (or use Toad's 'execute procedure' option) as in the example below. Note the ':' in front of 'v_cur_out'. When you run the block, TOAD will prompt you for a value / datatype for 'v_cur_out'. Ignore the value, set the datatype to 'Cursor' and click OK. The resultset (if any) will be displayed in the Data Grid window below.
    DECLARE
       v_status VARCHAR2 (32767);
    BEGIN
       ps_aon (v_status, :v_cur_out);
       DBMS_OUTPUT.PUT_LINE ('v_status => ' || v_status);
    END;
    /

  • How to Perform an Action from an outside MouseListener.

    Hi to all,
    The MouseListener Object can be either inside the main applet class or outside it. I want to define the MouseListener object outside the applet class.
    My question is how can the MouseListener object perform the specified action on an mouse event, when it is outside the main applet class?

    By "outside" you mean it's a top-level class, as opposed to a nested class?
    An event handling class is just a class that performs certain required actions. It doesn't need to be an inner class.
    If you're asking how a top-level class can access another class's private data or methods...it can't. So the programmer is required to do the various things that are necessary to control and/or permit access, which one has to do in other cases where one class needs (or seems to need) another class's privates.

  • How to JOIN the results of multiple SELECT statements

    Hello,
    I currently have a table where each row represents a single census date for a given tag number, where each tag number can have multiple census dates and data which are represented by their own row in the table.
    I currently have 2 SELECT statements that select all tag numbers given a census date, and would like to combine those 2 queries so that the data is presented in a manner such that for each tag number, instead of obtaining 2 rows for each tag number, I would be presented with 1 row for each tag number consisting of three columns: tag_number, data1, and data2.
    Both of the requested dates are not necessarily present for all tag numbers, and in the event that only one date is present, the other column should contain null, but if both dates are not present for a given tag number, the tag number is omitted.
    The two queries I would like to JOIN are:
    SELECT a.tag_number, a.data AS data1
    FROM tab1 a
    WHERE
    a.census_date='11/21/2009'and
    SELECT b.tag_number, b.data AS data2
    FROM tab2 b
    WHERE
    b.census_date='11/24/2009'The table from which I am selecting the data looks like such:
    tag_number  census_date     data
        1       11/21/2009      10
        1       11/23/2009      11
        1       11/24/2009      12
        2       11/19/2009      13
        2       11/21/2009      14And the data that I would like to result looks like:
    tag_number  data1           data2
        1       10              12
        2       14              nullAny help would be greatly appreciated.
    Thank you in advance,
    -Justin
    Edited by: m8r-qbkka9 on Nov 24, 2009 4:17 PM

    Hi,
    This looks like a job for pivot
    SELECT       a.tag_number
    ,       MAX (CASE  WHEN a.census_date = TO_DATE ('11/21/2009'
                                                       'MM/DD/YYYY'
                   THEN a.data
                END
               )          AS data1
    ,       MAX (CASE  WHEN a.census_date = TO_DATE ('11/24/2009'
                                                       'MM/DD/YYYY'
                   THEN a.data
                END
               )          AS data2
    FROM      tab1    a
    WHERE       a.census_date  IN ( TO_DATE ( '11/21/2009'
                                      , 'MM/DD/YYYY'
                       , TO_DATE ( '11/21/2009'
                                      , 'MM/DD/YYYY'
    GROUP BY  a.tag_number
    ;Comparing DATEs to stirngs, like '11/24/2009', is simply asking for trouble.
    Always use a conversion function (like TO_DATE) or DATE literals instead.

  • How to perform click action on the notification received in windows phone 8.1 silverlight app?

    Hi,
    I am developing a windows phone 8.1 silverlight app , I added push notification service to my app and I am able to receive notifications . 
    My question is when the app is not opened and the notification is received , if the user clicks on the notification it is directly taking to the app ,
    but I want to redirect it to a specific page in my app How is it possible?
    Any help..
    Thanks..
    Suresh.M

    Thanks for your information
    but where to write the rootframe.urimapper  , I think it is in app.xaml.cs , If I write urimapper , how do I know I am navigating from notificaition?
    Suresh.M
    Why you need to know it is from notification? If you must need to know this, try to check deep link
    Best Regards,
    Please remember to mark the replies as answers if they help

  • How to perform loop action in ODI

    hi all,
    i want to implement a function which fetches data from 3 tables and then inserts into one table
    but the problem is there with the loop.
    the function contains a loop and i dont know how to implement a loop in odi.
    anyone can give a solution.
    regards,
    prateek.

    hi guru,
    yes i have fk between the tables but i am not able to understand that how to apply the exit condition and how to tell the interface that if the exit condition is not satisfied then again loop back.
    can you please explain this in detail.
    thanks and regards,
    prateek sharma.
    Edited by: user11116379 on May 21, 2009 5:32 AM

  • How to perform this action..

    am having a condition in where clause like :-
    "and decode(si1.common_cat_id,4,si1.site_id,1, si1.site_id) = td.site_id(+)"
    now my query is running with condition but not giving the desired results..
    My requirement is like :-
    if si1.common_cat id = 4/1 then si1.site_id = td.site_id(+) else this condition sould not make any diffrence to my query..
    Any suggestions??
    Thanks
    Kapil

    OK. Great.
    :"else this condition should not make any diffrence to my query"?
    So, you have two queries.
    one query has following conditions (in addition to other conditions):
    AND si1.common_cat id IN (4,1)
    AND si1.site_id = td.site_id(+)
    the second query does not have these two conditions.
    Is this what you mean by "else this condition should not make any diffrence to my query"?
    null

Maybe you are looking for