Greetings.

I am trying to update a ListView dynamically with AJAX.  I have a
WebMarkupContainer that holds the ListView.  I have another
WebMarkupContainer that holds an AjaxFallbackLink (add button) and a
WebMarkupContainer (list item form) that holds the fields for a list
item and a AjaxFallBackLink (submit button).  I have been looking at the
ToDo List example in the Wicket-Library and have roughly followed what's
going on there.  The add button toggles on the list item form and hides
itself.  Then, the submit button adds the list item to the list that is
displayed in the ListView and hides the form and redisplays the add
button.

The problem I am having is that the first item that is added works fine,
and the item is added to the list.  However, any subsequent adds fail
with the following AJAX debug information:

INFO: Initiating Ajax GET request
on 
/SIMIS/app?wicket:interface=:3:editReportForm:addParameterContainer:addParameterForm:saveParameter::IBehaviorListener&wicket:behaviorId=0&random=0.35076995256166854
 
INFO: Invoking pre-call handler(s)... 
INFO: Received ajax response (53 characters)
INFO: <?xml version="1.0" encoding="UTF-8"?><ajax-response>  
ERROR: Error while parsing response: Could not find root <ajax-response>
element  
INFO: Invoking post-call handler(s)...  
INFO: Invoking failure handler(s)...

If it didn't work at all it would make more sense, but that it works to
add the first item and not subsequent items is strange.  If I comment
out the line of code in the onClick method of the "saveParameter"
AjaxFallbackLink where I call target.addComponent(parameterList) which
should update the ListView, the addParameterContainer behaves correctly.

Here is the associated markup:

<table wicket:id="parameterList">
  <tr>
    <!-- column headers -->
  </tr>
  <tr wicket:id="parameter">
    <td></td>
    <td wicket:id="name">param name</td>
    <td wicket:id="description">description</td>
    <td wicket:id="parameterType">type</td>
    <td wicket:id="dataType">data type</td>
  </tr>
</table>
<div wicket:id="addParameterContainer">
  <input type="button" wicket:id="addParameter" value="Add New
Parameter"/>
  <div wicket:id="addParameterForm">
    <input type="button" wicket:id="saveParameter" value="Save
Parameter"/>
    <table>
      <tr>
        <!-- column headers -->
      </tr>
      <tr>
        <td><input type="text" wicket:id="name"/></td>
        <td><input type="text" wicket:id="description"/></td>
        <td><select wicket:id="parameterType"></select></td>
        <td><input type="text" wicket:id="dataType"/></td>
      </tr>
    </table>
  </div>
</div>

Thanks ahead of time for any help.
   
-- 
Matthew R Hanlon <[EMAIL PROTECTED]>
Alliance Communications Management


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to