0

Problem generating label value dynamically with JavaScript

asked 2014-05-09 11:35:19 +0800

Antoc gravatar image Antoc
21 4

updated 2014-05-09 14:14:09 +0800

I want to create a zul page with a label which value is generated by a Javascript file.

I have create the following code but somehow it doesn't work:

<label id="oldest" style="color:#000000;font-size:110px; text-align: center">
         <attribute name="value" >
             <![CDATA[
                 <script language="javascript">
                      function getValue() {
                          return 'Hello JavaScript';
                      }
                 </script>
             ]]>                        
          </attribute>
</label>

Any idea on how to make this thing work? Thanks in advance

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-05-10 06:57:41 +0800

Ganeshkhakare gravatar image Ganeshkhakare
150 4

updated 2014-05-10 07:03:00 +0800

  1. If you will do like this then label value will not get updated at server.
  2. And if you don't want its value at sever then you can use plain html inside zul and do your javascript stuffs. Ref: http://books.zkoss.org/wiki/ZKComponentReference/Essential_Components/Html
link publish delete flag offensive edit
Your answer
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
1 follower

RSS

Stats

Asked: 2014-05-09 11:35:19 +0800

Seen: 15 times

Last updated: May 10 '14

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