You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tom Götz <to...@decoded.de> on 2015/10/07 12:42:06 UTC

Toggling visibility via ajax fails

Hi there,

I’m currently struggling with toggling the visibility of a WebMarkupContainer:

* setOutputMarkupIdPlaceholderTag is set to true
* container is not visible, i.e. contained components are hidden
* ajax request is triggered that should make the container visible
* the container is rerendered, I can see it’s contained components (that should now be visible) in the generated ajax response

Still, they are *not* visible after the ajax request finished and I currently have no clue where to look. Any hints maybe?

Cheers,
   Tom



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


Re: Toggling visibility via ajax fails

Posted by Martin Grigorov <mg...@apache.org>.
Well, you didn't mention that you have checked it ...

By chance/mistake do you use <wicket:container> for this component ?

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

On Wed, Oct 7, 2015 at 2:39 PM, Tom Götz <to...@decoded.de> wrote:

> Hi,
>
> thanks for your hints, I have already checked all of this, otherwise I
> wouldn’t have asked ;-)
>
> The container that’s toggled is added to the AjaxRequestTarget, which has
> no effect as described. If I add container.getParent() it works though …
> strange thing, will look even deeper.
>
>    Tom
>
>
>
>
> > On 07.10.2015, at 13:48, Martin Grigorov <mg...@apache.org> wrote:
> >
> > Hi Tom,
> >
> > Check the browser DevTools.
> > First check for JS errors in the console.
> > Then check the response of the Ajax call - you should see the new HTML
> with
> > all components there. Verify that the component id is existing in the
> DOM.
> > Wicket will log an error if it is not anyway.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Wed, Oct 7, 2015 at 12:44 PM, Tom Götz <to...@decoded.de> wrote:
> >
> >> … additional info: container + contained components are visible if I do
> a
> >> page refresh
> >>
> >>   Tom
> >>
> >>
> >>> On 07.10.2015, at 12:42, Tom Götz <to...@decoded.de> wrote:
> >>>
> >>> Hi there,
> >>>
> >>> I’m currently struggling with toggling the visibility of a
> >> WebMarkupContainer:
> >>>
> >>> * setOutputMarkupIdPlaceholderTag is set to true
> >>> * container is not visible, i.e. contained components are hidden
> >>> * ajax request is triggered that should make the container visible
> >>> * the container is rerendered, I can see it’s contained components
> (that
> >> should now be visible) in the generated ajax response
> >>>
> >>> Still, they are *not* visible after the ajax request finished and I
> >> currently have no clue where to look. Any hints maybe?
> >>>
> >>> Cheers,
> >>>  Tom
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> 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: Toggling visibility via ajax fails

Posted by Tom Götz <to...@decoded.de>.
Hi,

thanks for your hints, I have already checked all of this, otherwise I wouldn’t have asked ;-)

The container that’s toggled is added to the AjaxRequestTarget, which has no effect as described. If I add container.getParent() it works though … strange thing, will look even deeper.

   Tom




> On 07.10.2015, at 13:48, Martin Grigorov <mg...@apache.org> wrote:
> 
> Hi Tom,
> 
> Check the browser DevTools.
> First check for JS errors in the console.
> Then check the response of the Ajax call - you should see the new HTML with
> all components there. Verify that the component id is existing in the DOM.
> Wicket will log an error if it is not anyway.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Wed, Oct 7, 2015 at 12:44 PM, Tom Götz <to...@decoded.de> wrote:
> 
>> … additional info: container + contained components are visible if I do a
>> page refresh
>> 
>>   Tom
>> 
>> 
>>> On 07.10.2015, at 12:42, Tom Götz <to...@decoded.de> wrote:
>>> 
>>> Hi there,
>>> 
>>> I’m currently struggling with toggling the visibility of a
>> WebMarkupContainer:
>>> 
>>> * setOutputMarkupIdPlaceholderTag is set to true
>>> * container is not visible, i.e. contained components are hidden
>>> * ajax request is triggered that should make the container visible
>>> * the container is rerendered, I can see it’s contained components (that
>> should now be visible) in the generated ajax response
>>> 
>>> Still, they are *not* visible after the ajax request finished and I
>> currently have no clue where to look. Any hints maybe?
>>> 
>>> Cheers,
>>>  Tom
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> 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: Toggling visibility via ajax fails

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

Check the browser DevTools.
First check for JS errors in the console.
Then check the response of the Ajax call - you should see the new HTML with
all components there. Verify that the component id is existing in the DOM.
Wicket will log an error if it is not anyway.

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

On Wed, Oct 7, 2015 at 12:44 PM, Tom Götz <to...@decoded.de> wrote:

> … additional info: container + contained components are visible if I do a
> page refresh
>
>    Tom
>
>
> > On 07.10.2015, at 12:42, Tom Götz <to...@decoded.de> wrote:
> >
> > Hi there,
> >
> > I’m currently struggling with toggling the visibility of a
> WebMarkupContainer:
> >
> > * setOutputMarkupIdPlaceholderTag is set to true
> > * container is not visible, i.e. contained components are hidden
> > * ajax request is triggered that should make the container visible
> > * the container is rerendered, I can see it’s contained components (that
> should now be visible) in the generated ajax response
> >
> > Still, they are *not* visible after the ajax request finished and I
> currently have no clue where to look. Any hints maybe?
> >
> > Cheers,
> >   Tom
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Toggling visibility via ajax fails

Posted by Tom Götz <to...@decoded.de>.
… additional info: container + contained components are visible if I do a page refresh

   Tom


> On 07.10.2015, at 12:42, Tom Götz <to...@decoded.de> wrote:
> 
> Hi there,
> 
> I’m currently struggling with toggling the visibility of a WebMarkupContainer:
> 
> * setOutputMarkupIdPlaceholderTag is set to true
> * container is not visible, i.e. contained components are hidden
> * ajax request is triggered that should make the container visible
> * the container is rerendered, I can see it’s contained components (that should now be visible) in the generated ajax response
> 
> Still, they are *not* visible after the ajax request finished and I currently have no clue where to look. Any hints maybe?
> 
> Cheers,
>   Tom



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