Wicket on Heroku with multiple dyno's

2015-05-05 Thread Thies Edeling
Hi,

I can't seem to get a Wicket app running on Heroku with multiple dyno's.
Heroku doesn't have sticky sessions so I need a form of distributed
sessions.
I found a few old threads on running Wicket without sticky sessions but the
solutions either do not work or I'm missing something.

My stack is Wicket 6.19.0 and Jetty 9.2 and I'm trying to use Redis to
share the session between the dyno's/nodes.

When I store the HttpSession on the Jetty level I run into serialization
issues with my @SpringBean annotated dependencies as the serializer tries
to serialize the proxies. Marking @SpringBean annotated fields with
transient will fix this but for some reason it seems to be invalid.

When I use a SessionStoreProvider from
https://github.com/baholladay/WicketRedisSession there's still a lot of
stuff ending up in the HttpSession; giving me the same No serializer found
for class com.sun.proxy.$Proxy105 exception for @SpringBeans.

Any ideas? I'm getting a bit clueless :)

cheers,
Thies


Re: JQuery progressbar

2015-05-05 Thread Chris
Hi Sebastian,

it works now. thanks, Chris


 Am 05.05.2015 um 22:43 schrieb Chris chris...@gmx.at:
 
 Hi Sebastian,
 
 I am trying to apply the quick start to the real project.
 I have the problem that the onSuccess method is not called  - in the 
 quickStart it works. Do you know a hint but it is of course hard to figure it 
 out from the distance.
 
 br Chris
 
 final FutureListRoute contentsFuture = 
 routeGenerateService.generateRoutes();
 
