Find your content:

Search form

You are here

Visualforce Button open a new section

 
Share

I would ask a help with PageBlockSection, I have a Visualforce where the User can attach photos, I would have to click a button which would appear where a second PageBlockSection has another inputField to insert another picture. How can I do this?


Attribution to: Guilherme Gobetti

Possible Suggestion/Solution #1

You can use the rendered attribute to control whether a section or field is visible, so when he has finished attaching the first picture and clicks attach more, the controller in the background sets a variable which controls the rendering of the second section and displays it (you will also need a reRender attribute on button click to tell it which sections to rerender when the button is clicked). Also I would think rather than 5 actual sections, you could have five sectionItems of input fields where you put in the picture files. 5 sections would be too spaced out ? unless that is how you want to do it.

Here's a great post from @bob buzzard explaining how you can do this http://bobbuzzard.blogspot.co.uk/2011/02/visualforce-re-rendering-woes.html


Attribution to: techtrekker
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/3328

My Block Status

My Block Content