You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gu...@wellsfargo.com on 2010/06/01 19:25:13 UTC

How to make visible all child of WebMarkupContainer

Hi All,


I  am getting strange problem. Setting WebMarkupContainer.setVisible(true) is not making all its child visible via Ajax Link.

My Html code looks like this

<div wickit:id="wrapper1"><img><a wicked:id="ajaxlink1">Show All</a></div>
<div wickit:id="wrapper2"><img><a wicked:id="ajaxlink2">Show Recent</a></div>

I need to show one of those links at a time. But somehow setting setVisible(true) is not working , but setVisible(false) works

Thanks in Advance for replying

Preet



Re: How to make visible all child of WebMarkupContainer

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Jun 1, 2010 at 1:02 PM, <Gu...@wellsfargo.com> wrote:

>  Yeap I am adding both wrappers to AjaxRequesttarget  like this
>
>
>
>   target.addComponent(seeRecentWrapper..setVisible(true));
>
>   target.addComponent(seeAllWrapper..setVisible(false));
>
>
I'm not sure why you have the wrappers at all - they don't seem to add
anything.  Why not just toggle the visibility on the links themselves?  Have
you looked at the ajax debug window to see what's being sent?  Post that
response if you can't figure it out.

-- 
Jeremy Thomerson
http://www.wickettraining.com

RE: How to make visible all child of WebMarkupContainer

Posted by Gu...@wellsfargo.com.
Yeap I am adding both wrappers to AjaxRequesttarget  like this

  target.addComponent(seeRecentWrapper..setVisible(true));
  target.addComponent(seeAllWrapper..setVisible(false));

From: Jeremy Thomerson [mailto:jeremy@wickettraining.com]
Sent: Tuesday, June 01, 2010 10:59 AM
To: Singh, Gurpreet
Cc: users@wicket.apache.org
Subject: Re: How to make visible all child of WebMarkupContainer


On Tue, Jun 1, 2010 at 12:45 PM, <Gu...@wellsfargo.com>> wrote:
Thanks for replying and sorry about typos. Here is the real code

<div wicket:id="seeAllWrapper"><a href="#" wicket:id="seeAll"> <img src="images/al_faqarrow1_gen.gif" style="vertical-align:middle" border="0"/>See All </a></div>
   <div wicket:id="seeRecentWrapper"><a href="#" wicket:id="seeRecent"><img src="images/al_faqarrow1_gen.gif" style="vertical-align:middle" border="0"/> View Most Recent </a></div>

seeAll and seeRecent links visibility is set to default , which I assume is true.

Initialy seeRecentWrapper visibility is set to false and seeAllWrapper visibility is set to true.

On click on seeAll Ajax link I am setting seeRecentWrapper.setVisible(true) and seeAllWrapper.setVisble(false)

On click on seeRecent Ajax link I am setting seeRecentWrapper.setVisible(false) and seeAllWrapper.setVisble(true)

If setting parent component visibility does not affect its child visibility So not sure why links doesn't show up. Any idea?

In both links you will need to add both wrappers to the ajax response.  Are you doing this?

--
Jeremy Thomerson
http://www.wickettraining.com

Re: How to make visible all child of WebMarkupContainer

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Jun 1, 2010 at 12:45 PM, <Gu...@wellsfargo.com> wrote:

> Thanks for replying and sorry about typos. Here is the real code
>
> <div wicket:id="seeAllWrapper"><a href="#" wicket:id="seeAll"> <img
> src="images/al_faqarrow1_gen.gif" style="vertical-align:middle"
> border="0"/>See All </a></div>
>    <div wicket:id="seeRecentWrapper"><a href="#" wicket:id="seeRecent"><img
> src="images/al_faqarrow1_gen.gif" style="vertical-align:middle" border="0"/>
> View Most Recent </a></div>
>
> seeAll and seeRecent links visibility is set to default , which I assume is
> true.
>
> Initialy seeRecentWrapper visibility is set to false and seeAllWrapper
> visibility is set to true.
>
> On click on seeAll Ajax link I am setting seeRecentWrapper.setVisible(true)
> and seeAllWrapper.setVisble(false)
>
> On click on seeRecent Ajax link I am setting
> seeRecentWrapper.setVisible(false) and seeAllWrapper.setVisble(true)
>
> If setting parent component visibility does not affect its child visibility
> So not sure why links doesn't show up. Any idea?


