on 08-02-2006 12:24 PM
Hi All,
We are developing an application in Webdynpro using java.
Can we disable or enable a row selection on certain condition in Table Control and if yes How?
Thanks & Regards,
Nilesh
Nilesh,
There is no way to disable <b>selection</b> of particular row(s). It is possible only to disable selection alltogether for whole table. Or to disable cell editors (as other suggesting).
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nilesh
Its <b>possible</b> to enable or disable a entire row in a table control.
First add a attribute 'RowEnabled' of type boolean in the table control's source node.
Then for 'Enabled' Property of the table columns of the table, assign the attribute 'RowEnabled' of the source node.
Then using index, change the value of 'RowEnabled' to true or false. The particular row with the index will get enabled or disabled.
Any doubt i ll be happy to resolve ;>)
Regards
Rakesh.
Hi Nilesh
You can enable/disable a row on selection of a row. In Event handling method onActionOnleadSelection, get index by node().getLeadSelection() method. By the index change the RowEnabled attribute.
In this example, Itemx node contains many attributes including RowEnabled attribute of type boolean.
public void onActionOnleadSelection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionOnleadSelection(ServerEvent)
IWDNodeElement currentnode = wdContext.currentItemxElement();
int index = currentnode.node().getLeadSelection();
wdContext.nodeItemx().getItemxElementAt (index).setRow_Enabled(false);
}
Regards
Rakesh ;>)
Having a look at this code, I recall that NW04s (probably latest NW04 SPs like SP16) has selectionChangeBehavior property on Table control.
If you are using version that supports this property, you may do the following:
1. Set selectionChangeBehavior=manual. This way row is not selected automatically.
2. Add onLeadSelect action to table
3. Create mapping of "nodeElement" parameter to parameter "row" of type IWDNodeElement
4. In action handler check row.index(). If index is selectable, then execute wdContext.node<TableSource>().setLeadSelection( row.index() ) otherwise return.
This way user will be unable to select certain rows. This works only with single selection (not multiple).
Up to certain extent you may try the same even without selectionChangeBehavior property. Just always save lead selection to controller instance variable and try to restore previous selection in onLeadSelect action handler.
Valery Silaev
EPAM Systems
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.