Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Form Development 

  2. Form Display

Step1: Form Development

In VIENNA Advantage there are two ways to create a custom form: 

  • By Partial view. 

  • By JQuery or Javacript. 

  

In case of partial view, design is load into root (i.e "div") by using jQuery load method. While in case of Java Script, design/html created in java script function and then append to the root (i.e "div"). 

In Case of Partial view 

Now go to View folder and add a partial view as shown below

...

In Case of Jscript view 

In “Vienna Advantage”, in module Areas folder, go to Scripts folder, right click on it. Select add and then select java script file option as shown below

...

In Javascript file write function constructor. FormName function is responsible to build or initialized design and handle events of elements. e.g

...

Note: MPC refer to Module Prefix Code 

  

;MPC=window.MPC||{};

Image Added

Recommended to create a self-invoking function and within this create Form Class function 

; (function (MPC, $) { 

  

//logic to implement your form 

  

//Form Class function 

//Form Class function fullnamespace 

MPC.TestForm = function () { 

this.frame; 

this.windowNo; 

  

var $root; //root of the form 

  

function initializeComponent() { 

            $root = $("<div>"); 

        

//form by partial view 

  

$root.load(" mvc controller route for partial view+WindowNo"); 

  

           

              // OR 

  

//create via jQuery or javascript 

Var btn = $("<input type='button'>") 

$root.append (btn); 

  

  

        } 

initializedComponent(); 

  

this.getRoot = function(){ 

return $root; 

}; 

this.disposeComponent = function() { 

$root = null;/ / other clean up 

  }; 

}; 

})(MPC, jQuery); 

 

...

  1. Use window no to set unique id for UI form’s elements at time of form creation to escape duplicate id issue. 

  2. In case you are using CSS in your form, then you have to use MPC as a prefix in all css classes within your module. 

  3. Never overwrite existing html tags in CSS.