on 08-08-2006 12:56 PM
Hi,
I was trying to validate few UI elements in the Child/Popup window. But the error messages are getting displayed in the parent window rather in the child window. The MessageArea UI element is there in both Parent as well as Child windows View's.
Below is the code i have written in the child window:
public boolean isMinQuantity( )
{
//@@begin isMinQuantity()
IWDMessageManager messageMgr =
wdComponentAPI.getMessageManager();
if (String.valueOf(wdContext.currentItemElement().getMinQuantity()) instanceof String
&& wdContext.currentItemElement().getMinQuantity()!=0) {
return true;
}
else {
if(wdContext.currentItemElement().getMaxQuanity()!=0) {
messageMgr.reportContextAttributeMessage(
this.wdContext.currentContextElement(),
this.wdContext.getContext().getRootNodeInfo().getAttribute("minQuanity"),
IMessageEpsonRFQComp.MIN_QUANTITY,
null,
true);
} else {
messageMgr.reportException("Please enter Minimum Quantity which is more than 0.",true);
}
return false;
}
//@@end
}
Please help.
Thanks,
Regards,
Aditya Metukul
Hi Aditya,
Just add MessageArea UI elelement to your child window. And that`s it.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have multiple MessageArea elements, you need to disable all of them but the one you wish to display the message (in this case, the MessageArea on the child window). To disable the MessageAreas, bind their enabled properties to boolean, read-only context attributes and set those attribute values to false.
Hope this helps...
what version is your NWDS?
I am not successful in replicating this...
I have boolean context set to readonly and bound to the enabled attribute of the MessageArea UI in both windows.
I set the context attribute to false prior to showing the popup window and set it back to true after closing the popup.
I am running SP7.
Thanks
Dear Ken,
I am using SP15 for NWDS.
I guess its not the problem with the version, but with something else in the code.
Just make sure that boolean context attribute is set to false whenever you open the popup window and before that always set the boolean context attribute's readonly property to "true" and this is only for parent window'S MessageArea UI. And this worked for me.
Thanks,
Regards,
Aditya Metukul
Hi
The messageMgr.reportException() always point to the Parent and not the client
Try this
Create a attribute as error and bind it to the child view.
Create a UI element lable and bind the property text to the error attribute.
At run time set the error message to the attribute.
wdContext.current<Name>Element().setError("Please enter Minimum Quantity which is more than 0");
Kind Reagrds
Mukesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.