cancel
Showing results for 
Search instead for 
Did you mean: 

enable an element by code?

Former Member
0 Kudos

Hi experts,

Can anyone tell me how to enable/disable an element of a view by code?

Thanks!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Create a calculated attribute of type boolean lets say "Enabled".

Bind this to the element's enabled property.


public boolean getEnabled(IPrivateA.IContextElement element)
  {
    //@@begin getEnabled
        //TODO:Your Logic goes here.
        return false;
    //@@end
  }


Regards,

Ayyapparaj

Former Member
0 Kudos

Hi,

create a attribute of type boolean .

and which elements you want to disable at initial bind this boolean attribute with elements enable property.

the default value for boolean is false the elements are in disable mode by default.

so when ever you want to enable elements make this boolean attribte value as true.

if(<condition>){

wdContext.currentContextElement().setBooleanAttribute(true); // it makes elements enable.

}

Regards,

ramesh

kai_mattern2
Explorer
0 Kudos

bind the element property "enabled" to a context attribute of type boolean and set it to false.

Edited by: Kai Mattern on Sep 23, 2008 5:06 PM