You need to sign in to do that
Don't have an account?
Command Button {!QuickSave} Action throws an unknown method error
I am trying to refresh the visualforce page with
<apex:commandButton value="Refresh Button" action="{!QuickSave}"/>
but it throws an error as unknown method. Can anyone please help on this?
I have also tried with
<apex:commandButton value=" Refresh " onclick="URL"/>
but still not refreshing
<apex:commandButton value="Refresh Button" action="{!QuickSave}"/>
but it throws an error as unknown method. Can anyone please help on this?
I have also tried with
<apex:commandButton value=" Refresh " onclick="URL"/>
but still not refreshing
We can write PageReference method and then clear the list.
Clear the account list.
For example if you are displaying Accounts from the list called 'AccountList'.
Then the refresh method looks like this
<apex:commandButton value=" Refresh " action="{!RefreshPage}" styleClass="buttonStyle" style="width:100px;"/>
Public PageReference RefreshPage() {
AccountList.clear();
return null;
}
All Answers
Can you share the QuickSave method from your controller or extension so that we can pin point the issue.
You have written action={!QuickSave} as the component on vf page for that custom component to work you need to write a property in controller
Thats y it is showing that error.Mark as best answer to help others find it quickly.
public void Quicksave(){
// what it does..
}
Thanks,
Deepak Agarwal.
Doesn't {!QuickSave} is standard library method so you can call it on your vf page?
Anyway, I have a search bar and once you search the name it appreas on search list. Now, if you reload the page from URL the search results goes away. I want same behaviour with "Refresh" button.
Quick save is not a standard method. Salesforce standard controller do have Save method. For complete list of standard methods please refer to
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_ApexPages_StandardController_methods.htm
Hope this helps.
I appreciate your followup prateek..
You can try something like
Replace the VFPageName with you VF page name
Please share your code for the refresh link. Did you made the changes as mentioned in my post?
<apex:commandButton value=" Refresh " action="{!RefreshPage}" styleClass="buttonStyle" style="width:100px;"/>
controller:
Public PageReference RefreshPage(){
return page.MerchandiseVFSearchBars;
}
-----------------------------------------------------------------------------------------
New code:
<apex:commandLink value="click here to refresh" onclick="window.location.href='/apex/MerchandiseVFSearchBars" />
This link is not clickable for some reson...
so I tried to convert in button and it's clickable but acting same as old code
<apex:commandButton value="click here to refresh" onclick="window.location.href='/apex/MerchandiseVFSearchBars" />
please ensure that you commandbutton is wrapped inside an apex:form
<apex:commandButton value=" Refresh " action="{!RefreshPage}" styleClass="buttonStyle" style="width:100px;"/>
<apex:commandButton value="click here to refresh" onclick="this.form.reset();return false;"/>
</apex:pageBlockButtons>
This pageblock button is under <apex:form> component.
When I click the "click here to refresh" button, it looks like the button is not clickable.
We can write PageReference method and then clear the list.
Clear the account list.
For example if you are displaying Accounts from the list called 'AccountList'.
Then the refresh method looks like this
<apex:commandButton value=" Refresh " action="{!RefreshPage}" styleClass="buttonStyle" style="width:100px;"/>
Public PageReference RefreshPage() {
AccountList.clear();
return null;
}