on 01-05-2006 10:15 AM
Hi all,
I need to enable certain rows of a table based on a condition. I have implemented it in the following way.
IPrivateRailShipNomRetNomView.ILi_NominationsElement nominationnode = null;
IPrivateRailShipNomRetNomView.IEnableElement enabled_node =null;
int rows = wdContext.nodeZl_Wrailshipnom_Ret_Nomination_Input().nodeOutput2().nodeLi_Nominations().size();
for(int i=0;i<rows;i++)
{
nominationnode = wdContext.nodeLi_Nominations().getLi_NominationsElementAt(i);
enabled_node = nominationnode.nodeEnable().getEnableElementAt(0);
String update = nominationnode.getUpdate();
wdComponentAPI.getMessageManager().reportSuccess(update);
if (update.equalsIgnoreCase("X"))
{
enabled_node.setEnableAttribute(true);
continue;
}
enabled_node.setEnableAttribute(true);
}
My node structure is as follows:
---Node1 (Model Node)
-
Output (Model Node)
-
Li_Nominations (Model Node)
-
Enable (Value Node)
-
EnableAttribute (Value Attribute)
But it is not working. All the rows are getting enabled. What could be the problem? Can anyone help me out?
Thanks in advance.
Regards,
Reena
Let "Rows" be the context (model) node used as the table's data source.
Add a value node "State" (cardinality=1:1, selection=1:1, singleton=<b>false </b>) inside "Rows".
Add an attribute "RowEnabled", type "boolean" inside "State".
Now each(!) node element of "Rows" (i.e. each table row) has a storage location for its enabled-state, namely the attribute "RowEnabled" in node "State". Because "State" is a non-singleton node, every "Rows"-element has its own copy of this node and the contained attribute.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
Thanks for the reply.
I got your point.
I have set the cardinality, selection and singleton values as mentioned by you. Still I am unable to change the enable state of selected rows. All the rows are enabled. I want to make some rows disabled.
Any other pointers?
Thanks in advance,
Reena
Hello,
This may have been answered in various threads - but I am unable to find corresponding layout changes that would actually disable the row. Which IWDTable property should the "Enabled" boolean be assigned to - "enabled" or "rowSelectable"? Right now, after implementing the code above, the entire table gets disabled, whether I set the boolean to "enabled" or "rowSelectable". Would highly appreciate a step-by-step guidance.
Thanks in advance,
Siva.
Thanks for the quick response, Armin.
In my case,
a. I do not have any input fields in the table, it is a display only (but selectable) table - so I need to be able to disable the entire row instead of a specific field
b. Also, will this way of setting the boolean work? I am not sure if the way in which I access the state/boolean is correct.
for (int x = 0; x < wdContext.nodeRequests().size(); x++) {
if (x == 1 || x == 3 || x == 5) { //some business condition
wdContext
.nodeRequests()
<b>.getRequestsElementAt(x)
.currentStateElement()
.setRowEnabled(false)</b>;
}
}
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.