0

File selector window doesn't popup after clicking Upload button

asked 2014-04-15 23:50:33 +0800

stephenjiang gravatar image stephenjiang
1 1

updated 2014-04-16 00:06:57 +0800

Hi

I am using ZK 7.0.1 CE (build: 2014022710), I had problem with Upload button. When clicking the upload button, the file selector window doesn't popup in certain circumstances. I tried to figure out what can be condition, but it doesn't look very clear to me. See the code attached at the end.

The messageset.zul is the page entry and it includes messageSetDetail.zul, which includes messageDetail.zul. The upload button is inside the messageDetail.zul.

I am not sure whether it is because of the upload button being nested inside many layers of components. It looks to me it's a ZK bug.

Please help.

======================messageset.zul========================

<div align="center">
<window title="Push Scoring Service" border="normal" style="color:#336699;"  width="1324px"
apply="org.zkoss.bind.BindComposer" viewModel="@id('messageSetsVM') @init('com.nuance.vm2t.postscoringservice.vm.MessageSetViewModel')"
validationMessages ="@id('vmsgs')"  >
    <vlayout>
        <hlayout>
            <div align="right">
                <label value="Welcome"></label>
                <label value="@bind(messageSetsVM.userDetails)"></label>
                <label value=" "></label>
                <toolbarbutton label="Logout" onClick='Executions.sendRedirect("/j_spring_security_logout");' />
            </div>
        </hlayout>
        <tabbox>
            <tabs>
                <tab label="Test Sets" />
                <tab label="Scheduleing" />
                <tab label="Progress" />
                <tab label="Result" />
            </tabs>
            <tabpanels>
                <tabpanel style="color:#336699;">
                   <include src="messageSetList.zul"/>
                   <include src="messageSetDetail.zul"/>

                   <div align="left">
                    <button label="upload audio file" upload="true,maxsize=-1,multiple=true" onUpload="@command('uploadAudioFile', uploadEvent=event)"></button>
                   </div>
                </tabpanel>
                <tabpanel style="color:#333399;">
                </tabpanel>
                <tabpanel style="color:#663366;">Panel 3</tabpanel>
                <tabpanel style="color:#CC0033;">Panel 4</tabpanel>
            </tabpanels>
        </tabbox>
    </vlayout>
</window>

==================messageSetDetail.zul=================

<?page title="Message Set Detail" contentType="text/html;charset=UTF-8"?>

<zk> <window visible="@load(not empty messageSetsVM.messageSet)"> <tabbox> <tabs> <tab label="Basic Information"/> <tab label="Messages"/> </tabs> <tabpanels> <tabpanel style="color:#336699;"> <grid form="@id('fx') @load(messageSetsVM.messageSet) @save(messageSetsVM.messageSet, before='submitMessageSet') @validator(messageSetsVM.messageSetValidator)" hflex="true"> <rows> <row> <label value="Name" width="250px"/> <vlayout> <hlayout> <textbox value="@bind(fx.name)" width="150px" tabindex="1"/> <textbox value="@bind(fx.index)" width="0px" tabindex="1" visible="false"/> </hlayout> <label value="@bind(vmsgs['name'])" style="color: red;"/> </vlayout> </row> <row> <label value="Type" width="150px"/> <vlayout> <combobox width="160px" value="@bind(fx.messageType)"> <comboitem label="AgentSpecific" value="AgentSpecific"/> <comboitem label="EndToEnd" value="EndToEnd"/> </combobox> <label value="@bind(vmsgs['messageType'])" style="color: red;"/> </vlayout> </row> <row> <label value="Create Date" width="150px"/> <vlayout> <datebox id="dbCreateDate" value="@bind(fx.createDate)" width="150px" tabindex="3"/> <label value="@bind(vmsgs['createDate'])" style="color: red;"/> </vlayout> </row>
<row> <label value="Description" width="150px"/> <vlayout> <textbox rows="4" value="@bind(fx.description)" width="370px;" tabindex="4"/> <label value="@bind(vmsgs['description'])" style="color: red;"/> </vlayout> </row> <row> <cell colspan="2" style="text-align:center"> <hlayout> <button label="reload" onclick="@command('reloadMessageSet')" width="100px" height="30px"/> <button label="Submit" onclick="@command('submitMessageSet')" width="100px" height="30px" xmlns:w="client"/> <button label="Cancel" width="100px" height="30px" onclick="@command('cancelMessageSet')"/>
</hlayout> </cell> </row>
</rows> </grid> </tabpanel> <tabpanel style="color:#336699;"> <vlayout> <vlayout visible="@bind(empty messageSetsVM.message)"> <separator/> <button label="Add Message" onclick="@command('addMessage')"/> <separator/> <grid height="350px" model="@load(messageSetsVM.messageSet.messages)" emptymessage="Nothing in Inbox."> <columns> <column label="scrid"/> <column label="Class Of Service" width="180px"/> <column label="Profile" width="280px"/> <column label="Audio Length" width="280px"/> <column label="Action" width="280px"/> </columns> <template name="model"> <row> <label value="@load(each.scrid)"/> <label value="@load(each.classOfService)"/> <label value="@load(each.profile)"/> <label value="@load(each.audioLength)"/> <hlayout> <button label="Delete" onclick="@command('deleteMessage', message=each)"/> <button label="Detail" onclick="@command('showMessage', message=each)"/> </hlayout> </row> </template> </grid> </vlayout> <vlayout visible="@bind(not empty messageSetsVM.message)"> <include src="messageDetail.zul"/> </vlayout> </vlayout> </tabpanel> </tabpanels> </tabbox> </window> </zk>