FutureUpdateBehaviourListRoute futureUpdateBehaviour = new 
 FutureUpdateBehaviourListRoute(Duration.seconds(2), contentsFuture) {
@Override
protected void onPostSuccess(AjaxRequestTarget target) {
System.out.println(Success);
 
routingListPanel.setVisible(true);
target.add(routingListPanel.getParent());
 
}
 
@Override
protected void onUpdateError(AjaxRequestTarget target, 
 Exception e) {
 
}
};
 
 Am 05.05.2015 um 19:43 schrieb Sebastien seb...@gmail.com:
 
 Hi Chis,
 
 
 On Tue, May 5, 2015 at 6:25 PM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian,
 
 thanks a lot - in the meantime I have added a spring task executor service
 so that the thread pool is closed properly during shutdown.
 
 Could you explain to me why it is necessary to set the default model
 explicitly although the model is already set in the constructor?
 Is then the default model used when set or the other model?
 routingListPanel = new RoutingListPanel(routingPanel, routingModel);
 routingListPanel.setDefaultModel(routingModel);
 
 
 Because by new RoutingListPanel(routingPanel, routingModel);, you
 suppose it will be the model of the RoutingListPanel, but... is it not; you
 transmitted the model to the underlying list view... :) Just transmit the
 routingModel (too) to the call to super and this will be solved.
 
   public RoutingListPanel(String id, final IModelListRoute
 routingModel) {
   super(id, routingModel);
 
 also, you can remove this line:
 https://github.com/cat1000/FutureProgressBar/blob/ff0e9bda72ebc589a974103697baa5865719afcd/src/main/java/my/company/panels/MapPanel.java#L132
 
 
 
 
 Thanks, Chris
 
 
 Am 05.05.2015 um 16:10 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 I had a quick look today, I just applied the suggestion I mentioned
 previously and I have now a result...
 https://github.com/cat1000/FutureProgressBar/pull/1
 
 Best regards,
 Sebastien
 
 On Tue, May 5, 2015 at 1:52 AM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian
 
 thanks for the update!
 
 Chris
 
 
 Am 05.05.2015 um 01:39 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 I just had a brief look at files in the project. At least one thing
 which
 is wrong:
 
 
 https://github.com/cat1000/FutureProgressBar/blob/master/src/main/java/my/company/panels/RoutingListPanel.java#L24
 
 You should not unwrap the model object in a ctor; use the model
 directly.
 Also for subsequent components, use a model (like a propertymodel)
 That explains why your model object seems to never be updated, actually
 the
 listview is pointing the the old model object...
 
 I will try to have a deeper look tomorrow...
 
 Best regards,
 Sebastien.
 
 
 On Mon, May 4, 2015 at 9:47 PM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian  all,
 
 I have set up a quick start project (see
 https://github.com/cat1000/FutureProgressBar 
 https://github.com/cat1000/FutureProgressBar).
 Please read the readme.txt file contained in the package pages to
 get
 an
 overview over the goals and the open questions.
 
 Basically, I am using a Future-Task to load data from a long-running
 service and in the meantime would like to display the loading progress
 via
 a progressBar.
 This basically is working.
 
 However, after the loading has finished, the panel is not reloaded.
 
 Thanks a lot for your help!
 
 Chris
 
 
 Am 04.05.2015 um 11:40 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 
 I am using a heuristic for an optimization problem and this takes
 about
 5-10 seconds.
 So it might be a good idea to use a future task to run this service,
 which
 receives the data (list of object) in the end.
 In the beginning, I would like to initialize the model with an empty
 list
 so that the page is displayed fast, and in parallel execute a future
 task;
 as soon as the service has some results, exchanging the model
 against
 the
 data returned.
 
 I have looked at the example described here:
 https://gist.github.com/jonnywray/636875 
 https://gist.github.com/jonnywray/636875
 
 The future is called correctly, but how can the component/panel be
 updated
 via the onPostSuccess(AjaxRequestTarget target) method?
 
 
 target.add(yourPanel) ?
 Caution: it will call model#getObject. Given your explanation I don't
 think
 your model is a LDM. Just be aware...
 
 
 By the way, what is the difference when setting the model via
 constructor
 (e.g. new Panel(id, model)) or via 

Re: JQuery progressbar

2015-05-05 Thread Sebastien
Hi Chris,

I had a quick look today, I just applied the suggestion I mentioned
previously and I have now a result...
https://github.com/cat1000/FutureProgressBar/pull/1

Best regards,
Sebastien

On Tue, May 5, 2015 at 1:52 AM, Chris chris...@gmx.at wrote:

 Hi Sebastian

 thanks for the update!

 Chris


  Am 05.05.2015 um 01:39 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
  I just had a brief look at files in the project. At least one thing which
  is wrong:
 
 https://github.com/cat1000/FutureProgressBar/blob/master/src/main/java/my/company/panels/RoutingListPanel.java#L24
 
  You should not unwrap the model object in a ctor; use the model directly.
  Also for subsequent components, use a model (like a propertymodel)
  That explains why your model object seems to never be updated, actually
 the
  listview is pointing the the old model object...
 
  I will try to have a deeper look tomorrow...
 
  Best regards,
  Sebastien.
 
 
  On Mon, May 4, 2015 at 9:47 PM, Chris chris...@gmx.at wrote:
 
  Hi Sebastian  all,
 
  I have set up a quick start project (see
  https://github.com/cat1000/FutureProgressBar 
  https://github.com/cat1000/FutureProgressBar).
  Please read the readme.txt file contained in the package pages to get
 an
  overview over the goals and the open questions.
 
  Basically, I am using a Future-Task to load data from a long-running
  service and in the meantime would like to display the loading progress
 via
  a progressBar.
  This basically is working.
 
  However, after the loading has finished, the panel is not reloaded.
 
  Thanks a lot for your help!
 
  Chris
 
 
  Am 04.05.2015 um 11:40 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
 
  I am using a heuristic for an optimization problem and this takes about
  5-10 seconds.
  So it might be a good idea to use a future task to run this service,
  which
  receives the data (list of object) in the end.
  In the beginning, I would like to initialize the model with an empty
  list
  so that the page is displayed fast, and in parallel execute a future
  task;
  as soon as the service has some results, exchanging the model against
  the
  data returned.
 
  I have looked at the example described here:
  https://gist.github.com/jonnywray/636875 
  https://gist.github.com/jonnywray/636875
 
  The future is called correctly, but how can the component/panel be
  updated
  via the onPostSuccess(AjaxRequestTarget target) method?
 
 
  target.add(yourPanel) ?
  Caution: it will call model#getObject. Given your explanation I don't
  think
  your model is a LDM. Just be aware...
 
 
  By the way, what is the difference when setting the model via
  constructor
  (e.g. new Panel(id, model)) or via setDefaultModel method?
 
 
  There should no be differences. However, if you change the model object
  dynamically/afterward, you have to use #set[Default]ModelObject instead
  of
  #set[Default]Model.
 
 
  With the first, the default model is still null.
 
 
  No sure to follow here, because you said you initialized the model with
  an
  empty list... So neither the model and the modelobject should be
 null...
 
 
 
  Thanks, Chris
 
 
 
 
 


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




Check Box in pageablelistview

2015-05-05 Thread K
Hey




how are the selected records stored and how can i use it. i understand that
on form submission these records are submitted but i am not clear on how and
where. 

this is how the page looks like

http://apache-wicket.1842946.n4.nabble.com/file/n4670625/1.png 

Thanks in Advance

-
K
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Check-Box-in-pageablelistview-tp4670625.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Problems with wicket event registration: JavaScript links are not refreshed properly

2015-05-05 Thread Martin Grigorov
Hi,

On Tue, May 5, 2015 at 2:20 PM, Marcus Husar marcus.hu...@gmail.com wrote:

 Hello,

 I have two AjaxLinks inside a panel which is inside an IColumn of a
 DataTable. The table is refreshed by a TextField which implements an
 OnChangeAjaxBehavior. This behaviour manipulates the data provider and adds
 the table to the target.

 When text is entered to the text field the table is filtered as expected.
 But the response body of the Ajax post request delivers event registrations
 of the AjaxLinks rendered in the iteration before.

 E.g.: IBehaviourlisteners for AjaxLink IDs id54 and id55 are delivered. But
 the links have the IDs id56 and id57.

 Example:

 div
 a id=id56 href=javascript:;Edit/a
 a id=id57 href=javascript:;Delete/a
 /div

 ...

 evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id54,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id55,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response

 If I unfocus the text field I get a response with the correct event
 registrations.


How do you trigger the update in this case? with unfocused text field

I don't see any reason why Wicket will deliver out of date information like
this.
If you can reproduce this in a quickstart then please attach it to a ticket
in JIRA and we will take a look.


 ...

 evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id56,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id57,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response

 Has anyone seen similar problems? Is it possible enforce an event
 registration refresh for AjaxLinks?

 Just ask for code examples if needed.

 Regards,
 Marcus



Re: Check Box in pageablelistview

2015-05-05 Thread Martin Grigorov
Hi,

The data is saved in the Checkbox's model.
Make sure you read
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/markup/html/list/ListView.java#L84
before using FormComponents inside ListView.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, May 5, 2015 at 5:10 PM, K kondetiudayki...@gmail.com wrote:

 Hey




 how are the selected records stored and how can i use it. i understand that
 on form submission these records are submitted but i am not clear on how
 and
 where.

 this is how the page looks like

 http://apache-wicket.1842946.n4.nabble.com/file/n4670625/1.png

 Thanks in Advance

 -
 K
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Check-Box-in-pageablelistview-tp4670625.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Feedback Messages across Requests / Problem

2015-05-05 Thread Ernesto Reinaldo Barreiro
Store messages somewhere else? And on constructor check if there are any
and add them to the page?

On Tue, May 5, 2015 at 11:49 AM, Patrick Davids 
patrick.dav...@nubologic.com wrote:

 Hi all,

 I have have a quite complicated feedback message case here.
 Could someone help me, please...

 We only want to show a single feedback message.
 No matter, how much errors a form validation procudes.

 So, I use setMaxMessages(1) on the feedback panel.
 To avoid having them all showed up one by one while clicking reload, I
 implemented a FeedbackCollector and do a feedbackMessage.markAsRendered()
 somewhere on detach().
 (maybe someone remember my post some months ago ;-) )

 This all works pretty good... but:

 In a special case I need to use setResponsePage(getPage()) on an
 AjaxRequest, instead of target.add(...).

 To add feedback messages across requests, I have to use
 Session.get().error(my error).

 But on a ajax request, it seems there is a second detach() more when using
 setResponsePage(), so my message will never get displayed, even when I used
 Session.get().error(...).

 I read about a redirect issue, when using setReponsePage() in ajax cases.

 Does this redirect accidently marks my messages as rendered, caused by an
 implicit second detach() (- my own markAsRendered())?

 Could some one confirm that? And if yes, is there any way to prevent it?

 thanx and kind regards
 Patrick

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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: JQuery progressbar

2015-05-05 Thread Chris
Hi Sebastian,

thanks a lot - in the meantime I have added a spring task executor service so 
that the thread pool is closed properly during shutdown.

Could you explain to me why it is necessary to set the default model explicitly 
although the model is already set in the constructor?
Is then the default model used when set or the other model? 
routingListPanel = new RoutingListPanel(routingPanel, routingModel);
routingListPanel.setDefaultModel(routingModel);

Thanks, Chris


 Am 05.05.2015 um 16:10 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 I had a quick look today, I just applied the suggestion I mentioned
 previously and I have now a result...
 https://github.com/cat1000/FutureProgressBar/pull/1
 
 Best regards,
 Sebastien
 
 On Tue, May 5, 2015 at 1:52 AM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian
 
 thanks for the update!
 
 Chris
 
 
 Am 05.05.2015 um 01:39 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 I just had a brief look at files in the project. At least one thing which
 is wrong:
 
 https://github.com/cat1000/FutureProgressBar/blob/master/src/main/java/my/company/panels/RoutingListPanel.java#L24
 
 You should not unwrap the model object in a ctor; use the model directly.
 Also for subsequent components, use a model (like a propertymodel)
 That explains why your model object seems to never be updated, actually
 the
 listview is pointing the the old model object...
 
 I will try to have a deeper look tomorrow...
 
 Best regards,
 Sebastien.
 
 
 On Mon, May 4, 2015 at 9:47 PM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian  all,
 
 I have set up a quick start project (see
 https://github.com/cat1000/FutureProgressBar 
 https://github.com/cat1000/FutureProgressBar).
 Please read the readme.txt file contained in the package pages to get
 an
 overview over the goals and the open questions.
 
 Basically, I am using a Future-Task to load data from a long-running
 service and in the meantime would like to display the loading progress
 via
 a progressBar.
 This basically is working.
 
 However, after the loading has finished, the panel is not reloaded.
 
 Thanks a lot for your help!
 
 Chris
 
 
 Am 04.05.2015 um 11:40 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 
 I am using a heuristic for an optimization problem and this takes about
 5-10 seconds.
 So it might be a good idea to use a future task to run this service,
 which
 receives the data (list of object) in the end.
 In the beginning, I would like to initialize the model with an empty
 list
 so that the page is displayed fast, and in parallel execute a future
 task;
 as soon as the service has some results, exchanging the model against
 the
 data returned.
 
 I have looked at the example described here:
 https://gist.github.com/jonnywray/636875 
 https://gist.github.com/jonnywray/636875
 
 The future is called correctly, but how can the component/panel be
 updated
 via the onPostSuccess(AjaxRequestTarget target) method?
 
 
 target.add(yourPanel) ?
 Caution: it will call model#getObject. Given your explanation I don't
 think
 your model is a LDM. Just be aware...
 
 
 By the way, what is the difference when setting the model via
 constructor
 (e.g. new Panel(id, model)) or via setDefaultModel method?
 
 
 There should no be differences. However, if you change the model object
 dynamically/afterward, you have to use #set[Default]ModelObject instead
 of
 #set[Default]Model.
 
 
 With the first, the default model is still null.
 
 
 No sure to follow here, because you said you initialized the model with
 an
 empty list... So neither the model and the modelobject should be
 null...
 
 
 
 Thanks, Chris
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: Problems with wicket event registration: JavaScript links are not refreshed properly

2015-05-05 Thread Marcus Husar
Hello Martin,

I solved my problem 5 minutes ago. I haven’t seen your mail because I was
working hard to find the source of this behaviour.

The solution was to use AjaxFormComponentUpdatingBehavior with event type
input instead of OnChangeAjaxBehavior.

Martin wrote:
 How do you trigger the update in this case? with unfocused text field

 I don't see any reason why Wicket will deliver out of date information
like
 this.

For example: I entered 3 charaters into the text field which sent out one
post request each. Each of those post requests got an Ajax response with
correct table text and old event registrations of the table’s AjaxLinks.
When the text field then lost its focus because of clicking somewhere on
the page or into Firefox developer tools the browser sent out a fourth post
request which got correct event registrations.

After I switched to AjaxFormComponentUpdatingBehavior everything was fine.

...

I looked into the source code of OnChangeAjaxBehaviour. What it does is to
use the event type onchange. Also it adds a change handler to the reponse:

response.write(new Wicket.ChangeHandler(' + id + '););

This change handler maybe fires on change and blur. Maybe I had problems
with AjaxLinks inside a refreshed table because of some kind of race
condition.

Let me know if you still want to see this as a quickstart.

Thanks,
Marcus



Martin Grigorov mgrigo...@apache.org schrieb am Di., 5. Mai 2015 um
16:53 Uhr:

 Hi,

 On Tue, May 5, 2015 at 2:20 PM, Marcus Husar marcus.hu...@gmail.com
 wrote:

  Hello,
 
  I have two AjaxLinks inside a panel which is inside an IColumn of a
  DataTable. The table is refreshed by a TextField which implements an
  OnChangeAjaxBehavior. This behaviour manipulates the data provider and
 adds
  the table to the target.
 
  When text is entered to the text field the table is filtered as expected.
  But the response body of the Ajax post request delivers event
 registrations
  of the AjaxLinks rendered in the iteration before.
 
  E.g.: IBehaviourlisteners for AjaxLink IDs id54 and id55 are delivered.
 But
  the links have the IDs id56 and id57.
 
  Example:
 
  div
  a id=id56 href=javascript:;Edit/a
  a id=id57 href=javascript:;Delete/a
  /div
 
  ...
 
 
 evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id54,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id55,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response
 
  If I unfocus the text field I get a response with the correct event
  registrations.
 

 How do you trigger the update in this case? with unfocused text field

 I don't see any reason why Wicket will deliver out of date information like
 this.
 If you can reproduce this in a quickstart then please attach it to a ticket
 in JIRA and we will take a look.


  ...
 
 
 evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id56,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id57,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response
 
  Has anyone seen similar problems? Is it possible enforce an event
  registration refresh for AjaxLinks?
 
  Just ask for code examples if needed.
 
  Regards,
  Marcus
 



Re: JQuery progressbar

2015-05-05 Thread Sebastien
Hi Chis,


On Tue, May 5, 2015 at 6:25 PM, Chris chris...@gmx.at wrote:

 Hi Sebastian,

 thanks a lot - in the meantime I have added a spring task executor service
 so that the thread pool is closed properly during shutdown.

 Could you explain to me why it is necessary to set the default model
 explicitly although the model is already set in the constructor?
 Is then the default model used when set or the other model?
 routingListPanel = new RoutingListPanel(routingPanel, routingModel);
 routingListPanel.setDefaultModel(routingModel);


Because by new RoutingListPanel(routingPanel, routingModel);, you
suppose it will be the model of the RoutingListPanel, but... is it not; you
transmitted the model to the underlying list view... :) Just transmit the
routingModel (too) to the call to super and this will be solved.

public RoutingListPanel(String id, final IModelListRoute
routingModel) {
super(id, routingModel);

also, you can remove this line:
https://github.com/cat1000/FutureProgressBar/blob/ff0e9bda72ebc589a974103697baa5865719afcd/src/main/java/my/company/panels/MapPanel.java#L132




 Thanks, Chris


  Am 05.05.2015 um 16:10 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
  I had a quick look today, I just applied the suggestion I mentioned
  previously and I have now a result...
  https://github.com/cat1000/FutureProgressBar/pull/1
 
  Best regards,
  Sebastien
 
  On Tue, May 5, 2015 at 1:52 AM, Chris chris...@gmx.at wrote:
 
  Hi Sebastian
 
  thanks for the update!
 
  Chris
 
 
  Am 05.05.2015 um 01:39 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
  I just had a brief look at files in the project. At least one thing
 which
  is wrong:
 
 
 https://github.com/cat1000/FutureProgressBar/blob/master/src/main/java/my/company/panels/RoutingListPanel.java#L24
 
  You should not unwrap the model object in a ctor; use the model
 directly.
  Also for subsequent components, use a model (like a propertymodel)
  That explains why your model object seems to never be updated, actually
  the
  listview is pointing the the old model object...
 
  I will try to have a deeper look tomorrow...
 
  Best regards,
  Sebastien.
 
 
  On Mon, May 4, 2015 at 9:47 PM, Chris chris...@gmx.at wrote:
 
  Hi Sebastian  all,
 
  I have set up a quick start project (see
  https://github.com/cat1000/FutureProgressBar 
  https://github.com/cat1000/FutureProgressBar).
  Please read the readme.txt file contained in the package pages to
 get
  an
  overview over the goals and the open questions.
 
  Basically, I am using a Future-Task to load data from a long-running
  service and in the meantime would like to display the loading progress
  via
  a progressBar.
  This basically is working.
 
  However, after the loading has finished, the panel is not reloaded.
 
  Thanks a lot for your help!
 
  Chris
 
 
  Am 04.05.2015 um 11:40 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
 
  I am using a heuristic for an optimization problem and this takes
 about
  5-10 seconds.
  So it might be a good idea to use a future task to run this service,
  which
  receives the data (list of object) in the end.
  In the beginning, I would like to initialize the model with an empty
  list
  so that the page is displayed fast, and in parallel execute a future
  task;
  as soon as the service has some results, exchanging the model
 against
  the
  data returned.
 
  I have looked at the example described here:
  https://gist.github.com/jonnywray/636875 
  https://gist.github.com/jonnywray/636875
 
  The future is called correctly, but how can the component/panel be
  updated
  via the onPostSuccess(AjaxRequestTarget target) method?
 
 
  target.add(yourPanel) ?
  Caution: it will call model#getObject. Given your explanation I don't
  think
  your model is a LDM. Just be aware...
 
 
  By the way, what is the difference when setting the model via
  constructor
  (e.g. new Panel(id, model)) or via setDefaultModel method?
 
 
  There should no be differences. However, if you change the model
 object
  dynamically/afterward, you have to use #set[Default]ModelObject
 instead
  of
  #set[Default]Model.
 
 
  With the first, the default model is still null.
 
 
  No sure to follow here, because you said you initialized the model
 with
  an
  empty list... So neither the model and the modelobject should be
  null...
 
 
 
  Thanks, Chris
 
 
 
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




Preset the TimeZone of DateTimeField

2015-05-05 Thread Ulrich
I want the enduser to set the datetimefield as UTC-time. I want to make sure
ît is handled as UTC at program side - not to rely on the server settings. 
When I display the entered DateTimeField with the
getModelObject().toString()  it displays those values indicating that they
represent the server timezone. That means UTC is different. 
The only chance I see to handle the number as UTC themselves is that I need
to retrieve the Date().getTimeZoneOffset() and calculate the Date myself. 
Is the DateTimeField.changeTimeZone()-method of an help here? I don't see
what it is meant for right now.

My code looks like this:



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Preset-the-TimeZone-of-DateTimeField-tp4670631.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: JQuery progressbar

2015-05-05 Thread Chris
Hi Sebastian,

I am trying to apply the quick start to the real project.
I have the problem that the onSuccess method is not called  - in the quickStart 
it works. Do you know a hint but it is of course hard to figure it out from the 
distance.

br Chris

final FutureListRoute contentsFuture = 
routeGenerateService.generateRoutes();

FutureUpdateBehaviourListRoute futureUpdateBehaviour = new 
FutureUpdateBehaviourListRoute(Duration.seconds(2), contentsFuture) {
@Override
protected void onPostSuccess(AjaxRequestTarget target) {
System.out.println(Success);

routingListPanel.setVisible(true);
target.add(routingListPanel.getParent());

}

@Override
protected void onUpdateError(AjaxRequestTarget target, 
Exception e) {

}
};

 Am 05.05.2015 um 19:43 schrieb Sebastien seb...@gmail.com:
 
 Hi Chis,
 
 
 On Tue, May 5, 2015 at 6:25 PM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian,
 
 thanks a lot - in the meantime I have added a spring task executor service
 so that the thread pool is closed properly during shutdown.
 
 Could you explain to me why it is necessary to set the default model
 explicitly although the model is already set in the constructor?
 Is then the default model used when set or the other model?
 routingListPanel = new RoutingListPanel(routingPanel, routingModel);
 routingListPanel.setDefaultModel(routingModel);
 
 
 Because by new RoutingListPanel(routingPanel, routingModel);, you
 suppose it will be the model of the RoutingListPanel, but... is it not; you
 transmitted the model to the underlying list view... :) Just transmit the
 routingModel (too) to the call to super and this will be solved.
 
public RoutingListPanel(String id, final IModelListRoute
 routingModel) {
super(id, routingModel);
 
 also, you can remove this line:
 https://github.com/cat1000/FutureProgressBar/blob/ff0e9bda72ebc589a974103697baa5865719afcd/src/main/java/my/company/panels/MapPanel.java#L132
 
 
 
 
 Thanks, Chris
 
 
 Am 05.05.2015 um 16:10 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 I had a quick look today, I just applied the suggestion I mentioned
 previously and I have now a result...
 https://github.com/cat1000/FutureProgressBar/pull/1
 
 Best regards,
 Sebastien
 
 On Tue, May 5, 2015 at 1:52 AM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian
 
 thanks for the update!
 
 Chris
 
 
 Am 05.05.2015 um 01:39 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 I just had a brief look at files in the project. At least one thing
 which
 is wrong:
 
 
 https://github.com/cat1000/FutureProgressBar/blob/master/src/main/java/my/company/panels/RoutingListPanel.java#L24
 
 You should not unwrap the model object in a ctor; use the model
 directly.
 Also for subsequent components, use a model (like a propertymodel)
 That explains why your model object seems to never be updated, actually
 the
 listview is pointing the the old model object...
 
 I will try to have a deeper look tomorrow...
 
 Best regards,
 Sebastien.
 
 
 On Mon, May 4, 2015 at 9:47 PM, Chris chris...@gmx.at wrote:
 
 Hi Sebastian  all,
 
 I have set up a quick start project (see
 https://github.com/cat1000/FutureProgressBar 
 https://github.com/cat1000/FutureProgressBar).
 Please read the readme.txt file contained in the package pages to
 get
 an
 overview over the goals and the open questions.
 
 Basically, I am using a Future-Task to load data from a long-running
 service and in the meantime would like to display the loading progress
 via
 a progressBar.
 This basically is working.
 
 However, after the loading has finished, the panel is not reloaded.
 
 Thanks a lot for your help!
 
 Chris
 
 
 Am 04.05.2015 um 11:40 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 
 I am using a heuristic for an optimization problem and this takes
 about
 5-10 seconds.
 So it might be a good idea to use a future task to run this service,
 which
 receives the data (list of object) in the end.
 In the beginning, I would like to initialize the model with an empty
 list
 so that the page is displayed fast, and in parallel execute a future
 task;
 as soon as the service has some results, exchanging the model
 against
 the
 data returned.
 
 I have looked at the example described here:
 https://gist.github.com/jonnywray/636875 
 https://gist.github.com/jonnywray/636875
 
 The future is called correctly, but how can the component/panel be
 updated
 via the onPostSuccess(AjaxRequestTarget target) method?
 
 
 target.add(yourPanel) ?
 Caution: it will call model#getObject. Given your explanation I don't
 think
 your model is a LDM. Just be aware...
 
 
 By the way, what is the difference when setting the model via
 constructor
 (e.g. new Panel(id, model)) or via setDefaultModel method?
 
 
 There should no be differences. However, if you change the model
 object
 

Feedback Messages across Requests / Problem

2015-05-05 Thread Patrick Davids

Hi all,

I have have a quite complicated feedback message case here.
Could someone help me, please...

We only want to show a single feedback message.
No matter, how much errors a form validation procudes.

So, I use setMaxMessages(1) on the feedback panel.
To avoid having them all showed up one by one while clicking reload, I 
implemented a FeedbackCollector and do a 
feedbackMessage.markAsRendered() somewhere on detach().

(maybe someone remember my post some months ago ;-) )

This all works pretty good... but:

In a special case I need to use setResponsePage(getPage()) on an 
AjaxRequest, instead of target.add(...).


To add feedback messages across requests, I have to use 
Session.get().error(my error).


But on a ajax request, it seems there is a second detach() more when 
using setResponsePage(), so my message will never get displayed, even 
when I used Session.get().error(...).


I read about a redirect issue, when using setReponsePage() in ajax cases.

Does this redirect accidently marks my messages as rendered, caused by 
an implicit second detach() (- my own markAsRendered())?


Could some one confirm that? And if yes, is there any way to prevent it?

thanx and kind regards
Patrick

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



Re: Problems with wicket event registration: JavaScript links are not refreshed properly

2015-05-05 Thread Martin Grigorov
Hi,

Your description sounds somehow related to
https://issues.apache.org/jira/browse/WICKET-5432.

'input' event is not supported (properly) by all browsers. That's why
Wicket.ChangeHandler does some extra logic.
See https://developer.mozilla.org/en-US/docs/Web/Events/input

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Tue, May 5, 2015 at 7:05 PM, Marcus Husar marcus.hu...@gmail.com wrote:

 Hello Martin,

 I solved my problem 5 minutes ago. I haven’t seen your mail because I was
 working hard to find the source of this behaviour.

 The solution was to use AjaxFormComponentUpdatingBehavior with event type
 input instead of OnChangeAjaxBehavior.

 Martin wrote:
  How do you trigger the update in this case? with unfocused text field
 
  I don't see any reason why Wicket will deliver out of date information
 like
  this.

 For example: I entered 3 charaters into the text field which sent out one
 post request each. Each of those post requests got an Ajax response with
 correct table text and old event registrations of the table’s AjaxLinks.
 When the text field then lost its focus because of clicking somewhere on
 the page or into Firefox developer tools the browser sent out a fourth post
 request which got correct event registrations.

 After I switched to AjaxFormComponentUpdatingBehavior everything was fine.

 ...

 I looked into the source code of OnChangeAjaxBehaviour. What it does is to
 use the event type onchange. Also it adds a change handler to the
 reponse:

 response.write(new Wicket.ChangeHandler(' + id + '););

 This change handler maybe fires on change and blur. Maybe I had problems
 with AjaxLinks inside a refreshed table because of some kind of race
 condition.

 Let me know if you still want to see this as a quickstart.

 Thanks,
 Marcus



 Martin Grigorov mgrigo...@apache.org schrieb am Di., 5. Mai 2015 um
 16:53 Uhr:

  Hi,
 
  On Tue, May 5, 2015 at 2:20 PM, Marcus Husar marcus.hu...@gmail.com
  wrote:
 
   Hello,
  
   I have two AjaxLinks inside a panel which is inside an IColumn of a
   DataTable. The table is refreshed by a TextField which implements an
   OnChangeAjaxBehavior. This behaviour manipulates the data provider and
  adds
   the table to the target.
  
   When text is entered to the text field the table is filtered as
 expected.
   But the response body of the Ajax post request delivers event
  registrations
   of the AjaxLinks rendered in the iteration before.
  
   E.g.: IBehaviourlisteners for AjaxLink IDs id54 and id55 are delivered.
  But
   the links have the IDs id56 and id57.
  
   Example:
  
   div
   a id=id56 href=javascript:;Edit/a
   a id=id57 href=javascript:;Delete/a
   /div
  
   ...
  
  
 
 evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id54,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id55,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response
  
   If I unfocus the text field I get a response with the correct event
   registrations.
  
 
  How do you trigger the update in this case? with unfocused text field
 
  I don't see any reason why Wicket will deliver out of date information
 like
  this.
  If you can reproduce this in a quickstart then please attach it to a
 ticket
  in JIRA and we will take a look.
 
 
   ...
  
  
 
 evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id56,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id57,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response
  
   Has anyone seen similar problems? Is it possible enforce an event
   registration refresh for AjaxLinks?
  
   Just ask for code examples if needed.
  
   Regards,
   Marcus
  
 



Problems with wicket event registration: JavaScript links are not refreshed properly

2015-05-05 Thread Marcus Husar
Hello,

I have two AjaxLinks inside a panel which is inside an IColumn of a
DataTable. The table is refreshed by a TextField which implements an
OnChangeAjaxBehavior. This behaviour manipulates the data provider and adds
the table to the target.

When text is entered to the text field the table is filtered as expected.
But the response body of the Ajax post request delivers event registrations
of the AjaxLinks rendered in the iteration before.

E.g.: IBehaviourlisteners for AjaxLink IDs id54 and id55 are delivered. But
the links have the IDs id56 and id57.

Example:

div
a id=id56 href=javascript:;Edit/a
a id=id57 href=javascript:;Delete/a
/div

...
evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id54,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id55,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-26-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response

If I unfocus the text field I get a response with the correct event
registrations.

...
evaluate![CDATA[(function(){Wicket.Ajax.ajax({c:id56,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-editLink,e:click});})();(function(){Wicket.Ajax.ajax({c:id57,u:./SiglumIndexPage?4-1.IBehaviorListener.0-container-fragment-siglumDataTable-body-rows-27-cells-3-cell-deleteLink,e:click});})();]]/evaluate/ajax-response

Has anyone seen similar problems? Is it possible enforce an event
registration refresh for AjaxLinks?

Just ask for code examples if needed.

Regards,
Marcus