Enable/disable operation buttons according to the selected row in table?

Hi,
I used JDev 11.1.1.2.0
On my main page, it has a query section and display search result to a table component, and also has some operation buttons like (update/delete) on the toolbar.
I want to enable/disable the operation buttons according to some filed value of the selected row in the table, and I searched the OTN forum, found more questions like this but seemed no found one right solution.
The table is single selection, and has a status column, its data type is Integer, and I want to enable buttons when the selected row's status field value is 0 or 1, disable buttons when status value is other values.
Table code like:
<af:table value="#{bindings.VO1.collectionModel}" var="row"
rows="#{bindings.VO1.rangeSize}"
emptyText="#{bindingsVO1.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.VO1.rangeSize}"
rowBandingInterval="0"
filterModel="#{bindings.VOCriteriaQuery.queryDescriptor}"
queryListener="#{bindings.VOCriteriaQuery.processQuery}"
filterVisible="true" varStatus="vs"
selectedRowKeys="#{bindings.VO1.collectionModel.selectedRow}"
selectionListener="#{bindings.VO1.collectionModel.makeCurrent}"
rowSelection="single" id="resId1">
Operation buttons code like:
<af:commandToolbarButton text="Update" id="ctb2" action="editDAF"/>
Any suggestion will be great help.
Thanks,
zeroxin

Hi,
create an attribute binding in the PageDef file for the status field. Then setup the button PartialTriggers property to point to the table ID. The button's disabled property then points to the status attribute binding like
#{bindings.statusField.inputValue=='value'}
Frank

