0

How to get Combobox's value in CSA?

asked 2009-03-02 06:23:57 +0800

evpole gravatar image evpole
481 2

updated 2009-03-02 06:25:54 +0800

as we know it's easy to get textbox's value in CSA:
<textbox id="textbox" action="onblur:alert(#{textbox}.value);"/>

but in combobox :
<combobox id="c" action="onblur:alert(#{c}.value);"><comboitem label="aaaaaaaaaaaa"/><comboitem label="bbbbbbbbbb"/></combobox>
this doen't work.

i've see the codesource on Client:


<span id="z_9j_93" class="z-combobox" z.zcls="z-combobox" z.type="zul.cb.Cmbox" z.combo="true"><input id="z_9j_93!real" class="z-combobox-inp" autocomplete="off" type="text"/><span id="z_9j_93!btn" class="z-combobox-btn"><img class="z-combobox-img" onmousedown="return false;" src="/DsApp/zkau/web/img/spacer.gif"/></span><div id="z_9j_93!pp" class="z-combobox-pp" style="display:none" tabindex="-1">
<table id="z_9j_93!cave" cellpadding="0" cellspacing="0">

<tr id="z_9j_a3" z.type="Cmit" class="z-combo-item " z.zcls="z-combo-item">
<td class="z-combo-item-img"></td><td class="z-combo-item-text">aaaaaaaaaaaa</td>
</tr>

<tr id="z_9j_b3" z.type="Cmit" class="z-combo-item " z.zcls="z-combo-item">
<td class="z-combo-item-img"></td><td class="z-combo-item-text">bbbbbbbbbb</td>
</tr>

</table>

it seems that #{c} returns a span (id="z_9j_93" ) instead of text-input box(id="z_9j_93!real" ).
so How to get the value for combobox in CSA ?

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-03-03 06:55:10 +0800

evpole gravatar image evpole
481 2

action="onblur:alert(#{c}!real.value) doesn't work too...

link publish delete flag offensive edit

answered 2009-03-04 02:15:10 +0800

evpole gravatar image evpole
481 2

and a similar situation: checkbox.
is there anybody know how to get the checkbox's status(checked or not) in client side action ?

link publish delete flag offensive edit

answered 2009-03-04 02:34:58 +0800

robbiecheng gravatar image robbiecheng
1144 2
http://robbiecheng.sys-co...

i am sorry to tell you that you have to code a javascript to get the value of ZK component.
then using document.getElementById('some_id') to retrieve the object.

/robbie

link publish delete flag offensive edit

answered 2009-03-04 02:38:51 +0800

evpole gravatar image evpole
481 2

Thank you very much for response,robbie.
i will have a try.

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: 2009-03-02 06:23:57 +0800

Seen: 308 times

Last updated: Mar 04 '09

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