有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

组合框上的JavaZK框架onCreate事件

我对ZK框架比较陌生,需要解决一个问题。我必须隐藏一些combobox项,为了做到这一点,我必须访问这些项,并通过调用setVisible(false)来设置它们的可见性

当我在文件末尾调用一个方法时,我只得到一个combobox项,它是空的,但事实上,当页面完全加载时,至少有3个combobox项。因此,我必须找到类似onload javascript事件(我认为它是onCreate for 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> ```



共 (0) 个答案