cancel
Showing results for 
Search instead for 
Did you mean: 

drop down by index

Former Member
0 Kudos

Hi All,

how to populate the drop down by index with values..,

I created a dropdownbyindex element and bind it with a multiple element node which has a simple type but it is not getting populated?

help me

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello Bharath,

Here is a link which really fulfills your requirement.

This link will serve your purpose .If u find any problem please feel free to contact me with best of my efforts.I will sent you more documents as i will find as per your requirements.

xxxxxxxxxxxxxxxxxxxxx

Warm Regards,

Rakesh Kumar Verma

Edited by: Armin Reichert on Mar 14, 2008 2:07 PM

Former Member
0 Kudos

Hi bharath,

Post ur code here...

Regards,

P.Manivannan

Former Member
0 Kudos

1. Create a node called item

2. Create an element within this node called value.

3. Write this code in wdDoInit()

for(int i=0; i<10;i++)

{

IPrivate<ivewname>.IItemElement ele = wdContext.nodeItem().createItemElement();

ele.setValue(i+"");

wdContext.nodeItem().addElement(ele);

}

Regards,

Murtuza

Former Member
0 Kudos

Hi bharth,

If u want display static data u can do following steps

1.create one node called role

2. under role create one attribute called ctx_role

3. create Dropdownbyindex ui element

4. assign the ctx_role attribute to dropdownby index--->text property

4. choose the cardinality value of the role node is 0...n

selection--->1...1

String role[] = { "Program Manager", "Administrator","Client","AIC","Project Manager","Team Leader/PL","Team Member" };

for (int i = 0; i < role.length; i++) {

ele = wdContext.nodeRole().createRoleElement();

ele.setCtx_role(role<i>);

wdContext.nodeRole().addElement(ele);

}

thats it

Regards,

P.Manivannan

Former Member
0 Kudos

Hi Mani,

Thanks for the reply but I want to use a simple type..,I bind it to a attribute of type simple type..,then how can I go ahead?

Former Member
0 Kudos

For populating a drop-down list from the value set of a DDIC type, you have to use the DropDownByKey UI element.

Armin

Former Member
0 Kudos

Hi Armin,

I am using the drop down by key element now..,but now I have a different problem..,I have 2 selections in that drop down but Initially it should show "select output" as the first option in the drop down..so I used the below code to do that...

IPrivateSelectionView .IVn_rep_typeElement ele=wdContext.nodeVn_rep_type() .createVn_rep_typeElement() ;

ele.setStr_rep_typ( "**-Select Output Type-** ");

wdContext.nodeVn_rep_type().addElement( 0,ele);

So it is working fine..,but now the problem is after selecting the option in selection , it is going to the second screen .In the second screen I have a functionality called "BACK" .If I press that back button and come back to the selection screen..,I could not see the " select output" option in the drop down?

How to solve this problem..?

Thanks in advance.

Bharath .A

Former Member
0 Kudos

Can't you just put this attribute directly under the context root. Why this extra node and creation of node element?

If you want to use this attribute from several views, move it into the component controller and map it from both views.

To restore the drop-down list selection, you could set the attribute value to its initial value in the action handler for the BACK button.

Armin

Former Member
0 Kudos

Hi Armin,

Your answer is quite confusing..Can you explain it clearly..?

If we bind dropdownbykey to a attribute under context instead of a node attribute ,how can we populate more values to select?Can you give me some idea.

And one more thing that BACK button is in the second view,How can I initialize the first view node in that?

And also explain me how to Initialize the node?

Thanks in advance.

Former Member
0 Kudos

Quite confusing? Please read again carefully.

The DropDownByKey gets its entries form the DDIC type of the bound context attribute. Thus it does not matter where this context attribute lives. Putting it on the root level avoids creation of a separate node (and node element) explicitly.

I didn't talk about initializing a node. To reset the selection of the drop-down list from the BACK button handler, just set the context attribute value ("selectedKey" property is bound to this) to the first entry's value again

Armin