cancel
Showing results for 
Search instead for 
Did you mean: 

Create Dynamic Dictionary Simple Type Enumeration

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

former_member206397
Contributor
0 Kudos

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

Former Member
0 Kudos

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.