cancel
Showing results for 
Search instead for 
Did you mean: 

Need example for code use with Simple Type Enumeration

Former Member
0 Kudos

Hello,

I've created a Simple Type Enumeration in my Web DynPro Project's Local Directory.

I see that there is an option there to generate a class representation of this Enumeration. Can someone please show me an example code of how to use this Class. For example, to go over the Enumeration and get all the values?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi Roy,

Try this.

Iterator chk =

wdContext.nodeB().getNodeInfo().getAttribute("val").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet().entrySet().iterator();

I will check it and tel u in some time...

Regards

Bharathwaj

Message was edited by: Bharathwaj R

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

It will show a null pointer exception if their is no attribute of that name.

wdContext.getNodeInfo().getAttribute wil look at attributes directly under the root of the context. To access elements inside a node have to write

wdContext.node<name>().getNodeInfo().getAttribute("val name").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet().getText("value of enumeration text"));

Regards

Bharathwaj

Former Member
0 Kudos

Hey,

Is it possible to create an Iterator which will go over all the Keys/Values of this Enumeration?

Former Member
0 Kudos

Hi,

U can go write

wdContext.getNodeInfo().getAtrribute("Attribute").getModifiableSimpleType().getsvsERVICES().getModifiableSimpleValuesSet.getText("Key");

Regards,

Sowjanya.

Former Member
0 Kudos

Hey,

It doesn't seem to work, I receive NullPointerException.

I set at the getAtrribute the name of the Simple Type I've created and at the getText the Value I want from it.

Former Member
0 Kudos

getAtrribute(<Context-AttributeName>)

getText(<Key of the Key-Value pair>)