cancel
Showing results for 
Search instead for 
Did you mean: 

disabled dropdownbykey is showing up

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

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

karthik.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Jawed

in the loop add these lines

IPrivateDropDownElement ele=wdContext.createDropDownElement();

--

--

--

--

wdContext.nodeDropDown.addElement(ele);

Best Regards

Chaitanya.A

Former Member
0 Kudos

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

Former Member
0 Kudos

problem soved by changing the cardinality but why I have to change cardinality from 0..n to 1..n?

Former Member
0 Kudos

Hi,

You dont have a element under the context where the data can be hold.

When you set it to 1..n frame work will create one for you.

else you need to create an element of the node using createandelement method.

Regards

Ayyapparaj

Former Member
0 Kudos

can you tell me how I am going to do this? I appreciate if you could provide some code.

Regards,

Jawed Ali

Former Member
0 Kudos

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

Former Member
0 Kudos

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