on 12-23-2005 6:12 AM - last edited on 02-04-2024 1:23 AM by postmig_api_4
Hi,
I have created one simple type variable of String in dictionary and has set its fixed length property to 4.
Next created a context variable of type above one and binded to text field so that it accepts only 4 characters.
Now I have a clear button which should erase all data in that text field when I click clear. So the problem is that I can clear when number of characters in text field is 4 only else giving me that length if text field did not expected length of 4 characters.
Is there any solution to implement this feature?
Thanks in advance for all your time and help.
Thanks and regards,
Shiva
Hi
do u want to work only with simple type? or else
If u want the length of the string to be 4 , then try this alternate.
Create a message of type error in the messagepool.
Let the context attribute be of type String.
In the onaction method of ur save button give the code:
{
//@@begin onActionsave(ServerEvent)
String str= wdContext.currentContextElement().get<att. name>();
int i=str.length();
if(i==4){
wdContext.currentContextElement().set<att name where u want to set>(str);
}
else{
IWDMessageManager msg= wdComponentAPI.getMessageManager();
msg.reportMessage(IMessage<comp name>.LENGTH,null,false);
}
//@@end
}
In the onactionclear()
{
wdContext.currentContextElement().setTest("");
}
Regards,
Rathna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Shiva,
The problem is that your action associated with the clear event is causing a validating round trip. To change this, double click on the action and check the "Without Validation" checkbox.
Good luck,
Atul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
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.