cancel
Showing results for 
Search instead for 
Did you mean: 

Validation for DropDown Box

Former Member
0 Kudos

hi,

I want to do validation for dropdownbox. What I have done:

public void checkSelected(java.string.fieldName)

{

Print Message from Message Pool.

}

onActionsubmit()

{

checkSelected(IPrivateView.IMaritalStatusElement.Value)

checkSelected(IPrivateView.IBloodGroupElement.Value)

}

How can I pass node dynamically so that this single method"checkSelected" works for two DropDownbox?

Please help me...

Regards

Manish

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can't. There are 2 dropdownboxes and both are mapped with two different attributes, so you need to make a call to checkSelected(java.string.fieldName)

two times.

thanks & regards,

Manoj

Former Member
0 Kudos

Hi Manoj,

If we pass the node information dynamically so that somehow

node.getLeadselection==-1 will applicable just like attribute case for input field.

Thanks & Regards

Manish

Former Member
0 Kudos

Hi manish,

take the refference of ur DropDownByIndex in wdModifyView. at runtime map an action event using mappingOfAction method. take 2 different event id's for different ddBoxes. pass that event id at runtime to event handler.

u can check dynamic binding of events ,in case u want any calrification

regards

Sumit

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Manish, i explained how to do that here

[Dynamic validation regardless UI element.|;

Check my post at the bottom.

Regards

Julio César Herrera

Former Member
0 Kudos

Hi,

use as follows

public void validate(IWDNode node, String attrName)

{

// To access a value

node.getCurrentElement().getAttributeValue(attrName);

//To get attrinfo

node.getNodeInfo().getAttribute(attrName);

}

invoke the above function

validate(<YourNode>,<Your Attribute part of 1param node>);

Regards

Ayyapparaj