-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3883833
By: henrichen
What do you mean by "run in .jsp"?
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
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.
Asked: 2006-08-24 19:08:48 +0800
Seen: 264 times
Last updated: Aug 30 '06