Hi all,
If I build a layout with a certain template, all works fine until for each layout-part there is only one tab.
My problem comes when I try to put more than one tab into a certain layout part.
I can open the layout properly by clicking on the related menu, but when I try to switch into the second tab, I obtain this error:
Exception Object: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "program_id" from undefined (C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_toolbar_base.js#95)
MSG: TypeError: Cannot read property "program_id" from undefined (C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_toolbar_base.js#95)
<null>
TypeError: Cannot read property "program_id" from undefined (C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_toolbar_base.js#95)
TypeError: Cannot read property "program_id" from undefined (C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_toolbar_base.js#95)
at C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_toolbar_base.js:95 (getToolbarItems)
at C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_toolbar_base.js:194 (updateUI)
at C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_template_base.js:224 (generateTabForm)
at C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_panel_base.js:22 (onTabChange)
at C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_p_panel.js:20 (onTabChange)
at C:\Servoy_workspaces\Servoy6x_ws_deploy_and_demo\svy_nav_navigation\forms\svy_nav_fr_panel_base.js:91 (switchTab)
I’ve watched into the framework code and I found that the problem comes from the “onTabChange” function of “svy_nav_fr_panel_base”.
In this function, into the array “tabInfo” the property “programName” is null (the others are properly filled) and this is propagate until the “getToolbarItems” that when try to execute this code:
var _program_id = globals.nav.program[_program].program_id.toString()
It goes in error because the “_program” variable is null.
I’ve downloaded also the sample use in wich more layouts have more than one tabs, so I’ve tried to reproduce exactly the same example but without success.
For sure I’m missing to set something but I don’t understand what.
All forms involved are extending svy_nav_base (I’ve tried also to make a layout with multiple tabs using the sample-use’s forms to be sure).
I follow this step:
1 - I create a program for each form
2 - I create a layout
3 - For each layout part, I create one or more tab
4 - I assign the layout to a menu.
Here some shortcut:
All the programs involved are configured like this one:
[attachment=2]program.png[/attachment]
This is the layout:
[attachment=1]layout.png[/attachment]
And here is how I have configured the second tab for the third layout-part:
[attachment=0]second_tab.png[/attachment]
Am I missing to set something?
Thanks
Riccardo