0

Execution stopped pre-mature in .jsp

asked 2006-08-24 19:08:48 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3883298

By: nobody

I have the following codes. After the "delete" button is clicked, a message box will let the user to pick "OK" or "CANCEL" button, and then another message should indicate whether "OK" or "CANCEL" button is clicked. Unfortunately, the codes have different behavior in buth .zul and .jsp file. If they are run in .zul file, it's allright, i.e, two message box will be shown. However if they are run in .jsp file,only one message box will be shown and the second is missing,i.e., a messagebox will ask whether to delete the selected item without further indicating which choice("OK" or "CANCEL") is clicked. I want it to work in .jsp as in .zul. Anybody give me hint please? Thanks! Bakoma
-----------------
<z:window title="Messagebox demo" border="normal"
xmlns:z="http://www.potix.com/2005/zul">
<z:listbox checkmark="true" multiple="flase">
<z:listhead>
<z:listheader style="font-weight:600" width="96" sort="auto"
label='LastName'/>
<z:listheader style="font-weight:600" width="108" sort="auto"
label='FirstName'/>
</z:listhead>
<z:listitem>
<z:listcell label="Karry"/>
<z:listcell label="John"/>
</z:listitem>
<z:listitem>
<z:listcell label="Bush"/>
<z:listcell label="George"/>
</z:listitem>
<z:listitem>
<z:listcell label="Clinton"/>
<z:listcell label="Bill"/>
</z:listitem>
<z:listfoot>
<z:listfooter>
<z:hbox>
<z:button label="Delete"

onClick='if(self.getParent().getParent().getListbox().getSelectedItem()==null)
alert("Please select an item to delete!"); else delete(self.getParent().getParent().getListbox().getSelectedItem())'/>
</z:hbox>
</z:listfooter>
</z:listfoot>
</z:listbox>
<zscript><![CDATA[
import com.potix.zul.html.*;
void delete(Listitem li){
if(Messagebox.show("Are you sure to delete this item?",
"Question",
Messagebox.OK | Messagebox.CANCEL,
Messagebox.QUESTION)
==Messagebox.OK)
alert("You said yes!");
else alert("You said no!");
}
]]></zscript>
</z:window>

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2006-08-25 01:31:14 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3883833

By: henrichen

What do you mean by "run in .jsp"?


link publish delete flag offensive edit

answered 2006-08-25 14:44:39 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3884696

By: nobody

I mean if I put the code in a file, say test.zul, it works fine;but if I put these code in a file, say test.jsp, neither alert("You said yes!") nor alert("You said no!") get a chance to run after Messagebox.show(...). Can you help?
Thanks.
Bakoma

link publish delete flag offensive edit

answered 2006-08-30 04:30:51 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3890440

By: henrichen

An .zul is not an .jsp. The .zul code is read by the ZK loader and "interpreted"
by the ZK loader while .jsp is handled by a jsp engine. You should not expect zul code would work in .jsp file.


link publish delete flag offensive edit
Your reply
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

RSS

Stats

Asked: 2006-08-24 19:08:48 +0800

Seen: 264 times

Last updated: Aug 30 '06

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