How do I get the values from a selected row.

I am using JDeveloper 9.0.5. On my page, I have placed a button within a table. The button has been assigned an event. The event is within my Action class. This class implements DataAction and has overriden the
processComponentEvents(DataActionContext actionContext);
method.
Question: While I am within the processComponentEvents method, is it possible to obtain the values of selected row?

Good Morning Jeffery,
First off thanks for your clear explanation. I have a few related questions as noted from your response:
There are two ways to communicate the desired model row between the UIX view and the struts controller. One way is to use the singleSelection component in your table and put your buttons in the singleSelection's contents.
When the user selects the radio button for a particular row and then clicks on one the buttons, a built in event handler in UIX will set the current row in the model to be the user selected row. Therefore, your Struts action can operate on the currently selected model row.
When you drop a UIX table from the data control palette it is automatically set up in this way (with a single selection).
Ok, Lets say that i've set everything up as you described. Not lets say that the button was pressed and I hit the overriddenprotected void processComponentEvents(DataActionContext actionContext) throws IOException, ServletException ;
When I look at the request object, I do not see the values. How do I get access to the rowkey at this point?
Some people, however, want to actually render buttons in their table rows, and have those buttons initiate an action on their row. If you are doing this, then you need to pass the row id to your struts action as a parameter, which means that you need to know the row id when you are rendering a button for a given row. There is an EL expression that will return the row-id for the current row, it is:
${uix.current.rowKeyStr}
which is not so obvious or well documented in the preview release (sorry) but should be for the production release.
A generic code snippet would go a long way to shedding some light on that. I guess I am use to using JDeveloper 9.0.3. It seems,"to me", that JDev 9.0.5 has put a completely new twist on things. I find myself wondering when I can use the 9.0.3 syntax and when
should not. If your team has any short source toys around which demonstrated using rowkeys, or accessing the internal parts of the
struts controller, I would find that invaluable. It dose not matter if this information is documented.
Thank you

