I'm getting an Internal Error anytime I start debuging the web-client for the second time. The first time, it works fine, then I need to restart developer so that it works, or i get this message in the Servoy Admin Page.
org.apache.wicket.markup.MarkupException: Unable to find component with id 'sv__0DB075E1_D7CB_4716_A5D5_296E426F23D9' in [MarkupContainer [Component id = sv__8AC5EBCA_E25C_437C_9BE0_55199F16CC4F]]. This means that you declared wicket:id=sv__0DB075E1_D7CB_4716_A5D5_296E426F23D9 in your markup, but that you either did not add the component to your page at all, or that the hierarchy does not match.
followed by the markup.
Here's what I'm doing. I'm building an app with ( for the moment ) a 4 deep module hierarchy : main_app/navigation_module/transaction_module/ui_module
One form on the ui_module, "ui_big_menu", which acts as the application main menu is customized based on user privileges. Then involving form inheritance, this form is show in the main app in a "app_big_menu", which extend from "navi_big_menu", extending from "tra_big_menu" and finally extending from the "ui_big_menu" I intend to customize on startup.
If i set the opening form for testing purpose to be the "ui_big_menu", everything works as expected. Anytime I set one of the forms that inherits from the "ui_big_menu", it will work the first time and then throw the "Internal Error" and the log above. I need to restart developper to make it works once.
It sure has to do with the Solution Model and inheritance has everything works if I comment this part of the onSolutionOpen method.
If anyone has a clue for me, I'd be gratefull.
Here's my code, it seems very basic to me : _aSections is an array of the available sections as Strings, _obj is an object holding several properties for each sections.
I'm cloning existing components on the form that I'm using as references for new ones, then I'm removing thos references at the end of the function.
- Code: Select all
function frm_buildApplicationBigMenu(_aSections, _obj){
/**@type{JSForm}*/
var jsform;
/**@type{String}*/
var sectionName;
/**@type{JSComponent}*/
var jsSeparatorLabel;
/**@type{JSComponent}*/
var newjsSeparatorLabel;
/**@type{JSComponent}*/
var jsTitle;
/**@type{JSLabel}*/
var newjsTitle;
/**@type{JSButton}*/
var jsGoToButton;
/**@type{JSButton}*/
var newjsGoToButton;
jsform= solutionModel.getForm(_frm_base_application_menu_big);
jsGoToButton= jsform.getComponent(_baseGoToButton);
jsSeparatorLabel= jsform.getLabel(_baseSeparatorLabel);
jsTitle= jsform.getComponent(_baseTitle);
for (var index = 0; index < _aSections.length; index++) {
sectionName= _aSections[index];
newjsTitle=solutionModel.cloneComponent(_titleLabelName+(index+1),jsTitle);
newjsTitle.y= (jsTitle.height * index) + jsTitle.y + (2*index);
newjsTitle.text= _obj[sectionName].title;
newjsGoToButton=solutionModel.cloneComponent(_gotoButtonName+(index+1),jsGoToButton);
newjsGoToButton.y= newjsTitle.y;
newjsSeparatorLabel=solutionModel.cloneComponent(_separatorLabelName+(index+1),jsSeparatorLabel);
newjsSeparatorLabel.y= newjsTitle.y + newjsTitle.height + 1;
newjsSeparatorLabel.formIndex=1;
newjsTitle.formIndex= 2;
newjsGoToButton.formIndex=3;
}
jsform.removeComponent(jsSeparatorLabel.name);
jsform.removeComponent(jsTitle.name);
jsform.removeComponent(jsGoToButton.name);
forms[jsform.name].controller.recreateUI();
}
Thanks
Ugo