You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by amebaliu <am...@yahoo.com> on 2008/05/14 12:50:00 UTC

Question of form zone

Hi, I think I really confused this time. I searched some post about the form
zone and just try to test it. 

My tml code is below:
<t:zone t:id="zoneUpdateArea">
  Content before update
 </t:zone>
    							 
<t:block t:id="dynamicBlock">
     today's task ${task}<br />
</t:block>

<t:form t:id="addTasksForm" t:zone="zoneUpdateArea" >
	    								<div class="enter-todo">Enter a to-do item</div>
	    								<div class="task-textarea enter-todo"><t:textArea
t:value="task"  /></div>
	    								<div class="enter-todo">Who's responsible?</div>
	    								<div class="enter-todo">
	    									<select t:type="select" t:model="users" t:value="user">
	    										<option>User 1</option>
	    										<option>User 2</option>
	    									</select>
	    								</div>
	    								<t:submit />
</t:form>

and in page class

	@Inject
	private Block dynamicBlock;

	Block onSuccessFromAddTasksForm()
    {
        return dynamicBlock;
    } 
	


after i click the submit button, I got the exception:
org.apache.tapestry.runtime.ComponentEventException
A component event handler method returned the value
org.apache.tapestry.internal.structure.BlockImpl@29ed01. Return type
org.apache.tapestry.internal.structure.BlockImpl can not be handled.
Configured return types are java.lang.Class, java.lang.String, java.net.URL,
org.apache.tapestry.Link, org.apache.tapestry.StreamResponse,
org.apache.tapestry.runtime.Component.

I've test the zone with ActionLink, and it's working fine.. anything wrong
for my codes caused the error , or is the form onSuccess Handler can not
return block object??

-- 
View this message in context: http://www.nabble.com/Question-of-form-zone-tp17228290p17228290.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Question of form zone

Posted by amebaliu <am...@yahoo.com>.
Hi, Josh,

Thanks for your help, the browser I am using is ff3. I will try the way you
suggested. thanks a lot.


joshcanfield wrote:
> 
> I would guess that you are not getting the AJAX handler invoked and it's
> rendering the whole page, in which case returning the block would be
> innapprpriate. What browser are you using?
> 
> Try injecting the Request object and testing isXHR().
> 
> Josh
> 
> On Wed, May 14, 2008 at 3:50 AM, amebaliu <am...@yahoo.com> wrote:
> 
>>
>> Hi, I think I really confused this time. I searched some post about the
>> form
>> zone and just try to test it.
>>
>> My tml code is below:
>> <t:zone t:id="zoneUpdateArea">
>>  Content before update
>>  </t:zone>
>>
>> <t:block t:id="dynamicBlock">
>>     today's task ${task}<br />
>> </t:block>
>>
>> <t:form t:id="addTasksForm" t:zone="zoneUpdateArea" >
>>                                                                       
>> <div
>> class="enter-todo">Enter a to-do item</div>
>>                                                                       
>> <div
>> class="task-textarea enter-todo"><t:textArea
>> t:value="task"  /></div>
>>                                                                       
>> <div
>> class="enter-todo">Who's responsible?</div>
>>                                                                       
>> <div
>> class="enter-todo">
>>
>>    <select t:type="select" t:model="users" t:value="user">
>>
>>            <option>User 1</option>
>>
>>            <option>User 2</option>
>>
>>    </select>
>>
>>  </div>
>>
>>  <t:submit />
>> </t:form>
>>
>> and in page class
>>
>>        @Inject
>>        private Block dynamicBlock;
>>
>>        Block onSuccessFromAddTasksForm()
>>    {
>>        return dynamicBlock;
>>    }
>>
>>
>>
>> after i click the submit button, I got the exception:
>> org.apache.tapestry.runtime.ComponentEventException
>> A component event handler method returned the value
>> org.apache.tapestry.internal.structure.BlockImpl@29ed01. Return type
>> org.apache.tapestry.internal.structure.BlockImpl can not be handled.
>> Configured return types are java.lang.Class, java.lang.String,
>> java.net.URL,
>> org.apache.tapestry.Link, org.apache.tapestry.StreamResponse,
>> org.apache.tapestry.runtime.Component.
>>
>> I've test the zone with ActionLink, and it's working fine.. anything
>> wrong
>> for my codes caused the error , or is the form onSuccess Handler can not
>> return block object??
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Question-of-form-zone-tp17228290p17228290.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> -- 
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
> 
> 

-- 
View this message in context: http://www.nabble.com/Question-of-form-zone-tp17228290p17241715.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: Question of form zone

Posted by Josh Canfield <jo...@thedailytube.com>.
I would guess that you are not getting the AJAX handler invoked and it's
rendering the whole page, in which case returning the block would be
innapprpriate. What browser are you using?

Try injecting the Request object and testing isXHR().

Josh

On Wed, May 14, 2008 at 3:50 AM, amebaliu <am...@yahoo.com> wrote:

>
> Hi, I think I really confused this time. I searched some post about the
> form
> zone and just try to test it.
>
> My tml code is below:
> <t:zone t:id="zoneUpdateArea">
>  Content before update
>  </t:zone>
>
> <t:block t:id="dynamicBlock">
>     today's task ${task}<br />
> </t:block>
>
> <t:form t:id="addTasksForm" t:zone="zoneUpdateArea" >
>                                                                        <div
> class="enter-todo">Enter a to-do item</div>
>                                                                        <div
> class="task-textarea enter-todo"><t:textArea
> t:value="task"  /></div>
>                                                                        <div
> class="enter-todo">Who's responsible?</div>
>                                                                        <div
> class="enter-todo">
>
>    <select t:type="select" t:model="users" t:value="user">
>
>            <option>User 1</option>
>
>            <option>User 2</option>
>
>    </select>
>
>  </div>
>
>  <t:submit />
> </t:form>
>
> and in page class
>
>        @Inject
>        private Block dynamicBlock;
>
>        Block onSuccessFromAddTasksForm()
>    {
>        return dynamicBlock;
>    }
>
>
>
> after i click the submit button, I got the exception:
> org.apache.tapestry.runtime.ComponentEventException
> A component event handler method returned the value
> org.apache.tapestry.internal.structure.BlockImpl@29ed01. Return type
> org.apache.tapestry.internal.structure.BlockImpl can not be handled.
> Configured return types are java.lang.Class, java.lang.String,
> java.net.URL,
> org.apache.tapestry.Link, org.apache.tapestry.StreamResponse,
> org.apache.tapestry.runtime.Component.
>
> I've test the zone with ActionLink, and it's working fine.. anything wrong
> for my codes caused the error , or is the form onSuccess Handler can not
> return block object??
>
> --
> View this message in context:
> http://www.nabble.com/Question-of-form-zone-tp17228290p17228290.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.