Yes returning void is a typo. 
What I am trying to achieve is the following: 
I have two versions of a searchCriteriaForm. 
I have a second form (configureSearchCriteriaForm) that contains two radio
buttons. Depending on which radio button is selected an "onclick" event
submits this form to decide which searchCriteriaForm will be used. The
searchCriteriaForm is contained in a zone. Now, when the searchCriteriaForm
is submitted another zone is updated (searchResultsZone) that contains a
Grid component. The code below should make everything clearer. 

Configure search criteria
<t:form t:id="configureSearchCriteriaForm" zone="searchCriteriaZone">
       <t:radio t:id="searchCriteria1" onclick="this.form.submit()"/>
       <t:radio t:id="searchCriteria1" onclick="this.form.submit()"/>
       <!-- onSuccess of this form the block searchCriteriaBlock is
returned-->
</t:form>

Specify search criteria
<t:zone t:id="searchCriteriaZone">
   <t:block t:id="searchCriteriaBlock">
      <t:form t:id="searchCriteriaForm" zone="searchResultsZone">       
             <!-- onSuccess of this form the block searchResultsBlock is
returned and this works fine if the searchCriteriaZone and
searchCriteriaForm are returned
      </t:form>
   </t:block>
<t:zone>

Display search results
<t:zone t:id="searchResultsZone">
   <t:block t:id="searchResultsBlock">
      <t:grid source="foundEntitiesList"/>
   </t:block>
</t:zone>

Petros


Dmitry Shyshkin wrote:
> 
> What do you want to achieve by returning Block from onSucess event?
> As you can read from 
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html 
> Block is not a valid return value for listener method.
> 
> P.S.
> I think it is a typo, but you return myBlock from method as declared as 
> _void_.
> 
> Petros Petrou пишет:
>> The form below works fine when the Submit button is pressed but the
>> exception
>> below is thrown when the myRadioButton is selected. It looks like the
>> onclick="this.form.submit()" is making it fail. Any ideas how I can solve
>> this ?
>>
>>
>> org.apache.tapestry.runtime.ComponentEventException
>> Return type org.apache.tapestry.internal.structure.BlockImpl can not be
>> handled. 
>>
>> MyPage.tml
>> <form t:id="myForm" zone="myZone">
>>    ... 
>>    <t:radio t:id="myRadioButton" onclick="this.form.submit()"/>
>>    ...
>>     <input t:type="submit"/>
>> </form>
>> <t:zone t:id="myZone">
>>    <t:block t:id="myBlock">
>>         ..... some text ...
>>    </t:block>
>> </t:zone>
>> MyPage.java
>> public class MyPage
>> {
>>
>>     @Inject
>>     private Block myBlock;
>> ...
>>    public void onSuccessFromMyForm()
>>    {
>>       return myBlock;
>>     
>>    }
>> }
>>   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ComponentEventException-on-Form-Submit-with-Ajax-tp16467413p16476107.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to