[T5] StreamResponse causes java.lang.IllegalStateException

2008-05-29 Thread Donyee
when i click to submit the form, i got java.lang.IllegalStateException.
I search the web and found that wes because the wrong use of
response.getOutputStream(); and response.getWriter();
Is this a bug?
how to fix this?

In my java code:
StreamResponse onSuccess() {

return new TextStreamResponse(text/json, {key:'+test+'});
}
In my page .tml:
 t:form t:id=testForm
table
tr
td
test
/td
td
t:textField t:id=test value=test
/t:textField
/td
td
a href=# onclick=processForm();submit/a
/td
/tr
/table
/t:form
script
var processForm = function(){
alert('click');
ele = jQuery('#testForm');
var options = {
dataType: 'json',
success: function(data){
alert(data.key);
}
};
ele.ajaxSubmit(options);

};
/script


-- 
Yet Another Java EE Developer!


Re: [T5] StreamResponse causes java.lang.IllegalStateException

2008-05-29 Thread Peter Stavrinides
Not enough info here to be precise about this one, but an 'illegal state' is 
mostly caused by trying to modify a response that is already closed, or 
alternatively trying to start a new response before the old one is closed this 
can often be fixed by ensuring you use a return statement in the correct place.

cheers
Peter

- Original Message -
From: Donyee [EMAIL PROTECTED]
To: Tapestry users users@tapestry.apache.org
Sent: Thursday, 29 May, 2008 2:26:07 PM GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: [T5] StreamResponse causes java.lang.IllegalStateException

when i click to submit the form, i got java.lang.IllegalStateException.
I search the web and found that wes because the wrong use of
response.getOutputStream(); and response.getWriter();
Is this a bug?
how to fix this?

In my java code:
StreamResponse onSuccess() {

return new TextStreamResponse(text/json, {key:'+test+'});
}
In my page .tml:
 t:form t:id=testForm
table
tr
td
test
/td
td
t:textField t:id=test value=test
/t:textField
/td
td
a href=# onclick=processForm();submit/a
/td
/tr
/table
/t:form
script
var processForm = function(){
alert('click');
ele = jQuery('#testForm');
var options = {
dataType: 'json',
success: function(data){
alert(data.key);
}
};
ele.ajaxSubmit(options);

};
/script


-- 
Yet Another Java EE Developer!

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