Add new Tab to TabPanel and insert CustomWidget

195 views
Skip to first unread message

javier.c...@gmail.com

unread,
Apr 21, 2015, 6:33:31 AM4/21/15
to suppor...@runmyprocess.com
Hi, I have a TabPAnel with one tab (index 0) and I like insert with javascript a new Tab.

tab_detail.insertInsideTab(1, id_tab1);

But the id_tab1 is a CustomWidget where are some fields. When I insert, RMP return this error.

"his widget can not be instantiated dynamically from Javascript!"

I can't add a Custom Widget dinamically in a tab?

regrats

javier.c...@gmail.com

unread,
Apr 21, 2015, 6:41:46 AM4/21/15
to suppor...@runmyprocess.com, javier.c...@gmail.com
The CustomWidget are loaded in a First Tab. And I like load the same CW y news Tabs.

Thanks

Bidisha Das

unread,
Apr 21, 2015, 6:58:24 AM4/21/15
to suppor...@runmyprocess.com
Hi,
Do you mean that using the above code "tab_detail.insertInsideTab(1, id_tab1);",you are able to dynamically load the tab widget with a Custom widget in the first tab? 
Where did you plug in the Custom widget in the Web Interface(since you are using its identifier)?


Thanks & Regards
Bidisha

javier.c...@gmail.com

unread,
Apr 21, 2015, 7:12:17 AM4/21/15
to suppor...@runmyprocess.com
I have a WebInterface with an a TabPanel (tab_detail)
In TabPanel i have one tab (tab_detail[index0], first tab) in this tab i have a CustomWidget

And I add a Button to execute script, this script create a new index (new tab) into TabPanel, create index1 (second tab) and it insert the new CustomWidget, the same CW.

I need create tabs in TabPAnel and insert/load CustomWidgets, create many as the user wants or needs

Thanks
WI.jpg

Bidisha Das

unread,
Apr 21, 2015, 8:43:33 AM4/21/15
to suppor...@runmyprocess.com
Hi Javier,
Firstly, you can't dynamically insert tabs in an already existing tab widget. You either need to use the tab widget available in Web Interface and manually enter as many tabs as you want or else use the below code to dynamically generate a tab widget with predefined number of tabs:

var conf = {"id":"id_tab","js-type":"RMP_TabPanel","first-tab":"0","tabpos":"bottom","min-height":"200",tab:
 [{"visible":"true","active":"true","label":"TmV3IHRhYiAx"},
 {"visible":"true","active":"true","label":"TmV3IHRhYiAy"},{"visible":"true","active":"true","label":"TmV3IHRhYiAz"}]};
 
var id_tab = new RMP_TabPanel(conf);
id_widget.insertBefore(id_tab); 

This code will create a tab widget with 3 tabs.You can create as many tabs as you want but you need define it inside the function.

Secondly,you can't create a Custom widget dynamically nor you can insert it inside a tab widget dynamically.You don't have such privileges for Custom Widget.

Hope you are clear.


Thanks & Regards
Bidisha
Reply all
Reply to author
Forward
0 new messages