In both links you will need to add both wrappers to the ajax response.  Are
you doing this?

-- 
Jeremy Thomerson
http://www.wickettraining.com

RE: How to make visible all child of WebMarkupContainer

Posted by Gu...@wellsfargo.com.
Thanks for replying and sorry about typos. Here is the real code

<div wicket:id="seeAllWrapper"><a href="#" wicket:id="seeAll"> <img src="images/al_faqarrow1_gen.gif" style="vertical-align:middle" border="0"/>See All </a></div>
    <div wicket:id="seeRecentWrapper"><a href="#" wicket:id="seeRecent"><img src="images/al_faqarrow1_gen.gif" style="vertical-align:middle" border="0"/> View Most Recent </a></div>

seeAll and seeRecent links visibility is set to default , which I assume is true.

Initialy seeRecentWrapper visibility is set to false and seeAllWrapper visibility is set to true.

On click on seeAll Ajax link I am setting seeRecentWrapper.setVisible(true) and seeAllWrapper.setVisble(false)

On click on seeRecent Ajax link I am setting seeRecentWrapper.setVisible(false) and seeAllWrapper.setVisble(true)

If setting parent component visibility does not affect its child visibility So not sure why links doesn't show up. Any idea?

-----Original Message-----
From: Jeremy Thomerson [mailto:jeremy@wickettraining.com] 
Sent: Tuesday, June 01, 2010 10:36 AM
To: users@wicket.apache.org
Subject: Re: How to make visible all child of WebMarkupContainer

On Tue, Jun 1, 2010 at 12:25 PM, <Gu...@wellsfargo.com> wrote:

> Hi All,
>
>
> I  am getting strange problem. Setting WebMarkupContainer.setVisible(true)
> is not making all its child visible via Ajax Link.
>
> My Html code looks like this
>
> <div wickit:id="wrapper1"><img><a wicked:id="ajaxlink1">Show All</a></div>
> <div wickit:id="wrapper2"><img><a wicked:id="ajaxlink2">Show
> Recent</a></div>
>
> I need to show one of those links at a time. But somehow setting
> setVisible(true) is not working , but setVisible(false) works
>

Is that really your code?  There are multiple typos that would stop stuff
from working.  Please paste real code.

Anyway, if you have setVisible(false) on any children, then calling
setVisible(true) on the parent will not make the children also visible.
However, if the parent (webmarkupcontainer) were not visible, then obviously
the children would not be visible, even though their individual isVisible()
methods would return true.


-- 
Jeremy Thomerson
http://www.wickettraining.com

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


Re: How to make visible all child of WebMarkupContainer

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Tue, Jun 1, 2010 at 12:25 PM, <Gu...@wellsfargo.com> wrote:

> Hi All,
>
>
> I  am getting strange problem. Setting WebMarkupContainer.setVisible(true)
> is not making all its child visible via Ajax Link.
>
> My Html code looks like this
>
> <div wickit:id="wrapper1"><img><a wicked:id="ajaxlink1">Show All</a></div>
> <div wickit:id="wrapper2"><img><a wicked:id="ajaxlink2">Show
> Recent</a></div>
>
> I need to show one of those links at a time. But somehow setting
> setVisible(true) is not working , but setVisible(false) works
>

Is that really your code?  There are multiple typos that would stop stuff
from working.  Please paste real code.

Anyway, if you have setVisible(false) on any children, then calling
setVisible(true) on the parent will not make the children also visible.
However, if the parent (webmarkupcontainer) were not visible, then obviously
the children would not be visible, even though their individual isVisible()
methods would return true.


-- 
Jeremy Thomerson
http://www.wickettraining.com