Skip to Content
avatar image
Former Member

To populate drop down in a table..

Hi,

In my Application i have a table populated from an EJB bean through a class[]....

Node:GroupNode

Attributes:user , name, location.

User attribute is the dropdown field in table..

below values are to be poupulated in the dropdown of the table from the string array.

String[] ca = { "user1","user2","user3"}

I am populating the table from my class...but i am not able to populate the dropdownbox...

Below is the code i used to populate the table:

UserDTO[] cat = wdContext.currentBeanElement.modelobject.Objuser();

for(int i-0;i<cat.length;i++)

{

IPrivateUserView.IGroupNodeElement e = wdContext.createGroupNodeElement();

e.setUser(cat<i>.getUser());

e.setName(cat<i>.getNmae());

......

wdContext.nodeGroupNode.addElement(e);

}

When I use Textview element in the table UI , the values are populating..

But I need the User column in DropDown...So when i change the UI element to Drop Down Box in User column in Table,the User Column in the table is alone empty..

How can I populate the values in dropdownbox with String[] ca = { "user1","user2","user3"} ...

And I am usin DropDownByIndex UI element...

Thanx in advance...

Arjun.G

Edited by: arjun swamy on Jan 22, 2008 7:22 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jan 22, 2008 at 06:25 AM

    Hi,

    Try to use drop down by key and populate the user details

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Can you post the code what you have used.

      And the context structure of the node bound to the table and the list.

      Regards

      Ayyapparaj

  • avatar image
    Former Member
    Jan 22, 2008 at 06:42 AM

    Hi,

    What is the cardinality of the node set to?

    Make it 0:n if it is not and then try executing the same.

    Regards,

    Murtuza

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      The cardinality of the node is 0-n..

      can you give us some code snippets to populate drop down in the tble....

      thanx ,

      Arjun.G

  • avatar image
    Former Member
    Jan 22, 2008 at 07:11 AM

    hi,

    To populate DDK

    IWDNodeInfo nodeInfo=wdContext.<your node>().getNodeInfo();

    IWDAttributeInfo attinfo=nodeInfo.getAttribute("<Your attribute>");

    ISimpleTypeModifiable mstype=attinfo.getModifiableSimpleType();

    mstype.setFieldLabel("<Label text goes here>");

    IModifiableSimpleValueSet valueset=mstype.getSVServices().getModifiableSimpleValueSet();

    valueset.put("Your key","Your Value");

    valueset.put("Your key","Your Value");

    To populate DDI

    Ex: Test -> Context node of cardinality 0..n

    Attr1 -> Attribute of type string

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

    {

    ITestElement element = wdContext.nodeTest().createAndAddTestElement();

    element.setAttr1(String.valueOf(x));

    }

    bind this to the DDI

    Regards

    Ayyapparaj

    Regards

    Ayyapparaj

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 22, 2008 at 06:34 PM

    Hi 😊

    To populate a dropdown by key inside a table, you should do it this way:

    //YOURNODENAME card: 1..n selection: 1..n    ,  attribute within node,
    // it could be card: 0..n y  sel: 0..1, depend on your liking/mandatory
    //condition.
    IModifiableSimpleValueSet ValueSet= wdContext.getNodeInfo().
    	getChild("YOURNODENAME").getAttribute("ATTRIBUTENAME").
    	getModifiableSimpleType().getSVServices().
    	getModifiableSimpleValueSet();
    
    //Fill dropdownbykey with data
    ValueSet.put("user1","user1");
    ValueSet.put("user2","user2");
    ValueSet.put("user3","user3");
    ValueSet.put("user4","user4"); //... etc.. fill to fit your needs
    	
    //Fill table with independant copies, that means choosing one doesnt modify the others
    for (int i = 0; i<5 ; i++)
    {
      wdContext.nodeYOURNODENAME().addElement(wdContext.nodeYOURNODENAME().createElement());
    }
    

    Regards

    Julio Herrera

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 23, 2008 at 05:01 AM

    thanx TO all for the replies....

    Now my drop down boxes are getting filled ...

    but it has an new issue of repetitive display of the records...

    so i am starting a new thread on it making this answered....

    Thanx.

    Arjun

    Add comment
    10|10000 characters needed characters exceeded