Re: Browser back - reload page/panel

2015-04-23 Thread Chris
Hi Martin,

I am using the LOM as follows in a page constructor. When a subcomponent of 
this page (list item) is clicked, some part of the page is reloaded via ajax 
(not the whole page).
In this case the method #service.retrieveList() is called. From your note I 
would assume that the method should not be called as the list should be cached? 
In my case, the method is called as soon as some part of the page is reloaded 
via Ajax. Should this be the case?

Thanks for your help, Chris


IModel> poisModel = new ListModel() {
 @Override
 public List getObject() {
 return service.retrieveList();
 }
}


> Am 23.04.2015 um 07:47 schrieb 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"  wrote:
> 
>> Hi Sebastian,
>> 
>> With „static“ I mean something as follows: model = new
>> ListModel(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 :
>>> 
>>> 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 :
> 
> 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  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:
>> 
>> IModel> poisModel = new ListModel() {
>>  @Override
>>  public List 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 >> :
>>> 
>>> 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  wrote:
>>> 
 Hi all,
 
 how is it possible to refresh a pa

Re: setting cookie

2015-04-23 Thread Chris
Hi Martin,

I would like to place the cookie statement in the renderHead as based on this I 
would like to show/hide JS bar.

   @Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);

Cookie cookie = cookieUtils.getCookie("vis");
if (cookie == null) {
response.render(OnDomReadyHeaderItem.forScript("bar_show();"));
cookieUtils.save("vis", "true");
} else {
response.render(OnDomReadyHeaderItem.forScript("bar_hide();"));
}
}

Trace:

Last cause: org.apache.wicket.response.StringResponse cannot be cast to 
org.apache.wicket.request.http.WebResponse
WicketMessage: Exception in rendering component: [HtmlHeaderContainer 
[Component id = _header_0]]

Root cause:

java.lang.ClassCastException: org.apache.wicket.response.StringResponse cannot 
be cast to org.apache.wicket.request.http.WebResponse
 at 
org.apache.wicket.util.cookies.CookieUtils.getWebResponse(CookieUtils.java:362)
 at org.apache.wicket.util.cookies.CookieUtils.save(CookieUtils.java:304)
 at org.apache.wicket.util.cookies.CookieUtils.save(CookieUtils.java:190)

Thanks a lot,
Chris


> Am 23.04.2015 um 07:43 schrieb 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"  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


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



Re: AjaxLazyLoadPanel

2015-04-23 Thread Sven Meier

Yes, that should do it.

Sven

On 23.04.2015 15:47, Martin Grigorov wrote:

Well, if the browser screen dimensions are set then the JS is working, no ?

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

On Thu, Apr 23, 2015 at 4:28 PM, Sven Meier  wrote:


Sorry, that should have been:


You can *not* detect Javascript support with it.

Sven



On 23.04.2015 14:43, Sven Meier wrote:


Hi,

when you have JavaScript disabled, the page will request itself via
meta-refresh, that's intended.


If BrowserInfoPage has set the ClientInfo properties then JavaScript is

enabled

I don't think this is correct: WebClientInfo and ClientProperties are
always set. You can detect Javascript support with it.

Regards
Sven


On 23.04.2015 09:05, Martin Grigorov wrote:


Double check that JavaScript is disabled.

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

On Thu, Apr 23, 2015 at 12:06 AM, Chris  wrote:

  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 
:

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  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  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  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




-
To unsubscribe, e-mail: users-unsubscr...@wick

Re: Ajax navigation loading div issue

2015-04-23 Thread Martin Grigorov
Hi,

I'm afraid this is not possible.
The browser unloads the page (with all its elements, i.e. the loader too)
and then loads the new page.

It is possible only if you use single-page-application design, i.e. replace
the body with Ajax.

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

On Thu, Apr 23, 2015 at 4:30 PM, Kovács Áron  wrote:

> Hello!
>
> I'm facing the following issue:
> I have a page with a button. I'm navigation to some other page by
> setResponsePage.
> I've set up a loading div with spinner which works great with the
> ajaxrequest.
> It shows it and hides it automatically.
>
> But I would like to use it in a way that the loading div should be
> displayed, until the arrival page comes in a state of onLoad.
>
> I can show the loading div from js code before navigating and hide in in
> the recipient page's OnLoadHeaderItem js call, but is there a way to do it
> manually?
>
> Thanks,
>
> Aron Kovacs
>


