Skip to Content
author's profile photo Former Member
Former Member

enable an element by code?

Hi experts,

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

Thanks!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Sep 23, 2008 at 03:05 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 24, 2008 at 04:49 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 24, 2008 at 05:14 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.