on 06-19-2006 7:17 AM
Hi,
I am able to validate the required fields and display messages in bottom of application using following code.
private void checkMandatoryValues(String fieldName, String fieldValue, String fieldText,IWDMessageManager msgMgr)
{
if(fieldValue==null || fieldValue.length()==0){
IWDAttributeInfo attInfo = wdContext.nodeNotice().getNodeInfo().getAttribute(fieldName);
msgMgr.reportContextAttributeMessage( wdContext.currentNoticeElement(),
attInfo,
IMessageNoticeManagerComp.MANDATORY_ITEM,
new Object[]{fieldText},
true );
}
}
Now requirement, to make the UIElements( InputFileds, Dropdowns....) in red color or some thing different looking,visually indicate the fields that are missing.
Please help me in this context.Thanks in Advance.
Regards,
Davood.
Hi Davood,
Set the 'state' property of your input fields to 'required' and link your labels to the input fields with 'labelFor'. Then the labels will show a little star and users will know these fields are required.
Validation you still will have to do on your own, though.
Regards
Markus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Davood,
This is what you do in msgMgr.reportContextAttributeMessage()
Calling that method will create messages (displayed in the message area) that link (just try click them) to the fields that are bound to the context attributes. The fields also will have some tooltip with the error message.
Don't know if it is possible to explicitely set colors or things on UI elements because everything is style-sheet based as far as I know (beginners' level).
Regards
Markus
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.