Hi,

If you add the page instance to the AjaxRequestTarget then Wicket makes a
http redirect to repaint the whole page.
You should add only inner components to the target to keep the processing
completely Ajax.

Since you hide components with .setVisible(false) and later you try to make
them visible in Ajax request you should do :
ldapPanel.setOutputMarkupPlaceholderTag(true)

This way there will be empty and invisible HTML element that will act as a
placeholder that will be replaced with the real panel when it becomes
visible.

Martin Grigorov
Wicket Training and Consulting


On Wed, Mar 5, 2014 at 5:28 AM, msalman <mohammad_sal...@yahoo.com> wrote:

> I have a page where I switch between panels by making one of them visible
> and
> using a radio button as following:
>
>
>                 radioChoice.add(new
> AjaxFormChoiceComponentUpdatingBehavior()
>                 {
>
>                         /**
>                          *
>                          */
>                         private static final long serialVersionUID = 1L;
>
>                         @Override
>                         protected void onUpdate(AjaxRequestTarget target)
>                         {
>                                 if
> (panelSelection.equals(currentPanelSelection))
>                                 {
>                                         return;
>                                 }
>
>
>                                 if
> (panelSelection.equals(PanelSelection.AGENTS))
>                                 {
>                                         ldapPanel.setVisible(false);
>                                         agentPanel.setVisible(true);
>                                 }
>                                 else
>                                 {
>                                         ldapPanel.setVisible(true);
>                                         agentPanel.setVisible(false);
>                                 }
>
>                                 target.add(ldapPanel);
>                                 target.add(agentPanel);
>                                 target.add(FsUserBrowsePage.this);
>
>                                 currentPanelSelection = panelSelection;
>                         }
>
> As you can see that page is added to the target.   But this causes the
> "confirm navigation" type  popup dialog box in all the browsers.  If I
> don't
> include the page to the target then my changes do not happen.  Because of
> the frame work developed here, it seems that I would just have to add the
> page to the target.
>
> I have tried adding following lines to the above method but they do not
> help:
>
>
> target.prependJavaScript("Wicket.Window.unloadConfirmation = false;");
>                                 target.add(ldapPanel);
>                                 target.add(agentPanel);
>                                 target.add(FsUserBrowsePage.this);
>
> target.getHeaderResponse().renderOnEventJavaScript(target, event,
> javascript);
>
>
> I had a similar problem with a ModalWindow but
>
> target.prependJavaScript("Wicket.Window.unloadConfirmation = false;");
>
> worked.  But nothing seems to work with the above problem.
>
> Can some one please help avoid the "confirm navigation" popup.
>
> Thanks.
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Confirm-Navigation-pop-up-dialog-box-tp4664778.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
>
>

Reply via email to