Re: AjaxLazyLoadPanel

2015-04-23 Thread Martin Grigorov
Well, if the browser screen dimensions are set then the JS is working, no ?

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

On Thu, Apr 23, 2015 at 4:28 PM, Sven Meier  wrote:

> Sorry, that should have been:
>
> >You can *not* detect Javascript support with it.
>
> Sven
>
>
>
> On 23.04.2015 14:43, Sven Meier wrote:
>
>> Hi,
>>
>> when you have JavaScript disabled, the page will request itself via
>> meta-refresh, that's intended.
>>
>> >If BrowserInfoPage has set the ClientInfo properties then JavaScript is
>> enabled
>>
>> I don't think this is correct: WebClientInfo and ClientProperties are
>> always set. You can detect Javascript support with it.
>>
>> Regards
>> Sven
>>
>>
>> On 23.04.2015 09:05, Martin Grigorov wrote:
>>
>>> Double check that JavaScript is disabled.
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Thu, Apr 23, 2015 at 12:06 AM, Chris  wrote:
>>>
>>>  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 > >:
>>
>> 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  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  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  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().getCl

Ajax navigation loading div issue

2015-04-23 Thread Kovács Áron
Hello!

I'm facing the following issue:
I have a page with a button. I'm navigation to some other page by
setResponsePage.
I've set up a loading div with spinner which works great with the
ajaxrequest.
It shows it and hides it automatically.

But I would like to use it in a way that the loading div should be
displayed, until the arrival page comes in a state of onLoad.

I can show the loading div from js code before navigating and hide in in
the recipient page's OnLoadHeaderItem js call, but is there a way to do it
manually?

Thanks,

Aron Kovacs


Re: AjaxLazyLoadPanel

2015-04-23 Thread Sven Meier

Sorry, that should have been:

>You can *not* detect Javascript support with it.

Sven


On 23.04.2015 14:43, Sven Meier wrote:

Hi,

when you have JavaScript disabled, the page will request itself via 
meta-refresh, that's intended.


>If BrowserInfoPage has set the ClientInfo properties then JavaScript 
is enabled


I don't think this is correct: WebClientInfo and ClientProperties are 
always set. You can detect Javascript support with it.


Regards
Sven


On 23.04.2015 09:05, Martin Grigorov wrote:

Double check that JavaScript is disabled.

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

On Thu, Apr 23, 2015 at 12:06 AM, Chris  wrote:


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 
:


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  wrote:


Hi, could you give a small example how to reference the

BrowserInfoPage?

thanks

Am 21.04.2015 um 13:39 schrieb Martin Grigorov 

:

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  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 

:
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  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





-
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-23 Thread Sven Meier

Hi,

when you have JavaScript disabled, the page will request itself via 
meta-refresh, that's intended.


>If BrowserInfoPage has set the ClientInfo properties then JavaScript 
is enabled


I don't think this is correct: WebClientInfo and ClientProperties are 
always set. You can detect Javascript support with it.


Regards
Sven


On 23.04.2015 09:05, Martin Grigorov wrote:

Double check that JavaScript is disabled.

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

On Thu, Apr 23, 2015 at 12:06 AM, Chris  wrote:


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 :

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  wrote:


Hi, could you give a small example how to reference the

BrowserInfoPage?

thanks


Am 21.04.2015 um 13:39 schrieb Martin Grigorov 
:

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  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 
:

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  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





-
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-23 Thread Sandor Feher
Hi Sebastien, 

It would worth a try but session scoped spring bean will fulfill all my
needs right know.
Thank you anyway!

Regards., Sandor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Simple-message-solution-Wicket-Spring-combined-application-tp4670461p4670482.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-23 Thread Sandor Feher
Hi Martin,

Thanks! That's it I was looking for. I use spring beans I inject to wicket
context so it should be trivial choice to me but I did not keep it in my
mind.

Regards., Sandor

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

2015-04-23 Thread Martin Grigorov
Double check that JavaScript is disabled.

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

On Thu, Apr 23, 2015 at 12:06 AM, Chris  wrote:

> 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 :
> >>
> >> 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  wrote:
> >>
> >>> Hi, could you give a small example how to reference the
> BrowserInfoPage?
> >>>
> >>> thanks
> >>>
>  Am 21.04.2015 um 13:39 schrieb Martin Grigorov  >:
> 
>  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  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  >:
> >>
> >> 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  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
>
>