I want to call a method in the java class from the OnClick event on an inputtext. Is this possible.
Actual task is - to clear the value in the textbox onClick. If I use the script ----- onclick="this.value=''; ----- the value at the client page gets cleared but server side value in the java class stays. I want to clear the value in the java class variable as well.
What you could do is:
The server side component then calls the method on the class.
When form is submitted to servlet, your input parameter is null. So in servlet you can check a simple condition and set its mataching class data member to null.
Is that correct or i didnt understand your post correctly.