0

how to set today's date as default value in datebox?

asked 2013-10-18 10:13:39 +0800

susu gravatar image susu
11 2

updated 2013-10-18 10:57:06 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...
<label value="${lbl:name('Report Date')}" />
                        <span class="req"></span>
                        <datebox id="dbxRPT_DATE"  format="yyyy-MM-dd"  width="50%" readonly="false"
                        constraint="" onChange='' />
delete flag offensive retag edit

Comments

setValue(todayDateObject) in your viewmodel or controller.

roliroli ( 2013-10-19 14:26:35 +0800 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-12-21 14:56:14 +0800

cor3000 gravatar image cor3000
6280 2 7

instead of using inline zscript it is more efficient to use EL expressions:

<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk>
  <datebox format="yyyy-MM-dd" value="${c:new('java.util.Date')}"/>
</zk>
link publish delete flag offensive edit
-1

answered 2018-12-17 21:46:43 +0800

justhyno gravatar image justhyno
1 1

updated 2018-12-17 21:49:03 +0800

<datebox id="dbxRPT_DATE"  format="yyyy-MM-dd"  width="50%" readonly="false"
onCreate="self.value = new Date()" />
link publish delete flag offensive edit

Comments

thanks for the response, still I have to downvote this due to the use of zscript

cor3000 ( 2018-12-21 14:57:26 +0800 )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
2 followers

RSS

Stats

Asked: 2013-10-18 10:13:39 +0800

Seen: 62 times

Last updated: Dec 21 '18

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