on 05-25-2009 6:45 PM
Hello gurus!
I have a doubt about a validation in a textfield. I have done a little code to validate the textfield only receive letters. The code works fine but the problem is with the warning message I want to display. Below the screen a warning message is displayed when somebody writes something different ti letters, but I want this to appear in a textbox right below the textfield too. In a tutorial I've found an example doing this but this, receiving 3 arguments. In my code if I try to put only 3 arguments an error message tells me that the code is expecting 5 arguments. Here is my code:
*messageMgr.reportContextAttributeMessage(wdContext.nodeBuscaIniciativasForm().currentBuscaIniciativasFormElement(),*
** wdContext.nodeBuscaIniciativasForm().getNodeInfo().getAttribute(element.NO_CLIENTE),**
** IMessageIniciativasComp.SICRESE__NO_CLIENTE,**
** new Object[] ,**
** true);**
And there is the tutorial example:
messageMgr.reportContextAttributeMessage(wdContext
.currentContextElement().getAttributePointer(fieldName),
IMessageSimpleErrorsComp.MISSING_INPUT,
new Object[] );
Is there anything I have missed??
Regards IA
Hi Armando
The method that you are using is deprecated. try to use this:
messageMgr.reportContextAttributeMessage(wdContext.nodeBuscaIniciativasForm().getNodeInfo().getAttribute(element.NO_CLIENTE),
IMessageIniciativasComp.SICRESE__NO_CLIENTE,
new Object[] { fieldLabel });
messageMgr.cancelNavigation();
The quantity of objects that you need to have in the 3° parameter, must be exactly the same quantity of parameters that you have in SICRESE__NO_CLIENTE message in message pool.
Regards
Marcos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Marcos
Thanks for the answer. i've applied the code you kindly sent me but this error appears:
The method reportContextAttributeMessage(IWDNodeElement, IWDAttributeInfo, IWDMessage, Object[], boolean) in the type IWDMessageManager is not applicable for arguments (IWDAttributeInfo,IWDMessage, Object[])
The version I am using is the 7.0.11.
Regards
Hi Armando,
Can you try this code:
messageMgr.reportContextAttributeMessage(wdContext.nodeBuscaIniciativasForm().getNodeInfo().getAttribute("NO_CLIENTE"),
IMessageIniciativasComp.SICRESE__NO_CLIENTE,
new Object[] { "fieldLabel"});
I hope this will resolve the issue. In case you face any other issue then please let me know.
Thanks and Regards
Pravesh
Hi Armando
In version 7.0 doesn't have this method with this parameter, because this the error appears.
I've Tried with this 2 methods:
wdComponentAPI.getMessageManager().reportContextAttributeMessage(wdContext.nodeBuscaIniciativasForm().currentBuscaIniciativasFormElement().getAttributePointer(wdContext.nodeTest().currentTestElement().NO_CLIENT),
IMessageIniciativasComp.SICRESE__NO__MESSAGE,
new Object[] { "Parameter 1" });
And
wdComponentAPI.getMessageManager().reportContextAttributeMessage(wdContext.nodeTest().currentTestElement(),
wdContext.nodeTest().getNodeInfo().getAttribute(wdContext.nodeBuscaIniciativasForm().currentBuscaIniciativasFormElement().MESS),
IMessageIniciativasComp.SICRESE__NO_MESSAGE,
new Object[] { "Parameter 0" },
true);
In both you need to create one message in messgae pool with the name "sicrese_no_message" with one parameter in the message "".
hi Armando
For a while i can't help in this case.
I never put one message per field. I always put only one message area, with all the messages.
I don't know if you saw , but when you click in message error, the focus is set to the field which cause the error. Then you know what is the problematic field.
Regards
Marcos
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.