Я относительно новичок в ZK Framework и должен решить проблему. Мне нужно скрыть некоторые элементы в выпадающем списке, и для этого мне нужно получить доступ к этим элементам и установить их видимость, вызвав setVisible (false).
Когда я вызываю метод в конце файла, я получаю только один элемент комбинированного списка, который является пустым, но на самом деле, по крайней мере, 3 элемента комбинированного списка при полной загрузке страницы. Поэтому мне нужно найти что-то вроде события onload javascript (я думаю, что это onCreate для ZK) и вызвать мой метод java ( initSkillBox ) внутри этого события. Приведенный ниже код не вызывает никаких ошибок, но он просто ничего не делает, событие не вызывается.
Кто-нибудь может сказать мне, что я делаю неправильно?
Спасибо.
<form id="topComponent" style="String:border: 0px;">
<Style src="/forms/TegsoftTelecom/webchat/ccchat.css" />
<script src="/forms/TegsoftTelecom/webchat/20200122_ccchatmessage.js" />
<Vbox id="webChatUserLoginVbox" align="center" style="String:background:#fff;border: 0px;" width="100%" height="93%" visible="boolean:false">
<window id="userLoginWindow" height="300px" width="350px" style="String:text-align:left" contentStyle="String:border: 0px;overflow: hidden;" border="none">
<div>
<Grid width="100%" height="100%" style="String:border:0px solid #ddd;border-radius:3px;background:white">
<Columns sizable="boolean:false" menupopup="auto">
<Column width="100%" />
</Columns>
<Rows>
<Row>
<TextField id="webchatLoginFirstName" placeholder="${Firstname}" class="labelParameterText" width="100%" height="40px" maxlength="int:50" tooltiptext="${Surname}" />
</Row>
<Row>
<TextField id="webchatLoginLastName" placeholder="${Surname}" class="labelParameterText" width="100%" height="40px" maxlength="int:50" tooltiptext="${Surname}" />
</Row>
<Row>
<TextField id="webchatLoginEmail" placeholder="${Email}" class="labelParameterText" width="100%" height="40px" maxlength="int:150" tooltiptext="${Email}" />
</Row>
<Row>
<TextField id="webchatLoginPhone" placeholder="${Phone}" class="labelParameterText" width="100%" height="40px" maxlength="int:50" tooltiptext="${Phone}" />
</Row>
<Row>
</Row>
<Row>
<ComboBox id="webchatLoginSkill" placeholder="${Subject}" width="100%" bindingProperty="SelectedIndex" listDataSourceName="TBLCCCHATSKILLS"
listDataMember="NAME" listBindingProperty="SKILLID" class="labelParameterValueText" height="40px" maxlength="int:50">
<eventListener eventName="onCreate" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.initSkillBox"/>
</ComboBox>
</Row>
<Row>
<Button height="35px" style="String:border: 2px solid #ff7d00;border-radius:3px;background:#ff7d00;color:white;font-size:15px;font-family: 'Roboto', sans-serif;" width="100%" label="${StartWebChat}">
<eventListener eventName="onClick" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.startWebchat" />
</Button>
</Row>
<Row>
<HtmlNativeComponent tag="div" id="loading">
<method name="setDynamicProperty" parameter0="id" parameter1="loading" />
<method name="setDynamicProperty" parameter0="styleClass" parameter1="loading" />
</HtmlNativeComponent>
</Row>
</Rows>
</Grid>
</div>
</window>
</Vbox>
<Vbox id="webChatVbox" align="center" style="String:background:#fff;border: 0px;" width="100%" height="93%" visible="boolean:false">
<window id="chatWindow" height="400px" width="350px" style="String:text-align:left" contentStyle="String:border: 0px;overflow: hidden;" border="none">
<div class="container clearfix" visible="boolean:true">
<div class="chat" height="400px">
<div class="chat-history" height="370px">
<html id="chatHtml" />
</div>
<div height="20px">
<div id="agentWritingStatus" class="typing" visible="boolean:false">
<Label value="${Typing}" style="String:font-style: italic;padding-left: 2px;padding-right:2px;color:#FF7D00;font-family: 'Open Sans', Helvetica, Arial, sans-serif;" />
<div class="ball ball-1">
</div>
<div class="ball ball-2">
</div>
<div class="ball ball-3">
</div>
<div class="ball ball-4">
</div>
</div>
</div>
</div>
<Hbox width="100%" style="String:background:#fff;border: 0px;">
<div class="send-message-area">
<TextField id="sendMSG" width="280px" placeholder="${MessageText}" height="35px" style="String:width: 100%;row:3;border: none;padding: 2px 5px 2px 5px;font: 16px/20px 'Roboto', sans-serif; margin-bottom: 1 px ; border-radius: 5 px ; resize: none ;">
<eventListener eventName="onOK" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.sendMessageContact" />
<eventListener eventName="onChange" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.updateContactWritingStatus" />
<eventListener eventName="onChanging" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.updateContactWritingStatus" />
<eventListener eventName="onFocus" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.updateContactWritingStatus" />
</TextField>
<Image src="P{TEGSOFT_THEME}/tegsoft-chat-send.png" id="P{RECEIVERUID}_chatImage" hover="P{TEGSOFT_THEME}/tegsoft-chat-send-hover.png" tooltiptext="${Send}" style="String:cursor:pointer;position: absolute;background-color: #fff;width: 50px;height: 35px;bottom: 3px;right: 3px;border: none;">
<eventListener eventName="onClick" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.sendMessageContact" />
</Image>
</div>
</Hbox>
</div>
</window>
</Vbox>
<Iframe id="desttypeChatIframe" width="100%" height="93%" visible="boolean:false" />
<Iframe id="waitChatIframe" width="100%" height="93%" visible="boolean:false" />
<Iframe id="endChatIframe" width="100%" height="93%" visible="boolean:false" />
<Vbox id="webChatPoweredByTegsoft" align="center" pack="center" style="String:background:#fff;border: 0px;" width="100%" height="7%">
<window id="poweredByTegsoftWindow" height="40px" width="350px" style="String:text-align:left" contentStyle="String:border: 0px;overflow: hidden;" border="none">
<div>
<Grid width="100%" height="100%" style="String:border:0px solid #ddd;border-radius:3px;background:white">
<Columns sizable="boolean:false" menupopup="auto">
<Column width="60%" />
<Column width="25%" />
<Column width="15%" />
</Columns>
<Rows>
<Row>
<div id="optionsBtn" visible="boolean:false">
<Button height="35px" class="hiddenButtonClass" style="String:border: 2px solid #ff7d00;border-radius:3px;background:#ff7d00;color:white;font-size:15px;font-family: 'Roboto', sans-serif;" width="100%" label="${chatEnd}">
<eventListener eventName="onClick" methodName="com.tegsoft.cc.webchat.WebchatUIEventHandler.exitChat" />
</Button>
</div>
<TextField value="Powered by" width="100%" style="String:text-align:right;border:none;color:grey;font-size:12px;font-style: italic;font-family: 'Roboto', sans-serif;" readonly="boolean:true" />
<HtmlNativeComponent tag="img">
<method name="setDynamicProperty" parameter0="height" parameter1="50px" />
<method name="setDynamicProperty" parameter0="width" parameter1="50px" />
<method name="setDynamicProperty" parameter0="style" parameter1="String:cursor:pointer" />
<method name="setDynamicProperty" parameter0="src" parameter1="/Tobe/image/Tegsoft-hello-happy.png" />
<method name="setDynamicProperty" parameter0="onclick" parameter1="openTegsoftUrl();" />
</HtmlNativeComponent>
</Row>
</Rows>
</Grid>
</div>
</window>
</Vbox>
<method type="com.tegsoft.cc.webchat.WebchatUIEventHandler" name="initChat" />
<method type="com.tegsoft.cc.webchat.WebchatUIEventHandler" name="initSkillBox" />
</form> ```