Re: ModalWindow.PageCreator()#createPage() is loading login page unexpectedly sometimes

2016-09-12 Thread durairaj t
Hi Martin,

DefaultPageStore#storePage(SerializedPage page) is holding only 40 pages in
cache and removes others. It seems pageSotre appending every new versions
and deleting old one. Like, cache.remove(0).

I'm keeping my page in session and trying to fetch from session . But
wicket looking into the PageStore not in the session.

why it is not checking in session?

Can I directly store a page by calling the
DefaultPageStore#storePage(SerializedPage page) in a page to refresh the
page version in pageStore?

Ex: DefaultPageStore#storePage(this)


Following code works for me, but I don't know whether this is the right
solution for the issue.

IDataStore dataStore=new HttpSessionDataStore(pageManagerContext,new
PageNumberEvictionStrategy(500));

Any Help?


On Thu, Sep 8, 2016 at 3:12 PM, Martin Grigorov 
wrote:

> Hi,
>
>
> On Thu, Sep 8, 2016 at 8:38 PM, durairaj t  wrote:
>
> > I have added the below code in my WebApp.java to keep the pages in
> session
> > alive. Is it correct? Any help?
> >
> > setPageManagerProvider(new DefaultPageManagerProvider(this)
> >   {
> >   protected IDataStore newDataStore()
> >   {
> >   //new HttpSessionDataStore(getPageManagerContext(), new
> > MemorySizeEvictionStrategy (null ) )
>
>
> According to the code "MemorySizeEvictionStrategy(null)" should throw
> IllegalArgumentException. The size (maxBytes) could not be null!
>
>
> > ;
> >   return  new HttpSessionDataStore(getPageManagerContext(), new
> > PageNumberEvictionStrategy(10));
> >
>
> This is very big number!
> You could easily run your web server out of memory!
> Consider more sane value!
>
>
> The reasons for PageExpiredException are listed in its javadoc.
> I'd bet the first one is the real reason - the page has never been stored
> due to some problem, e.g. NotSerializableException.
> Put a breakpoint
> at org.apache.wicket.pageStore.memory.HttpSessionDataStore#storeData() and
> make sure the page is being stored.
> Ajax requests *override* existing entries in the page store. So the store
> size doesn't change much.
>
>
> >   }
> >   });
> >
> >
> >
> >
> >
> >
> > On Thu, Sep 8, 2016 at 9:20 AM, durairaj t 
> wrote:
> >
> > > Hi Martin,
> > >
> > > I got the exact error  message while debugging in eclipse;
> > >
> > > *Error*:  " org.apache.wicket.protocol.http.PageExpiredException: Page
> > > with id '3' has expired."
> > >
> > >
> > > I tried following code snippet in the page constructor. It seems the
> > > following code updating the page until I'm moving out from the current
> > > (search modal window) page.
> > >
> > > *Solun 1:*
> > >
> > > moduleForm.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1)){
> > >  //one second
> > >
> > > private static final long serialVersionUID = 1L;
> > > @Override
> > > protected void onPostProcessTarget(AjaxRequestTarget target) {
> > > // TODO Auto-generated method stub
> > > super.onPostProcessTarget(target);
> > > System.out.println(" i'm alive");
> > > }
> > > });
> > >
> > > *Solun 2:*
> > > moduleForm.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) {
> > >  //one second
> > > protected void onTimer(final AjaxRequestTarget target) {
> > > System.out.println(" i'm alive");
> > > }
> > > });
> > >
> > >
> > > How to extend the page life time?
> > >
> > >
> > > On Wed, Aug 31, 2016 at 3:29 PM, durairaj t 
> > > wrote:
> > >
> > >> Thank you martin! Let me try this.
> > >>
> > >>
> > >>
> > >>
> > >> On Wed, Aug 31, 2016 at 2:27 PM, Martin Grigorov <
> mgrigo...@apache.org>
> > >> wrote:
> > >>
> > >>> Hi,
> > >>>
> > >>> Put a breakpoint at RequestCycle#setResponsePage(Class,
> > PageParameters)
> > >>> and
> > >>> see who and why is calling it. This will tell you the reason.
> > >>> If this doesn't help then put breakpoints in
> > >>> RestartReponseAtInterceptPageException constructors.
> > >>>
> > >>> Martin Grigorov
> > >>> Wicket Training and Consulting
> > >>> https://twitter.com/mtgrigorov
> > >>>
> > >>> On Wed, Aug 31, 2016 at 5:06 PM, durairaj t 
> > >>> wrote:
> > >>>
> > >>> > I got the same issue in Wicket 1.5, so I migrated it to 6.23, but
> > >>> still it
> > >>> > is happening.
> > >>> >
> > >>> > Moreover, I used "*Session.get().replaceSession()**;*" just to
> > >>> reproduce
> > >>> > the issue. it will not be in the actual application code.
> > >>> >
> > >>> > and I just used "* WebSession.get().clear(); *,
> > >>> *Session.get().clear(); , *
> > >>> > *WebSession.get().**replaceSession()*" to reproduce the issue.
> they
> > >>> are
> > >>> > also loading login page as it is happening in the application.
> > >>> >
> > >>> > I don't know the exact code or component or reason for this issue.
> > >>> >
> > >>> >
> > >>> > On Wed, Aug 31, 2016 at 10:51 AM, Francois Meillet <
> > >>> > francois.meil...@gmail.com> wrote:
> > >>> >
> > >>> > > Javadoc from Session # replaceSession() says : Call() upon login
> to
> > >>> > > protect against session fixation.
> > >>> > >
> > >>> > > Until Wicket version 6.2

