You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "J.K. Baltzersen" <jo...@pvv.org> on 2013/12/10 17:00:01 UTC

user activity disabled during page load

Dear all,

I have been having trouble with a page that is heavy in loading, especially
at client locations with low bandwidth. The main problem is that fields that
are updated by the user before load has completed are not saved in their
edited form.

I have made an attempt to solve this problem with a modal window based on
this:
http://apache-wicket.1842946.n4.nabble.com/opening-ModalWindow-on-page-load-td3055618.html

renderHead has been amended to:

    public void renderHead(IHeaderResponse response) {
       
response.render(OnDomReadyHeaderItem.forScript(getWindowOpenJavaScript()));
        response.render(OnLoadHeaderItem.forScript(getCloseJavacript()));
    }

However, a problem with this approach is the modal window can be closed by
the user at will.

This problem, again, I have sought to resolve by amending the close
behavior:

    private void initialize() {

        setCloseButtonCallback(new CloseButtonCallback() {
            @Override
            public boolean onCloseButtonClicked(AjaxRequestTarget target) {
                return false;
            }
        });

This works fine for modal window's case. However, I now suddenly get this
message: "The page is asking you to confirm that you want to leave - data
you have entered may not be saved." With the options: Leave Page. Stay on
Page.

This behavior seems to show up no matter what if a new CloseButtonCallback
is implemented. If this behavior were non-present, everything would be fine.

I just want to disable user activity in the page before the entire page is
loaded.

I have looked into using an adaptation of the DisableComponentListener:
http://wicket.apache.org/guide/guide/chapter17.html#chapter17_6

But I have thus far failed to see how this can be applied when I am not
using Ajax in this instance.

Any tips that can please be provided for this task to move forward will be
greatly appreciated.

Thank you very much in advance.

Best regards,
J.K. Baltzersen



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: user activity disabled during page load

Posted by Martin Grigorov <mg...@apache.org>.
You can remove it with Javascript.
$(".wicket-modal .w_close").remove() or something similar

Martin Grigorov
Wicket Training and Consulting


On Fri, Dec 20, 2013 at 4:18 PM, J.K. Baltzersen <jo...@pvv.org> wrote:

> Martin Grigorov-4 wrote
> > .wicket-modal .w_close { display: none }
> >
> > You may make this CSS rule even more specific because it will affect all
> > modal windows when it is applied.
>
> I managed to implement this. However, the close (x) button is still there.
> So the user may click it if he knows it is there or otherwise happens to
> click in the right area.
>
> Is there a CSS solution that gets rid of the close button from the web page
> perspective altogether?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4663162.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: user activity disabled during page load

Posted by "J.K. Baltzersen" <jo...@pvv.org>.
Martin Grigorov-4 wrote
> .wicket-modal .w_close { display: none }
> 
> You may make this CSS rule even more specific because it will affect all
> modal windows when it is applied.

I managed to implement this. However, the close (x) button is still there.
So the user may click it if he knows it is there or otherwise happens to
click in the right area.

Is there a CSS solution that gets rid of the close button from the web page
perspective altogether?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4663162.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: user activity disabled during page load

Posted by Martin Grigorov <mg...@apache.org>.
.wicket-modal .w_close { display: none }

You may make this CSS rule even more specific because it will affect all
modal windows when it is applied.


On Wed, Dec 11, 2013 at 1:29 PM, J.K. Baltzersen <jo...@pvv.org> wrote:

> Thanks. I have the same concept with a different text in the alert.
>
> As I cannot resolve why the page is being abandoned, I think the better
> approach is, as you suggest, to make the close (x) button unavailable to
> the
> user. I've had a look in this forum and elsewhere for specific solutions
> for
> that.
>
> Any concrete examples of implementations?
>
>
> Martin Grigorov-4 wrote
> > I'm not sure why it tries to leave the page in your case.
> >
> > You can also hide the "x" button with CSS rule, so your user won't be
> able
> > to click it.
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4662912.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: user activity disabled during page load

Posted by "J.K. Baltzersen" <jo...@pvv.org>.
Thanks. I have the same concept with a different text in the alert.

As I cannot resolve why the page is being abandoned, I think the better
approach is, as you suggest, to make the close (x) button unavailable to the
user. I've had a look in this forum and elsewhere for specific solutions for
that.

Any concrete examples of implementations?


Martin Grigorov-4 wrote
> I'm not sure why it tries to leave the page in your case.
> 
> You can also hide the "x" button with CSS rule, so your user won't be able
> to click it.





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4662912.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: user activity disabled during page load

Posted by Martin Grigorov <mg...@apache.org>.
https://github.com/apache/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/modal/ModalContent1Page.java?source=c#L91
does something similar. It uses alert() additionally.
You can test it at
http://www.wicket-library.com/wicket-examples-6.0.x/ajax/modal-window?0 (Show
dialog with a page, the inner modal).

