I'm creating a VisualForce page that is going to load records from a web service using JSON.

I have a requirement to add a button next to each record I pull. I don't see a direct way to do this with Dynamic Visualforce Components (unless I missed something). Can you bind and display a button for each record dynamically?

The button is going to load an object new record page using the values corresponding to the button bindings.

Thanks in advance.

2 Answers 2


You can define an ApexPages.Action on your parent controller/page to pass to your components.


I am not entirely clear on your data structure, if you insert the data before, or what but you can use the following to get you close

I find it simpler in these case to just use html / javascript

Using a repeat to display the records:

<apex:repeat value="{!yourrecords}" var="r">

 ..row of data ...<button onclick="window.open('/{!r.id}')">Button Text</button>


Of course this is not the be all end all solution but it is one way to do it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.