0

How to close a modal dialog without controller

asked 2013-04-23 09:12:32 +0800

JustinFrost gravatar image JustinFrost
143 1 6

updated 2013-04-23 09:15:12 +0800

I have created a window with a close button as follows:

<window id="screenPaintDialog" title="Screen Painting" closable="true" border="normal" width="1000px" position="center,center" action="show: slideDown;hide: slideUp" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('com.empower.viewmodel.ScreenPaintingViewModel')">
<vlayout>
    <grid model="@bind(vm.personalDetailsScreenPaintingFields)" height="600px;">
        ...
    </grid>
    <hlayout><button id="cancelBtn" label="Cancel" onClick="screenPaintDialog.detach();"/></hlayout>  
</vlayout>

</window>

When I click the Cancel button the following error occurs and displays:

SEVERE: >>bsh.InterpreterError: set: Field access: bsh.ReflectError: No such field: system : at Line: -1 : in file: <called from="" java="" code=""> : <compiled java="" code="">

delete flag offensive retag edit

2 Answers

Sort by » oldest newest most voted
0

answered 2013-04-23 10:11:12 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I have run below code

 <zk>
    <window id="screenPaintDialog" title="Hi!" border="normal" width="200px">   
        <caption>       
            <toolbarbutton label="Help"/>
        </caption>       
        <checkbox label="Hello, Wolrd!"/>       
    </window>   


   <button label="Detch" onClick="screenPaintDialog.detach();"/> 
</zk>

Its worked fine for me

link publish delete flag offensive edit
0

answered 2013-04-24 03:01:38 +0800

JustinFrost gravatar image JustinFrost
143 1 6

It might be the way I am implementing the window, given the following window.zul:

<window id="screenPaintDialog" title="Painting" width="850px" >
<vlayout>
    <hlayout>
          <button id="Btn" label="Cancel" onClick="screenPaintDialog.detach();"/>
        </hlayout>
    </vlayout>
</window>

If I display this from a menu controller using the following code:

Window w = (Window)Executions.createComponents("/content/window.zul", null, null);
window.doModal();

When clicking the cancel button, I still get:

SEVERE: >>bsh.InterpreterError: set: Field access: bsh.ReflectError: No such field: system : at Line: -1 : in file: <called from="" java="" code=""> : <compiled java="" code="">

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: 2013-04-23 09:12:32 +0800

Seen: 35 times

Last updated: Apr 24 '13

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