cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Gronert" <cocoon....@gmail.com>
Subject double-listbox --> within a repeater
Date Wed, 13 Dec 2006 15:34:49 GMT
Hello folks,

is there anybody who can help ;-)! I'am using cocoon 2.1.10 and i have some
problems with cforms. I build a model like this:

<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
xmlns:i18n="http://apache.org/cocoon/i18n/2.1">

  <fd:widgets>

  <fd:multivaluefield id="test2">
                 <fd:label>TEST-LABEL</fd:label>
                <fd:help>TEST-HELP</fd:help>
                <fd:hint>TEST-HINT</fd:hint>
                  <fd:datatype base="string"/>
                <fd:selection-list>
                      <fd:item value="1"/>
                      <fd:item value="2"/>
                      <fd:item value="3">
                        <fd:label>three</fd:label>
                      </fd:item>
                      <fd:item value="4"/>
                      <fd:item value="5"/>
                  </fd:selection-list>
              </fd:multivaluefield>

      <!-- list of all groups -->
    <fd:class id="grouplist-class">
      <fd:widgets>

        <fd:repeater id="groups">
          <fd:widgets>
            <!-- inline widget definitions from group-class -->
            <fd:new id="group-class"/>
          </fd:widgets>
        </fd:repeater>
        <fd:repeater-action id="addsub" repeater="groups" command="add-row">
          <fd:label>Add group</fd:label>
          <fd:hint>Creates a new Group</fd:hint>
        </fd:repeater-action>
      </fd:widgets>
    </fd:class>

    <!-- a task -->
    <fd:class id="group-class">
      <fd:widgets>
      <!-- FIXME: doesn't work if there's not an enclosing group -->
        <fd:group id="group">
          <fd:widgets>
              <fd:field id="groupName" required="true">
                <fd:label>Name of the group/flag:</fd:label>
                  <fd:hint>This is the name of the group/flag within the
PBD-file.</fd:hint>
                  <fd:datatype base="string"/>
              </fd:field>
              <fd:booleanfield id="active" state="active">
                  <fd:label>Active: </fd:label>
                  <fd:hint>Should this group/flag be avtivated in the
PBD?</fd:hint>
                  <fd:datatype base="string"/>
              </fd:booleanfield>

                <fd:repeater id="singleClasses">
                  <fd:widgets>
                    <fd:new id="singleClass-class"/>
                  </fd:widgets>
              </fd:repeater>
              <fd:repeater-action id="addSingleClasses"
repeater="singleClasses" command="add-row">
                <fd:label>Add new Single Classes</fd:label>
                <fd:hint>Creates a new SingleClasses</fd:hint>
              </fd:repeater-action>

              <!-- these actions will act on the "tasks" repeater in which
this class is inlined -->
              <fd:row-action id="add" command="add-after">
                <fd:label>+</fd:label>
              </fd:row-action>
              <fd:row-action id="up" command="move-up">
                <fd:label>^</fd:label>
              </fd:row-action>
              <fd:row-action id="down" command="move-down">
                <fd:label>v</fd:label>
              </fd:row-action>
              <fd:row-action id="delete" command="delete">
                <fd:label>X</fd:label>
              </fd:row-action>
          </fd:widgets>
        </fd:group>
      </fd:widgets>
    </fd:class>

    <!-- a task -->
    <fd:class id="singleClass-class">
      <fd:widgets>
      <!-- FIXME: doesn't work if there's not an enclosing group -->
        <fd:group id="singleClass">
          <fd:widgets>
              <fd:multivaluefield id="test">
                 <fd:label>TEST-LABEL</fd:label>
                <fd:help>TEST-HELP</fd:help>
                <fd:hint>TEST-HINT</fd:hint>
                  <fd:datatype base="string"/>
                <fd:selection-list>
                      <fd:item value="1"/>
                      <fd:item value="2"/>
                      <fd:item value="3">
                        <fd:label>three</fd:label>
                      </fd:item>
                      <fd:item value="4"/>
                      <fd:item value="5"/>
                  </fd:selection-list>
              </fd:multivaluefield>

              <fd:field id="targetClasses" required="true">
                  <fd:datatype base="string"/>
              </fd:field>
              <fd:field id="sourceClasses" required="true">
                  <fd:datatype base="string"/>
              </fd:field>
              <fd:field id="tracer" required="true">
                  <fd:datatype base="string"/>
              </fd:field>
                            <!-- these actions will act on the "tasks"
repeater in which this class is inlined -->
              <fd:row-action id="add" command="add-after">
                <fd:label>+</fd:label>
              </fd:row-action>
              <fd:row-action id="up" command="move-up">
                <fd:label>^</fd:label>
              </fd:row-action>
              <fd:row-action id="down" command="move-down">
                <fd:label>v</fd:label>
              </fd:row-action>
              <fd:row-action id="delete" command="delete">
                <fd:label>X</fd:label>
              </fd:row-action>
          </fd:widgets>
        </fd:group>
      </fd:widgets>
    </fd:class>


    <!-- the top-level tasks -->
    <fd:new id="grouplist-class"/>

    <fd:submit id="ok">
      <fd:label>OK</fd:label>
    </fd:submit>

  </fd:widgets>
</fd:form>



The first multivaluefield is dispayed ok. But the second within the repeater
does not work. I think the reason is that the js-components will not build
by the js-function.

Is there any solution for this?!

--dirk

Mime
View raw message