cancel
Showing results for 
Search instead for 
Did you mean: 

getting dictionary simple types in java code

Former Member
0 Kudos

Hi,

I defined two simple types in my dictionary ,now i have to use those simple types in my java code.

please suggest me ,if there is any sample code share with me..

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

suppose you have created two simple type like location and Name,nw you have two attribute location and Name.

The Location context attribute is given the data type of the new simple type Location as its value

1.Select the Location context attribute. On the Properties Page, choose ...tab to open the dialog for selecting the simple type for the type property.

2. Select Dictionary Simple Type and choose Dictionaries >Local Dictionary> com.sap.<your package name>.simpletypes-->. Choose the Location simple type and confirm by choosing OK.

do same for value attribute Name.

Hope it will help u.

Thanks

Abhilasha

Former Member
0 Kudos

Hi,

You need to set type property of context attributes to these simple types first.

Take two context attributes , attr1 an attr2 in your view and change the 'type' property of those attributes to respective simple types.

RightClick on attribute--> properties , then in properties tab below, choose type -- select *...* -- expand Local Dictionary--> <package of simpletype> --> Ok

then use this code

IWDAttributeInfo objAttrInfo=wdContext.getNodeInfo().getAttribute(IPrivateTestView.IContextElement.ATTR1);

ISimpleTypeModifiable simple=objAttrInfo.getModifiableSimpleType();

Map m=simple.getEnumerationTexts();

Collection c=m.values();

Iterator it=c.iterator();

while(it.hasNext())

{

wdComponent.getmessageManager().reportSuccess(it.next().toString());

}

in the same way for ATTR2

Regards

LN

Edited by: Lakshmi Narayana Chowdary Namala on Sep 22, 2008 9:23 AM