Re: ModalWindow.PageCreator()#createPage() is loading login page unexpectedly sometimes

2016-09-12 Thread Martin Grigorov
On Mon, Sep 12, 2016 at 5:26 PM, durairaj t  wrote:

> Hi Martin,
>
> DefaultPageStore#storePage(SerializedPage page) is holding only 40 pages
> in
> cache and removes others. It seems pageSotre appending every new versions
> and deleting old one. Like, cache.remove(0).
>

You seem to use pretty old version of Wicket.
This store has been disabled 2.5 years ago (https://issues.apache.
org/jira/browse/WICKET-5554).

In YourApplication#init() do: getStoreSettings.setInmemoryCacheSize(0);


>
> I'm keeping my page in session and trying to fetch from session . But
> wicket looking into the PageStore not in the session.
>
> why it is not checking in session?
>
> Can I directly store a page by calling the
> DefaultPageStore#storePage(SerializedPage page) in a page to refresh the
> page version in pageStore?
>
> Ex: DefaultPageStore#storePage(this)
>
>
> Following code works for me, but I don't know whether this is the right
> solution for the issue.
>
> IDataStore dataStore=new HttpSessionDataStore(pageManagerContext,new
> PageNumberEvictionStrategy(500));
>
> Any Help?
>
>
> On Thu, Sep 8, 2016 at 3:12 PM, Martin Grigorov 
> wrote:
>
> > Hi,
> >
> >
> > On Thu, Sep 8, 2016 at 8:38 PM, durairaj t 
> wrote:
> >
> > > I have added the below code in my WebApp.java to keep the pages in
> > session
> > > alive. Is it correct? Any help?
> > >
> > > setPageManagerProvider(new DefaultPageManagerProvider(this)
> > >   {
> > >   protected IDataStore newDataStore()
> > >   {
> > >   //new HttpSessionDataStore(getPageManagerContext(), new
> > > MemorySizeEvictionStrategy (null ) )
> >
> >
> > According to the code "MemorySizeEvictionStrategy(null)" should throw
> > IllegalArgumentException. The size (maxBytes) could not be null!
> >
> >
> > > ;
> > >   return  new HttpSessionDataStore(getPageManagerContext(),
> new
> > > PageNumberEvictionStrategy(10));
> > >
> >
> > This is very big number!
> > You could easily run your web server out of memory!
> > Consider more sane value!
> >
> >
> > The reasons for PageExpiredException are listed in its javadoc.
> > I'd bet the first one is the real reason - the page has never been stored
> > due to some problem, e.g. NotSerializableException.
> > Put a breakpoint
> > at org.apache.wicket.pageStore.memory.HttpSessionDataStore#storeData()
> and
> > make sure the page is being stored.
> > Ajax requests *override* existing entries in the page store. So the store
> > size doesn't change much.
> >
> >
> > >   }
> > >   });
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Thu, Sep 8, 2016 at 9:20 AM, durairaj t 
> > wrote:
> > >
> > > > Hi Martin,
> > > >
> > > > I got the exact error  message while debugging in eclipse;
> > > >
> > > > *Error*:  " org.apache.wicket.protocol.http.PageExpiredException:
> Page
> > > > with id '3' has expired."
> > > >
> > > >
> > > > I tried following code snippet in the page constructor. It seems the
> > > > following code updating the page until I'm moving out from the
> current
> > > > (search modal window) page.
> > > >
> > > > *Solun 1:*
> > > >
> > > > moduleForm.add(new AjaxSelfUpdatingTimerBehavior(
> Duration.seconds(1)){
> > > >  //one second
> > > >
> > > > private static final long serialVersionUID = 1L;
> > > > @Override
> > > > protected void onPostProcessTarget(AjaxRequestTarget target) {
> > > > // TODO Auto-generated method stub
> > > > super.onPostProcessTarget(target);
> > > > System.out.println(" i'm alive");
> > > > }
> > > > });
> > > >
> > > > *Solun 2:*
> > > > moduleForm.add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) {
> > > >  //one second
> > > > protected void onTimer(final AjaxRequestTarget target) {
> > > > System.out.println(" i'm alive");
> > > > }
> > > > });
> > > >
> > > >
> > > > How to extend the page life time?
> > > >
> > > >
> > > > On Wed, Aug 31, 2016 at 3:29 PM, durairaj t 
> > > > wrote:
> > > >
> > > >> Thank you martin! Let me try this.
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> On Wed, Aug 31, 2016 at 2:27 PM, Martin Grigorov <
> > mgrigo...@apache.org>
> > > >> wrote:
> > > >>
> > > >>> Hi,
> > > >>>
> > > >>> Put a breakpoint at RequestCycle#setResponsePage(Class,
> > > PageParameters)
> > > >>> and
> > > >>> see who and why is calling it. This will tell you the reason.
> > > >>> If this doesn't help then put breakpoints in
> > > >>> RestartReponseAtInterceptPageException constructors.
> > > >>>
> > > >>> Martin Grigorov
> > > >>> Wicket Training and Consulting
> > > >>> https://twitter.com/mtgrigorov
> > > >>>
> > > >>> On Wed, Aug 31, 2016 at 5:06 PM, durairaj t <
> durairaj@gmail.com>
> > > >>> wrote:
> > > >>>
> > > >>> > I got the same issue in Wicket 1.5, so I migrated it to 6.23, but
> > > >>> still it
> > > >>> > is happening.
> > > >>> >
> > > >>> > Moreover, I used "*Session.get().replaceSession()**;*" just to
> > > >>> reproduce
> > > >>> > the issue. it will not be in the actual application code.
> > > >>> >
> > > >>> > and I just used "* WebSession.ge