Similar Messages

  • Get the value from a selected row in a table

    Hi all,
    My table contains a tree structure.
    When I select a single row, I need to get the value of a particular column.
    I created an action on the leadSelect of the table and gave the following code:
    public void onActionleadValue(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionleadValue(ServerEvent)
        String strLeadValue = wdContext.nodeAttribute_View_Out().currentAttribute_View_OutElement().getAttributeAsText("<MyModelAttributename>");
        wdComponentAPI.getMessageManager().reportSuccess("selected lead value "+strLeadValue);
        wdContext.currentContextElement().setLeadselectedvalue(strLeadValue);
        //@@end
    My Bapi returns me 6 records. and when I click on any row its always pointing to the last record value.
    What could be the problem?
    Thanks
    Anjana

    Hi Anjana,
    Try this.
    try
         IWDMessageManager msg = wdComponentAPI.getMessageManager();
         int leadselect = wdContext.nodeSChild1().getLeadSelection();
          for(int i=0;i<wdContext.nodeSChild1().size();i++)
              if(leadselect == i)
              //Displaying output in diff table
    //           IPublicTestComp.ITableNodeElement tabelm = wdContext.createTableNodeElement();
    //           tabelm.setAttribute1(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute1());
    //           tabelm.setAttribute2(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute2());
    //           tabelm.setAttribute3(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute3());
    //           wdContext.nodeTableNode().addElement(tabelm);
              String att1 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute1();
              String att2 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute2();
              String att3 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute3();
                     msg.reportSuccess("Row ("i") : "att1"====="att2"======"+att3);
    } catch (WDDynamicRFCExecuteException e) {
         wdComponentAPI.getMessageManager().reportException("Message : "+ e.getMessage(),true);
    Regards,
    Mithu

  • How we can get the values  from one screen to another screen?

    hi guru's.
         how we can get the values  from one screen to another screen?
              we get values where cusor is placed but in my requirement i want to get to field values from one screen to another screen.
    regards.
      satheesh.

    Just think of dynpros as windows into the global memory of your program... so if you want the value of a field on dynpro 1234 to appear on dynpro 2345, then just pop the value into a global variable (i.e. one defined in your top include), and you will be able to see it in your second dynpro (assuming you make the field formats etc the same on both screens!).

  • How do I get the values from a form?

    How do I get the values from a form?

    You can try using request method..
    request.getParameter("yourFormInputName");
    Try this.

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • Please, How do i get the values from a h:selectManyCheckbox ?

    How do i get the values (selected or not) of a <h:selectManyCheckbox> tag and show them .For instance
    i have the folowing options :
    <h:selectManyCheckbox
                           id="cartas"
                       layout="pageDirection"
                        value="#{store.cartas}">
          <f:selectItems
                        value="#{cartas}"/>
        </h:selectManyCheckbox>
        <h:message styleClass="validationMessage" for="newsletters"/>with my faces-config.xml:
    <managed-bean>
        <description></description>
        <managed-bean-name>cartas</managed-bean-name>
        <managed-bean-class>java.util.ArrayList</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
        <list-entries>
          <value-class>javax.faces.model.SelectItem</value-class>
          <value>#{cartas0}</value>
          <value>#{cartas1}</value>
          <value>#{cartas2}</value>
          <value>#{cartas3}</value>
        </list-entries>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas0</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>Semanal</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>200</value>
        </managed-property>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas1</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>As bruxas</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>201</value>
        </managed-property>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas2</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>Exercise</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>202</value>
        </managed-property>
      </managed-bean>
      <managed-bean>
        <managed-bean-name>cartas3</managed-bean-name>
        <managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>
        <managed-property>
          <property-name>label</property-name>
          <value>Gusman Park</value>
        </managed-property>
        <managed-property>
          <property-name>value</property-name>
          <value>203</value>
        </managed-property>
      </managed-bean>Thanks for the atention!! All the best!!

    Hi,
    In your backing bean you will need to add a new variable to bind your control to, I think this variable needs to be of teh "HtmlSelectManyCheckbox" type. The on your jsp page you can add binding="#{myBean.myVariable}".
    When you want to get the values of the selectMany in your backing bean, you can call the getSelectedValues() function on your HtmlSelectManyCheckbox variable.
    in backing bean:
    private HtmlSelectManyCheckbox hsmc;
    public HtmlSelectManyCheckbox getHsmc(){
        return hsmc;
    public void setHsmc(HtmlSelectManyCheckbox hsmc){
        this.hsmc = hsmc;
    public void someFunction(){
       Object[] obs = hsmc.getSelectedValues();
    }On jsp page:
    <h:selectManyCheckbox
                           id="cartas"
                       layout="pageDirection"
                        value="#{store.cartas}"
                         binding="#(myBean.hsmc}">
          <f:selectItems
                        value="#{cartas}"/>
        </h:selectManyCheckbox>

  • How can we get the value from the af:selectInpuText component

    Hi,
    I have to get the value from af:selectInputText component when we click on af:selectInputText mirror icon.
    Edited by: durga on Aug 17, 2009 1:59 AM

    That was not what I was looking for. Because it would give null as value in my scenario. But I have solved that problem by passing the value of element in href. as window.open('www.sun.com?text='+document.getElementByID('req').value,'Blank',standards);
    Thanks for your comment.

  • How do you get the value of a selected list item?

    I have a drop-down list that the user can choose from. How do I get the value of what they selected? I thought I could do this by using the NAME_IN function, but I'm getting FRM-40105 Unable to resolve reference to item X. I don't know what I'm doing wrong.
    Thanks!

    Hi,
    You can use an WHEN-LIST-CHANGED trigger, attached to the list-item itself. And, in this trigger, you can use the name of the item to refer its value.
    For example:
    :block_name.list_item_name
    John

  • How can we get the values from the view?

    Hi All,
    my scenario is i have two fields in my view .one is parameter.and another on is select-options.how can i get the user entered values into my selection screen.?
    for the select options i get the values into field-symbol.for parameter i get the value using get_attribute.
    can i use like this in select statement.
    WHERE SERVICE_ID  = ZSD_DD_AUFNRS
                       AND CRE_DT IN <FS_DATE>.
    Regards,
    Ravi.

    Hi Sravan,
    when i am using the below code to generate self defined functions i m getting a error .
    *Generate an object for self defined functions
      DATA: lo_self_functions TYPE REF TO if_salv_wd_function_settings,
    *Generate an object for button 'Confirm'
           lr_button TYPE REF TO cl_salv_wd_fe_button,
           lo_self_function TYPE REF TO cl_salv_wd_function,
                  l_text type string.
    *Set Self-defined functions
    *'Confirm' Button
      lo_self_functions ?= l_value..
      lo_self_function = lo_self_functions->create_function( 'CONFIRM'  ).
      CREATE OBJECT lr_button.
      CLEAR l_text.
      l_text = 'Confirm'.
      lr_button->set_text( l_text ).
      lr_button->set_image_source( '' ).
      lr_button->set_image_first( 'X' ).
      lo_self_function->set_editor( lr_button ).
    Error when processing your request
    What has happened?
    The URL http://cgslsvr3.cgsl.com:8020/sap/bc/webdynpro/sap/zsdr_cash_work_list/ was not called due to an error.
    Note
    The following error text was processed in the system CGD : WebDynpro Exception: IDs Can Only Contain Characters of Syntactical Character Set
    The error occurred on the application server cgslsvr3_CGD_20 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: RAISE of program CX_WD_GENERAL=================CP
    Method: CONSTRUCTOR of program CL_WDR_VIEW_ELEMENT===========CP
    Method: CONSTRUCTOR of program CL_WD_TOOLBAR_BUTTON==========CP
    Method: NEW_TOOLBAR_BUTTON of program CL_WD_TOOLBAR_BUTTON==========CP
    Method: IF_SALV_WD_COMP_TABLE_UI~CREATE_TOOLBAR_ITEM of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~CREATE_TOOLBAR_ITEMS of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE_TOOLBAR_ITEMS of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE_TOOLBAR of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_COMP_TABLE_UI~UPDATE of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    Method: IF_SALV_WD_VIEW~MODIFY of program CL_SALV_WD_C_TABLE_V_TABLE====CP
    What can I do?
    If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system CGD in transaction ST22.
    If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server cgslsvr3_CGD_20 in transaction SM21.
    If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server cgslsvr3_CGD_20 . In some situations, you may also need to analyze the trace files of other work processes.
    If you do not yet have a user ID, contact your system administrator.
    Error code: ICF-IE-http -c: 110 -u: CT-0024 -l: E -s: CGD -i: cgslsvr3_CGD_20 -w: 0 -d: 20080414 -t: 105835 -v: RABAX_STATE -e: UNCAUGHT_EXCEPTION
    HTTP 500 - Internal Server Error
    Your SAP Internet Communication Framework Team
    How can i resolve it?
    Regards,
    Ravi

  • How can i get the value from a HTML Form

    hi,
    I am using HTML form (logfrm). there are userId field,password field, submit button,reset button, and a link.
    when i click on the link, it should fetch the value of userid.
    How it is possible?
    AE

    use jsp:
    which lets you embed java statments in your html -so you when you click on the link you can use request.getParameter("userID") to get the userid.
    Ideally with html forms use a combination of jsp and java beans, where the fields in the form are also fields in your java bean, which you can access through setters and getters.
    google for some jsp tutorials.

  • How do I Get the value from a mouse click - on a waveform graph?

    If I have made a plot into a Waveform Graph and later want to do a zoom of my data
    (Not zoom into the Waveform Graph, but regenerate the data). How do I read the mouse
    coordinate if I click on the graph window. I know how to put up the horiz and vert
    cursors but don't know how to just read the mouse click. I would really like to
    follow the windows standard that identifys a rectangle by clicking and draging and then
    be able to read the corners of the rectangle. Thanks, Rick
    PS: Using Labview 6i

    I would recommend to 'translate' your graph in a picture and dislay it in a picture control (see picture examples in LV6).
    Once you did it, pictures have an extremely useful property called Mouse that returns the mouse coordinates and click events when you place the cursor on the picture.
    By this you can re-arrange the graph on picture appearance.
    There are also other methods such as using a Window's API that returns the mouse position referred to the whole screen window, but I believe this would be much more difficult to implement.
    Let me know if this was clear and if you need an example vi.
    Good luck,
    Alberto

  • ListView + MVVM: How do I get the value of a selected cell?

    Hi,
    I love programming WPF using MVVM, but sometimes easy looking problems lead to unbearable suffering.
    Here is my problem: I have a simple list view with about a couple of columns. All I want to do is to copy the cell content to clipboard, when the user right-clicks on a cell.
    <ListView Grid.Row="0" ItemsSource="{Binding Articles}" SelectedItem="{Binding SelectedArticle}" SelectionMode="Single">
    <ListView.View>
    <GridView>
    <GridView.Columns>
    <GridViewColumn Header="ID" Width="70" DisplayMemberBinding="{Binding Path=ID, Mode=OneWay}" />
    <GridViewColumn Header="Name" Width="150" DisplayMemberBinding="{Binding Path=Name, Mode=OneWay}"/>
    <GridViewColumn Header="Price" Width="100" DisplayMemberBinding="{Binding Path=Price, Mode=OneWay}"/>
    <GridViewColumn Header="Description" Width="70" DisplayMemberBinding="{Binding Path=Description, Mode=OneWay}"/>
    </GridView.Columns>
    </GridView>
    </ListView.View>
    </ListView>
    Without MVVM I probably would have used the some Click-Event and extract the info from the event args. But of course I don't want to break the MVVM pattern.
    But if I use some kind of event binding I cannot find a way to retrieve event args or the sender object:
    <i:EventTrigger EventName="PreviewMouseRightButtonDown">
    <i:InvokeCommandAction Command="{Binding CopyCellValueToClipCommand}"/>
    </i:EventTrigger>
    Using this trigger I can react to the desired event, but how can I retrieve the cell value?
    I really hope you guys have a clue.
    Thanks for your help,
    Michael

    I'm not so sure about listview, I rarely use them for more complicated requirements.
    I would use a datagrid.
    You can bind a cellinfo:
    http://stackoverflow.com/questions/20080130/how-to-bind-currentcell-in-wpf-datagrid-using-mvvm-pattern
    <DataGrid AutoGenerateColumns="True"
    SelectionUnit="Cell"
    SelectionMode="Single"
    Height="250" Width="525"
    ItemsSource="{Binding Results}"
    CurrentCell="{Binding CellInfo, Mode=OneWayToSource}"/>
    and
    private DataGridCellInfo _cellInfo;
    public DataGridCellInfo CellInfo
    get { return _cellInfo; }
    set
    _cellInfo = value;
    OnPropertyChanged("CellInfo");
    MessageBox.Show(string.Format("Column: {0}",
    _cellInfo.Column.DisplayIndex != null ? _cellInfo.Column.DisplayIndex.ToString() : "Index out of range!"));
    You can use index and bind selecteditem or get contents of cell:
    public DataGridCell GetDataGridCell(DataGridCellInfo cellInfo)
    var cellContent = cellInfo.Column.GetCellContent(cellInfo.Item);
    if (cellContent != null)
    return (DataGridCell) cellContent.Parent;
    return null;
    Hope that helps.
    Recent Technet articles:
    Property List Editing ;  
    Dynamic XAML

  • How to get the values of last selected row in Table?

    Hi,
    I have one editable table , where i have Create, Delete and Commit operation on it.
    When i am clicking on Create button it add new row to my table.
    But I want the value of my last selected row from the table in my Bean.
    Can anyone suggest me please....... its urgent
    Jdev:- 11.1.1.0.3
    Thanks,
    Ramit

    just get this code empTable is the table binding
                    RowKeySet rks = new RowKeySetImpl(); 
                    CollectionModel model = (CollectionModel)empTable.getValue(); 
          RowKeySet selectedRowKeys = empTable.getSelectedRowKeys();
          if (selectedRowKeys != null)
                Iterator iter = selectedRowKeys.iterator();
                if (iter != null && iter.hasNext())
                  empTable.setRowKey(iter.next());
                  model.setRowIndex(empTable.getRowIndex()); 
                  Object key = model.getRowKey(); 
                  rks.add(key); 
                    empTable.setSelectedRowKeys(rks); 
          AdfFacesContext.getCurrentInstance().addPartialTarget(empTable);
        public void setEmpTable(RichTable empTable) {
            this.empTable = empTable;
        public RichTable getEmpTable() {
            return empTable;
        }

  • How to capture a  charateristics value from a selected row in IP

    The requirements is to select a line in the summery layout and go to detail layout for further
    planning.
    In BPS, it's very easy to achieve this, since we can use the variables in the WIB to capture the value of selected line, In IP's query, after click a row, the selected row is highlight, but I am not sure how can we  pass the characteristics value of the selected row into a variable.  I did the following test by defining a variable for a account number characteristics in the row of a query, and define a dropdown filter with that account variable, after the query is launched in IP, when I click a row in the query, the account number dropdown filter value did not display the corresponding account number I choose. Anybody know how to achieve this?
    Thanks in advance

    Say your analysis item has 0material as one of the characteristics and say you can bind the material value on the selected line item to variable 'ZMAT' when the user clicks on a button. In the data binding section of the comand you want to perform when button is clicked you will make the fillowing settings:
    Variable - ZMAT
    Variable Type - 'SELECTION_BINDING
    Please give this a try.
    Regards

  • How can i get the values from one JSP to another JSP

    Hi All,
    I am very new to JSP technology, I have one jsp having radio button, i want to accecc the state of this radio button to another JSP page, How can i do this.
    Could anybody help me.
    with Regards
    Suresh

    Try page import <%@ page import ="index.jsp" %> or include <%@include file="index.jsp" %> methods perhaps they might work.

Maybe you are looking for