You need to sign in to do that
Don't have an account?
AndreiG
How to update records after clicking the button “Save”?
Hi!
I am using <apex:inlineEditSupport>. I can edit all the records which are displayed in the table. But....when I click the button Save it redirects me to its original tab without saving any changes to the records.
I am looking to accomplish the following: after clicking “Save” all the changes are updated and the page is refreshed.
Thanks
I am using <apex:inlineEditSupport>. I can edit all the records which are displayed in the table. But....when I click the button Save it redirects me to its original tab without saving any changes to the records.
I am looking to accomplish the following: after clicking “Save” all the changes are updated and the page is refreshed.
Thanks
I've recreated your scenario in my dev org, and it seems that inline editing doesn't like it if you don't use an outputfield to in the column.
Try the following changes:
You will still end up on the home page, but when you navigate back you should see the updated data. If you want to remain on the existing page, you'll need an extension controller that executes the parent standard set controller save and then redirects back to the current page.
All Answers
Have you given your save button an action method that saves the record to the database?
e.g. if you are using a standard controller, that provides a save method for the record:
Hi! Thanks for reply.
Yes, I have given to the save button an action method that saves the record to the database. The code is below:
Did I miss something?
Actually, it redirects me to the home tab even if I click on Edit, Cancel button. I can not figure out where is the problem....
Returning to the home tab is documented behaviour for the Standard Set Controller class, if there is no original page defined (which I think means if there is no retUrl parameter on the URL).
I'm wondering if its the fact that you've given the same name for the standard controller and recordsetvar:
This may confuse the controller between the list of records being edited and the prototype record used for mass updates.
Try changing to the following and see if that helps - you'll need to change your value backing the pageBlockTable too.
It won't show any records in this case as the variable backing the table is that of the prototype object, Catalog__c.
You'll need to change your pageblock to:
in order to display the existing records.
Returning to the home page is expected behaviour - both the cancel and save methods from the standard set controller will send you back to the home page. If you make the change above, you should be able to update your records as part of that.
Hi Thanks again for your reply. Yes, I have changed my pageblock and the existing records are displayed.
Still....after clicking any of the buttons it redirects me to the Standard Home Page and it doesn't save changes to the record, even if I click Save. What should I do?
I've recreated your scenario in my dev org, and it seems that inline editing doesn't like it if you don't use an outputfield to in the column.
Try the following changes:
You will still end up on the home page, but when you navigate back you should see the updated data. If you want to remain on the existing page, you'll need an extension controller that executes the parent standard set controller save and then redirects back to the current page.
Thanks! The changes are saved after clicking the button. Now....I need to resolve with the extension.