Required DateTimeField not showing 'is required' feedback...

2016-09-12 Thread ChambreNoire
Hello,

Quick question: When I attach a FeedbackPanel to a DateTimeField with
setRequired(true), the required message never shows in the feedback whereas
validators like DateValidator.maximum work fine…

Any ideas?

Thanks

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Required-DateTimeField-not-showing-is-required-feedback-tp4675499.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: ModalWindow.PageCreator()#createPage() is loading login page unexpectedly sometimes

2016-09-12 Thread durairaj t
Thank you martin.

let me upgrade to wicket 7.x. it may resolve.

On Mon, Sep 12, 2016 at 11:33 AM, Martin Grigorov 
wrote:

> On Mon, Sep 12, 2016 at 5:26 PM, durairaj t 
> wrote:
>
> > Hi Martin,
> >
> > DefaultPageStore#storePage(SerializedPage page) is holding only 40 pages
> > in
> > cache and removes others. It seems pageSotre appending every new versions
> > and deleting old one. Like, cache.remove(0).
> >
>
> You seem to use pretty old version of Wicket.
> This store has been disabled 2.5 years ago (https://issues.apache.
> org/jira/browse/WICKET-5554).
>
> In YourApplication#init() do: getStoreSettings.setInmemoryCacheSize(0);
>
>
> >
> > I'm keeping my page in session and trying to fetch from session . But
> > wicket looking into the PageStore not in the session.
> >
> > why it is not checking in session?
> >
> > Can I directly store a page by calling the
> > DefaultPageStore#storePage(SerializedPage page) in a page to refresh the
> > page version in pageStore?
> >
> > Ex: DefaultPageStore#storePage(this)
> >
> >
> > Following code works for me, but I don't know whether this is the right
> > solution for the issue.
> >
> > IDataStore dataStore=new HttpSessionDataStore(pageManagerContext,new
> > PageNumberEvictionStrategy(500));
> >
> > Any Help?
> >
> >
> > On Thu, Sep 8, 2016 at 3:12 PM, Martin Grigorov 
> > wrote:
> >
> > > Hi,
> > >
> > >
> > > On Thu, Sep 8, 2016 at 8:38 PM, durairaj t 
> > wrote:
> > >
> > > > I have added the below code in my WebApp.java to keep the pages in
> > > session
> > > > alive. Is it correct? Any help?
> > > >
> > > > setPageManagerProvider(new DefaultPageManagerProvider(this)
> > > >   {
> > > >   protected IDataStore newDataStore()
> > > >   {
> > > >   //new HttpSessionDataStore(getPageManagerContext(), new
> > > > MemorySizeEvictionStrategy (null ) )
> > >
> > >
> > > According to the code "MemorySizeEvictionStrategy(null)" should throw
> > > IllegalArgumentException. The size (maxBytes) could not be null!
> > >
> > >
> > > > ;
> > > >   return  new HttpSessionDataStore(getPageManagerContext(),
> > new
> > > > PageNumberEvictionStrategy(10));
> > > >
> > >
> > > This is very big number!
> > > You could easily run your web server out of memory!
> > > Consider more sane value!
> > >
> > >
> > > The reasons for PageExpiredException are listed in its javadoc.
> > > I'd bet the first one is the real reason - the page has never been
> stored
> > > due to some problem, e.g. NotSerializableException.
> > > Put a breakpoint
> > > at org.apache.wicket.pageStore.memory.HttpSessionDataStore#storeData()
> > and
> > > make sure the page is being stored.
> > > Ajax requests *override* existing entries in the page store. So the
> store
> > > size doesn't change much.
> > >
> > >
> > > >   }
> > > >   });
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Thu, Sep 8, 2016 at 9:20 AM, durairaj t 
> > > wrote:
> > > >
> > > > > Hi Martin,
> > > > >
> > > > > I got the exact error  message while debugging in eclipse;
> > > > >
> > > > > *Error*:  " org.apache.wicket.protocol.http.PageExpiredException:
> > Page
> > > > > with id '3' has expired."
> > > > >
> > > > >
> > > > > I tried following code snippet in the page constructor. It seems
> the
> > > > > following code updating the page until I'm moving out from the
> > current
> > > > > (search modal window) page.
> > > > >
> > > > > *Solun 1:*
> > > > >
> > > > > moduleForm.add(new AjaxSelfUpdatingTimerBehavior(
> > Duration.seconds(1)){
> > > > >  //one second
> > > > >
> > > > > private static final long serialVersionUID = 1L;
> > > > > @Override
> > > > > protected void onPostProcessTarget(AjaxRequestTarget target) {
> > > > > // TODO Auto-generated method stub
> > > > > super.onPostProcessTarget(target);
> > > > > System.out.println(" i'm alive");
> > > > > }
> > > > > });
> > > > >
> > > > > *Solun 2:*
> > > > > moduleForm.add(new AbstractAjaxTimerBehavior(Duration.seconds(1))
> {
> > > > >  //one second
> > > > > protected void onTimer(final AjaxRequestTarget target) {
> > > > > System.out.println(" i'm alive");
> > > > > }
> > > > > });
> > > > >
> > > > >
> > > > > How to extend the page life time?
> > > > >
> > > > >
> > > > > On Wed, Aug 31, 2016 at 3:29 PM, durairaj t <
> durairaj@gmail.com>
> > > > > wrote:
> > > > >
> > > > >> Thank you martin! Let me try this.
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > > >> On Wed, Aug 31, 2016 at 2:27 PM, Martin Grigorov <
> > > mgrigo...@apache.org>
> > > > >> wrote:
> > > > >>
> > > > >>> Hi,
> > > > >>>
> > > > >>> Put a breakpoint at RequestCycle#setResponsePage(Class,
> > > > PageParameters)
> > > > >>> and
> > > > >>> see who and why is calling it. This will tell you the reason.
> > > > >>> If this doesn't help then put breakpoints in
> > > > >>> RestartReponseAtInterceptPageException constructors.
> > > > >>>
> > > > >>> Martin Grigorov
> > > > >>> Wicket Training and Consulting
> > > > >>> https://twitter.com/mtgri

