You need to sign in to do that
Don't have an account?
Controller Methods
Hi,
I am new to the salesforce platform, and I am creating a custom visualforce page to do some work on a datatable (it is a popup from a list button forone of my custom objects) right now I am just using the standard controller for that custom object, and I am displaying some data in a dataTable, and then I have some commandButton's. Now my question is, I want to have an action performed on this data when one of the buttons is clicked, but it's sort of complex, so I figured maybe I can write a custom method for this controller? Can salesforce do this?
Also, how do I make a cancel button simply close the page with no changes? is there a default Action for that?
Loving the platform so far, just wrapping my head around it.
Thanks, Scott
Yes, Salesforce can definately do this.
<apex:commandButton action="{!cancel}" value="Cancel" />
This would give you the default action for the cancel button.
All Answers
Yes, Salesforce can definately do this.
<apex:commandButton action="{!cancel}" value="Cancel" />
This would give you the default action for the cancel button.
Thanks hehe, that solves the simple part.... now for the custom controller... looking for references at the moment...
Scott
If standard controller is mostly doing what you need, then you should look into writing an extension, rather than a custom controller. Extension allows you to add actions while still having all the standard functionality.
Wow, I didn't even think of that, do controller classes extend just like any other Java class? can I override and overload methods if need?
A controller extension is not quite like a java class extension, but you can override standard actions.
I think there are good examples in the docs.