Re: Submitlink + PageParameters

2015-04-22 Thread Chris
Hi, thanks a lot, I will try it out.

br, Chris



 Am 22.04.2015 um 10:58 schrieb lucast lucastol...@hotmail.com:
 
 Hi Chris,
 Have you tried the following?:
 
 
 
 In my case, the above solution was not properly redirecting to external url
 in production mode, so I resorted to using RedirectToUrlException:
 
 
 
 On the onSubmit(), I then called  setResponsePage(new RedirectPage(
 external url ) );
 
 I hope this helps.
 Regards,
 Lucas
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Submitlink-PageParameters-tp4670454p4670464.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
 


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



Re: Browser back - reload page/panel

2015-04-22 Thread Martin Grigorov
Hi,

Wicket disables caching for the pages [1] so going back will make a request
for re-render.
You should use dynamic models [2] to re-render the latest state.


1.
https://github.com/apache/wicket/blob/822a1693c2d017478613321ae6fce40d519b24fa/wicket-core/src/main/java/org/apache/wicket/markup/html/WebPage.java#L205
2.
https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels

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

On Wed, Apr 22, 2015 at 5:48 AM, Chris chris...@gmx.at wrote:

 Hi all,

 how is it possible to refresh a page or panel on browser back? If the user
 deletes an item and clicks on browser back to go to the last page, it is
 still displayed which should not be the case.

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




Re: Storing data in wicket session

2015-04-22 Thread Martin Grigorov
Hi,

On Wed, Apr 22, 2015 at 4:48 AM, Chris chris...@gmx.at wrote:

 Hi all,

 I need so share a list of strings between some objects during a session;
 Within the session, the list of strings will be deleted based on specific
 requests.

 Currently, I store them in the page but the disadvantage of this approach
 is that I have to delegate the list to each sub(sub)component.


You can create a helper class: PageHelper#getMyList(Page page) { return
((MyPage) page).getMyList();}
And use it in any component: MyList myList =
PageHelper.getMyList(getPage());



 Would it be good practice to store this directly in the wicket session?
 How to do this?


Yes. Just create a property/getter/setter in MySession and then use it:
((MySession) Session.get()).getMyList();
Make sure you synchronize the access to the list!



 A second approach would be to store it in the user object and inject this
 object in the individual components.


This is also an option. It could be a session scoped bean, or a provider...



 Could you give me a recommendation?

 Thanks, Chris


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




Re: Browser back - reload page/panel

2015-04-22 Thread Chris
Martin, thanks for the tip.

