You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Karen Torres <kt...@agssa.net> on 2007/06/18 18:21:26 UTC

Error in suggestion-list into a repeater

Hello,
I'm trying to implement a suggestion list into a repeater, but I've a 
problem when a second row is added in the repeater,
because the value of the "filter" parameter is the value of the 
identifier in the first row and the value of "phase" parameter is "init". 
The hassle is that the "phase" parameter wouldn't should be there.

I'm getting an error from the Firebug tool from Mozilla browser:
node has no 
properties                                                                      
dojo.js (line 5528)
getOpacity(undefined)dojo.js (line 5528)
start()dojo.js (line 6079)
(no name)(Object property=opacity end=0, 0)dojo.js (line 6001)
forEach([Object property=opacity end=0], function(), Object 
_properties=[1] diffs=[1])dojo.js (line 1610)
_559([Object property=opacity end=0])dojo.js (line 6016)
beforeBegin()dojo.js (line 6040)
(no name)()dojo.js (line 1695)
(no name)()dojo.js (line 4343)
(no name)()dojo.js (line 4342)
fire("beforeBegin", undefined)dojo.js (line 4349)
play(undefined, undefined)dojo.js (line 4413)
(no name)(null, 150, null, function())dojo.js (line 139)
loadUriAndCheck()dojo.js (line 226)
(no name)(undefined)dojo.js (line 315)
(no name)()dojo.js (line 983)
(no name)()dojo.js (line 917)
(no name)()dojo.js (line 1254)
[Break on this error] var 
opac=node.style.opacity||node.style.MozOpacity||node.style.KhtmlOpacity||1;

I have in the definition form:
<fd:repeater id="nationalities">
            <fd:widgets>
                   <fd:field id="nationalityId">
                    <fd:label>Nationality</fd:label>
                    <fd:datatype base="integer"/>
                    <fd:suggestion-list type="javascript">
                      var handler = new 
Packages.net.handler.forms.nationality.NationalitiesHandler();
                      var suggestions = [];
                      if (filter) {
                        var phase = cocoon.request.getParameter("phase");
                        if (phase &amp;&amp; phase.equals("init")) {
                          if (!isNaN(parseInt(filter))) {
                            var bean = handler.retrieve(parseInt(filter));
                            suggestions.push({
                              value: bean.getNationalityId().intValue(),
                              label: new String(bean.getNationalityName())
                              });
                          } else {
                            cocoon.log.error("The filter: '" + filter + 
"' must be a number.");
                          }
                        } else {
                          var list = handler.getList(filter);
                          for (var i = 0; i &lt; list.size(); i++) {
                            var item = list.get(i);
                            suggestions.push({
                              value: item[0].intValue(),
                              label: new String(item[1])
                              });
                          }
                        }
                      } else {
                        var list = handler.getList();
                        for (var i = 0; i &lt; list.size(); i++) {
                          var item = list.get(i);
                          suggestions.push({
                              value: item[0].intValue(),
                              label: new String(item[1])
                              });
                        }
                      }
                      return suggestions;
                    </fd:suggestion-list>
                </fd:field>
       </fd:widgets>
 </fd:repeater>
      
 <fd:repeater-action id="add" command="add-row" repeater="nationalities">
            <fd:label>Add</fd:label>
            <fd:hint>
                Add a row.
            </fd:hint>
 </fd:repeater-action>

At template form:

<ft:repeater id="nationalities">
    <div>
        <table>
            <tbody>
                <ft:repeater-rows>
                    <tr>
                        <td><ft:widget id="nationalityId" 
type="suggest"/></td>
                    </tr>
                </ft:repeater-rows>
                <tr><td><ft:widget id="../add"/></td></tr>
            </tbody>
        </table>
   </div>
</ft:repeater>

-- 
Regards,

Karen Torres N. 


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