cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers, AGP" <robby.pelss...@agp.nl>
Subject RE: What is most efficient way to select/deselect all checkboxes of repeater
Date Fri, 08 Sep 2006 13:56:52 GMT
I have a solution that works nicely under firefox, but under
internetexplorer the "select all" functionality only works after i click on
a checkbox in the repeater.  Anybody a clue why this doesn't work in
internetexplorer?

Cheers,
Robby

Current configuration:
----------------------------------------------------------------------------
-----------------------------
<?xml version="1.0" encoding="UTF-8"?>

<fd:form

xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"

>

<fd:widgets>



  <fd:field id="deelproject" required="true">

    <fd:label>DeelProject</fd:label>

    <fd:datatype base="integer"/>

    <fd:on-value-changed>

      <javascript>

        event.source.form.getAttribute("controller").handleDeelProjectValueC
hanged(event);

      </javascript>

    </fd:on-value-changed>

  </fd:field>




  <fd:output id="deelprojectLabel">

    <fd:datatype base="string"/>

  </fd:output>




  <fd:booleanfield id="taak_selectAll">

    <fd:hint>Select all projects</fd:hint>

    <fd:on-value-changed>

      <javascript>

        event.source.form.getAttribute("controller").handleSelectAllProjects
ValueChanged(event);

      </javascript>

    </fd:on-value-changed>

  </fd:booleanfield>




  <fd:field id="afdelingen">

    <fd:datatype base="string"/>

  </fd:field>




  <fd:repeater id="taken">

    <fd:widgets>

      <fd:booleanfield id="taak_select">

        <fd:hint>Select Project</fd:hint>

      </fd:booleanfield>

      <fd:output id="taak_medewerker">

        <fd:datatype base="string"/>

      </fd:output>

      <fd:output id="taak_omschrijving">

        <fd:datatype base="string"/>

      </fd:output>

      <fd:field id="taak_begin" required="true">

        <fd:datatype base="date"/>

      </fd:field>

      <fd:field id="taak_eind" required="true">

        <fd:datatype base="date"/>

      </fd:field>

    </fd:widgets>

  </fd:repeater>

</fd:widgets>

</fd:form>



----------------------------------------------------------------------------
----------------------------------------------------------------------------

<ft:repeater id="taken">

  <jx:choose>

    <jx:when test="${widget.parent.lookupWidget('deelproject').getValue() ==
null }">

      <span>Geen deelproject geselecteerd.</span>

    </jx:when>

  <jx:otherwise>

    <div>

      <t:table>

        <t:caption>Taken</t:caption>

        <t:tr>

          <t:td colspan="5">

            <ft:widget id="../afdelingen"/>

          </t:td>

        </t:tr>

        <t:tr>

          <t:th><ft:widget id="../taak_selectAll"/></t:th>

          <t:th>Mw.</t:th>

          <t:th>Omschrijving</t:th>

          <t:th>Begin</t:th>

          <t:th class="last">Eind</t:th>

        </t:tr>

        <ft:repeater-rows>

          <t:tr>

            <t:td><ft:widget id="taak_select"/></t:td>

            <t:td>

              <ft:widget id="taak_medewerker">

                <fi:styling size="3"/>

              </ft:widget>

            </t:td>

            <t:td><ft:widget id="taak_omschrijving"/></t:td>

            <t:td>

              <ft:widget id="taak_begin">

                <fi:styling size="6" class="image"/>

              </ft:widget>

            </t:td>

            <t:td class="last">

              <ft:widget id="taak_eind">

                <fi:styling size="6" class="image"/>

              </ft:widget>

            </t:td>

          </t:tr>

        </ft:repeater-rows>

      </t:table>

    </div>

  </jx:otherwise>

</jx:choose>

</ft:repeater>

----------------------------------------------------------------------------
--------------------------------------------------------------------

TaakMutatie.prototype.handleSelectAllProjectsValueChanged = function(event)
{

    for (var i = 0; i < event.source.parent.lookupWidget("taken").getSize();
i++) {

        var row = this.takenWidget.getRow(i);

        row.lookupWidget("taak_select").setValue(this.selectAlleTakenWidget.
getValue());

    }

}

----------------------------------------------------------------------------
--------------------------------------------------------------------

  -----Oorspronkelijk bericht-----
  Van: Robby Pelssers, AGP [mailto:robby.pelssers@agp.nl]
  Verzonden: vrijdag 8 september 2006 13:43
  Aan: users@cocoon.apache.org
  Onderwerp: What is most efficient way to select/deselect all checkboxes of
repeater


  Hi guys,

  Anybody who can tell me what is the quickest way to accomplish Gmail
behaviour to select/deselect all checkboxes of a repeater.

  I know I could iterate over all my repeaterrows and set the value of the
booleanfields, but isn't there some way I could use a group to
select/deselect them all?  And how would that be structured in my fd?

  What I want to achieve is something like:
  <table>
    <tr><th><ft:widget id="selectAllProjects"/></th></tr>
    <ft:repeater-rows>
      <tr><td><ft:widget id="selectProject"/></td></tr>
    </ft:repeater-rows>
  </table>



  When the value of the SelectAllProjects-widget changes, all
selectProject-widgets should get a new value.



  Cheers,

  Robby

Mime
View raw message