[UIX-ADF] How to get the selected row in my ViewObjImpl.java

Hi,
I have a uix table with a select column. I dragged my method from my ViewObjImpl
and dropped it on the select column (radiobutton) as a submitbutton.
If I run my application and select a row and press my button it always reads the first
row. Why?
I also tried including a param in my method, for the record id, but I dont know what to
pass to my action binding as a param, where can I find the selected row?
This is what I want, my method in ViewObjImpl.java
public void doDelete() {
  ViewObjRowImpl pRow = (ViewObjRowImpl)this.getCurrentRow();
  try {
    pRow.setIsDeleted("Y");
    //this.executeQuery();
    this.getDBTransaction().commitAndSaveChangeSet();
    //this.validate();
  } catch(Exception e) { System.out.println("ERROR doDelete" + e);  }
}It should set the IsDeleted field to 'Y' for the selected row. Perhaps im not doing the
right thing for this?
Can anyone give me some pointers?
Thanks in advance
Ido

Thanks. So even if you select a row and then press the button, your method still only finds the first row?!
Are you sure that the selection mechanism of your table is working? Your tableSelection fires a select event and your page contains a select handler?
When you wire your page using drag and drop the binding should always use the default iterator of the ViewObject. And getCurrentRow() should always give you the current row of that iterator. So my feeling is that the selection doesn't take place.
Or could it be that something resets the currency in the ViewObject from another place?
Sascha

