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

disabled dropdownbykey is showing up

I have added dropdownbykey form element and binded it controller attribute node. I have put following code to initialize the drop down.

  public void wdDoInit()
  {
    //@@begin wdDoInit()
	String locations[] = new String[]{"Economy","Compact","Intermediate","Full Size","Premium","Luxury","Convertible","Mini Van" };
	IWDNodeInfo csn=wdContext.nodeDropdown().getNodeInfo();
	IWDAttributeInfo cattinfo=csn.getAttribute("location");
	ISimpleTypeModifiable cmstype = cattinfo.getModifiableSimpleType();
	cmstype.setFieldLabel("Cities");
	IModifiableSimpleValueSet cvalueset=cmstype.getSVServices().getModifiableSimpleValueSet();
	for (int i = 0; i < locations.length; i++) {
		cvalueset.put(locations<i>, locations<i>);	  
	}    
    //@@end
  }

when I am running application, a disabled dropdown box shown up. Can any body tell me how to fix this? or what I have been doing wrong?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 10:28 AM

    Hi,

    Change the cardinality of the node as 1..n from 0..n.It will enable.

    karthik.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 10:18 AM

    Hi Jawed

    Only the DropDownListBox is disabled or rest all UI elements have the same problem

    Looking like you havent created a node element..

    create a node element and add that to node

    Best Regards

    Chaitanya.A

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Chaitanya,

      I have created following nodes in context.

      Controller Context:

      + dropdown ( value node )

      |---- location ( value attribute)

      and associated this mapping with view context attributes(similar hierarchy).

      regards,

      Jawed Ali

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 10:22 AM

    Hi,

    <b>Check the cardinality of the node bound to this control make it 1..n</b>

    The property <b>selectedKey</b> must be bound to a context attribute Key having a simple type like String with a value set.

    The selectable items of the drop-down list are the keys of the value set, the displayed texts are the corresponding values. The currently selected item is given by the current value of property selectedKey.

    Regards

    Ayyapparaj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 21, 2007 at 10:31 AM

    Hi Jawed

    in the loop add these lines

    IPrivateDropDownElement ele=wdContext.createDropDownElement();

    --

    --

    --

    --

    wdContext.nodeDropDown.addElement(ele);

    Best Regards

    Chaitanya.A

    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.