zk messagebox 弹出对话框判断点击按钮

    zk里使用messagebox  需要实现js的confirm("你确认要删除?") 效果,每次点击按钮都回执为1.

 

 <z:window title="Messagebox demo" border="normal"> 
     <z:button label="Question" width="100px">    
          <z:attribute name="onClick"> 
              //in enable case .   
int responseCode = Messagebox.show("Question is pressed. Are you sure?", "Question", Messagebox.OK | Messagebox.CANCEL,     Messagebox.QUESTION);
alert(responseCode);  
         if(responseCode == Messagebox.OK){  
         alert("user click ok");    
          }
          else if(responseCode == Messagebox.CANCEL){    
               alert("user click cancel");    
                } 
                </z:attribute>   
                  </z:button>
 </z:window> 

 

所有的messagebox都弹出。

 

解决办法:zk.xml 添加

<system-config>
	     <disable-event-thread>false</disable-event-thread> 
	</system-config>

 

参考地址:

 

http://www.zkoss.org/forum/listComment/9797/1/20

 

你可能感兴趣的:(thread,xml,zk)