on 10-24-2006 8:51 PM
Hi,
In the dropdowm by index, I want to throw error if the selected value is blank, how can I do that?. I tried to get value something like here.
String = wdContext.currentT_Material.getMatnr();
if I select blank, I am getting null pointer exception.
T_material is from R/3. How can I throw error if I select blank?.
Thanks,
Sunita.
if (wdContext.currentT_Material() == null)
{
/* nothing selected */
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
can u plz check once again, how can we write that statement, I am getting error when I write like that,
as currentT_Material() is undefined.
I want to write a message when we select blank field, and press the next button. So we should select something.
One more thing, whats the standard way (efficient way) to process the mandatory field. Since I have more than 10 fields, If mandatory field is blank, I want to throw error.
Thanks-a-lot for help.
Sunita.
Message was edited by: sunita
Hi
One more thing, whats the standard way (efficient way) to process the mandatory field. Since I have more than 10 fields, If mandatory field is blank, I want to throw error.
public void checkMandatory(String name,String filedContextID)
{
String attributeValue = wdContext.currentContextElement.getAttributeAsText(filedContextID);
String attributeinfo = wdCotext.getNodeInfo().getAttribute(filedContextID);
if(attributeValue ==" ")
{
msgMgr.reportContextAttributeMessage(this.wdContext.currentContextElement(), attributeInfo,
IMessageSimpleErrors..MISSING_INPUT, new Object[] {"Name"},true);
}
}
Declare u context attribute name in current View method
Where you used this method.
This.checkMandatory("Ur errorMsg",Attributeof declaredView);
Or Do u need to * red color ur input filed label do follow.
set the property state as required for the input Field
In the Label's property labelFor set the coressponding text field's Id.
Thanks,
Lohi
Sunita,
I think the one which Roberto suggested will work fine. If u wanna throw an error message, u can either catch the exception and 'throw' it or u can use 'message manager'.
if (wdContext.nodeT_Material().getLeadSelection() == -1)
{
IWDMessageManager msgmgr = wdComponentAPI.getMessageManager();
msgmgr.reportException("No lead selection in dropdown", true);
}
Regards,
Aparna .P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.