You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Petr Fejfar <pe...@gmail.com> on 2009/08/07 07:32:53 UTC

DropDownChoice.onSelectionChanged() in ModalWindow

Hi all,

I have a DropDownChoice on a panel within ModalWindow
and once I return true from wantOnSelectionChangedNotifications()
method and its value is changed, a browser shows dialog asking
for confirmation to continue:

   "Reloading this page will cause the modal window to disappear"

Please, could somebody advice me what I am missing?


Thanks, Petr

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


Re: DropDownChoice.onSelectionChanged() in ModalWindow

Posted by Petr Fejfar <pe...@gmail.com>.
On Fri, Aug 7, 2009 at 8:39 AM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:

> hidden component not found".. naturally. So in order for  the hidden
> component to "exist" in the HTML DOM tree even if it is HIDDEN, you
> must set:

... still thinking like in Desktop world  :'(

Thanks for prompt help

Petr

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


Re: DropDownChoice.onSelectionChanged() in ModalWindow

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
> I've AjaxButton on my form in the modal window hidden at the beginning:
> But the button is not shown event if setVisible() is set to true.
> What I'm missing now?

Look at Wicket Debug console in your browser. You will probably see
that "canont replace hidden component with visible component because
hidden component not found".. naturally. So in order for  the hidden
component to "exist" in the HTML DOM tree even if it is HIDDEN, you
must set:

dropDownChoice.setOutputMarkupPlaceholderTag(true);

**
Martin

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

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


Re: DropDownChoice.onSelectionChanged() in ModalWindow

Posted by Petr Fejfar <pe...@gmail.com>.
On Fri, Aug 7, 2009 at 8:03 AM, Martin
Makundi<ma...@koodaripalvelut.com> wrote:

> You must add OnChangeAjaxBehavior onto the dropdown and NOT
> wantOnSelectionChangedNotifications().

I see... I fixed it following you recommendation. Thanks for prompt help.

--

Anyway, I'm still fighting with Ajax:

I want to show/hide a AjaxButton in dependence on whether
there is any value selected by the DropDownChoice.

I've AjaxButton on my form in the modal window hidden at the beginning:

        musterButton.setOutputMarkupId(true);
        musterButton.setVisible(false);
        form.add(musterButton);

and in the handler of onUpdate event I'm trying to show it if selected
value is not null:

            protected void onUpdate(AjaxRequestTarget target) {
                ...
                musterButton.setVisible(pp.getMuster()!=null);
                target.addComponent(musterButton);
            }

But the button is not shown event if setVisible() is set to true.
What I'm missing now?


Thanks, Petr

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


Re: DropDownChoice.onSelectionChanged() in ModalWindow

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
ModalWindow supports only AJAX behavior.

You must add OnChangeAjaxBehavior onto the dropdown and NOT
wantOnSelectionChangedNotifications().

dropdown.add(new OnchangeAjaxBehavior() {
  onUpdate() {... }
});

**
Martin

2009/8/7 Petr Fejfar <pe...@gmail.com>:
> Hi all,
>
> I have a DropDownChoice on a panel within ModalWindow
> and once I return true from wantOnSelectionChangedNotifications()
> method and its value is changed, a browser shows dialog asking
> for confirmation to continue:
>
>   "Reloading this page will cause the modal window to disappear"
>
> Please, could somebody advice me what I am missing?
>
>
> Thanks, Petr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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