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
Neal03416264103989518Neal03416264103989518 

How to render a field multiple times on Visualforce page?

Hi,

I ahve a requirement where I need to give the user an ability to enter a free text multiple times. FOr eg; I have a field named PIN. I will create a button named 'add additional PINs'. On click of the button the field should be rendered multiple times on the page. User will enter the value and the values entered in each field  must be stored in a Long text area field seperated by commas. 

Can I achieve this in VF page? Any suggestions on the code please!!

Thank you in advance for the help!!
Sure@DreamSure@Dream
You can create list of innerClass and try that
PeaceMakerPeaceMaker
Create a new VF Page with a controller or extensions , Declare a wrapper class like 

public class addpin
{
public string inputpin{get;set;}
}

whenever user clicks on add new pin button, create a dummy entry and reload the datatable or pageblocktable. while saving iterate through the wrapper class and (read) all the values from the wrapper class  "inputpin" and finally save to the rich text field separated by comma.

Hope this helps :)
Neal03416264103989518Neal03416264103989518
Hi suresh and Peace maker,

Thank you so much for the prompt response. 

I am am a newbie to the programming world. I really tried hard to understand the wrapper class but I could not figure out the logic. I know it's more to ask, but Could you please help
me with the code for my requirement and I will be able to understand it better. 

Thank you !!!
PeaceMakerPeaceMaker
Have  a look at this URL, you will get an idea of using Wrapper class.

Wrapper class are nothing but a placeholder for records/data. where you can declare , store and use for later DML operations.

http://www.forcetree.com/2009/07/database-search-and-selection.html