on 11-06-2007 12:53 PM
Hi,
I have created a view that has an input field and a "save" button.
The save button is disabled by default, and should become enabled only if some text was written to the input field. As for now, the best I could do is to enable the button after pressing "Enter" from the input field.
I would like to know, if there is a more elegant way, in which the button will be automatically enabled the moment the text is inserted, and disabled if one deletes the text.
Thanks,
Oren.
Hi ,
Make a boolean variable which will be set to the enabled prpoperty of ui elementt - button.
Your input field UI would also be binded to a context - say XXX,
Place a code in the OnEnter Event of the inputelementUI ,
in that code checkif the lenght of the string entered is greater than 0. in that case simply set the boolean varialble above to true , the button would be enabled
Message was edited by:
Vivek Mishra
Message was edited by:
Vivek Mishra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
OK, so instead, I intead to leave the "ok" button enabled, but if pressed, and the the input field is empty - I want to emphasize the input field with a red frame.
Is this possible?
Thanks,
Oren.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Oren
You can achieve this by creating an item in Message Pool and then using that in your code like
if length()<0 then you can throw raisependingException. code will look like
IWDNodeElement task = node.getElement();
manager = wdComponentAPI.getMessageManager();
IWDAttributeInfo attibute = node.getNodeInfo().getAttribute(XX);
String message = wdComponentAPI.getTextAccessor().getText(IMessageXX.Messagepool_Name);
manager.raiseInvalidContextAttributeException(task, attibute, message, true);
manager.raisePendingException();
Best Regards
Chaitanya.A
Yes, this is possible.
Open the message editor and create a message with message key as Blank and text as Please enter some value and type can be standard,error or warning.
Now, OnAction of the button wirte this code.
IWDAttributeInfo attr = wdContext.getNodeInfo().getAttribute(<name of the attribute binded to the input field>);
wdComponentAPI.getMessageManager().reportContextAttributeMessage(wdContext.currentContextElement,attr,IMessage<component name>.BLANK,null,true);
Warm Regards,
Murtuza
Oren,
Unfortunately web dynpro doesnt support Java Script and it doesnt have any methods for your functionality.
onEnter you have to write to enable. But i dont think it would make sense to use.
Regards,
Sridhar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Oren,
Their is no Change event or key press event . Unless a round trip is triggered this will not work.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The answer to your question would be No.
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.