You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Daniel Henze <da...@gmx.com> on 2010/10/21 09:40:29 UTC

T5.1 Form with zone throws "Forms require that the request method be POST and that the t:formdata query parameter have values."

  Hi all,

not being able to solve that myself for days now, I hope someone's got 
an idea how to help with a strange behaviour:
I've enabled a form to update a zone, but that resulted in the form to 
stopped working with an error popping up in the Tapestry Console 
(therefore visible for everyone):

   1. (Error) Communication with the server failed: Forms require that
      the request method be POST and that the t:formdata query parameter
      have values.
   2. (Info) Ajax Error : Status 500 für
      /matchpatch/search/quick.quicksearch: Forms require that the
      request method be POST and that the t:formdata query parameter
      have values.

If I select any field (select, checkbox, input) the form is updated and 
a request send to the server. Could someone explain to me, how to stop 
that behaviour and therefore the error? Or aren't those related at all? 
The same works fine with other forms and even without the chenillekit 
mixin (at country) it's the same. Below the full template:

<t:layout title="matchpatch Quick Search"

     xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd"

     xmlns:p="tapestry:parameter">

     <div id="quickSearch">

     <t:zone t:id="display">

         <t:if test="profileView">

             <h2>

                 <t:actionlink t:id="listView" zone="display" class="button">zurück zur Suche</t:actionlink>

             </h2>

             <div class="content">

                 <t:usersearchprofileviewcomponent />

             </div>

             <p:else>

                 <h2>

                     <t:actionlink t:id="profileView" zone="display" class="button">Profile in Detailansicht</t:actionlink>

                 </h2>

                 <div class="content">

                 <div id="quickSearchForm">

                 <t:form t:id="quickSearch" zone="refresh">

                     <table>

                         <tr>

                             <td class="first">Alter</td>

                             <td class="second">

                                 <label class="age" for="ageFrom">von:</label>

                                 <t:select t:id="ageFrom" value="ageFrom"

                                 model="prop:ageList" blankOption="never" />

                             </td>

                                 

                             <td class="third">

                                 <label class="age" for="ageTo">bis:</label>

                                 <t:select t:id="ageTo" value="ageTo"

                                     model="prop:ageList" blankOption="never" />

                             </td>

                             <td class="fourth"></td>

                         </tr>

                         <tr>

                             <td>Größe</td>

                             <td><label class="height" for="heightFrom">von:</label>

                             <t:select t:id="heightFrom" value="heightFrom"

                                 model="prop:heightList" blankOption="never" /></td>

                             <td>

                                 <label class="height" for="heightTo">bis:</label>

                                 <t:select t:id="heightTo" value="heightTo"

                                     model="prop:heightList" blankOption="never" />

                             </td>

                             <td></td>

                         </tr>

                         <tr>

                             <td><label class="picture" for="withPicture">mit Foto:</label></td>

                             <td colspan="3"><t:checkbox t:id="withPicture"></t:checkbox></td>

                         </tr>

                         <tr>

                             <td><label for="country">Land</label></td>

                             <td colspan="3"><t:select t:id="country" value="country"

                                 t:mixins="ck/OnEvent" event="change"

                                 model="literal:ALL=egal, DE=Deutschland, AT=Österreich, CH=Schweiz"  t:blankoption="never"

                                 onCompleteCallback="onSelectCompleteFunction" class="state" /></td>

                         </tr>

                         <tr>

                             <td><label class="state" for="state">Bundesland:</label></td>

                             <td colspan="3"><t:select t:id="state" value="state"

                                 model="prop:stateList" blankOption="always" class="state" /></td>

                         </tr>

                         <tr>

                             <td></td>

                             <td colspan="3"><t:submit

                                 class="searchButton" value="suchen" /></td>

                         </tr>

                     </table>

                 </t:form>

                 </div>

                 <t:zone t:id="refresh">

                     <div class="searchResult"><t:userlistquicksearchcomponent /></div>

                 </t:zone>

                 </div>

             </p:else>

         </t:if>

     </t:zone>

     </div>

     <script type="text/javascript">   

         function onSelectCompleteFunction(response) {

             var json = response.result;

             var array = $A(json)

             var counter = 0;

             document.forms['quickSearch'].state.options.length = 0;

             array.each(function(item){

                 document.forms['quickSearch'].state.options[counter] = new Option(item);

                 counter++;

             })

         }

      </script>

</t:layout>


Best regards
Daniel