Create form

Hello I want to write method to create form for following case 1.create section in a form can anyone please explain?
  • Former Member
    Former Member
    Hi Angela, I think you will have to explain a little more exactly what you want to do. What do you mean by "a section in a form"? What is the bigger problem you are trying to solve? If you can supply a little more information people are more likely to be able to help. Cheers, Brian.
  • Hello Brian, I created two forms First one with name ABC having one single button.And second named DEF with one groupBox.Now I want event on first form so that on click of button on first form second form should open. Angela
  • Former Member
    Former Member
    Hi Angela, I presume you want the onClick event to show the other form as a Dialog.  
    var ctx = document.thisItem;
    var q = ctx.newItem("Form", "get");
    q.setAttribute("select", "id,width,height");
    q.setProperty("name", "DEF");  //your form name goes here
    var r = q.apply();
    
    var height = r.getProperty("height", "500");
    var width = r.getProperty("width", "500");
    
    var param = new Object();
    param.title = "Title of dialog box goes here"; 
    param.formId = r.getItemByIndex(0).getID(); // the id of the Form to be used
    param.item = ctx;
    param.aras = top.aras; // the aras object
    param.isEditMode=true;
    
    var res = showModalDialog(
    "ShowFormAsADialog.html",
    param,
    "dialogHeight:" + height + "px; dialogWidth:" + width + 
    "px; " +
    "status:0; help:0; resizable:1; scroll:0;"
    );
    
    Put the above code into a method that you call from the onClick of the button.
    This should show the dialog box DEF. Hope this helps. Brian.
  • Former Member
    Former Member
    Hello all I also have same query with little change in it. I want to create two section (bar) naming A & B. Section A has 3 different field (name, image and number respectively) and B section contain 1 button. 1.My requirement is When user clicks on button "section A" should have come with all 3 fields automatically. (I am using Event= on click) 2.Section also has some background color. 3.Section and group box is same or different
  • Hello Brian,, I tried with this it is giving error as 'ShowModalDialogIsNotDefined' do you have any idea about this? Angela