cancel
Showing results for 
Search instead for 
Did you mean: 

Clear first index in DropDownIndex

Former Member
0 Kudos

Hi Friends,

How to clear Perticualr index in dropxown(dropdowmindex)

Thanks & regards

Mathi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi

If you wish to clear any particular index then remove the element (as specified by the preceding post) from the node bound to the drop down by index. Incase you wish to remove only the first empty element then use the selection property in the value node. It is by default 0...1 make it 1..1.

regards

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

if it is DropDownByKey

IModifiableSimpleValueSet valueSet = wdContext.nodePersonal().getNodeInfo().getAttribute(IPublicTestComp.IPersonalElement.SPORTS).getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();

valueSet.put("CRICKET", "Cricket");

valueSet.put("BASKET", "Basket Ball");

valueSet.put("TT","Table Tennis");

valueSet.removeKey("CRICKET");

if it is DropDownByIndex.

wdContext.nodePersonal().removeElement(wdContext.nodePersonal().getElementAt(0));

here the Personal is the node which is binded to DropDown

Regards

Abhimanyu L

Former Member
0 Kudos

Hi

thanks for reply.....

You have created a contextnode personal.....

The personal node has some property

Like

IntialLeadselection--->can we do intial lead selection through coding?....

Cardinality

Selection

Singleton...

Thanks

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi

You can create a context node dynamically at runtime, at that time you can specify the cardinality and some other properties..

The method to create dynamic context node.

wdContext.getNoddInfo().

addChild( java.lang.String name,

java.lang.Class elementClass,

boolean singleton,

boolean mandatory,

boolean multiple,

boolean mandatorySelection,

boolean multipleSelection,

boolean initializeLeadSelection,

java.lang.String dataType,

IWDNodeCollectionSupplier supplier)

But, i didn't find any clue to change the properties of already existing context node.

There are methods only to check isSingleton or not isMultiselect or not etc..

Regards

Abhimanyu L

Message was edited by:

Abhimanyu Lagishetti

Former Member
0 Kudos

Hi

I will tel u ,what i am done...

I have created one dropdown and populate the values from backend..

1.My Rfc model has no empty Rows

2.I go to change selection property 0..1.

If I set Initial selection property is True -->always display first vlaue...

If I set Initial selection property is false -->Initially blank

<b>I want to the drop down should be initially blank</b>

The second option is rectified my issue...

Is this way only possible(or any other way)?

Also tried setLeadSeletion(-1)..It not worked {at the same time runtime error displayed...There is no leadSelection for (-1)...Yes... Because no empty values in RFC model...}

Thanks

Mathi s

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Mathi

As a practice i always use Value Nodes in the Layout, model node data should not be exposed directly for user input.

it gives you flexibility in validation and all.

you can create a value node of similar structure and always use..

WDCopyService class to copy the elements.

then you can play with the value node.

Regards

Abhimanyu L

Former Member
0 Kudos

hi

Add an empty instance to the data source at any index you want.

wdContext.nodeVn_yournode().addElement(i,ele);

And set the lead selection.

It is not possible when you have a mapped model node.

regards

LNV

Former Member
0 Kudos

Hi,

Thanks For ur reply....

Is possible to give <b>reportContextNodeMessage</b> Like as reportContextAttributeMessage?

If Possible,Please tel me How to do?

Thanks & Regards

Mathi