You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Florian Leinberger <le...@seitenbau.com> on 2005/09/13 09:46:41 UTC

[Cforms] Activating/Hiding whole repeaters?

Hi,

I would like to display/hide a whole repeater (containing several widgets) in a
cocoon form depending on which value is selected in a select-field above this
repeater.

I know how this can be done with single widgets using javascript in the form
definition, like 
setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE);  

I would appreciate any hints if this can be done in a similiar way to show/hide
not only a single widget but a whole repeater containing several widgets (with
all its repetitions). I tried "RepeaterState" which didn't work though :-(

Thanks, Florian


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


Re: [Cforms] Activating/Hiding whole repeaters?

Posted by Dan Ochs <da...@gmail.com>.
I just came across a similar situation; I display the repeater if it
has any values. Since I was already using jx I did the following and
it works great.
<jx:if test="widget.getChild('repeaterWidgetID').getSize() &gt; 0">

dan

On 9/13/05, Florian Leinberger <le...@seitenbau.com> wrote:
> Hi,
> 
> I would like to display/hide a whole repeater (containing several widgets) in a
> cocoon form depending on which value is selected in a select-field above this
> repeater.
> 
> I know how this can be done with single widgets using javascript in the form
> definition, like
> setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
> setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE);
> 
> I would appreciate any hints if this can be done in a similiar way to show/hide
> not only a single widget but a whole repeater containing several widgets (with
> all its repetitions). I tried "RepeaterState" which didn't work though :-(
> 
> Thanks, Florian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

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


Re: [Cforms] Activating/Hiding whole repeaters?

Posted by Jason Johnston <co...@lojjic.net>.
Florian Leinberger wrote:
> Hi,
> 
> I would like to display/hide a whole repeater (containing several widgets) in a
> cocoon form depending on which value is selected in a select-field above this
> repeater.
> 
> I know how this can be done with single widgets using javascript in the form
> definition, like 
> setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
> setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE);  
> 
> I would appreciate any hints if this can be done in a similiar way to show/hide
> not only a single widget but a whole repeater containing several widgets (with
> all its repetitions). I tried "RepeaterState" which didn't work though :-(

The widget states feature is (intended to be) globally available for all 
widgets, so the exact same syntax as your two lines above should work 
for repeater widgets.  If not then it's a bug and should be reported in 
Bugzilla.

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


Re: [Cforms] Activating/Hiding whole repeaters?

Posted by Christoph Hermann <ch...@guschtel.de>.
Florian Leinberger schrieb:

Hello,

> I would like to display/hide a whole repeater (containing several widgets) in a
> cocoon form depending on which value is selected in a select-field above this
> repeater.
> 
> I know how this can be done with single widgets using javascript in the form
> definition, like 
> setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
> setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE);  
> 
> I would appreciate any hints if this can be done in a similiar way to show/hide
> not only a single widget but a whole repeater containing several widgets (with
> all its repetitions). I tried "RepeaterState" which didn't work though :-(

If you don't get this working, you could activate JX in your form
template and display the repeater according to your select field with
the jx macros.

See the dreamteam example.

HTH
Christoph

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


Re: [Cforms] Activating/Hiding whole repeaters?

Posted by Marc Salvetti <ma...@notremanou.net>.
What about puting your repeater and whatever you'd like in a fd:group 
and then hiding the group ?

Marc

Florian Leinberger a écrit :

>Hi,
>
>I would like to display/hide a whole repeater (containing several widgets) in a
>cocoon form depending on which value is selected in a select-field above this
>repeater.
>
>I know how this can be done with single widgets using javascript in the form
>definition, like 
>setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.ACTIVE);
>setState(Packages.org.apache.cocoon.forms.formmodel.WidgetState.INVISIBLE);  
>
>I would appreciate any hints if this can be done in a similiar way to show/hide
>not only a single widget but a whole repeater containing several widgets (with
>all its repetitions). I tried "RepeaterState" which didn't work though :-(
>
>Thanks, Florian
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
>  
>

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