cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownIndex Mandatory

Former Member
0 Kudos

Hi friends

HOw to set mandatory in dropdownbyindex...

IWDMessageManager messageMgr = wdComponentAPI.getMessageManager();

Object attributeValue =

wdContext.currentdetailElement().getAttributeValue(fieldName);

IWDAttributeInfo attributeInfo =

wdContext.nodedetail().getNodeInfo().getAttribute(fieldName);

if (((String) attributeValue).length() == 0) {

messageMgr.reportContextAttributeMessage(

wdContext.currentdetailElement(),

attributeInfo,

IMessageForm.MISSING_INPUT,

new Object[] { fieldLabel },

true);

}

But this code is not triggered drop down index ....

Could you please tel me ..how to do that...

Thanks & regards

Mathi s

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member182374
Active Contributor
0 Kudos

Hi Mathi,

If you're asking about the lack of red border when using DropDownByIndex, I asked exactly the same question:

Since I didn't get an answer, I opened OSS. As soon as I get an answer I will post it here...

Regards,

Omri

former_member365727
Active Contributor
0 Kudos

Hi Mathi,

First time when the page loads,show a blank value in the drop down as default (for blank index = -1). Now when the user changes this value, leadselection will be changed. Display the message(to select an entry from drop down) if the lead selection <0.

To set the value as blank by default: set the selection cardinality to 0:1

Regards

Srikanth

former_member365727
Active Contributor
0 Kudos

Hi Mathi,

First time when the page loads,show a blank value in the drop down as default (for blank index = -1). Now when the user changes this value, leadselection will be changed. Display the message(to select an entry from drop down) if the lead selection <0.

To set the value as blank by default: set the <b>selection cardinality to <i>0:1</i></b>

Regards

Srikanth

Former Member
0 Kudos

What do you mean with "mandatory"? Do you mean that a value must be selected before some action may be executed? If yes, just check in the action handler that there is a value selected, i.e. there is a lead selection in the node that provides the dropdown list values:

void onListEntrySelected(...)
{
  if ( wdContext.node<Values>().getLeadSelection() != IWDNode.NO_SELECTION)
  {
    /* process action */
  }
  else
  {
    /* show message */
  }
}

Armin

Former Member
0 Kudos

Hi Armin

Thanks for ur reply...

If dropdownbyindex is blank (that means no lead selection),that fields is mandatory(indicates red color rectangular box) when I submit the form....Is possible to give context error message to dropdownbyindex...

Please advice me....

Thanks.

Mathi s

former_member182374
Active Contributor
0 Kudos

See this thread:

Omri