You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew Madu <an...@gmail.com> on 2006/07/12 17:27:42 UTC

Difference between fi:group and ft:group

Hi,
can someone tell me what the difference is between an fi:group and ft:group?
I ask i relation to:

http://cocoon.apache.org/2.1/userdocs/ajax.html

Quote:
'Container widgets must enclose a container element

The Ajax support of Cocoon Forms works by sending partial page updates to
the browser. This requires the representation of widgets to be contained in
a single element, which becomes the "replacement unit" for that widget.

The styling stylesheets take care of this for terminal widgets such as
fields and actions, but not for container widgets whose layout are
completely defined by the page template. Concretely, this means that
<ft:repeater>, <ft:group> and <ft:union> instructions must contain a single
element such as HTML <div>, <table>, <span>, etc.

<ft:group id="info">
  <div>
    <p><ft:widget id="foo"/></p>
    <p><ft:widget id="bar"/></p>
  </div>
</ft:group> '


In my jx I have the following type of widget definitions:

                        <fi:group>
                            <fi:items>
                              <ft:widget id="credit">
                                <fi:styling class="keyinbox"
submit-on-change="true"/>
                              </ft:widget>
                            </fi:items>
                        </fi:group>

Is it required in this example to wrap the ft:widget section inside <DIV />
tags?

regards

Andrew

Re: Difference between fi:group and ft:group

Posted by Andrew Madu <an...@gmail.com>.
Hi Simone,
once again, you have been a great help. Many thanks for the explanation.

regards

Andrew

On 14/07/06, Simone Gianni <s....@thebug.it> wrote:
>
> Hi Andrew,
> ft:group is a logical grouping, you define an fd:group in the
> definition, then use it in the binding and in the template. It's used to
> make some actions easier. For example, if you want to set the state of
> 10 widgets disables, you just need to set the group disables, the
> widgets contained in it will inherit the state. It's also very useful
> when using form libraries, cause you can define a group in a library and
> then use it in your forms.
>
> The fi:group is only the view part of it. That means that a fi:group has
> no logical function, it's not a widget, is not declared in the
> definition or in the binding, but it's simply a pagination feature in
> the form template. The form template can contain HTML, but that's not
> the suggested way of doing it, instead it would be better to define your
> layout using fi:groups and then customize the CSS (or your XSLT) to
> obtain the desired layout.
>
> In the template, ft:group and fi:group use the same syntax (they both
> result in a fi:group in the form instance), but ft:group needs an id
> since it refers to an fd:group in the definition, while fi:group does
> not need it since it's just a view construct.
>
> Hope this helps,
> Simone
>
> Andrew Madu wrote:
>
> > Hi,
> > can someone tell me what the difference is between an fi:group and
> > ft:group? I ask i relation to:
> >
> > http://cocoon.apache.org/2.1/userdocs/ajax.html
> >
> > Quote:
> >
> >
> >       'Container widgets must enclose a container element
> >
> > The Ajax support of Cocoon Forms works by sending partial page updates
> > to the browser. This requires the representation of widgets to be
> > contained in a single element, which becomes the "replacement unit"
> > for that widget.
> >
> > The styling stylesheets take care of this for terminal widgets such as
> > fields and actions, but not for container widgets whose layout are
> > completely defined by the page template. Concretely, this means that
> > <ft:repeater>, <ft:group> and <ft:union> instructions must contain a
> > single element such as HTML <div>, <table>, <span>, etc.
> >
> >
> ><ft:group id="info">
> >  <div>
> >    <p><ft:widget id="foo"/></p>
> >    <p><ft:widget id="bar"/></p>
> >
> >  </div>
> ></ft:group> '
> >
> >
> >
> >
> > In my jx I have the following type of widget definitions:
> >
> >                         <fi:group>
> >                             <fi:items>
> >                               <ft:widget id="credit">
> >                                 <fi:styling class="keyinbox"
> > submit-on-change="true"/>
> >                               </ft:widget>
> >                             </fi:items>
> >                         </fi:group>
> >
> > Is it required in this example to wrap the ft:widget section inside
> > <DIV /> tags?
> >
> > regards
> >
> > Andrew
>
> --
> Simone Gianni
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Difference between fi:group and ft:group

Posted by Simone Gianni <s....@thebug.it>.
Hi Andrew,
ft:group is a logical grouping, you define an fd:group in the
definition, then use it in the binding and in the template. It's used to
make some actions easier. For example, if you want to set the state of
10 widgets disables, you just need to set the group disables, the
widgets contained in it will inherit the state. It's also very useful
when using form libraries, cause you can define a group in a library and
then use it in your forms.

The fi:group is only the view part of it. That means that a fi:group has
no logical function, it's not a widget, is not declared in the
definition or in the binding, but it's simply a pagination feature in
the form template. The form template can contain HTML, but that's not
the suggested way of doing it, instead it would be better to define your
layout using fi:groups and then customize the CSS (or your XSLT) to
obtain the desired layout.

In the template, ft:group and fi:group use the same syntax (they both
result in a fi:group in the form instance), but ft:group needs an id
since it refers to an fd:group in the definition, while fi:group does
not need it since it's just a view construct.

Hope this helps,
Simone

Andrew Madu wrote:

> Hi,
> can someone tell me what the difference is between an fi:group and
> ft:group? I ask i relation to:
>
> http://cocoon.apache.org/2.1/userdocs/ajax.html
>
> Quote:
>
>
>       'Container widgets must enclose a container element
>
> The Ajax support of Cocoon Forms works by sending partial page updates
> to the browser. This requires the representation of widgets to be
> contained in a single element, which becomes the "replacement unit"
> for that widget.
>
> The styling stylesheets take care of this for terminal widgets such as
> fields and actions, but not for container widgets whose layout are
> completely defined by the page template. Concretely, this means that
> <ft:repeater>, <ft:group> and <ft:union> instructions must contain a
> single element such as HTML <div>, <table>, <span>, etc.
>
>
><ft:group id="info">
>  <div>
>    <p><ft:widget id="foo"/></p>
>    <p><ft:widget id="bar"/></p>
>
>  </div>
></ft:group> '
>
>
>  
>
> In my jx I have the following type of widget definitions:
>
>                         <fi:group>
>                             <fi:items>
>                               <ft:widget id="credit">
>                                 <fi:styling class="keyinbox"
> submit-on-change="true"/>
>                               </ft:widget>
>                             </fi:items>
>                         </fi:group>
>
> Is it required in this example to wrap the ft:widget section inside
> <DIV /> tags?
>
> regards
>
> Andrew

-- 
Simone Gianni

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