-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I use format properties to get a date like this dd/MM/yyyy
But when i use myDateBox.getValue() the function return a String like this 'Jun 11, 2013 12:00:00 AM'
How to get the format value (12/06/2013) ???
Thanks,
j.
You can bind the <datebox>
' value attribute directly to a member in your ViewModel (which can be also of type Timestamp) see the this example.
I do the formatting on the server side using java.text.DateFormat, and on the client side with the format attribute of <datebox>
.
If this does not help, feel free to update the example and post the updated version here to show problems you encounter.
via a Button's 'OnClick Event'
zul :
<button label="Execute Model"
onClick="@command('generateReport', date1=db1, date2=db2.value, intervalle=interval.selectedItem.id, typedate=rg.selectedItem.label)" />
java MVVM :
@Command
public void generateReport(@BindingParam("date1") Datebox date1,
@BindingParam("date2") String date2,
@BindingParam("intervalle") String interval,
@BindingParam("typedate") String typedate) {
System.out.println(date1.getValue() + " / " + date2 + " / " + interval + " / "
+ typedate);
Asked: 2013-06-07 17:17:08 +0800
Seen: 27 times
Last updated: Jun 10 '13
Facing issue in masking on phone [closed]
coerceFromString_ override no longer works from 6.5.1 [closed]
Execute Javascript on component visible
Is there a way to resolve view model properties as input to client side javascripts?
scrollbar listner for 2 grid [closed]
Theme javascript wpd file not found
How you bind your datebox with java code can you post that code?
sjoshi ( 2013-06-07 18:57:39 +0800 )editvia a Button's 'OnClick Event'
jhusson ( 2013-06-08 11:05:45 +0800 )edit