I would like to use some dynamic List Model, but not a detachable one and put 
following in the page’s initialization method:

  IModelListSomeType poisModel = new ListModelSomeType() {
@Override
public ListSomeType getObject() {
return service.retrieveList();
}

Why is the service.retrieveList method called so often, I thought that this 
call should be only made once?
Should I use another model?

Thanks!
Chris


 Am 22.04.2015 um 07:58 schrieb Martin Grigorov mgrigo...@apache.org:
 
 Hi,
 
 Wicket disables caching for the pages [1] so going back will make a request
 for re-render.
 You should use dynamic models [2] to re-render the latest state.
 
 
 1.
 https://github.com/apache/wicket/blob/822a1693c2d017478613321ae6fce40d519b24fa/wicket-core/src/main/java/org/apache/wicket/markup/html/WebPage.java#L205
 2.
 https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Wed, Apr 22, 2015 at 5:48 AM, Chris chris...@gmx.at wrote:
 
 Hi all,
 
 how is it possible to refresh a page or panel on browser back? If the user
 deletes an item and clicks on browser back to go to the last page, it is
 still displayed which should not be the case.
 
 Thanks a lot,
 Chris
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


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



Re: Browser back - reload page/panel

2015-04-22 Thread Chris
Hi Sebastian,

thanks - but if the page has many subcomponents that consume the model then 
there would be many subsequent calls? The service call might be expensive, 
isn’t it?
Is there another solution next to loadable detachable model? I could use a 
static model if the model does not change during a request…

You said that the #getObject should not be overridden in this way:
When to recommend it? The example below uses this approach:

personForm.add(new RequiredTextField(personName, new Model() {
@Override
public Object getObject() {
return person.getName();
}
 
@Override
public void setObject(Serializable object) {
person.setName((String) object);
}
}));

Thanks, Chris

 Am 22.04.2015 um 23:16 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 #getObject is potentially called often, yes. You should never override
 #getObject() like this
 A dynamic model is a LoadableDetachableModel. Overrides #load and it will
 be called only once by server request, at each server request (that
 consumes the model, of course).
 
 Hope this helps,
 Sebastien.
 
 
 On Wed, Apr 22, 2015 at 11:05 PM, Chris chris...@gmx.at wrote:
 
 Martin, thanks for the tip.
 
 I would like to use some dynamic List Model, but not a detachable one and
 put following in the page’s initialization method:
 
  IModelListSomeType poisModel = new ListModelSomeType() {
@Override
public ListSomeType getObject() {
return service.retrieveList();
}
 
 Why is the service.retrieveList method called so often, I thought that
 this call should be only made once?
 Should I use another model?
 
 Thanks!
 Chris
 
 
 Am 22.04.2015 um 07:58 schrieb Martin Grigorov mgrigo...@apache.org:
 
 Hi,
 
 Wicket disables caching for the pages [1] so going back will make a
 request
 for re-render.
 You should use dynamic models [2] to re-render the latest state.
 
 
 1.
 
 https://github.com/apache/wicket/blob/822a1693c2d017478613321ae6fce40d519b24fa/wicket-core/src/main/java/org/apache/wicket/markup/html/WebPage.java#L205
 2.
 
 https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Wed, Apr 22, 2015 at 5:48 AM, Chris chris...@gmx.at wrote:
 
 Hi all,
 
 how is it possible to refresh a page or panel on browser back? If the
 user
 deletes an item and clicks on browser back to go to the last page, it is
 still displayed which should not be the case.
 
 Thanks a lot,
 Chris
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Re: Browser back - reload page/panel

2015-04-22 Thread Sebastien
Hi Chris,

thanks - but if the page has many subcomponents that consume the model then
 there would be many subsequent calls?


To getObject, yes. But if you use a (shared) LDM it doesn't matter.


 The service call might be expensive, isn’t it?


Yes, probably.


 Is there another solution next to loadable detachable model?


It depends of your use case, you can do what you want with models
(including writing yours of course)
But for your use case, a LDM should suit...


 I could use a static model if the model does not change during a request…


Not sure what you mean by static model...



 You said that the #getObject should not be overridden in this way:
 When to recommend it? The example below uses this approach:

 personForm.add(new RequiredTextField(personName, new Model() {
 @Override
 public Object getObject() {
 return person.getName();
 }

 @Override
 public void setObject(Serializable object) {
 person.setName((String) object);
 }
 }));


The example is correct... There is a difference between
service.retrieveList and person.getName(): the latest being is an atomic
call while the first is potentially time consuming.
That's exactly one of the two reason why the LDM as been written :) (the
second being it is automatically detached...)



 Thanks, Chris

  Am 22.04.2015 um 23:16 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
  #getObject is potentially called often, yes. You should never override
  #getObject() like this
  A dynamic model is a LoadableDetachableModel. Overrides #load and it will
  be called only once by server request, at each server request (that
  consumes the model, of course).
 
  Hope this helps,
  Sebastien.
 
 
  On Wed, Apr 22, 2015 at 11:05 PM, Chris chris...@gmx.at wrote:
 
  Martin, thanks for the tip.
 
  I would like to use some dynamic List Model, but not a detachable one
 and
  put following in the page’s initialization method:
 
   IModelListSomeType poisModel = new ListModelSomeType() {
 @Override
 public ListSomeType getObject() {
 return service.retrieveList();
 }
 
  Why is the service.retrieveList method called so often, I thought that
  this call should be only made once?
  Should I use another model?
 
  Thanks!
  Chris
 
 
  Am 22.04.2015 um 07:58 schrieb Martin Grigorov mgrigo...@apache.org:
 
  Hi,
 
  Wicket disables caching for the pages [1] so going back will make a
  request
  for re-render.
  You should use dynamic models [2] to re-render the latest state.
 
 
  1.
 
 
 https://github.com/apache/wicket/blob/822a1693c2d017478613321ae6fce40d519b24fa/wicket-core/src/main/java/org/apache/wicket/markup/html/WebPage.java#L205
  2.
 
 
 https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Wed, Apr 22, 2015 at 5:48 AM, Chris chris...@gmx.at wrote:
 
  Hi all,
 
  how is it possible to refresh a page or panel on browser back? If the
  user
  deletes an item and clicks on browser back to go to the last page, it
 is
  still displayed which should not be the case.
 
  Thanks a lot,
  Chris
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 




Re: AjaxLazyLoadPanel

2015-04-22 Thread Chris
Hi Martin,

do you have a tip for following problem?

Thanks!


 
 I have disabled Javascript in Firefox and inserted following code below but 
 nevertheless, the page does not display If you see this, it means that both 
 javascript and meta-refresh are not support by your browser configuration. 
 Please click this link 
 http://localhost:8080/wicket/bookmarkable/org.apache.wicket.markup.html.pages.BrowserInfoPage;jsessionid=5694CB335CDA79B343ADF5D4DC3E029C
  to continue to the original destination.“  This message shortly pop ups when 
 setting a breakpoint but then refers to the original page content.
 
 The client info properties are set.
 
 Wicket App:
public void init() {
super.init();
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
 
 Page:
 WebClientInfo clientInfo = WebSession.get().getClientInfo();
 clientInfo.getProperties();
 
 br Chris 
 
 
 
 Am 21.04.2015 um 14:29 schrieb Martin Grigorov mgrigo...@apache.org:
 
 http://www.wicket-library.com/wicket-examples-6.0.x/hellobrowser/ shows it
 https://github.com/apache/wicket/tree/master/wicket-examples/src/main/java/org/apache/wicket/examples/hellobrowser
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Tue, Apr 21, 2015 at 3:21 PM, Chris chris...@gmx.at wrote:
 
 Hi, could you give a small example how to reference the BrowserInfoPage?
 
 thanks
 
 Am 21.04.2015 um 13:39 schrieb Martin Grigorov mgrigo...@apache.org:
 
 Java != JavaScript
 
 If BrowserInfoPage has set the ClientInfo properties then JavaScript is
 enabled
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Tue, Apr 21, 2015 at 2:09 PM, Chris chris...@gmx.at wrote:
 
 Andrew, thanks a lot!
 
 How could I in addition check if Javascript is enabled so that I can
 add a
 default Panel in case if it is not enabled?
 
 The following 2 lines do not work as it returns false although JS is
 enabled.
 
 WebClientInfo clientInfo = WebSession.get().getClientInfo();
 if (clientInfo.getProperties().isJavaEnabled()) …
 
 br, Chris
 
 Am 21.04.2015 um 05:24 schrieb Andrew Geery andrew.ge...@gmail.com:
 
 In AjaxLazyLoadPanel#getLazyComponent(String), you should be using the
 id
 parameter, not pList, when creating the PListPanel.
 
 Andrew
 
 @Override
 public Component getLazyLoadComponent(String id) {
 return new PListPanel(pList, pModel); // change
 the first param from pList to id
 }
 
 On Mon, Apr 20, 2015 at 11:10 PM, Chris chris...@gmx.at wrote:
 
 Hi all,
 
 I am following the example from
 http://www.mkyong.com/wicket/how-do-use-ajaxlazyloadpanel-in-wicket/
 but
 get following error:
 
 Last cause: Cannot replace a component which has not been added:
 id='pList', component=[PListPanel [Component id = pList]]:
 [AjaxLazyLoadPanel [Component id = pList]]
 
 By the way, is the checking for JavaEnabled valid or still needed? I
 have
 JavaScript enabled but the method #isJavaEnabled returns false;
 
 WebClientInfo clientInfo = WebSession.get().getClientInfo();
 if (clientInfo.getProperties().isJavaEnabled()) {
 add(new AjaxLazyLoadPanel(pList, pModel) {
 @Override
 public Component getLazyLoadComponent(String id) {
 return new PListPanel(pList, pModel);
 }
 }).setOutputMarkupId(true);
 } else {
 add(new PListPanel(pList, pModel);
 }
 
 Thanks, Chris
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 


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



setting cookie

2015-04-22 Thread Chris
Hi all,

I would like to call a certain JS method in the #renderHead method based on 
whether a cookie is set:

I am getting a Last cause: org.apache.wicket.response.StringResponse cannot be 
cast to org.apache.wicket.request.http.WebResponse exception.
Is it still possible to do this in the #renderHead method?

if (cookie == null) {
response.render(OnDomReadyHeaderItem.forScript(show();));
cookieUtils.save(key, value);
} else {
response.render(OnDomReadyHeaderItem.forScript(hide();));
}

Thanks, Chris

Re: Browser back - reload page/panel

2015-04-22 Thread Sebastien
Hi Chris,

#getObject is potentially called often, yes. You should never override
#getObject() like this
A dynamic model is a LoadableDetachableModel. Overrides #load and it will
be called only once by server request, at each server request (that
consumes the model, of course).

Hope this helps,
Sebastien.


On Wed, Apr 22, 2015 at 11:05 PM, Chris chris...@gmx.at wrote:

 Martin, thanks for the tip.

 I would like to use some dynamic List Model, but not a detachable one and
 put following in the page’s initialization method:

   IModelListSomeType poisModel = new ListModelSomeType() {
 @Override
 public ListSomeType getObject() {
 return service.retrieveList();
 }

 Why is the service.retrieveList method called so often, I thought that
 this call should be only made once?
 Should I use another model?

 Thanks!
 Chris


  Am 22.04.2015 um 07:58 schrieb Martin Grigorov mgrigo...@apache.org:
 
  Hi,
 
  Wicket disables caching for the pages [1] so going back will make a
 request
  for re-render.
  You should use dynamic models [2] to re-render the latest state.
 
 
  1.
 
 https://github.com/apache/wicket/blob/822a1693c2d017478613321ae6fce40d519b24fa/wicket-core/src/main/java/org/apache/wicket/markup/html/WebPage.java#L205
  2.
 
 https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Wed, Apr 22, 2015 at 5:48 AM, Chris chris...@gmx.at wrote:
 
  Hi all,
 
  how is it possible to refresh a page or panel on browser back? If the
 user
  deletes an item and clicks on browser back to go to the last page, it is
  still displayed which should not be the case.
 
  Thanks a lot,
  Chris
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 


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




Re: setting cookie

2015-04-22 Thread Martin Grigorov
It seems you have changed the response to StringResponse earlier and you
try to write a Cookie into it.

Please paste the stacktrace if you need more help.
On Apr 23, 2015 12:48 AM, Chris chris...@gmx.at wrote:

 Hi all,

 I would like to call a certain JS method in the #renderHead method based
 on whether a cookie is set:

 I am getting a Last cause: org.apache.wicket.response.StringResponse
 cannot be cast to org.apache.wicket.request.http.WebResponse exception.
 Is it still possible to do this in the #renderHead method?

 if (cookie == null) {
 response.render(OnDomReadyHeaderItem.forScript(show();));
 cookieUtils.save(key, value);
 } else {
 response.render(OnDomReadyHeaderItem.forScript(hide();));
 }

 Thanks, Chris


Re: Browser back - reload page/panel

2015-04-22 Thread Martin Grigorov
See the implementation of LoadableDetachableModel. It caches the result for
the request lifetime. That's why it calls getObject() just once
On Apr 23, 2015 1:56 AM, Chris chris...@gmx.at wrote:

 Hi Sebastian,

 With „static“ I mean something as follows: model = new
 ListModelSomeType(service.retrieve());

 I do not quite understand why the subsequent calls do not matter when
 using a LDM.
 If I use an LDM and a component of the page uses this model (e.g. creating
 a new Panel) then the service method is called again and this has a
 negative impact on performance if the database is hit all the time. With
 the line above this does not happen.

 thanks for your feedback!
 Chris


  Am 23.04.2015 um 00:30 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
  thanks - but if the page has many subcomponents that consume the model
 then
  there would be many subsequent calls?
 
 
  To getObject, yes. But if you use a (shared) LDM it doesn't matter.
 
 
  The service call might be expensive, isn’t it?
 
 
  Yes, probably.
 
 
  Is there another solution next to loadable detachable model?
 
 
  It depends of your use case, you can do what you want with models
  (including writing yours of course)
  But for your use case, a LDM should suit...
 
 
  I could use a static model if the model does not change during a
 request…
 
 
  Not sure what you mean by static model...
 
 
 
  You said that the #getObject should not be overridden in this way:
  When to recommend it? The example below uses this approach:
 
  personForm.add(new RequiredTextField(personName, new Model() {
 @Override
 public Object getObject() {
 return person.getName();
 }
 
 @Override
 public void setObject(Serializable object) {
 person.setName((String) object);
 }
  }));
 
 
  The example is correct... There is a difference between
  service.retrieveList and person.getName(): the latest being is an atomic
  call while the first is potentially time consuming.
  That's exactly one of the two reason why the LDM as been written :) (the
  second being it is automatically detached...)
 
 
 
  Thanks, Chris
 
  Am 22.04.2015 um 23:16 schrieb Sebastien seb...@gmail.com:
 
  Hi Chris,
 
  #getObject is potentially called often, yes. You should never override
  #getObject() like this
  A dynamic model is a LoadableDetachableModel. Overrides #load and it
 will
  be called only once by server request, at each server request (that
  consumes the model, of course).
 
  Hope this helps,
  Sebastien.
 
 
  On Wed, Apr 22, 2015 at 11:05 PM, Chris chris...@gmx.at wrote:
 
  Martin, thanks for the tip.
 
  I would like to use some dynamic List Model, but not a detachable one
  and
  put following in the page’s initialization method:
 
  IModelListSomeType poisModel = new ListModelSomeType() {
@Override
public ListSomeType getObject() {
return service.retrieveList();
}
 
  Why is the service.retrieveList method called so often, I thought that
  this call should be only made once?
  Should I use another model?
 
  Thanks!
  Chris
 
 
  Am 22.04.2015 um 07:58 schrieb Martin Grigorov mgrigo...@apache.org
 :
 
  Hi,
 
  Wicket disables caching for the pages [1] so going back will make a
  request
  for re-render.
  You should use dynamic models [2] to re-render the latest state.
 
 
  1.
 
 
 
 https://github.com/apache/wicket/blob/822a1693c2d017478613321ae6fce40d519b24fa/wicket-core/src/main/java/org/apache/wicket/markup/html/WebPage.java#L205
  2.
 
 
 
 https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels
 
  Martin Grigorov
  Wicket Training and Consulting
  https://twitter.com/mtgrigorov
 
  On Wed, Apr 22, 2015 at 5:48 AM, Chris chris...@gmx.at wrote:
 
  Hi all,
 
  how is it possible to refresh a page or panel on browser back? If
 the
  user
  deletes an item and clicks on browser back to go to the last page,
 it
  is
  still displayed which should not be the case.
 
  Thanks a lot,
  Chris
 
 -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 


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




Re: Storing data in wicket session

2015-04-22 Thread Chris
Martin, thanks a lot for your explanations!

Chris


 Am 22.04.2015 um 08:05 schrieb Martin Grigorov mgrigo...@apache.org:
 
 Hi,
 
 On Wed, Apr 22, 2015 at 4:48 AM, Chris chris...@gmx.at wrote:
 
 Hi all,
 
 I need so share a list of strings between some objects during a session;
 Within the session, the list of strings will be deleted based on specific
 requests.
 
 Currently, I store them in the page but the disadvantage of this approach
 is that I have to delegate the list to each sub(sub)component.
 
 
 You can create a helper class: PageHelper#getMyList(Page page) { return
 ((MyPage) page).getMyList();}
 And use it in any component: MyList myList =
 PageHelper.getMyList(getPage());
 
 
 
 Would it be good practice to store this directly in the wicket session?
 How to do this?
 
 
 Yes. Just create a property/getter/setter in MySession and then use it:
 ((MySession) Session.get()).getMyList();
 Make sure you synchronize the access to the list!
 
 
 
 A second approach would be to store it in the user object and inject this
 object in the individual components.
 
 
 This is also an option. It could be a session scoped bean, or a provider...
 
 
 
 Could you give me a recommendation?
 
 Thanks, Chris
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 


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



Re: Browser back - reload page/panel

2015-04-22 Thread Chris
Hi Sebastian, 

With „static“ I mean something as follows: model = new 
ListModelSomeType(service.retrieve());

I do not quite understand why the subsequent calls do not matter when using a 
LDM.
If I use an LDM and a component of the page uses this model (e.g. creating a 
new Panel) then the service method is called again and this has a negative 
impact on performance if the database is hit all the time. With the line above 
this does not happen.

thanks for your feedback!
Chris


 Am 23.04.2015 um 00:30 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 thanks - but if the page has many subcomponents that consume the model then
 there would be many subsequent calls?
 
 
 To getObject, yes. But if you use a (shared) LDM it doesn't matter.
 
 
 The service call might be expensive, isn’t it?
 
 
 Yes, probably.
 
 
 Is there another solution next to loadable detachable model?
 
 
 It depends of your use case, you can do what you want with models
 (including writing yours of course)
 But for your use case, a LDM should suit...
 
 
 I could use a static model if the model does not change during a request…
 
 
 Not sure what you mean by static model...
 
 
 
 You said that the #getObject should not be overridden in this way:
 When to recommend it? The example below uses this approach:
 
 personForm.add(new RequiredTextField(personName, new Model() {
@Override
public Object getObject() {
return person.getName();
}
 
@Override
public void setObject(Serializable object) {
person.setName((String) object);
}
 }));
 
 
 The example is correct... There is a difference between
 service.retrieveList and person.getName(): the latest being is an atomic
 call while the first is potentially time consuming.
 That's exactly one of the two reason why the LDM as been written :) (the
 second being it is automatically detached...)
 
 
 
 Thanks, Chris
 
 Am 22.04.2015 um 23:16 schrieb Sebastien seb...@gmail.com:
 
 Hi Chris,
 
 #getObject is potentially called often, yes. You should never override
 #getObject() like this
 A dynamic model is a LoadableDetachableModel. Overrides #load and it will
 be called only once by server request, at each server request (that
 consumes the model, of course).
 
 Hope this helps,
 Sebastien.
 
 
 On Wed, Apr 22, 2015 at 11:05 PM, Chris chris...@gmx.at wrote:
 
 Martin, thanks for the tip.
 
 I would like to use some dynamic List Model, but not a detachable one
 and
 put following in the page’s initialization method:
 
 IModelListSomeType poisModel = new ListModelSomeType() {
   @Override
   public ListSomeType getObject() {
   return service.retrieveList();
   }
 
 Why is the service.retrieveList method called so often, I thought that
 this call should be only made once?
 Should I use another model?
 
 Thanks!
 Chris
 
 
 Am 22.04.2015 um 07:58 schrieb Martin Grigorov mgrigo...@apache.org:
 
 Hi,
 
 Wicket disables caching for the pages [1] so going back will make a
 request
 for re-render.
 You should use dynamic models [2] to re-render the latest state.
 
 
 1.
 
 
 https://github.com/apache/wicket/blob/822a1693c2d017478613321ae6fce40d519b24fa/wicket-core/src/main/java/org/apache/wicket/markup/html/WebPage.java#L205
 2.
 
 
 https://cwiki.apache.org/confluence/display/WICKET/Working+with+Wicket+models#WorkingwithWicketmodels-DynamicModels
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Wed, Apr 22, 2015 at 5:48 AM, Chris chris...@gmx.at wrote:
 
 Hi all,
 
 how is it possible to refresh a page or panel on browser back? If the
 user
 deletes an item and clicks on browser back to go to the last page, it
 is
 still displayed which should not be the case.
 
 Thanks a lot,
 Chris
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 


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



Simple message solution Wicket-Spring combined application

2015-04-22 Thread Sandor Feher
Hi,

I'm looking for a simple and feasible message sending solution for my
application.
The main goal is that components (both wicket and spring) should be send
messages if a specific event occurs to users.
The message will be displayed at top of the page with help
AjaxSelfUpdatingBehaviour.
Spring messages are system wide. (Eg. all users should be notified) while
wicket ones can be session wide.
Wicket's event mechanism can be fine but my Spring based web service does
not know anything about wicket sessions (and should not of course).
I can do it via database table but I will cause overhead because of two
seconds refresh time I set in AjaxSelfUpdatingBehaviour.
So I'm looking for a more lightweight approach.

Thanks!

Regards., Sandor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Simple-message-solution-Wicket-Spring-combined-application-tp4670461.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: Simple message solution Wicket-Spring combined application

2015-04-22 Thread Martin Grigorov
Hi,

The session services could store messages to application scoped bean.
The Wicket components in either the Wicket Session or session scoped bean.
The AjaxSelfUpdatingBehaviour will check both.
The session scoped messages could be deleted after render but you have to
think of a way how to mark an application scoped message as read by a
client and delete it when all it is read by all clients.

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

On Wed, Apr 22, 2015 at 10:58 AM, Sandor Feher sfe...@bluesystem.hu wrote:

 Hi,

 I'm looking for a simple and feasible message sending solution for my
 application.
 The main goal is that components (both wicket and spring) should be send
 messages if a specific event occurs to users.
 The message will be displayed at top of the page with help
 AjaxSelfUpdatingBehaviour.
 Spring messages are system wide. (Eg. all users should be notified) while
 wicket ones can be session wide.
 Wicket's event mechanism can be fine but my Spring based web service does
 not know anything about wicket sessions (and should not of course).
 I can do it via database table but I will cause overhead because of two
 seconds refresh time I set in AjaxSelfUpdatingBehaviour.
 So I'm looking for a more lightweight approach.

 Thanks!

 Regards., Sandor

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Simple-message-solution-Wicket-Spring-combined-application-tp4670461.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: Wicket+Websockets+mod_proxy question

2015-04-22 Thread Maxim Solodovnik
Thanks for the reply Martin,

Unfortunately this story is not over :((
The solution published is not working, I'm still looking for the advice.

published configuration leads to: Error during WebSocket handshake:
Unexpected response code: 302



On Wed, Apr 22, 2015 at 4:02 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 Hi Maxim,

 I think I have a Deja Vu :-)
 You fought the same problem several months ago and reported that you have
 implemented it at http://markmail.org/message/v25lzvhkfydu5yyb

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

 On Wed, Apr 22, 2015 at 12:23 PM, Maxim Solodovnik solomax...@gmail.com
 wrote:

  Hello All,
 
  We are developing Wicket based application. Additionally on our demo
 server
  we are using mod_proxy to allow access to the users who have port 5080
  closed.
 
  Everything worked as expected until we have added websockets :((
 
  Maybe anyone have positive experience on configuring
  mod_proxy+mod_proxy_wstunnel with wicket application with websockets
  support?
 
  what I have tried:
 
  1)
  Location /openmeetings
  Order allow,deny
  Allow from all
  ProxyPass http://localhost:5080/openmeetings
  ProxyPassReverse http://localhost:5080/openmeetings
  /Location
 
  not working, HTML/JS/CSS works as expected, WS gives code 302 on page
 load
 
  2)
  ProxyPass /openmeetings/wicket/websocket
  ws://localhost:5080/openmeetings/wicket/websocket
  ProxyPassReverse /openmeetings/wicket/websocket
  ws://localhost:5080/openmeetings/wicket/websocket
  ProxyPass /openmeetings http://localhost:5080/openmeetings
  ProxyPassReverse /openmeetings http://localhost:5080/openmeetings
 
  not working, HTML/JS/CSS works as expected, WS is very silent on page
 load,
  gives rror during WebSocket handshake: Unexpected response code: 200
 
  Thanks in advance for any help
 
  OS: Ubuntu 14.04.2 LTS
  Apache: 2.4.7
 
 
  --
  WBR
  Maxim aka solomax
 




-- 
WBR
Maxim aka solomax


Re: Wicket+Websockets+mod_proxy question

2015-04-22 Thread Martin Grigorov
Hi Maxim,

I think I have a Deja Vu :-)
You fought the same problem several months ago and reported that you have
implemented it at http://markmail.org/message/v25lzvhkfydu5yyb

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

On Wed, Apr 22, 2015 at 12:23 PM, Maxim Solodovnik solomax...@gmail.com
wrote:

 Hello All,

 We are developing Wicket based application. Additionally on our demo server
 we are using mod_proxy to allow access to the users who have port 5080
 closed.

 Everything worked as expected until we have added websockets :((

 Maybe anyone have positive experience on configuring
 mod_proxy+mod_proxy_wstunnel with wicket application with websockets
 support?

 what I have tried:

 1)
 Location /openmeetings
 Order allow,deny
 Allow from all
 ProxyPass http://localhost:5080/openmeetings
 ProxyPassReverse http://localhost:5080/openmeetings
 /Location

 not working, HTML/JS/CSS works as expected, WS gives code 302 on page load

 2)
 ProxyPass /openmeetings/wicket/websocket
 ws://localhost:5080/openmeetings/wicket/websocket
 ProxyPassReverse /openmeetings/wicket/websocket
 ws://localhost:5080/openmeetings/wicket/websocket
 ProxyPass /openmeetings http://localhost:5080/openmeetings
 ProxyPassReverse /openmeetings http://localhost:5080/openmeetings

 not working, HTML/JS/CSS works as expected, WS is very silent on page load,
 gives rror during WebSocket handshake: Unexpected response code: 200

 Thanks in advance for any help

 OS: Ubuntu 14.04.2 LTS
 Apache: 2.4.7


 --
 WBR
 Maxim aka solomax



Re: Simple message solution Wicket-Spring combined application

2015-04-22 Thread Sebastien
Hi

If you are looking for another approach, you can give a try to native
websockets.

In the java sample below, the business tier is triggering a listener event,
which received by the web tier, which sends the websocket message.
Client side, the page is registered to the websocket by a Behavior. When a
message arrives, it is displayed.
The scope of the websocket message broadcast can be controlled IIRC
(Session, Application).

Wiki:
https://cwiki.apache.org/confluence/display/WICKET/Wicket+Native+WebSockets

Sample (scala)
https://github.com/martin-g/wicket-native-websocket-example

Sample (java, cdi  ejb)
https://github.com/sebfz1/wicket-quickstart-cdi-async

Best regards,
Sebastien



On Wed, Apr 22, 2015 at 10:22 AM, Martin Grigorov mgrigo...@apache.org
wrote:

 Hi,

 The session services could store messages to application scoped bean.
 The Wicket components in either the Wicket Session or session scoped bean.
 The AjaxSelfUpdatingBehaviour will check both.
 The session scoped messages could be deleted after render but you have to
 think of a way how to mark an application scoped message as read by a
 client and delete it when all it is read by all clients.

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

 On Wed, Apr 22, 2015 at 10:58 AM, Sandor Feher sfe...@bluesystem.hu
 wrote:

  Hi,
 
  I'm looking for a simple and feasible message sending solution for my
  application.
  The main goal is that components (both wicket and spring) should be send
  messages if a specific event occurs to users.
  The message will be displayed at top of the page with help
  AjaxSelfUpdatingBehaviour.
  Spring messages are system wide. (Eg. all users should be notified) while
  wicket ones can be session wide.
  Wicket's event mechanism can be fine but my Spring based web service does
  not know anything about wicket sessions (and should not of course).
  I can do it via database table but I will cause overhead because of two
  seconds refresh time I set in AjaxSelfUpdatingBehaviour.
  So I'm looking for a more lightweight approach.
 
  Thanks!
 
  Regards., Sandor
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Simple-message-solution-Wicket-Spring-combined-application-tp4670461.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: Submitlink + PageParameters

2015-04-22 Thread lucast
Hi Chris,
Have you tried the following?:



In my case, the above solution was not properly redirecting to external url
in production mode, so I resorted to using RedirectToUrlException:



On the onSubmit(), I then calledsetResponsePage(new RedirectPage(
external url ) );

I hope this helps.
Regards,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Submitlink-PageParameters-tp4670454p4670464.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



Wicket+Websockets+mod_proxy question

2015-04-22 Thread Maxim Solodovnik
Hello All,

We are developing Wicket based application. Additionally on our demo server
we are using mod_proxy to allow access to the users who have port 5080
closed.

Everything worked as expected until we have added websockets :((

Maybe anyone have positive experience on configuring
mod_proxy+mod_proxy_wstunnel with wicket application with websockets
support?

what I have tried:

1)
Location /openmeetings
Order allow,deny
Allow from all
ProxyPass http://localhost:5080/openmeetings
ProxyPassReverse http://localhost:5080/openmeetings
/Location

not working, HTML/JS/CSS works as expected, WS gives code 302 on page load

2)
ProxyPass /openmeetings/wicket/websocket
ws://localhost:5080/openmeetings/wicket/websocket
ProxyPassReverse /openmeetings/wicket/websocket
ws://localhost:5080/openmeetings/wicket/websocket
ProxyPass /openmeetings http://localhost:5080/openmeetings
ProxyPassReverse /openmeetings http://localhost:5080/openmeetings

not working, HTML/JS/CSS works as expected, WS is very silent on page load,
gives rror during WebSocket handshake: Unexpected response code: 200

Thanks in advance for any help

OS: Ubuntu 14.04.2 LTS
Apache: 2.4.7


-- 
WBR
Maxim aka solomax