0

Retrieve List Value wont work in JSP

asked 2007-01-04 10:30:37 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: roxcastaneda

The code below works in a .zul file but when i changed it to JSP with the x:
tags, it won't work. Is there a workaround for this?

Thanks,

-rocky

<html xmlns:zk="http://www.zkoss.org/2005/zk"
xmlns:x="http://www.zkoss.org/2005/zul">
<x:window title="listbox demo" border="normal"> <x:listbox width="250px" context="Menu1" id="lb1">
<x:listhead>
<x:listheader label="name" sort="auto"/>
<x:listheader label="gender" sort="auto"/>
</x:listhead>

<x:listitem value="1">
<x:listcell label="Mary"/>
<x:listcell label="FEMALE"/>
</x:listitem>

<x:listitem value="2">
<x:listcell label="John"/>
<x:listcell label="MALE"/>
</x:listitem>

<x:listitem value="3">
<x:listcell label="Jane"/>
<x:listcell label="FEMALE"/>
</x:listitem>

<x:listitem value="4">
<x:listcell label="Henry"/>
<x:listcell label="MALE"/>
</x:listitem>

</x:listbox>

<x:menupopup id="Menu1" >
<x:menuitem label="do1" onClick="do1()"/>
<x:menuitem label="do2" onClick="do2()"/> </x:menupopup>

<zk:zscript>
void do1()
{
// do something on selected item
Messagebox.show(lb1.getSelectedItem().getValue()+"","Msg", Messagebox.OK, Messagebox.QUESTION); } void do2() {
//do something...
}
</zk:zscript>
</x:window>
</html>



delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2007-01-04 10:57:14 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: henrichen

Please be more specific. What do you mean by "it won't work".

/henri

link publish delete flag offensive edit

answered 2007-01-04 11:05:35 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: roxcastaneda

Sorry I wasn't so clear.

Upon executing the
<x:menuitem label="do1" onClick="do1()"/>

I get an error:

/////////////////////
Failed to process [object Object]
_e has no properties
_pc1

... etc ...
////////////////////

Did i miss any package to import?

Its so strange because this code works fine in a .zul file and without the x:
tags.

TIA,

-rocky

link publish delete flag offensive edit

answered 2007-01-04 11:20:18 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: henrichen

It looks like a bug. Please post to bug list along with your testing code.
Thanks.

/henri

link publish delete flag offensive edit

answered 2007-01-04 11:47:16 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: roxcastaneda

Ok thanks, i hope u guys will find a cure for this.

All the best.

-rocky

link publish delete flag offensive edit

answered 2007-01-04 12:11:01 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: roxcastaneda


Is there any other workaround for this in order for me to get the value?

Messagebox.show(lb1.getSelectedItem().getValue(),"Msg", Messagebox.OK, Messagebox.QUESTION);

Any replacement syntax for the above code that might work in JSP?

-rocky

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: 2007-01-04 10:30:37 +0800

Seen: 175 times

Last updated: Jan 04 '07

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