0
Good night!!!
I’m trying to make a dynamic tabpanel, when I click on the clients bar menu, it opens a clients tab with the items (textbox, combobox, etc). More is not working.You are returning the error
Sourced file: inline Evaluation of: tabCad("impathoz . . . '' : Attempt to resolve method: appendChild() on undefined variable or class name: fbTabPanels : at Line: 105 : in file: inline evaluation of:
private v . . . '' : fbTabPanels . appendchild ( fbTabPanel )
'''
<!--<zscript src="/lib/bdados.java">
</zscript>-->
<window id="janPrincipal" title="SisFraldas" border="normal" position="center" sizable="true" maximizable="true" minimizable="true" closable="false" width="100%">
<zscript>
private void bmOnClientInfo(ClientInfoEvent bmEvt) {
bm_ResTelaW = bmEvt.getScreenWidth();
bm_ResTelaH = bmEvt.getScreenHeight();
<![CDATA[
]]>
}
private void bmJanPrincipalClose() {
desktop.getWebApp().removeAttribute("bm_Usuario_"+desktop.getId());
desktop.getWebApp().removeAttribute("bm_Exec_"+desktop.getId());
bmGeraLogs(bm_Usuario, "Login", "of", 0);
try {
bm_Con.close();
bm_Con = null;
} catch (fbEs) {
//
}
Executions.sendRedirect("http://www.uol.com.br");
}
</zscript>
<zscript>
ArrayList bm_Janelas = new ArrayList();
EventListener fbOnNotify = new EventListener() {
public void onEvent(Event fbEvento) {
tabCad(fbEvento.getData());
}
};
janPrincipal.addEventListener("onNotify",fbOnNotify);
</zscript>
<menubar>
<menu label="Principal" >
<menupopup>
<menuitem label="Clientes">
<attribute name="onClick">
tabCad("impathoz");
</attribute>
</menuitem>
</menupopup>
</menu>
</menubar>
<!-- <vbox/> -->
<zscript>
private void tabCad(String arg) {
<![CDATA[
if (janPrincipal.getFellowIfAny("tabBoxPrincipal") == null) {
fbTabBox = new Tabbox();
fbTabBox.setId("tabBoxPrincipal");
fbTabBox.width = "100%";
fbTabs = new Tabs();
fbTabs.setId("tabsCad");
fbTabBox.appendChild(fbTabs);
fbTabPanels = new Tabpanels();
fbTabPanels.setId("tabpanels");
fbTabBox.appendChild(fbTabPanels);
janPrincipal.appendChild(fbTabBox);
fbTabs.align = "center";
} else {
fbTabs = janPrincipal.getFellow("tabsCad");
fbTabPanels = janPrincipal.getFellow("tabpanels");
}
////////////////////////
if (arg.equals("impathoz")) {
fbTabImpDados = "tabImpDados";
if (janPrincipal.getFellowIfAny(fbTabImpDados) == null) {
fbTabPanel = new Tabpanel();
fbImpDados = Executions
.createComponents("/conprodutovendido.zul",null,null);
bm_Janelas.add("janCadBDados");
fbTabPanel.appendChild(fbImpDados);
fbTabPanels.appendChild(fbTabPanel);
fbTab = new Tab();
fbTab.setLabel("Imp.Athoz");
fbTab.setId(fbTabImpDados);
EventListener fbOnSelect = new EventListener() {
public void onEvent(Event fbEvento) {
Events.sendEvent(
new Event("onNotify",janCadBDados,null));
}
};
fbTab.addEventListener("onSelect",fbOnSelect);
fbTabs.appendChild(fbTab);
}
tabImpDados.selected = true;
Events.sendEvent(new Event("onNotify",janCadBDados,null));
}
]]>
}
</zscript>
</window>
[
'''
This is line 105 ----->>> fbTabPanels.appendchild(fbTabPanel);
– Bruno