function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kay TwoKay Two 

Dynamic components, command buttons and parameters

I am adding a few command buttons dynamically by using the 

<apex:dynamicComponent/>

 

For each command button's controller action, I want to pass in a parameter value so that I know which button has been pressed. Each command button needs to have a different parameter value associated with it.

 

The use case is:

I want to display list of items a user can purchase. Each is a button. When the user clicks on the button, I need to have an item id associated with that item. These items are not regular Salesforce entities and are populated from a remote web-service call.

 

All the examples I have seen so far are simple and deal with only 1 button and on static Apex pages. None show how to pass a parameter to the controller action from a commandButton that is created dynamically.

 

How can I do this? 

Travis HendrixTravis Hendrix
Were you ever able to find a solution to this?