Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 50796 invoked from network); 27 Mar 2007 13:12:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Mar 2007 13:12:47 -0000 Received: (qmail 849 invoked by uid 500); 27 Mar 2007 13:12:48 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 838 invoked by uid 500); 27 Mar 2007 13:12:48 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 827 invoked by uid 99); 27 Mar 2007 13:12:48 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 06:12:48 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [217.116.183.178] (HELO asterix.workflow.at) (217.116.183.178) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2007 06:12:39 -0700 In-Reply-To: <008801c77068$9b655e90$4501a8c0@MIDDLEEARTH.IQUO.COM> To: users@cocoon.apache.org Subject: Problem with Binding of fd:multivaluefield MIME-Version: 1.0 X-Mailer: Lotus Notes Release 7.0.1 January 17, 2006 Message-ID: From: Alexander Malic Date: Tue, 27 Mar 2007 15:12:11 +0200 X-MIMETrack: Serialize by Router on asterix/Workflow(Release 7.0.2|September 26, 2006) at 27.03.2007 15:12:38, Serialize complete at 27.03.2007 15:12:38 Content-Type: multipart/alternative; boundary="=_alternative 004886C1C12572AB_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 004886C1C12572AB_= Content-Type: text/plain; charset="US-ASCII" hi there, i have a form with a repeater containing a multivaluefield. i noticed following issues: - when i submit the form, the selected items (the ones in the right select-multiple-box) are not selected - when i select them manually before submitting only the last value is saved below is my sample regards, alex btw: i'm using cocoon 2.1.10 here's the snipped of the repeater in the definition ta_createRebookings.job_selectedClient var widget=event.source; var gWidget=widget.lookupWidget('../selectedGroups'); if(widget.getValue()!=null){ gWidget.setState(ACTIVE); var client=PoOrganisationService.getClient(widget.getValue()); var orgHierarchy=PoOrganisationService.getOrgHierarchy(client); var topLevelGroup=orgHierarchy.getTopLevelGroup(); var clientsGroups=PoOrganisationService.findAllChildGroupsFlat(orgHierarchy.getTopLevelGroup()); gWidget.setSelectionList(clientsGroups,"UID","shortName"); } else { gWidget.setState(INVISIBLE); } ta_createRebookings.job_selectedGroups po_delete po_add var widget=event.source; var repeater=widget.lookupWidget('../selection'); if(repeater.getSize()>0){ var lastRow=repeater.getRow(repeater.getSize()-1); var cWidget=lastRow.lookupWidget('selectedClient'); var allClients=PoOrganisationService.loadAllClients(); allClients.add(0,null); cWidget.setSelectionList(allClients,'UID','name'); } here's the template-snippet:
ta_createRebookings.job_selectedGroups_Available ta_createRebookings.job_selectedGroups_Selected
and here's the binding-snippet: var allClients=PoOrganisationService.loadAllClients(); allClients.add(0,null); java.lang.System.out.println("allClients: " + allClients); widget.setSelectionList(allClients,"UID","name"); widget.setValue(jxpathPointer.getValue()); jxpathPointer.setValue(widget.getValue()); --=_alternative 004886C1C12572AB_= Content-Type: text/html; charset="US-ASCII"
hi there,

i have a form with a repeater containing a multivaluefield.

i noticed following issues:
        - when i submit the form, the selected items (the ones in the right select-multiple-box) are not selected
        - when i select them manually before submitting only the last value is saved

below is my sample

regards, alex

btw: i'm using cocoon 2.1.10

