标题翻译
ZK framework onCreate event on Combobox
问题
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<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>
<!-- Other Rows and Controls -->
<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>
<!-- Other Rows and Controls -->
</Rows>
</Grid>
</div>
</window>
</Vbox>
<!-- Other sections and controls -->
</form>
英文翻译
I am relatively new to ZK framework and need to solve a problem. I have to hide some of the combobox items, and in order to do that i have to access those items and set their visibility by calling setVisible(false).
When I call a method at the end of the file I only get one combobox item which is empty, but in fact there is at least 3 combobox items when the page fully loads. So I have to find something like onload javascript event(I think it is onCreate for ZK) and call my java method(initSkillBox) inside that event. The code below does not raise any errors but it simply does nothing, no event is triggered.
Can anybody tell me what i am doing wrong?
Thanks.
<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> ```
</details>
专注分享java语言的经验与见解,让所有开发者获益!
评论