Multiple custom form controls within a single usercontrol

Posted by Community Admin on 04-Aug-2018 17:42

Multiple custom form controls within a single usercontrol

All Replies

Posted by Community Admin on 08-Aug-2011 00:00

I am attempting to extend the example found at the link below.
http://blog.falafel.com/blogs/peterkinmond/11-03-14/Creating_Custom_Form_Controls_in_Sitefinity_4_0.aspx

I would like to have a group of textboxes with pre populated data that would be placed on a page with a single control from the toolbox. So far I can have multiple input controls display on the rendered form, however the values are not persisting to the DB and are not being reflected in the responses recorded from the form submission.

Anyone have any insight as to what is missing to get this behavior? Is it even possible or will I have to have each pre populated text box a separate control in the forms toolbox?

Thanks,

Tony

Posted by Community Admin on 11-Aug-2011 00:00

Hello Tony,

The controls on a form control act as a filed setter. for example if you create a form with 3 of the out of the box text inputs it will create 3 fields (columns) in the table for this form which will store the input. When building a custom widget for the forms module and you want it to to store the values of each textbox in the same field you will have to combine the input in the bellow JS methods:

// Gets the value of the field control.
get_value: function ()
   //here get the input from all textboxes and format the input string
    return this._textbox.get_value();
,
 
// Sets the value of the text field control depending on DisplayMode.
set_value: function (value)
    //parse the value so that you can populate each textbox
    this._textbox.set_value(value);
 
,


Kind regards,
Radoslav Georgiev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed