You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ulrich <Fo...@gombers.de> on 2015/04/10 08:12:20 UTC

Wicket DateTimeField content not availabe w/ rerendering

Maybe this is a stupid question - but I'm new to Wicket and didn't find a
discussion about this - and no sample expresses my problem:

When using the DateTimeField I see that when editing I dont get control
about the edited time only after rerendering the page (F5/refresh) or when
clicking the date selection icon.

DateTimeField dateEnd = new DateTimeField("edate", new
PropertyModel<Date>(this, "edate")){
			@Override
			protected boolean use12HourFormat() {
				//this will force to use 24 hours format
				return false;
			}
		};
add(dateEnd);
add(new Button("button") {
			@Override
			public void onSubmit() {
				Date mydate=dateEnd.getDate();
				LOGGER.info("Selected Date={}", mydate);;
			}
		});



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-DateTimeField-content-not-availabe-w-rerendering-tp4670238.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket DateTimeField content not availabe w/ rerendering

Posted by Maxim Solodovnik <so...@gmail.com>.
yes, registration is required

On Fri, Apr 10, 2015 at 1:59 PM, Ulrich <Fo...@gombers.de> wrote:

> How can I do this. I found  this
> <
> https://issues.apache.org/jira/browse/WICKET/?selectedTab=com.atlassian.jira.jira-projects-plugin:issues-panel
> >
> .
> Do you mean to register here to report the problem?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-DateTimeField-content-not-availabe-w-rerendering-tp4670238p4670244.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
WBR
Maxim aka solomax

Re: Wicket DateTimeField content not availabe w/ rerendering

Posted by Ulrich <Fo...@gombers.de>.
How can I do this. I found  this
<https://issues.apache.org/jira/browse/WICKET/?selectedTab=com.atlassian.jira.jira-projects-plugin:issues-panel> 
. 
Do you mean to register here to report the problem?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-DateTimeField-content-not-availabe-w-rerendering-tp4670238p4670244.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket DateTimeField content not availabe w/ rerendering

Posted by Martin Grigorov <mg...@apache.org>.
Please file a ticket with this code packed as a quickstart and we will take
a look.
Thanks!

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Fri, Apr 10, 2015 at 10:14 AM, Ulrich <Fo...@gombers.de> wrote:

> Maybe a quickstart-sample will show it better than I can tell:
>
> JAVA-Code:
> [CODE]
> public class HomePage extends WebPage {
>         private static final Logger LOGGER =
> LoggerFactory.getLogger(HomePage.class);
>         private static final long serialVersionUID = 1L;
>         private Date edate=new Date();
>
>         public HomePage(final PageParameters parameters) {
>                 super(parameters);
>                 final DateTimeField dateEnd = new DateTimeField("edate",
> new
> PropertyModel<Date>(this, "edate")){
>                         @Override
>                         protected boolean use12HourFormat() {
>                                 //this will force to use 24 hours format
>                                 return false;
>                         }
>                 };
>                 dateEnd.setRequired(true);
>                 dateEnd.setDefaultModelObject(edate);
>                 add(dateEnd);
>                 Form<?> form = new Form("submitform") ;
>                 form.add(new Button("button") {
>                         @Override
>                         public void onSubmit() {
>                                 Date mydate=dateEnd.getDate();
>                                 LOGGER.info("Selected Date={}", mydate);
>                         }
>                 });
>
>                 add(form);
>         }
> }
> [/CODE]
>
> HTML-File:
> [HTML]
> <!DOCTYPE html>
> <html xmlns:wicket="http://wicket.apache.org">
> <body>
>         [StartDate]
>         <form wicket:id="submitform">
>                 <input wicket:id="button" type="submit" value="show" />
>         </form>
> </body>
> </html>
> [/HTML]
>
> The sample displays a date, a date-selection icon and time in form hh:mm.
> If you just edit the hour or minute and press the "show"-button right away,
> the LOGGER shows the resulting timestamp as if it wasn't changed.
> Editing the time only becomes effective if you refresh the page by pressing
> "F5" or select the date-selection icon.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-DateTimeField-content-not-availabe-w-rerendering-tp4670238p4670241.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket DateTimeField content not availabe w/ rerendering

Posted by Ulrich <Fo...@gombers.de>.
Maybe a quickstart-sample will show it better than I can tell:

JAVA-Code:
[CODE]
public class HomePage extends WebPage {
	private static final Logger LOGGER =
LoggerFactory.getLogger(HomePage.class);
	private static final long serialVersionUID = 1L;
	private Date edate=new Date();

	public HomePage(final PageParameters parameters) {
		super(parameters);
		final DateTimeField dateEnd = new DateTimeField("edate", new
PropertyModel<Date>(this, "edate")){
			@Override
			protected boolean use12HourFormat() {
				//this will force to use 24 hours format
				return false;
			}
		};
		dateEnd.setRequired(true);
		dateEnd.setDefaultModelObject(edate);
		add(dateEnd);
		Form<?> form = new Form("submitform") ;
		form.add(new Button("button") {
			@Override
			public void onSubmit() {
				Date mydate=dateEnd.getDate();
				LOGGER.info("Selected Date={}", mydate); 
			}
		});
 
		add(form);
	}
}
[/CODE]

HTML-File:
[HTML]
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<body>
	[StartDate]
	<form wicket:id="submitform">
		<input wicket:id="button" type="submit" value="show" />
	</form>
</body>
</html>
[/HTML]

The sample displays a date, a date-selection icon and time in form hh:mm.
If you just edit the hour or minute and press the "show"-button right away,
the LOGGER shows the resulting timestamp as if it wasn't changed. 
Editing the time only becomes effective if you refresh the page by pressing
"F5" or select the date-selection icon.   


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-DateTimeField-content-not-availabe-w-rerendering-tp4670238p4670241.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket DateTimeField content not availabe w/ rerendering

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

On Fri, Apr 10, 2015 at 9:12 AM, Ulrich <Fo...@gombers.de> wrote:

> Maybe this is a stupid question - but I'm new to Wicket and didn't find a
> discussion about this - and no sample expresses my problem:
>
> When using the DateTimeField I see that when editing I dont get control
> about the edited time only after rerendering the page (F5/refresh) or when
> clicking the date selection icon.
>

It is not very clear to me what exactly is the problem.
Could you please give more details?

Martin Grigorov
Freelancer, available for hire!
Wicket Training and Consulting
https://twitter.com/mtgrigorov


>
> DateTimeField dateEnd = new DateTimeField("edate", new
> PropertyModel<Date>(this, "edate")){
>                         @Override
>                         protected boolean use12HourFormat() {
>                                 //this will force to use 24 hours format
>                                 return false;
>                         }
>                 };
> add(dateEnd);
> add(new Button("button") {
>                         @Override
>                         public void onSubmit() {
>                                 Date mydate=dateEnd.getDate();
>                                 LOGGER.info("Selected Date={}", mydate);;
>                         }
>                 });
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-DateTimeField-content-not-availabe-w-rerendering-tp4670238.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>