here's the snipped of the repeater in the definition
            <fd:repeater id="selection">
                    <fd:widgets>
                            <fd:field id="selectedClient">
                                    <fd:datatype base="string"/>
                                    <fd:label><i18n:text>ta_createRebookings.job_selectedClient</i18n:text></fd:label>
                                    <fd:selection-list/>
                                    <fd:on-value-changed>
                                            <javascript>
                                                    var widget=event.source;
                                                    var gWidget=widget.lookupWidget('../selectedGroups');
                                                   
                                                    if(widget.getValue()!=null){
                                                            gWidget.setState(ACTIVE);
                                                            var client=PoOrganisationService.getClient(widget.getValue());
                                                            var orgHierarchy=PoOrganisationService.getOrgHierarchy(client);
                                                            var topLevelGroup=orgHierarchy.getTopLevelGroup();
                                                            var clientsGroups=PoOrganisationService.findAllChildGroupsFlat(orgHierarchy.getTopLevelGroup());
                                                            gWidget.setSelectionList(clientsGroups,"UID","shortName");
                                                    } else {
                                                            gWidget.setState(INVISIBLE);
                                                    }
                                            </javascript>
                                    </fd:on-value-changed>
                            </fd:field>
                            <fd:multivaluefield id="selectedGroups" state="invisible">
                                    <fd:datatype base="string"/>
                                    <fd:label><i18n:text>ta_createRebookings.job_selectedGroups</i18n:text></fd:label>
                                    <fd:selection-list/>
                            </fd:multivaluefield>
                            <fd:row-action id="deleteSelection" command="delete">
                                    <fd:label><i18n:text>po_delete</i18n:text></fd:label>
                            </fd:row-action>
                    </fd:widgets>
            </fd:repeater>
            <fd:repeater-action id="addSelection" command="add-row" repeater="selection">
                    <fd:label><i18n:text>po_add</i18n:text></fd:label>
                    <fd:on-action>
                            <javascript>
                                    var widget=event.source;
                                    var repeater=widget.lookupWidget('../selection');
                                    if(repeater.getSize()>0){
                                            var lastRow=repeater.getRow(repeater.getSize()-1);
                                            var cWidget=lastRow.lookupWidget('selectedClient');
                                            var allClients=PoOrganisationService.loadAllClients();
                                            allClients.add(0,null);
                                            cWidget.setSelectionList(allClients,'UID','name');
                                    }
                            </javascript>
                    </fd:on-action>
            </fd:repeater-action>


here's the template-snippet:
            <table>
                    <tr>
                            <th><ft:repeater-widget-label id="selection" widget-id="selectedClient"/></th>
                            <th><ft:repeater-widget-label id="selection" widget-id="selectedGroups"/></th>
                            <th/>
                    </tr>
                    <ft:repeater-widget id="selection">
                            <tr>
                                    <td>
                                            <ft:widget id="selectedClient">
                                                    <fi:styling submit-on-change="true"/>
                                            </ft:widget>
                                    </td>
                                    <td>
                                            <ft:widget id="selectedGroups">
                                                    <fi:styling list-type="double-listbox">
                                                            <fi:available-label><i18n:text>ta_createRebookings.job_selectedGroups_Available</i18n:text></fi:available-label>
                                                            <fi:selected-label><i18n:text>ta_createRebookings.job_selectedGroups_Selected</i18n:text></fi:selected-label>
                                                    </fi:styling>
                                            </ft:widget>
                                    </td>
                                    <td><ft:widget id="deleteSelection"/></td>
                            </tr>
                    </ft:repeater-widget>
            </table>
            <ft:widget id="addSelection"/>


and here's the binding-snippet:
        <fb:repeater id="selection" parent-path="selections" row-path="selection">
                <fb:javascript id="selectedClient" path="client/@uid">
                        <fb:load-form>
                                var allClients=PoOrganisationService.loadAllClients();
                                allClients.add(0,null);
                                java.lang.System.out.println("allClients: " + allClients);
                                widget.setSelectionList(allClients,"UID","name");
                                widget.setValue(jxpathPointer.getValue());
                        </fb:load-form>
                        <fb:save-form>
                                jxpathPointer.setValue(widget.getValue());
                        </fb:save-form>
                </fb:javascript>
                <fb:multi-value id="selectedGroups" parent-path="selectedGroups" row-path="group/@uid"/>
        </fb:repeater>

--=_alternative 004886C1C12572AB_=--