You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by dhongyt <da...@gmail.com> on 2013/10/25 18:13:43 UTC

Displaying ListView After Being Hidden

I have a drop down choice that has a OnChangeAjaxBehavior on the drop down
choice. When a user selects from the drop down choice and chooses an option,
it will populate and show that option on a ListView below it.

That ListView is surrounded by a WebMarkupContainer in order to refresh the
view in an Ajax way.



I would like to hide the WebMarkupContainer if that ListView does not
contain anything. So I set the visibility to false using .setVisibility on
"wmc". Which hides it properly.
So when I reveal it again because of the OnChangeAjaxBehavior was called I
get an error.

ERROR: Wicket.Ajax.Call.processComponent: Component with id [[wmc24]] was
not found while trying to perform markup update. Make sure you called
component.setOutputMarkupId(true) on the component whose markup you are
trying to update.
ERROR: Cannot find element with id: deleteLink25



When you set the visibility to true again in the OnChangeAjaxBehavior, does
it not render the ListView markup? Seems like it may not hence the error?
How can I resolve this issue?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Displaying-ListView-After-Being-Hidden-tp4661963.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: Displaying ListView After Being Hidden

Posted by Bas Gooren <ba...@iswd.nl>.
That's precisely why that method/functionality exists. If you have a 
component which is not visible on the first render, how can wicket 
"replace" it on subsequent ajax renders?

When you call setOutputMarkupPlaceholderTag(true), wicket will render a 
tag with style="display:none" which provides wicket's ajax library with 
a hook in the dom.

Suppose you don't call that method, there will be no element in the dom 
which can be replaced.

Met vriendelijke groet,
Kind regards,

Bas Gooren

schreef Jared Sol op 25-10-2013 23:03:
> No problem. I'm not exactly sure. I just know when hiding an element and then unhiding it you have to tell the component to keep a placeholder so it doesn't lose access to the component when you hide it. Might have something to do with keeping it around in the dom and using display=none. I haven't looked into the details.
>
> Sent from my iPhone
>
>> On Oct 25, 2013, at 11:45 AM, dhongyt <da...@gmail.com> wrote:
>>
>> Thanks you! That worked for me. What is the reason for this? Is this so that
>> it would it would hold the placeholder with in wmc?
>>
>>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Displaying-ListView-After-Being-Hidden-tp4661963p4661972.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
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


Re: Displaying ListView After Being Hidden

Posted by Jared Sol <so...@gmail.com>.
No problem. I'm not exactly sure. I just know when hiding an element and then unhiding it you have to tell the component to keep a placeholder so it doesn't lose access to the component when you hide it. Might have something to do with keeping it around in the dom and using display=none. I haven't looked into the details.

Sent from my iPhone

> On Oct 25, 2013, at 11:45 AM, dhongyt <da...@gmail.com> wrote:
> 
> Thanks you! That worked for me. What is the reason for this? Is this so that
> it would it would hold the placeholder with in wmc?
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Displaying-ListView-After-Being-Hidden-tp4661963p4661972.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
> 

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


Re: Displaying ListView After Being Hidden

Posted by dhongyt <da...@gmail.com>.
Thanks you! That worked for me. What is the reason for this? Is this so that
it would it would hold the placeholder with in wmc?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Displaying-ListView-After-Being-Hidden-tp4661963p4661972.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: Displaying ListView After Being Hidden

Posted by Jared Sol <so...@gmail.com>.
Give setting the outputMarkupPlaceholderId to true a shot on the webMarkupContainer.

> On Oct 25, 2013, at 9:13 AM, dhongyt <da...@gmail.com> wrote:
> 
> I have a drop down choice that has a OnChangeAjaxBehavior on the drop down
> choice. When a user selects from the drop down choice and chooses an option,
> it will populate and show that option on a ListView below it.
> 
> That ListView is surrounded by a WebMarkupContainer in order to refresh the
> view in an Ajax way.
> 
> 
> 
> I would like to hide the WebMarkupContainer if that ListView does not
> contain anything. So I set the visibility to false using .setVisibility on
> "wmc". Which hides it properly.
> So when I reveal it again because of the OnChangeAjaxBehavior was called I
> get an error.
> 
> ERROR: Wicket.Ajax.Call.processComponent: Component with id [[wmc24]] was
> not found while trying to perform markup update. Make sure you called
> component.setOutputMarkupId(true) on the component whose markup you are
> trying to update.
> ERROR: Cannot find element with id: deleteLink25
> 
> 
> 
> When you set the visibility to true again in the OnChangeAjaxBehavior, does
> it not render the ListView markup? Seems like it may not hence the error?
> How can I resolve this issue?
> 
> 
> 
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Displaying-ListView-After-Being-Hidden-tp4661963.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
> 

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