on 12-09-2005 2:56 AM
How to set a line (or a cell) of table as read only during runtime?
Hi Valery,
A bit confusing. If the cardinality is set to 1..1, how can it determine the status for each line? and why should it be set to singleton?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wei,
Somehow my post was discarded
1. It should be non-singleton -- otherwise settings for lead selected element will be applied to whole table
2. You may either add calculated attributes here or provide your own supply function. In either way you may determine status from parent element:
a) in calculus: element.node().getParentElement().getAttributeValue("Status")
b) in supply: parentElement is function parameter.
VS
Hi wei,
For the usage of supply functions and creation of nodes chk out this link.
http://help.sap.com/saphelp_erp2005/helpdata/en/48/70b1c763a45a4a8bc7f2b7d2c171e6/frameset.htm
In the link expand <b>Application of Context Programming and Data Binding</b> to check out for the procedures.
Hope this helps u,
Regards,
Nagarajan.
Wei,
I believe concepts are the same for both Java & ABAP WD.
So, in context node, you have to select attribute, then modify it properties. Namely, you have to set property "calculated" to true. Next, designer will generate for you getter and setter method (setter is available only for writable properties, i.e. readOnly=false) Note, that for calculated properties it is common to be read-only when property just transform some state to UI flag (enabled, visibility, semantic color etc).
VS
hi wei
yes you can create a context node and do it
regards
saravana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can I create the attributes used as indicators in another context node? otherwise I have to create too many new fields in the structure to which the context node binds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi wei
if possible try the above said method.check whether it suits you.or else please explain your scenario a bit more
regards
saravana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Currently I use an attribute for all fields of the line for the sake of convenience. If I need to set the display status for some of fields additionally, what can I do ?
Is it good to use the Enabled property for this field ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi wei
when you create a table keep the readonly property of table as false
you create the columns of table as inputfield.you bind the readonly property of
the inputfield to two context variables
say one for all the columnfields you to want always have as readonly and let this contextattribute of type boolean and let this be attr1
and another for all the columnfields you donot want to be readonly and let this contextattribute of type boolean and let this be attr2
initially set the context attributes attr1 and attr2 as true so the entire table is readonly.
based on the condition you want to check change the attr2 to be false.
if(your condition)
{
wdcontext.currentcontextelement.setattr2(false);
}
hope this helps.
regards
saravana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
What if I want some field in this line to be not read-only (according to certain value) when the other fields in this line is set to read-only ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi wei
bind the property readonly of the table to a context attribute of type boolean.by default it is false whenever you want a line to act as readonly get the context attribute during runtime and set it to true.when you dont want it to act as readonly change it to false.
regards
saravana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
You can make a cell enabled/disabled by using "Enable" property of a UIElement.
Create a valueattribute "enabled" of type boolean and bind the "Enable" property of the table cell editor to the valueattribute.
Regards, Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.