You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Antonio Gallardo <ag...@agsoftware.dnsalias.com> on 2003/10/23 07:57:03 UTC

Woody as the only widget inside a

Hi:

Can be <wd:repeater> the only widget inside a <wd:form>?

I tought it can be used as a "grid" table. Example:

Suppuse you have a simple table with 2 fields: are_id and are_name:

Here is the woody definition file:

<wd:form xmlns:wd="http://apache.org/cocoon/woody/definition/1.0">

<wd:repeater id="transaction">
  <wd:field id="area_id" required="true">
    <wd:label>Id: </wd:label>
    <wd:datatype base="integer"/>
  </wd:field>

  <wd:field id="area_name" required="true">
    <wd:label>Name</wd:label>
    <wd:datatype base="string">
      <wd:validation>
        <wd:length min="5" max="50"/>
      </wd:validation>
    </wd:datatype>
  </wd:field>

  <wd:booleanfield id="select">
    <wd:label>Select</wd:label>
  </wd:booleanfield>
</wd:repeater>

But however I try it never return to the flow and just send forever
continuations if I clic on the "submit" buton.

Please help.

Best Regards,

Antonio Gallardo



Re: Woody as the only widget inside a

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Hi:

I forgot the binding file. Here is the binding definition file:

<wb:context
  xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
  path="/areasList">
    <wb:repeater id="transaction" parent-path="."
      row-path="." unique-row-id="are_id" unique-path="@are_id">

        <wb:on-bind>
            <wb:value id="are_id" path="are_id"/>
            <wb:value id="are_nombre" path="are_nombre"/>
        </wb:on-bind>

        <!-- executed when a repeater row has been deleted -->
        <wb:on-delete-row>
            <wb:delete-node/>
        </wb:on-delete-row>

        <wb:on-insert-row>
            <wb:insert-node/>
         <wb:insert-bean classname="test.Areas" addmethod="addAreas"/>
        </wb:on-insert-row>
    </wb:repeater>
</wb:context>

if we set <wb:context path"/"> and <wb:repeater row-path="areasList"> the
result is the same:

The flow does not continue and I don't see any error message in flow.log
or woody.log. It just send again a continuation.

The "areasList" is a Bean that just contain a "java.util.Vector". Here is
the definition:

public class AreasList
{
    private Vector vAreas;

    public AreasList(){
        vAreas = new Vector();
    }
    /* Methods */
    public boolean addAreas(Areas a) { return vAreas.add(a); }

	public Vector getAreasList() { return vAreas; }
}

I think it shoud work. But it looks like woody does not want to return and
the continuations always continue.

Please help.

Best Regards,

Antonio Gallardo



[SOLUTION] - Re: Woody as the only widget inside a

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Antonio Gallardo dijo:
> Hi:
>
> Can be <wd:repeater> the only widget inside a <wd:form>?
>
> I tought it can be used as a "grid" table. Example:
>
> Suppuse you have a simple table with 2 fields: are_id and are_name:
>
> Here is the woody definition file:
>
> <wd:form xmlns:wd="http://apache.org/cocoon/woody/definition/1.0">
>
> <wd:repeater id="transaction">
>   <wd:field id="area_id" required="true">

Thanks for the help. Just for the record:

Cause: If a field was not included in the form, then there is no way to
see the errors of woody for this field.

Solution:
Remove @required="true" from <wd:field id="area_id">

BTW, the "Cause" is a bug or a feature? :-D Please comments.

Best Regards,

Antonio Gallardo.




Best Regards,

Antonio Gallardo