Re: Indicating dialog button don't stop

2016-09-12 Thread Maxim Solodovnik
Thanks a lot for the SNAPSHOT
It works as expected :) the only issue I was able to see is: dialog
flickers while waiting ... is it expected?

Thanks for the steps will try to use it to debug broken menu item,
will write back :)

On Mon, Sep 12, 2016 at 5:23 AM, Sebastien  wrote:
> Hi Maxim,
>
> I've deployed 7.4.1-SNAPSHOT with the fix.
>
> About debugging the client side, you would :
> - watch the dev tool / network ajax requests and response
> - watch the ajax debug window if there is any js commands in the ajax
> response that has not effect (you can copy/paste them in the brower's dev
> console)
> - look at the rendered source, also for the js commands in the widget
> initialization
> - clone wicket-jquery-ui and put some 'console.log' in the relevant
> javascript statements.
> - if still no clue, start from scratch in a quickstart... :/
>
> Hope this helps,
> Sebastien
>
>



-- 
WBR
Maxim aka solomax

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



Re: Indicating dialog button don't stop

2016-09-12 Thread Sebastien
Hi Maxim,

This is not intended that the dialog flickers... This is weird and I don't
see any reason (and I don't see this on my side...)

Can you run the "upload dialog" sample of wicket-jquery-ui-samples to see
if you do repro it ?

> git clone https://github.com/sebfz1/wicket-jquery-ui.git
> cd wicket-jquery-ui
> mvn clean install
> cd wicket-jquery-ui-samples
> mvn jetty:run
(AFAIR)

Thanks in advance,
Sébastien


Re: Required DateTimeField not showing 'is required' feedback...

2016-09-12 Thread Sven Meier

Hi,

DateTimeField is a FormComponentPanel and thus overrides 
#checkRequired() to always return true.


I'm not sure whether your usage is possible or even makes sense for a 
FormComponentPanel.


Regards
Sven


On 12.09.2016 17:40, ChambreNoire wrote:

Hello,

Quick question: When I attach a FeedbackPanel to a DateTimeField with
setRequired(true), the required message never shows in the feedback whereas
validators like DateValidator.maximum work fine…

Any ideas?

Thanks

CN

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Required-DateTimeField-not-showing-is-required-feedback-tp4675499.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