================messageDetail.zul==================

<grid form="@id('fx2') @load(messageSetsVM.message) @save(messageSetsVM.message, before='submitMessage') @validator(messageSetsVM.messageValidator)" hflex="true">
        <rows>
            <row>
                <label value="Scrid" width="250px" />
                <vlayout>
                    <textbox  value="@bind(fx2.scrid)" width="150px" tabindex="1"/>
                    <label value="@bind(vmsgs['scrid'])" style="color: red;" />
                </vlayout>
            </row>
            <row>
                <label value="Class Of Service" width="150px" />
                <vlayout>
                    <textbox  value="@bind(fx2.classOfService)" width="150px" tabindex="1"/>
                    <label value="@bind(vmsgs['classOfService'])" style="color: red;" />
                </vlayout>
            </row>
            <row>
                <label value="profile" width="150px" />
                <vlayout>
                    <textbox  value="@bind(fx2.profile)" width="150px" tabindex="1"/>
                    <label value="@bind(vmsgs['profile'])" style="color: red;" />
                </vlayout>
            </row>
            <row>
                <label value="Audio File" width="150px" />
                <vlayout>
                    <hlayout>
                        <a href="/MessageAudio?scrid=MessageSet1-scrid0" target="_new"  label="@load(fx2.audioFileName)" style="text-decoration:underline;color:blue;cursor:pointer;"  visible="@load(not empty fx2.audioFileName)"/>
                        <button label="Upload" upload="true"/>
                    </hlayout>
                    <label value="@bind(vmsgs['audioFileName'])" style="color:red;" />
                </vlayout>
            </row>
            <row>
                <label value="Targeted Agents" width="150px" />
                <vlayout>
                    <hlayout>
                        <listbox model="@bind(fx2.agents)" emptyMessage="There is no targeted agent." width="210px" selectedItem="@bind(messageSetsVM.selectedAgent)" 
                            onSelect="@command('removeAgentFromMessage', selectedAgent=messageSetsVM.selectedAgent)">
                            <template name="model">
                                <listitem>
                                    <listcell label="@bind(each.name)" />
                                </listitem>
                            </template>
                        </listbox>
                        <button id="addAgentButton" label="add agent"  apply="com.nuance.vm2t.postscoringservice.controller.AgentListDialogController"></button>
                    </hlayout>
                    <label value="@bind(vmsgs['audioFileName'])" style="color:red;" />
                </vlayout>
            </row>
            <row>
                <label value="Description" width="150px" />
                <vlayout>
                    <textbox rows="4" value="@bind(fx2.description)"   width="370px;" tabindex="4" />
                    <label value="@bind(vmsgs['description'])" style="color: red;" />
                </vlayout>
            </row>
            <row>
                <label value="Golden Text" width="150px" />
                <vlayout>
                    <textbox rows="4" value="@bind(fx2.goldenText)"   width="370px;" tabindex="4" />
                    <label value="@bind(vmsgs['goldenText'])" style="color: red;" />
                </vlayout>
            </row>
            <row>
                 <cell colspan="2" style="text-align:center">
                     <hlayout>
                            <button label="Save" onClick="@command('submitMessage')" width="100px" height="30px" ></button>
                            <button label="Cancel" onClick="@command('cancelMessage')" width="100px" height="30px" ></button>
                     </hlayout>
                 </cell>
            </row>
         </rows>
 </grid>
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-07-27 05:58:05 +0800

Darksu gravatar image Darksu
1991 1 4

updated 2014-07-27 06:10:10 +0800

Hello stephenjiang,

If i am not mistaken, this issue has been identified, and resolved in the latest version of zk (7.0.2)

The issue was similar to your case, where when there are multiple tabs the file upload would not display.

Could you please download the latest version, and try it again?

Best Regards,

Darksu

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2014-04-15 23:50:33 +0800

Seen: 37 times

Last updated: Jul 27 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More