Could 1C create dynamic form by adding controls by code?

Understanding basics of 1C:Enterprise platform. To start working with 1C:Enterprise platform visit Getting started page

#1
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Aug 17, 2012
Company:

I want to add controls to form which bind data from catalogs. Could 1C support Invoke method or CreateInstance like C#?

 
#2
People who like this:0Yes/0No
Active user
Rating: 7
Joined: Sep 26, 2012
Company: individual

Yes, you can. i have some example, may be it help to you

Code
// add attributes to form

FormAttribute_1 = New FormAttribute("id1", new TypeDescription("DynamicList"));
FormAttribute_2 = New FormAttribute("id2", new TypeDescription("String"));
   
addAttributes = New Array;
addAttributes.add(FormAttribute_1 );
addAttributes.add(FormAttribute_2 );
   
someForm.ChangeAttributes(addAttributes);

// add items to form
curItem_1 = someForm.Items.add("id1", Type("FormTable"));
curItem_1.DataPath = "id1"; //add attribute id1 before
curItem_1.ChangeRowSet = False;
curItem_1.ChangeRowOrder = False;
curItem_1.CommandBarLocation = FormItemCommandBarLabelLocation.None;
curItem_1.Height = 4;

curItem_2 = someForm.Items.add("id2", Type("FormField"));
curItem_2.Type          = FormFieldType.InputField;
curItem_2.DataPath       = "id2"; //add attribute id2 before
curItem_2.TitleLocation    = FormItemTitleLocation.Right;
curItem_2.Title       = "some text";
curItem_2.SetAction("AutoComplete", "id2AutoComplete");
curItem_2.SetAction("OnChange", "id2OnChange");

// add command
new_command = someForm.Commands.Add("new_command");
new_command.Title = "title of command";
new_command.Action = "someAction";
new_command.ToolTip = "tooltip of command";
new_command.Picture = PictureLib.ListSettings;
            
new_button = someForm.Items.add("button_1", Type("FormButton"), someForm.CommandBar);
new_button.On lyInAllActions = True;
new_button.CommandName = "new_command";

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.