on 03-08-2006 5:56 PM
Hi,
i have one table with several rows and columns with input fields, i wabt to set single cell property readonly to true or false depends on business logic.
can i set single cell property readonly in a table.
Iam getting the error for the following code, rightnow iam not iterating through a column, just trying to set whole column.
IWDTable table= (IWDTable)view.getElement("ResultsTable");
IWDTableColumn column=(IWDTableColumn) table.getColumn(3);
//wdContext.currentContextElement().setLength(column.length);
IWDInputField IF= (IWDInputField)column;
IF.setReadOnly(true);
//table.iterateColumns();
//@@end
Thanks,
Damodhar.
Hi,
i have the node structure like following
Zmm_Bapi(modelnode)
Output(modelnode) |
po_items(modelnode)
x(modelattribute) y(modelattribute) so i binded the x to tablecell of type InputField, depends on the condition of y i want to change the x's input field property to true or flase. I hope it gives good idea. i did the following, po_items(modelnode) | addtionalcolumns ( valuenode,cardinality1..1,selection 1..1,singleton false) |
readonly(valueattributeof type boolean)
so iam checking in wdDoModifyView like you said iterating through the node po_items, and checking the valu of Y attribute and assigning true or false to readonly attribute.
the code looks like follows in wdDoModifyView
for(int i=0;i<wdContext.nodePo_Items().size();i++){
if(wdContext.currentPo_Items().getY=="Closed")
{ wdContext.currentAdditionalColumnElement().setReadOnly(true); }
else{
wdContext.currentAdditionalColumnElement().setReadOnly(false);
}
wdContext.nodePo_Items().moveNext();
}
and somehow it is not working, all input fields are editable although Y has value Closed.
may i know where i am doing wrong.
Thanks,
Damodhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Several remarks.
First, you should not update the context in method wdDoModifyView(). You could do it after executing the BAPI or in a supply function.
Your code should be changed to
for (int i = 0; i < wdContext.nodePo_Items().size(); i++)
{
IPo_ItemsElement item = wdContext.nodePo_Items().getPo_ItemsElementAt(i);
IAdditionalColumnElement additional = item.nodeAdditionalColumn().currentAdditionalColumnElement();
additional.setReadOnly( "Closed".equals(item.getY() )
}
Armin
Hi Armin,
Thanks Armin,i implemented in onPlugFromSearch(), its working fine.
Thanks,
Damodhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
i got it but need some help, i don't understand
"Set the attribute value for the node element corresponding to the row (<u>index of node element = row index)."</u>
Thanks,
Damodhar.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Damodhar
As Armin suggested, attach the attribut of type : boolean to the inputcell editor to which you want to change.
Then iterate through the node and according to the condition set the attribute according the condition.
the code might look like this.
int rows = wdContext.node<iterating node name>.size();
IPublic<ControllerName>.I<Node Name>element ele = null
IPublic<ControllerName>.I<Node Name> node = wdContext.node<iterating node>;
for(int i = 0;i<rows;i++)
{
ele = node.get<node name>elementat(i);
if(ele.getAttribute ==condition)
//set the attribute "readonly" true
}
it will be on these lines.
Can you be more specific about your problem as this can be mostly worked with supplyfunctions also
I hope it helps
Thanks
Srikant
Bind the "readOnly" property of the InputField cell editor to a context attribute under the data source node.
Set the attribute value for the node element corresponding to the row (index of node element = row index).
Armin
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.