I'm not sure why it tries to leave the page in your case.

You can also hide the "x" button with CSS rule, so your user won't be able
to click it.


On Wed, Dec 11, 2013 at 10:56 AM, J.K. Baltzersen <jo...@pvv.org> wrote:

> I am not submitting a form. There is no submit button. I am invoking the
> modal window upon wait for load of the page to complete (non-Ajax).
>
> However, the setCloseButtonCallback includes an onCloseButtonClicked
> defined
> and declared with an AjaxRequestTarget parameter.
>
> If I remove the overridden callback, I don't have that problem, but then
> the
> user may close the window at will and hence be able to do edit before the
> page is completely loaded, which undermines the purpose of the dialog box.
>
>
> Martin Grigorov-4 wrote
> > Hi,
> >
> > Do you use *Ajax* button to submit the form ?
> > If you use normal (non-Ajax) submit button then you will leave the page.
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4662910.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: user activity disabled during page load

Posted by "J.K. Baltzersen" <jo...@pvv.org>.
I am not submitting a form. There is no submit button. I am invoking the
modal window upon wait for load of the page to complete (non-Ajax).

However, the setCloseButtonCallback includes an onCloseButtonClicked defined
and declared with an AjaxRequestTarget parameter.

If I remove the overridden callback, I don't have that problem, but then the
user may close the window at will and hence be able to do edit before the
page is completely loaded, which undermines the purpose of the dialog box.


Martin Grigorov-4 wrote
> Hi,
> 
> Do you use *Ajax* button to submit the form ?
> If you use normal (non-Ajax) submit button then you will leave the page.





--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4662910.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: user activity disabled during page load

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

Do you use *Ajax* button to submit the form ?
If you use normal (non-Ajax) submit button then you will leave the page.


On Wed, Dec 11, 2013 at 10:12 AM, J.K. Baltzersen <jo...@pvv.org> wrote:

> Thanks, but it is not the confirmation dialog itself that is the problem,
> it
> is the fact that the browser tries to leave the page.
>
> If I disable the confirmation dialog, all that will happen is that the user
> is thrown off the page without any confirmation. That is not what is
> intended.
>
> I have not called setResponsePage. All that I have done is overriden the
> CloseButtonCallback, and that somehow causes a page switch (with a
> confirmation dialog), which it -- in my humbe opinion -- should not.
>
> That is, I am not just getting this annoying confirmation dialog. The user
> is also thrown out (login page appears) if leave page is chosen. That is
> the
> main problem. The confirmation dialog is secondary to that.
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4662908.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: user activity disabled during page load

Posted by "J.K. Baltzersen" <jo...@pvv.org>.
Thanks, but it is not the confirmation dialog itself that is the problem, it
is the fact that the browser tries to leave the page.

If I disable the confirmation dialog, all that will happen is that the user
is thrown off the page without any confirmation. That is not what is
intended.

I have not called setResponsePage. All that I have done is overriden the
CloseButtonCallback, and that somehow causes a page switch (with a
confirmation dialog), which it -- in my humbe opinion -- should not.

That is, I am not just getting this annoying confirmation dialog. The user
is also thrown out (login page appears) if leave page is chosen. That is the
main problem. The confirmation dialog is secondary to that.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4662908.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: user activity disabled during page load

Posted by iluwatar <il...@gmail.com>.
In your getWindowOpenJavaScript() you need to set one property to disable the
confirmation dialog:

Wicket.Window.unloadConfirmation = false;

See here:
http://stackoverflow.com/questions/8013364/how-to-defeat-browser-dialog-popup-when-calling-wicket-setresponsepage-from-mo



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/user-activity-disabled-during-page-load-tp4662891p4662907.html
Sent from the Users forum mailing list archive at Nabble.com.

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