Similar Messages

  • How to Highlight the selected row of table

    Hi All,
    I have a result table. I want the selected row to be highlighted in orange color.
    The properties of the table are as follows :
    rowSelectable : true
    selectionChangeBehaviour : auto
    selectionMode : auto
    Please let me know what am I missing.
    Nikhil

    Hi Nikhil,
                 We too encountered this problem in EP 6.0. The code is correct. Actually
    int index=wdContext.nodeSales_Orders1().getLeadSelection();
    is enough.
    But this is not the problem. It is the problem with  either browser or Portal Runtime.
    Is your version EP 6.0? Is this a problem for all tables or only this table? Check with other browsers like Mozilla..(or different IE versions).
    regards,
    Siva

  • Getting the contents of the selected row in table webitem

    Hi,
    If i have a table web item in a web template,how do i get
    the selected row and row contents of the table.
    regards
    kaushik

    Just incase if you have not looked at the following documents:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6eb89190-0201-0010-89bf-ad46d1503ef9
    http://help.sap.com/saphelp_nw04/helpdata/en/99/08629bd3e41d418530c6849df303c9/frameset.htm

  • Print the selected rows in table

    Hi All,
    I have a one applications which shows the data in table (i.e multiple rows are displayed)
    Now from this table user wants to select some selected rows and take the print out of those selected rows
    I dont want to take the print out of entire table i want only print out of selected rows
    How can we achieve this
    Regards
    Srinivas

    Hi Srinivas,
    I can't think of a way of doing it in VC. However, a kind of workaround can be done in EhP1 where you can export the table to Excel and there you can print whatever you want.
    Regards,
    Natty

  • Selecting rows in table control

    Hi experts,
    I have question regarding selecting rows in table control. How can I select a row when a button is pressed. I cannot use the selection column in this case. Is there any option to achieve my requirement without using the selection column. Thanks.
    regards,
    sriram.

    By,
    Using the Get cursor syntax you can achive the Selected row in Table control.
      DATA : selrow TYPE i,
             selindex TYPE i  .
    * getting the cursor line in Table Control for selected row
      GET CURSOR FIELD selfield LINE selrow.
      selindex = <tablecontrol>-top_line + selrow - 1.
    Prabhu

  • 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 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);
    }

  • Invalid batch according to the selection criteria in batch determination

    Good day to all!
    I am trying to Post Goods Issue in my Delivery but I cannot proceed because of the Batch. When I am trying to use a Batch in the Picking tab of Delivery Create Overview, this message appears: Invalid batch <BATCH NAME>according to the selection criteria in batch determination. Do you have any idea how to resolve this? Thanks!

    you work with batches,
    and your system is customized to check if a manually entered batch fulfills the  criteria of your batch determination.
    This is not the case, hence you get the error message.
    So you have to decide whether your batch determinatiion selection criteria wrong, or if the customizing to check this criteria is unwanted, or if you better do not send this chosen batch to your customer as it may result in a return.

  • Show different dropdownlists according to the selected value

    Hi All,
    I need pop up a different dropdownlist according to the selected item in one dropdownlist.
    .e.g. if I select state in one dropdownlist, another dropdownlist contains all the states will show up beside it.
    Any one can help me?
    Thanks a lot

    There are two ways of doing it. Both involve javascript
    1 - capture the onchange event of the first dropdown. Submit the page, and reload it with the correct values for the second dropdown list
    2 - If there aren't that many different options, you can download all the different option lists into your page. Capture the onchange event of the first dropdown, and then use javascript to set the values in the second dropdown box.
    Both have pros and cons. The first option requires a page refresh. The second one requires that you download all possible options to the page.
    Good luck,
    evnafets

  • Enhancement Implementation - Operation not supported by the selected object

    Hi,
    I have created an Enhancement Implementation (EI) of Enhancement Spot BADI_ACC_DOCUMENT via transaction SE19. When activating the EI, the following message occurs and the EI is not activated:
    Operation not supported by the selected object
    Message no. SEU_MANAGER061
    I have searched the forum and service marketplace for the message, but I still have no resolution of the problem. Any help is greatly appreciated.
    Thank you.

    It turned out to be a basis problem. Looking into transaction SM21 showed that the database was full.

  • How do I set only the first row of a DataGrid as the selected row?

    I have a "Go" button on a search form that fetches data into an already data bound grid.  After the data is fetched, I want to make the first row in the Datagrid the selected row, as if the user clicked on it.  If the result set is empty, I don't want the code to crash.  (I only want one row to be able to be selected at a time)
                protected function btnGo_clickHandler(event:MouseEvent):void
                    getSBJsResult.token = baa_data_svc.getSBJs(cmbSrch.text);
                    grdSBJs. //  ?????  What goes here to select the first row?

    This should do it.
    If this post answered your question or helped, please mark it as such.
    if(myDataGrid.dataProvider.length > 0){
      myDataGrid.selectedIndex = 0;

  • 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

  • [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

  • How to delete or remove the selected row in a table

    Dear Experts,
    I'm facing a typical requirement in VC, similiar to variable selection screen in BI Queries :
    I will have two tabes and if the user selects data from one table it will be moved to target table.I'm able to populate the target table with the value but I'm not able to delete the selected row from the source table.
    Any help in this regard would be highlt appreciated.
    Thankx in advance.
    Regds,
    Srinivasan.

    Hi
    Follow the following steps -
    1. Create two buttons.One for 'delete row' and another one for 'insert row'.
    2. Assign the proper system action as per the name.
    2. Change the name of both buttons as common name.
    3. To trigger the actions simultaneously add a star before the action.( For Example : *select)
    4. Change the visibility of any one of the button as 'false'. (so it will not get displayed)
    5. Now, if u click the visible button both actions will be triggered simultaneously.
    Regards
    Sandeep

  • How to populate the selected row details of table in the next view?

    hi,
    Im having a table, on selecting a particular row of a table by clicking on a radio button. i need that row details to be passed on(populated) to the next view when i navigate to that view by clicking on a button?
    Thanks & Regards,
    Suresh

    Hi Suresh,
    Your scenario is simple. Just follow the ex as shown below
    (Assuming you want default selection view provided by table itself.)
    1>Create 2 views (Ex:A and B)
    2>Create a Context with a node and attributes(For Ex:Person as node and Fname and Last Name as attributes
    2>In A view create a table with F name and L Name(map to context as well) and a action button to navigate to B view when you selected a particualr row o.k
    3>In B view, create a TextView with mapping to LastName(or all the data if you want from input selection) from the context
    If you want you can add back action button from B view to A view for easy navigation.
    4>Execute the application and select any row in the table appeared, press next action button,you can see that the selected row details will be shown in second(B) view.
    If you do the above example, I think you can easily find the solution for navigation issue.. try it out.
    In case if you are not able to ...let me know..I have that example.
    Hope that helps
    Regards
    Praveen

Maybe you are looking for