Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Re: Adding new fields to the Dynamic Form

$
0
0
Hi,

I Wanted to add new fields for the existing Dynamic Form. As we don't have an option of adding new Form items to the Dynamic Form directly, I have used the below code to achieve the same.

But the problem is, If we have date or datetime as a form Item type then I am getting a below exception

Code:



for datetime type:

Unable to get the property "datetimeFormatter": Object is null or undefined.

for date type:

Unable to get the property "datetFormatter": Object is null or undefined.

Below Code used to add new Items to the form:

My DynamicForm Object ID is formObj;

I am getting the above javascript error when formObj contains the date or dateTime as formItem type.

Code:


var formItems = formObj.getItems();
var newFormItems = new Array();

for(var i=0;i<formItems.length;i++){
 
  newFormItems.push(formItems[i]);
}

var newFormItem = {name="newItem",title:"new Item",type:"text"};

newFormItems.push(newFormItem);
formObj.setFields(newFormItems);


If the above approach is not correct then please let me know the way to achieve the same.

We are working on below environment:

Smartclient version : Isomorphic SmartClient/SmartGWT Framework (9.1p_2014-09-04/PowerEdition Deployment 2014-09-04)

Browser : IE9

Thanks in Advance.

Viewing all articles
Browse latest Browse all 4756

Trending Articles