Skip to Content
avatar image
Former Member

DropDownIndex Mandatory

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jul 28, 2007 at 11:11 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 28, 2007 at 10:55 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 28, 2007 at 11:15 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 29, 2007 at 08:00 AM

    Hi Mathi,

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

    reportContextAttributeMessage for DropDownByIndex

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

    Regards,

    Omri

    Add comment
    10|10000 characters needed characters exceeded