Similar Messages

  • How to get the selected rows & columns in the table?

    hi everybody,
                         In my application the table is kept inside the event structure.I select the cells  in the table (using mouse) on running time.How to get the selected number of rows & columns in that table?

    Hello,
    You can fill selected values of the table by writing to it or the corresponding property using a property node - the table is just a 2D array of strings.  I think for your "disable" question you are referring to the shortcut menu (when you right click).  If you are using LabVIEW 8.x, you can edit or disable that shortcut menu - just right click on your table at edit time and choose Advanced >> Run-Time Shortcut Menu.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Check box als column in a standard table, how to get the selected row

    Dear experts,
    I habe standard tablt with check box as column. Now I want to get the current selected row structure and do some changes. How could I solve this problem? till now I just know to get the structure via lead selection.
    lo_node->get_element().
    lo_element = lo_node->get_static_attributes ( static_attributes = ls_row).
    How could I get the element through check-box in stead of lead selection. Many thanks!

    check this code
    To get the selected row number
    data: lr_element type ref to if_wd_context_element,
              lv_index type i.
      lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
      lv_index = lr_element->get_index( ).
    Thanks
    Bala Duvvuri

  • V v urgent ...  how to get the selected rows in the vl02n transaction

    Hi ,
    I have requirement that i have selected the line items in the vl02n transaction.
    If I select only one row there is option gs_get_cursor-line.
    If I select more than one line item at a time I am getting only the last value in to gs_get_cursor-line.
    Can anybody let me know how to get the multiple line items  that are selected
    It is very urgent ..
    Plz Help

    Hi,
    can you check the E_row_id .
    v_row type LVC_S_ROW
    read table itab index E_ROW-index.
    regards,
    Ajay
    Edited by: Ajay on Feb 14, 2008 6:22 PM

  • How to get the selected rows in a table

    Hi,
    How to get the ids of all the selected rows. On Page load a query is executed that shows the data in a table with a checkbox in the first column to select the rows and delete. Now if a user select multiple rows how do I get the ids of selected rows in the backend code.
    Thanks

    Please search the forum before posting questions.
    refer following thread for table selection.
    Re: Record selection with MessageCheckBox and print the selected record.
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                           

  • How to get the selected cell in a Matrix.

    Hi all,
    Does any one know how to get the selected cell in a Matrix. Please help to answer. Thanks in advance.
    Regards,
    Thanh Tran

    Hi,
    You can get the value of every cell  using UI API but using datasources is a better aproach.
    Using UI API you need to know the event you want to catch. Example: Catching click event in itemcode column and getting the value (C#):Ki
          if ((pVal.EventType == BoEventTypes.et_CLICK) &&  //CLICK EVENT
              (pVal.ItemUID == "38")  &&                                       //MATRIX-> ITEM 38
              (pVal.ColUID == "1") &&                                           //ITEMCODE COLUMN
              (!pVal.InnerEvent) &&                                
              (!pVal.BeforeAction))
                    Form form = null;
                    try
                        form = kernel.Application.Forms.Item(pVal.FormUID);
                        form.Freeze(true);
                        Matrix mtx = (form.Items.Item(pVal.ItemUID).Specific as Matrix);  //MATRIX OBJECT
                        string itemCode = (mtx.Columns.Item("1").Cells.Item(pVal.Row).Specific as EditText).Value.Trim();  //itemcode = VALUE OF CELL. COLUMN "1": ITEMCODE COLUMN. CURRENT ROW: pVal.Row
                    catch (Exception ex)
                        kernel.Application.MessageBox("Error " + ex.Message, 0, "", "", "");
                    finally
                         if (form != null)
                            form.Freeze(false);
    Kind regards,
    Nauzet Díaz

  • Getting the Selected Row from a JTable

    hi,
    how Can i get the Selected row from a JTable
    thanks...

    You know that JTable class? Well, you see those methods in it called "getSelectedRow()" and "getSelectedRows()"...?

  • How to get the selected values from the shuttle

    Hi
    Please tell me how to get the selected option values from the shuttle leading list.
    Thanks

    you can also obtain the option values present in the leading and trailing lists using the
    following methods:
    public String[] getLeadingListOptionValues(OAPageContext pageContext, OAWebBean
    webBean)
    public String[] getTrailingListOptionValues(OAPageContext pageContext, OAWebBean
    webBean)For example, the following code sample returns an array of values in the trailing list, ordered according to the
    order in which they appear in the list:
    String[] trailingItems =
    shuttle.getTrailingListOptionValues(pageContext, shuttle);Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to delete the selected rows in a JTable on pressing a button?

    How to delete the selected rows in a JTable on pressing a button?

    You are right. I did the same.
    Following is the code where some of them might find it useful in future.
    jTable1.selectAll();
    int[] array = jTable1.getSelectedRows();
    for(int i=array.length-1;i>=0;i--)
    DefaultTableModel model = (DefaultTableModel)jTable1.getModel();
    model.removeRow(i);
    }

  • How to get the selected value in SelectOneMenu in backing bean

    Hello all,
    I need your help. I want to have 2 select menus with the second menu's items list are populated based on the selection in the first menu. I don't know how to get the selected value in the backing bean so that I can based on that select menu to populate the second menu's item list. Basically I need to access to the UI Component of the first select Menu and retrieve its selected value.
    Could you help me out?
    Thank you very much in advance,
    Lngo

    Hi Lingo,
    There r two ways of getting the values into the list. First one is hardcoding the values and the second one is use the list and get the values into the list by firing a query in the database.
    Inorder to display the values in the second menu based on the first onces selection we need to add an attribute to the first selectonemenu known as valueChangeListener and we need to sumit the page.
    Here is the sample code
    <h:selectOneMenu id="catalogue"
                                  binding="#{urbean.catalogue}" onchange="submit()"
                                  valueChangeListener="#{urbean.categoryValueChange}"
                                  <f:selectItem itemLabel="Select Catalogue" itemValue="" />
                                  <f:selectItems value="#{urbean.catalogueList}" />
    </h:selectOneMenu>
    <h:selectOneMenu id="category"
                                  binding="#{urbean.category}">     <f:selectItem itemLabel="Select Category" itemValue="" />
                                  <f:selectItems value="#{urbean.categoryList}" />
                                  <                         </h:selectOneMenu>
    now in method called by valuechangelistener we need to write the similar code
    public void categoryValueChange(ValueChangeEvent event) {
    String rfnum = (String) event.getNewValue();
    List categoryList = new ArrayList();
    List tempList = new TablenameDAO().getActiveCatByCatalogueID(rfnum);
              for (int i = 0; i < tempList.size(); i++) {
                   Tablename tablename = (Tablename ) tempList.get(i);
                   String value = "" + tablename .getrfnum();
    String label = tablename .getname();
         if (label == null) {
                   label = "";
                   SelectItem item = new SelectItem(value, label);
                   categoryList.add(item);
              bean.setCategoryList(categoryList);
    ///getActiveCatByCatalogueID (rfnum) should bring the records which r based on the rfnum
    if u follow this process i am damsure that u will get the values in to the secondlist based upon the first list
    Thanks & Regards
    Manidhar

  • How to get the selection parameters from logical database into one of the t

    Hi Sap ABAP Champians,
    How to get the selection parameters from logical database into one of the tab in the tabstrip selection-screen.
    Please help me for this
    Thanks
    Basu

    Hi
    Thanks, that will work, but then I'll have to insert code into all my reports.
    I can see that "Application Server Control Console" is able to rerun a report.
    This must mean that the Report Server has access to the runtime parameters.
    But how?
    Cheers
    Nils Peter

  • How to identify the Selected row number or Index in the growing Table

    Hi,
    How to find the selected Row number or Row Index of growing  Table using Javascript or Formcalc in Interactive Adobe forms
    Thanks & Regards
    Srikanth

    After using bellow script it works fine
    xfa.resolveNode("Formname.Table1.Row1["this.parent.index"].fieldname").rawValue;

  • Getting the selected row (selected using radio button in dataTable)

    I have problem getting the selected row.
    If not mistaken, the way used in BalusC's website sets the value to the backing bean using the valueChangeListener.
    Can I set the value to the DTO instead?
    using something like
    private boolean selected;
    public void setSelectedItem(ValueChangeEvent e){
    this.selected = true;
    }  If i use this way it throws NoSuchMethodException. I have no idea why. I did this for the checkbox and it works fine. I don't know why it doesn't work for radio buttons.

    The DataTable is below :
    <h:panelGrid columns="1" columnClasses="table_align">
              <t:dataTable id="table1" value="#{sysMgrBean.locationList}"
                   var="location" rows="5" styleClass="table" headerClass="tableHeader"
                   rowClasses="tableRowOdd, tableRowEven" width="500">
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['no']}" />
                        </f:facet>
                        <h:outputText value="#{location.id}" />
                   </t:column>
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['slct']}" />
                        </f:facet>
                        <h:selectOneRadio  value="#{location.selected}"
                             onfocus="dataTableSelectOneRadio(this);"
                             onclick="enableInput(this.form,this)" valueChangeListener="#{location.setSelectedItem}">
                             <f:selectItem itemValue="" value="true" />
                        </h:selectOneRadio>
                   </t:column>
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['cd']}" />
                        </f:facet>
                        <h:outputText value="#{location.loccd}" />
                   </t:column>
                   <t:column>
                        <f:facet name="header">
                             <h:outputText styleClass="lbl" value="#{lbl['desc']}" />
                        </f:facet>
                        <h:inputText id="Description" value="#{location.descr}" disabled="#{location.disabled}" />
                   </t:column>
              </t:dataTable>In the DTO :
    private boolean selected;
    public void setSelectedItem(ValueChangeEvent e){
    this.selected = true;
    }

  • How to get the today's julian date in java?

    how to get the today's julian date in java?
    hi can any one tell me how to get the todays julian date using Calender class or GregorianCalender class....
    Julian date for 2006.November.01 AD 05:54 PM : 2454041.0
    i have tryied with
    calJ.setGregorianChange(new Date(Long.MAX_VALUE));
    System.out.println(sdf2.format(calJ.getGregorianChange()));
    thanks
    Tushar
    Message was edited by:
    lad_tushar

    thanks a lot....for intrest....
    I have found some details about the Julian calendar as follows:
    The Julian date for 2006: JAN: 01:12:01:59 is 2453737.00138
    245 represent the year digits for year 2006
    3737 represent the date fir 1 Jan
    .00138 represents the time for 12:01:59
    Julian date change as per every day 12 noon it increase one digit in it.
    As per ref from
    http://www.aavso.org/observing/aids/jdcalendar.shtml
    Also chk this calendar where Julian date is 20. October 2006 for 02 November 2006
    As per ref from
    http://www.calendar.sk/julian_calendar-en.php
    I have tried the pure �GregorianCalendar� class from jdk1.4 API and its setGregorianChange method but not getting as per the expected Julian date format. Using the �setGregorianChange()� i have setting the cutover date to Long.MAX_VALUE it means GregorianCalendar now have to act as per the Julian calendar ...so after setting the cutover date it return me changed date using �getGregorianChange()� but that was not the Julian date of the current date...as expected or as per above both scenario. Even though the last two digits are nowhere equal to the actual Julian date.
    Program
    GregorianCalendar cal = new GregorianCalendar();
    cal.setGregorianChange(new Date(Long.MAX_VALUE)); // setting the calendar to act as a pure Julian calendar.
    // cal.set(Calendar.DATE, new Date().getDate()); // seting the current date
    // Date todayJD = cal.getGregorianChange(); // getting the changed date after the setGregorianChange
    Date todayJD = cal.getTime(); // getting the calculated time of today�s Julian date
    SimpleDateFormat sdfJulianDate = new SimpleDateFormat("yyDDD");
    SimpleDateFormat sdfJuliandayOfYear = new SimpleDateFormat("DDD");
    System.out.println("today Date = " + new Date());
    System.out.println("Today as julian date = " + sdfJulianDate.format(todayJD));
    System.out.println("Today as day of year = " + sdfJuliandayOfYear.format(todayJD));
    OUTPUT:
    USING : Date todayJD = cal.getGregorianChange();
    Today Date = Thu Nov 02 15:17:05 IST 2006
    Today as julian date = 94229
    Today as day of year = 229
    USING : cal.set(Calendar.DATE, new Date().getDate());
    Today Date = Thu Nov 02 15:19:22 IST 2006
    Today as julian date = 06319
    Today as day of year = 319
    USING : Date todayJD = cal.getTime();
    Today Date = Thu Nov 02 15:17:59 IST 2006
    Today as julian date = 06306
    Today as day of year = 306
    There is one another concept i found to get the Julian day of the year as per the Julian day chart mention on nasa site (http://angler.larc.nasa.gov/armsgp/JulianDayChart.html) and i m getting the moth of the year that is 306 for nov 02 2006 using getTime() method in above code then the out put is right for Julian day. But it was not as per the expected Julian date format. So in conclusion we can only able to retrieve the day of year for the Julian calendar. hope their will be a solution for this problem in java api ....else we allways have to depend upon the third party api that was not accepteble some times.....
    Kindly chk chart on the site
    http://angler.larc.nasa.gov/armsgp/JulianDayChart.html
    http://weather.uwaterloo.ca/julian.html
    http://www.fs.fed.us/raws/book/julian.shtml
    Thanks,
    Tushar Lad

  • How can I get the selected rows from two ALV grids at the same time?

    I have a program that uses two ALV grids in one dialog screen. I'm using the OO ALV model (SALV* classes).
    The user can select any number of rows from each grid. Then, when a toolbar pushbutton is pressed, I'd have to retrieve the selected rows from both grids and start some processing with these rows.
    It is no problem to assign event handlers to both grids, and use the CL_SALV_TABLE->GET_SELECTIONS and CL_SALV_SELECTIONS->GET_SELECTED_ROWS methods to find out which rows were marked by the user. Trouble is, this only works when I raise an event in each grid separately, for instance via an own function that I added to the grid's toolbar. So, I can only see the selected rows of the same grid where such an event was raised.
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.
    As it is right now, I can have an own button in both grid's toolbar, select the rows, click on the extra button in each grid (this will tell me what entries were selected per grid). Then, I'd have to click on a third button (the one in the dialog screen's toolbar), and process the selected rows from both grids.
    How can I select the rows, then click on just one button, and process the marked entries from both grids?
    Is it somehow possible to raise an event belonging to each grid programmatically, so that then the corresponding CL_SALV_SELECTIONS->GET_SELECTED_ROWS will work?
    Thanks.

    Hello Tamas ,
    If I try to do this in the PBO of the dialog screen (that contains the two grids), the result of CL_SALV_SELECTIONS->GET_SELECTED_ROWS will be empty, as the program does not recognize the marked entries in the grids. Also, an event for grid1 does not see the selected rows from grid2 either.--->
    is it possible to  have a check box in each grid  & get the selected lines in PAI of the screen ?
    regards
    prabhu

Maybe you are looking for

  • Comm channels between edi siebel subsystems to sap r/3

    hi how to establish communication channels between siebel EDI SUBSYSTEMS TO SAP R/3 AND SAP BW systems how to integrate SAP system with people soft

  • The iTunes application could not be opened. An unknown error occured (-50)

    The iTunes application could not be opened. An unknown error occured (-50). I get this when i click on the icon on the dock. it was fine until the last update that i installed. i'm using version 8.0.1 anyone??? Message was edited by: itsmesunny Messa

  • Returned Macbook but forgot to de-activate Pshop!

    Hi guys, My question is this, I have recently returned a faulty macbook air and received a replacement however I forgot to de-activate Pshop. Now I have the sorftware installed on another machine and also added it to the returned laptop. Once Apple h

  • IPod shuffle - synch between Windows PC and Mac G3

    Hi there! I started my iPod account on a pc and I have a whole library on there.I would sign in with my hotmail account. I have recently changed to a Mac G3 and I can't access my library on it. I have now created an Apple login. My question is how ca

  • Setting JMS MQ on server

    Hey, I need to use a Servlet for JMS.My jar files are in my application folder(ear) and I added entries for these jar files in web.xml.When I invoke the Servlet then it executes non-MQ part of Servlet and gives Resource Exception for JMS code.Can any