Hello,
I am trying to use the Tomahawk popup in my own renderer.
Here the code:
HtmlAjaxCommandLink link = new HtmlAjaxCommandLink();
//some settings for the link
HtmlPopup pop = new HtmlPopup();
link.setParent(pop);
pop.setParent(this.component);
pop.setDisplayAtDistanceX(10);
pop.setDisplayAtDistanceY(10);
pop.setClosePopupOnExitingElement(true);
pop.setClosePopupOnExitingPopup(true);
HtmlOutputText tex = new HtmlOutputText();
tex.setValue("Popuptext");
pop.getFacets().put("popup", tex);
pop.encodeAll(context);
The link will not be rendered (pop.getChildCount() = 0) and if I use the
following line of code:
pop.getChildren().add(link);
I get this exception in the line of the code above:
java.lang.IllegalStateException: Parent was not null, but this component
not related
The div and the scripts got rendered but not the child of the popup.
What is wrong with the code and how can I use the popup in my renderer?
Thanks for help,
Markus