on 02-09-2007 6:37 AM
Hi,
I have created a Model and filling up a table of 12 column with some data. I am using 7 Inputfields and 5 textviews in a row. Now the problem am facing is that <b>I want to disable some InputFields in a row (not column wise).</b> I am able to disable the UI element columnwise but that doesn't solve my problem.
So can anybody suggest solution to disable a particular cell in a row containing inputfield during runtime?
Regards,
Vaibhav
hi,
do the following steps
--> first take value attribute under your model node and set the type of that value attribute as boolean
--> set the enabled property of the table cell that u want to make disable to this value attribute
--> after u got data for the model node( i,e after ececute() method )
--> use loop to set each row cell to make disable or enable
for(int i=0;i<wdcontent.node<nodename>.size'i++)
{
wdcontext.current<nodename>Element.set<valueAttribut>(true/false);
// set true/false according to ur requirement
}
--> if u want to make two or more number of inuputfields as disable/enable then use that much number of value attributes under the model node ( for each inputfield on value attribute )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ModelNode
+ State (value node, card=1:1, selection=1:1, singleton=false)
---- IsReadOnly (attribute, boolean)
To set row at index i to read-only, bind InputField (table cell editor) "readOnly" property to attribute "IsReadOnly".
Set value of attribute in row i to true:
IModelNodeElement e = wdContext.nodeModelNode().getModelNodeElementAt(i);
e.currentStateElement().setIsReadOnly(true);
or declare attribute "IsReadOnly" as calculated and return value from generated get-method.
Armin
Hi Armin,
Thanks a lot for your suggestion.
I created a modelnode named as ModelNode and then State Vale node and then IsReadOnly attribute. But am not able to get IModelNodeElement.
Can you please mention the properties of model node and also please elaborate "<b>declare attribute "IsReadOnly" as calculated and return value from generated get-method.</b>
"
1>Create a value attribute of type boolean under table source node with calculated property set as true.Bind readOnly property of table cell editor to this value attribute
2>In the getter method of value attribute compare value of the field and set it accordingly.
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.
Hi,
Create a boolean variable say "flag".
set readOnly properties to "false".
now go to InputFields and set "Readonly" properties to that boolean variable.
Now in run time you can write conditional statement to make them readonly or disabled.
like:
<b>for disable</b>
wdContext.currentContextElement().setflag(True);
<b>for enable</b>
wdContext.currentContextElement().setflag(false);
Thanks
Manoj
<b>Note: If helpful give reward points.</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vaibhav
U r using a loop to add elements to the table rt?
u can do some "if" condition in that to achieve this.
First, the inputFields enabled property should be mapped to a context variable of type boolean. Then in the loop assign this variable true or false according to the conditions.
If u can paste the code snippet of that loop, i can give u a working code sample,
Regards
BP
Award points if found usefull
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bp,
Thanks a lot for your fast reply. I am using Model to fill the table. So there is no need of using a loop to fill the table.
Earlier I tried creating a boolean type context variable and assigned it to TableCellEditor (InputField) enable properyty, but it will disable or enable the whole column which I don't want to happen. I want a cell of a particular row to get disable/enable.
Regards,
Vaibhav
I have created custom controller for model created
<b> public void executeZFunction_Input( )
{
//@@begin executeZFunction_Input()
//$$begin Service Controller(-213575660)
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try{
wdContext.currentZFunction_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
} catch(WDDynamicRFCExecuteException ce) {
manager.reportException(ce.getMessage(), false);
}</b>
In view following method fills the table:
<b> public void wdDoInit()
{
//@@begin wdDoInit()
wdThis.wdGetMCustController().executeZFunction_Input();
//@@end
}</b>
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.