Get value from Table/Recordset Cell into a JSP variable

Can anyone please help with this ?...
I need to get a cell value from a selected row of a table into a variable to pass to a java bean.
1 - The dynamic table is populated by a recordset named "rs" and has a submit button for each row .
2 - The user clicks on the corresponding button to select the row.
3 - The recordset retrieved the ID for that row in the query, but does not display it in the table.
I have tried :
<% String ID = rs.getString("bookid");%>
<% Library.bookConfirm(ID);%>
But this fails saying that it "cannot resolve variable rs..."
Yet the recordset populates correctly and its name is "rs"
Is there another way to do this perhaps ?... ie: put the id in a column of the table and get the cell value ?...
What would be the syntax to get the ID cell value of that selected row on the button click ?...
Your feed back would be greatly appreciated.
Thank you.

Create a new rs
ResultSet rs1 = statement.executeQuery(query);
and use getstring to access the individual cell.

Similar Messages

  • Get value from table control

    Hi Guys,
    FYI, im having a table control with field Plant and Material. I have defaulted the <b>std search help</b> to field <u>Material</u> at the screen painter. Meaning system will call up the search help for Material once i press F4.
    Since the search help for field Material is a collective search help, and there is a <u>Plant</u> field available for Material filtering. Thus i may need to get the Plant's value from of same row of the  table control to Populate into the Material's search help.
    I have already tried to create a new module under the LOOP...ENDLOOP at PAI's flow logic. And try to use parameter id to set the value for plant, purpose is to populate it to Material's search help when i click F4 on material field. The problem is the new module that i coded under LOOP...ENDLOOP will never trigger when i click F4. Because there is NO event to trigger my module.
    Other than the above, i tried to code it under POV. But it doesn't work as well, because there is more than 1 record under table control and i can not determine the during runtime which row of F4 for material being click.
    Please comment on this above on how to solve the problem.
    Thanks in advance.

    Hi,
          You can call standard collective search help [say for Eg:<b>MAT1</b>] through Process on value-request event and set the paramenter id of Plant field before calling the funtion module <b>'HELP_START'</b>.Then we can get the materials specific to the PLANT in the corresponding row of the TABLE CONTROL.
    To get which row of the table control is clicked use <b>Get Cursor Line</b> Statement as i mentioned below.
    Flow logic:
    PROCESS ON VALUE-REQUEST.
    FIELD x_marc-matnr MODULE mat_shelp.
    Module definition:
    MODULE mat_shelp INPUT.
      DATA:v_help_info LIKE help_info,n TYPE i,
       it_dyselect LIKE TABLE OF dselc WITH HEADER LINE,
        it_dyvaltab LIKE TABLE OF dval WITH HEADER LINE.
      REFRESH it_dyselect.
      it_dyselect-fldname = 'MANDT'.
      it_dyselect-dyfldname = 'SY-MANDT'.
      APPEND it_dyselect.
      it_dyselect-fldname = 'MATNR'.
      it_dyselect-dyfldname = 'X_MARC-MATNR'.
      APPEND it_dyselect.
      v_help_info-call     =     'M'.
      v_help_info-object     =     'F'.
      v_help_info-program     =      sy-repid.    "'ZVIG_MOD_TABLE_CONTROL_1'.
      v_help_info-dynpro     =     sy-dynnr.    "'9001'.
    v_help_info-tabname     =      'MARC'.
      v_help_info-fieldname = 'MATNR'.
      v_help_info-fieldtype     =  'CHAR'.
      v_help_info-keyword   =   'MATNR'.
      v_help_info-fieldlng = 18.
      v_help_info-fldvalue = ''.
      v_help_info-mcobj = 'MAT1'.
      v_help_info-spras = 'E'.
      v_help_info-menufunct = 'HC'.
      v_help_info-title =     'SAP'.
      v_help_info-dynprofld = 'X_MARC-MATNR'.     <b>----
    > Give ur screen field name</b>
      v_help_info-tcode     =      sy-tcode.       "'ZTC1'.
      v_help_info-pfkey     =      'MEN'.
      v_help_info-docuid     =     'FE'.
      v_help_info-pov     =     'N'.
    v_help_info-curow     =   '2'.
    v_help_info-cucol     =  '1'.
      v_help_info-dynpprog = sy-repid.       " ZVIG_MOD_TABLE_CONTROL_1
      v_help_info-stepl     =   '1'.
      v_help_info-selectart = 'A'.
      GET CURSOR LINE n.
      READ TABLE it_marc INTO x_marc INDEX n.
      SET PARAMETER ID 'WRK' FIELD  X_MARC-WERKS .
      CALL FUNCTION 'HELP_START'
        EXPORTING
          help_infos         = v_help_info
        TABLES
          dynpselect         = it_dyselect
          dynpvaluetab       = it_dyvaltab           .
    ENDMODULE.                 " mat_shelp  INPUT

  • Get value from table column

    Hi,
    I am new to OAF, I am trying to get the value from the table in order to make validation. I have the following PG:
    SearchResultsTableRN
    itemRow
    DetailsCell
    DetailsTableLayout
    ShortDescRow
    ShortDescCell
    ShortDesc
    LongDescRow
    LongDescCell
    LongDesc
    AttributesRow
    AttributesCell
    AttributesTableLayout
    Attributes1Row
    Attribute11Cell
    ect...
    Can anyone help me please in how to go into the table --> row --> column to retrieve the value from a specific column?
    If their is a document or example that can help I will appreciate it. Since I tried searching in devguide and didn't find any results.
    Note: I am extending the controller and reached till the following code:
    public void processFormRequest(OAPageContext oapageContext, OAWebBean webBean){
    super.processFormRequest(oapageContext, webBean);
    String event = oapageContext.getParameter("ShortDescRow");
    OATableBean advtable = (OATableBean)webBean.findChildRecursive("SearchResultsTableRN");
    OARowBean rowtbl = (OARowBean)advtable.findChildRecursive("DetailsCell");
    String message = "test:"+event+"|"+advtable+"|"+"|"+"|"+"|";
    throw new OAException(message, OAException.INFORMATION);
    Thanks and Regards
    Patrick

    Patrick,
    My first advice would be go through OAF guide and do tutorial examples, for such basic details.
    If ur talking about tablelayout region
    u can use pageContext.getParameter(<Item id of UIX bean whose value u want>);
    If you are talking about table
    You can Iterate through the VO based on primary key ...on which the table is based, and retrive the corresponding Vo attribute value.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get data from table to pass into alvgrid function module

    i want to get some data from below table to pass into function module of alvgrid
    how can i get data please help.
    thanks in advanced.
    form get_data.
    select * into corresponding fields of table itab
             from  J_1IEXCHDR
                     inner join  J_1IEXCDTL
                        on  J_1IEXCDTLlifnr =  J_1IEXCHDRlifnr
                     where  J_1IEXCHDr~status = 'P'.
       append itab.
    endform.

    Pass your final table(internal table which you want to display) along with fieldcatalog to FM reuse_alv_grid_display.:\
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = i_repid
       IT_SORT               = gt_sort
          it_fieldcat        = lt_fieldcat[]
        TABLES
          t_outtab           = lt_final
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.

  • Getting values From Table in method execute??

    Hi,
    I'm using JDEV 10.1.2 and UIX, i have a table with a singleSelection component.
    I'm trying to send the values of the selected row to an action, in the primaryClientAction property of the submitButton i'm adding an action parameter with the key value = CveConcept and the Value &{bindings.SrvCConceptosView1.CveConcepto}, in the execute method i'm getting the parameters using request.getParameter("CveConcepto"). The problem is that it seems that the value is saved in cache or something like that because when i select a diferent row, the value of the last row is sended, only by clicking two times the submitButton the correct selected parameter is sended.
    Am i doing this the correct way?
    Is there a different way to send table values to the execute method from a submitButton?
    I hope some one can help.
    Thank you.

    Wouldn't a more direct approach like so help out ? :-
    Once you have the table with the single selection component enabled. Within the execute method of your managed bean ( or any other method you refer to in the action tag ) , get hold of the view Object and simply doing a getCurrentRow , would get hold of the row with all the required attribute details.....
    Or am i understanding your requirement differently ?
    Cheers
    K

  • Get value from table attribute.

    Hello,
    I'm trying to get the value of an attribute from a table in my page. Shouldn't the expression be as such: "#{bindings.TestfilesView11.collectionModel.Filename.inputValue}"?
    This didn't work. I thought maybe it's because the row is selected, so the expression should point to that row. So i tried "rowIterator", "currentRow" instead, and still nothing worked.
    Thanks,
    Mohamed

    >
    Can i do this for the button while viewing a table and not a form?
    Without the use of a bean (with expression builder)...
    >
    Yes, you can do it,
    If the button is inside the table, you can use this EL
    #{row.bindings.AttributeName.inputValue eq null}If the button is outside the table, then go to the page definition, click the add binding and select attributeValues and then select the data source and the desired attribute. then you can use this attribute in EL like #{bindings.AttributeName.inputValue eq null}.

  • Get value from table record and set Disabled property...

    Hi! I have table in my JSPX page. I search for records and then press on one of the records with right click, see: http://my.jetscreenshot.com/2677/20120203-fas1-30kb
    I set disabled property like this of my commandMenuItem:
    #{row.GenResGrupa != 'true'}But as You can see from my picture above, the disabled property do not work. Where I am wrong with my code:
    <af:commandMenuItem text="#{sampleBundle.pases}"
                                                  id="commandMenuItem1"
                                                  action="adfMenu_pasesDati"
                                                  actionListener="#{bindings.setCurrentRowWithKeyValue.execute}"
                                                  disabled="#{row.GenResGrupa != 'true'}"/> Please correct me! If You need some other information, please let me know.
    Best regards, Debuger!

    Dear fedor! Popup is in facet contextMenu. contentDelivery="lazyUncached" for my popup:
    <af:popup id="p1" contentDelivery="lazyUncached">
                            <af:menu text="menu 1" id="menu1">
                              <af:commandMenuItem text="#{sampleBundle.pases}"
                                                  id="commandMenuItem1"
                                                  action="adfMenu_pasesDati"
                                                  actionListener="#{bindings.setCurrentRowWithKeyValue.execute}"
                                                  disabled="#{row.bindings.GenResGrupa.inputValue != 'true'}"/>
                            </af:menu>
                          </af:popup>In my pageDef I have this code:
    <bindings>
        <tree IterBinding="LVAIMeklesanaIterator" id="LVAIMeklesana">
          <nodeDefinition DefName="kokaugi.model.view.LVAIMeklesana"
                          Name="LVAIMeklesana0">
            <AttrNames>
              <Item Value="Accename"/>
              <Item Value="LvaiKolekcijaPk"/>
              <Item Value="Accenumb"/>
              <Item Value="AvsGrupa"/>
              <Item Value="Cropname"/>
              <Item Value="EkspGrupa"/>
              <Item Value="GenResGrupa"/>
              <Item Value="Genus"/>
              <Item Value="Species"/>
              <Item Value="Sinonims"/>
            </AttrNames>
          </nodeDefinition>
        </tree>
        <action IterBinding="LVAIKolekcijaDatiIterator"
                id="setCurrentRowWithKeyValue"
                InstanceName="KokaugiModuleDataControl.LVAIKolekcijaDati"
                DataControl="KokaugiModuleDataControl" RequiresUpdateModel="false"
                Action="setCurrentRowWithKeyValue">
          <NamedData NDName="rowKey" NDValue="#{row.LvaiKolekcijaPk}"
                     NDType="java.lang.String"/>
        </action>
      </bindings>And disabled property is like this:
    disabled="#{row.bindings.GenResGrupa.inputValue != 'true'}"But it is still do not working. I am wrong somewhere? Maybe the only way to correct my problem is like Hohn said?
    Best regards, Debuger!

  • Extracting a value from the j_security_check servlet into a JSP page

    Hi Folks...
    I have a problem as follows:
    I log in into the web app, via my login.jsp page. Below is the code for the form that accepts the login information
    <form method="POST" action="j_security_check">  
    <table cellpadding="0" cellspacing="0" border="0">  
      <tr>  
        <td align="right">Username: </td>  
        <td><input type="text" name="j_username"></td>  
      </tr>  
      <tr>  
        <td align="right">Password: </td>  
        <td><input type="password" name="j_password"></td>  
      </tr>  
      <tr>  
        <td></td>  
        <td><input type="submit" value="Login"></td>  
      </tr>  
    </table>  
    </form>Login is sucessful and I am brought to the 'studentstub.jsp' page. I would like the user name to appear on the 'studentstub.jsp' page. I used the following code in the 'studentstub.jsp' page :
    <td><%= request.getParameter("j_username")%></td>  but all I am getting is a null. The 'j_security_check' servlet is not exactly part of my package, but the glassfish app server. Is there anything wrong in the way I am extracting the information from 'j_security_check' ? Hope someone can advise, thanks.

    Hi Folks..
    I managed to get a reply from another forum and the suggested solution works. I am going to share it with everyone here.
    I repalced this line of code:
    <td><%= request.getParameter("j_username")%></td>with this:
    <td><%= request.getRemoteUser()%></td>The 'getRemoteUser' method from HttpServletRequest returns the name of the authenticated user. I hope this information will be helpful to those caught in a simillar problem. Thanks.

  • Get value from Direct Database Request

    Hi Experts,
    I have report based on Direct Database Request which returns one row. I have to use value from this report in other one.
    So, I have to get value from query and set into some variable but I don't know there is any way to do it.
    Thanks in advance for any suggestion
    Regards,
    Esk

    Thank you for your reply, but I don't want to use variable in Direct Database Request in clausal 'WHERE' or 'IN'.
    I want value which returns query. For example if my Direct Database Request is : 'Select ID from table1', then
    I wand this 'ID' in variable to use it in other report.
    regards
    Esk
    Edited by: Eskarina on 21-may-2012 2:16

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • POPUP FM to get values from a table control?

    I know about the FM POPUP_GET_VALUES to get one or more values from a popup dialog box.  I would like to find a similar FM that allows getting values from a table control or something that allows entry of multiple lines of values.  Is there such a thing, or do I need to write my own?

    it depends on what values you want to enter, better write your own to have a control on the function.

  • Select values from table%ROWTYPE variable into a cursor

    I have a stored procedure which has an OUT parameter of table1%ROWTYPE.
    In future we might have to add more OUT parameters of table2%ROWTYPE etc. But at any point of time only one will have values.
    So instead of having table%ROWTYPE as OUT parameter, can I send these single row ( with variable values) in a cursor, so that declaration part atleast will not change.
    Is it possible to select values from table%ROWTYPE variable into a cursor.
    cursorOUT IS
    SELECT * FROM varREC;
    where varREC is table.ROWTYPE variable.
    Or which is the better solution in this situation.
    Thanks.

    SQL> var a refcursor
    SQL> declare
      2   bb emp%ROWTYPE;
      3  begin
      4   select * into bb from emp where rownum = 1;
      5   open :a for select bb.ename ename, bb.empno empno from dual;
      6  end;
      7  /
    PL/SQL procedure successfully completed.
    SQL> print a
    ENAME                                 EMPNO
    SMITH                                  7369Rgds.

  • Deleting the values from table control

    HI,
    I need to remove the selected line from the Table control on my screen.
    The point is that the Internal table does not have any records,.
    for example in the Customer Create screen,
    while entering the bank details we will enter it in a tbale contraol.
    but the records doesnt exist in the database. but the record gets deleted from the table control only if we press delete button.
    please guide me.
    please note : I want to delete the record from Table Control on the screen and I dont have any corresponding database records..
    regards

    Hi..
    The solution to your problem - deleting values from table control.
    Here: it_wizard is the internal table which is holding the value of table control.
             wa_wizard is the work are of the internal table it_wizard.
             it_delete is the internal table which holds the deleted record of table control.
             wa_delete is the work area of the internal table it_delete
    Also here the field ZSEL is the character field which is used to select the entire record in the table control.
    LOOP AT it_wizard into wa_wizard WHERE zsel = 'X'.
           MOVE-CORRESPONDING wa_wizard TO wa_delete.
           APPEND wa_delete TO it_delete.
           delete table it_wizard from wa_wizard.
    DELETE  FROM zfin_goods WHERE ZFG = WA_delete-ZFG.
    ENDLOOP
    if sy-subrc eq 0.
    Message 'Delete Successful' type 'S'.
    endif.
    The above code will delete the record from both the table control.internal table and the database table.
    I think this will help you to great extent.
    Ward regards,
    Bhuvaneswari
    Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:39 AM

  • Getting values from a datagrid to an ArrayCollection

    Hi, I have a drag and dropable datagrid. I fill it with rows of data from another datagrid. Finally, my application demands savings the data from the datagrid into an array collection along with the index of each row. How do i get values from a datagrid into an arrayCollection variable? Please help me..!

    Whatever is dropped into the DataGrid automatically goes into its dataProvider property, typically an ArrayCollection. Just access the data grid's dataProvider property to see the values.

Maybe you are looking for

  • Can someone explain to me what the history state slider does?

    Hi everyone! Why use the slider when I can easily click a previous state from the list in the history panel? Does the slider have some extra function that I may have overlooked? Thanks for your help, It's been bugging me for ages. Kelly (using Photos

  • Java is not coming up after deploying Cryptographic toolkit 1.4

    Hi, when i open the keystore service in visualadministrator, i got following issue. Java.lang.NoClassDefFoundError.iaik/security/provider/IAIK IAIK security library not found after searching in SDN i got the following link : http://help.sap.com/saphe

  • Edit Default User Killed Leopard Default User folder completely disapeared

    I was trying to create a custom default user for network users to login to because I was learning how to set up a Mac for use as a campus public PC. We do not have a Mac server but do have a Novell server set as Open directory. I was the first to fig

  • Office365 - Move Mailbox and Export to PST

    Hi Everyone So we have moved all our Mailboxes to Office365 and I am in the process of setting up our service desk checklists etc. One issue that i have came across is that it is not possible to directly export mailboxes from Exchange Online to PST.

  • Dust spot removal iphoto08

    Hi Can anyone tell me if they are having the same problem as me ? In iphoto select edit, the picture in question has a few dust spots at the edge , im trying to remove them using the retouch tool, it cannot be done. the retouch tool workes in such a