Skip to Content
avatar image
Former Member

Create Dynamic Dictionary Simple Type Enumeration

Hi, I'm working with WebDynpro and MDM Java API and I have created some EJB's to extract info from MDM and use it on WebDynpro.

Is there any chance that I can use the data that comes from MDM via the EJB's to create a dynamic filled enumeration on a certain symple type in the Data Types from the Local Dictionary on my WebDynpro Project?

By dynamic I mean that the values for the enumeration on the data type are dynamically generated instead of filling the values manually using the enumeration tab on the simple type definition.

Thanks for your help.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jun 14, 2007 at 02:27 PM

    Hi,

    You can do one thing that in Web Dynpro you can create value Node and value attributes and store data within the attributes dynamically.

    But in dictionary you can not create the field dynamically.

    Thanks

    Chandan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Chandan, I've already did that on my WebDynpro, the problem is that one of the list is a Manufacturer List with 3180 values, and I need to create 6 different Value Node for each Manufacturer, dynamically created, and that takes too much time to load.

      In the Component Controller I have this Context nodes:

      Manufacturer1

      Manufacturer2

      Manufacturer3

      Manufacturer4

      Manufacturer5

      ManufacturerWW

      All this values are filled via the next code

      fillManufacturers(

      IPrivateAddUserComp.IContextElement.MANUFACTURER1,

      arrayManufacturers);

      fillManufacturers(

      IPrivateAddUserComp.IContextElement.MANUFACTURER2,

      arrayManufacturers);

      fillManufacturers(

      IPrivateAddUserComp.IContextElement.MANUFACTURER3,

      arrayManufacturers);

      fillManufacturers(

      IPrivateAddUserComp.IContextElement.MANUFACTURER4,

      arrayManufacturers);

      fillManufacturers(

      IPrivateAddUserComp.IContextElement.MANUFACTURER5,

      arrayManufacturers);

      fillManufacturers(

      IPrivateAddUserComp.IContextElement.MANUFACTURER_WW,

      arrayManufacturers);

      As you can see, arrayManufacturers is the list of Manufacturers that comes from an MDM Table via the API.

      This is the function that fills the nodes:

      public void fillManufacturers(

      String attribute,

      LookupFlatValuesModel[] stringArrayManufacturers) {

      IWDAttributeInfo theManufacturerAttributeInfo =

      wdContext.getNodeInfo().getAttribute(attribute);

      ISimpleTypeModifiable theManufacturerSimpleTypeModifiable =

      theManufacturerAttributeInfo.getModifiableSimpleType();

      IModifiableSimpleValueSet theManufacturerModifiableSimpleValueSet =

      theManufacturerSimpleTypeModifiable

      .getSVServices()

      .getModifiableSimpleValueSet();

      for (int j = 0; j < stringArrayManufacturers.length; j++)

      theManufacturerModifiableSimpleValueSet.put(

      String.valueOf(

      stringArrayManufacturers[j].getLookupFlatValueCode()),

      stringArrayManufacturers[j].getLookupFlatValueDescription());

      theManufacturerModifiableSimpleValueSet.sort(false, true, true);

      }

      Thanks for your help.

  • avatar image
    Former Member
    Jun 14, 2007 at 04:07 PM

    Hi,

    You can try this out. Let's say the node attribute which needs the enumeration is called "Foo".

    HashSet enumSet = new HashSet();
    
    //Add all entries from the EJB call
    enumSet.add(...);
    //...  
    
    wdContext.getNodeInfo().getAttribute("Foo").getModifiableSimpleType().setEnumeration(enumSet);

    Regards,

    Satyajit.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Satyajit, this could help, but the problem is that I'm using the EJB as a WebServices and then I'm importing it as a model in WebDynpro.

      I dont want to change my models from WebServices to EJB's as a first option.

      My main question is if its possible to create a Simple Type that is filled Dynamically, from outside or inside the Web Dynpro in the Local Dictionary so I will not have to fill my 6 context node for manufacturer.

      Thanks.