You need to sign in to do that
Don't have an account?
Gaurav Agnihotri
How to reset the input Text value to blank on a click of a button
Gurus,
I am doing a simple search and displaying the result. I am getting the value of the input field by
Apexpages.currentPage().getParameters().get()
by using the code below:
However, it does not update the value to blank on the visualforce page.
Any suggestions?
I am doing a simple search and displaying the result. I am getting the value of the input field by
Apexpages.currentPage().getParameters().get()
String Name = Apexpages.currentPage().getParameters().get('Name'); String Description= Apexpages.currentPage().getParameters().get('Description'); String ProductType= Apexpages.currentPage().getParameters().get('ProductType');Now, I want to clear the values on ProcessSelected() method
by using the code below:
Apexpages.currentPage().getParameters().put ('Name',null);
However, it does not update the value to blank on the visualforce page.
Any suggestions?
Without gutting your code and pursuing a different approach, if you create another Javascript function:
Then just add an "oncomplete" to your actionFunction to clear that field via the Javascript function:
That should do it without refactoring!
All Answers
Name=null;
Description=null;
ProductType=null;
Can you give me an example. I am totally lost here.
Without gutting your code and pursuing a different approach, if you create another Javascript function:
Then just add an "oncomplete" to your actionFunction to clear that field via the Javascript function:
That should do it without refactoring!
Name='';
Description='';
ProductType='';
Your changes are clearing any text I type in the search . How can I use this for action ProcessSelected
I think we are misunderstanding each other. What is the actual desired result (not technical) that you're trying to achieve? I understood that you were trying to clear the "Name" field after your search ran via "ProcessSelected".
I was able to get the desired result by adding oncomplete on apex:commandButton
It works fine.
Thank you for your help.
Regards,
Gaurav