You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Leon Derks <le...@cumquat.nl> on 2008/04/24 14:45:53 UTC

T5: Select component + onchange()

Hello

Is it possible to catch the onChange event from a select component in 
the java  page?

I would expect something like: onChangeFromSelect(long id) {....}

Because I want to update information on my page, based on the value that 
is selected.

How can I do that?

Leon


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


Re: T5: Select component + onchange()

Posted by Chris Lewis <ch...@bellsouth.net>.
Unless https://issues.apache.org/jira/browse/TAPESTRY-2286 has been
addressed, you cannot respond with JSONArray, but you can with JSONObject.

Sven Homburg wrote:
> the JSONObject/JSONArray response too
>
> 2008/4/24, Sven Homburg <ho...@googlemail.com>:
>   
>> the return type is not limited to StreamResponse.
>> all you can respond all that tapestry allowes here
>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
>> its up to you
>>
>> 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
>>     
>>> I had the same issue as Leon some days ago (and this seems to be a very
>>> common issue), and i tried your component. It's very good, with some ajax,
>>> but the return type is a little bit limited for what i was trying to
>>> achieve(update a combo with information from another combo, which has your
>>> mixin). The only way to do it was hardcoding the select in my java(or
>>> javascript, whatever), that was too creepy for me.
>>>
>>> My questions:
>>> 1 - Is there any way of change my page data with something more elaborate
>>> than TextStreamResponse?
>>> 1 - Is there any efforts on adding some similar behavior to future
>>> releases?
>>>
>>> Thank you!
>>>
>>> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>>>
>>>
>>>       
>>>> try this
>>>>
>>>>
>>>>         
>>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
>>>       
>>>> 2008/4/24, Leon Derks <le...@cumquat.nl>:
>>>>         
>>>>> Hello
>>>>>
>>>>> Is it possible to catch the onChange event from a select component in
>>>>>           
>>> the
>>>       
>>>>> java  page?
>>>>>
>>>>> I would expect something like: onChangeFromSelect(long id) {....}
>>>>>
>>>>> Because I want to update information on my page, based on the value
>>>>>           
>>> that
>>>       
>>>> is
>>>>         
>>>>> selected.
>>>>>
>>>>> How can I do that?
>>>>>
>>>>> Leon
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>           
>>>> --
>>>> with regards
>>>> Sven Homburg
>>>> http://tapestry5-components.googlecode.com
>>>>
>>>>         
>>>
>>>
>>> --
>>> Atenciosamente,
>>>
>>> Marcelo Lotif
>>>
>>>       
>>
>> --
>> with regards
>> Sven Homburg
>> http://tapestry5-components.googlecode.com
>>
>>     
>
>
>
>   

-- 
http://thegodcode.net


Re: 答复: T5: Select component + onchange()

Posted by Lance Java <la...@googlemail.com>.
getBytes() will use the default encoding
[System.getProperty("file.encoding");]
if the default encoding is not UTF-8 in your example, you are trying to
construct a utf-8 string from a non utf-8 byte array.

Try this:
utfStr=new String("滕训华".getBytes("UTF-8"),"UTF-8");

Using chinese characters directly in you java code may be seen as bad
practice. You could instead store them in a property file or similar.
Alternatively you could use the unicode representation in your java code
"\u..."

Cheers,
Lance.

2008/8/14 滕训华 <te...@magic-sw.com.cn>

>
> Hi,Sven:
>        I use your example code in my project,but when I return Chinese to
> javascript function and use alert to display it.it can not display
> normally,
> how can I slove this problem,thanks.
>
> My code:
>
>        TextStreamResponse onChange(TblCustomerInfo changedCustomer){
>        String utfStr="";
>        try{
>                utfStr=new String("滕训华".getBytes(),"UTF-8");
>        }
>        catch(UnsupportedEncodingException e){
>
>        }
>        return new  TextStreamResponse("text/html",utfStr);
>
>    }
>
> My javascript code:
>
>                function customerChangeEvent(response){
>
>                        alert(response);
>
>                }
> -----邮件原件-----
> 发件人: Sven Homburg [mailto:homburgs@googlemail.com]
> 发送时间: 2008年4月25日 2:54
> 收件人: Tapestry users
> 主题: Re: T5: Select component + onchange()
>
> here some sample code sequences
>
> your page class (simplified):
>
> @Component(parameters={"event=change"
> "onCompleteCallback=onSelect1Changed"})
> @Mixins("t5components/OnEvent")
> private Select _select1
>
> @Component
> private Select _select2
>
> @OnEvent(component = "select1", value = "change")
> JSONObject select1ElementChanged(String value)
> {
> JSONObject json = new JSONObject();
> json.put("result", new JSONArray("[['a', 'value a'], ['b', 'value b'],
> ['c',
> 'value c'], ['d', 'value d']]"));
> return json;
> }
>
>
> your page tml (simplified):
>
> <select t:id="select1">
> <option value="1">first value</option>
> </select>
>
> <select t:id="select2">
> </select>
>
> <script type="text/javascript">
> function onSelect1Changed(response)
> {
> var json = response.evalJSON();
> var array = $A(json.result)
>
> array.each(function(item){
>
> // create new option for select tag "select2" and fill value attribute with
> "item[0]"
> // and fill option.innerText with "item[1]"
>
> })
> }
> </script>
>
>
>
> 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
> >
> > Yeah, i know this, but none of these responses suit to my needs (maybe a
> > Page response, but this will force a reload)... i tried to return a block
> > with the part of the code that i was trying to change, but i had no
> success
> >
> > And i don't have the enough knowledge of the JSON api and javascript...
> >
> > So i'm using the onchange='this.form.submit()'...
> >
> > =)
> >
> >
> > 2008/4/24 Sven Homburg <ho...@googlemail.com>:
> >
> > > the JSONObject/JSONArray response too
> > >
> > > 2008/4/24, Sven Homburg <ho...@googlemail.com>:
> > > >
> > > > the return type is not limited to StreamResponse.
> > > > all you can respond all that tapestry allowes here
> > > >
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
> > > > its up to you
> > > >
> > > > 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
> > > >>
> > > >> I had the same issue as Leon some days ago (and this seems to be a
> > very
> > > >> common issue), and i tried your component. It's very good, with some
> > > ajax,
> > > >> but the return type is a little bit limited for what i was trying to
> > > >> achieve(update a combo with information from another combo, which
> has
> > > your
> > > >> mixin). The only way to do it was hardcoding the select in my
> java(or
> > > >> javascript, whatever), that was too creepy for me.
> > > >>
> > > >> My questions:
> > > >> 1 - Is there any way of change my page data with something more
> > > elaborate
> > > >> than TextStreamResponse?
> > > >> 1 - Is there any efforts on adding some similar behavior to future
> > > >> releases?
> > > >>
> > > >> Thank you!
> > > >>
> > > >> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
> > > >>
> > > >>
> > > >> > try this
> > > >> >
> > > >> >
> > > >>
> > >
> >
>
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/
> commons/mixins/OnEvent.html<http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html>
> > > >> >
> > > >> > 2008/4/24, Leon Derks <le...@cumquat.nl>:
> > > >> > >
> > > >> > > Hello
> > > >> > >
> > > >> > > Is it possible to catch the onChange event from a select
> component
> > > in
> > > >> the
> > > >> > > java  page?
> > > >> > >
> > > >> > > I would expect something like: onChangeFromSelect(long id)
> {....}
> > > >> > >
> > > >> > > Because I want to update information on my page, based on the
> > value
> > > >> that
> > > >> > is
> > > >> > > selected.
> > > >> > >
> > > >> > > How can I do that?
> > > >> > >
> > > >> > > Leon
> > > >> > >
> > > >> > >
> > > >> > >
> > > ---------------------------------------------------------------------
> > > >> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > >> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >> > >
> > > >> > >
> > > >> >
> > > >> >
> > > >> > --
> > > >> > with regards
> > > >> > Sven Homburg
> > > >> > http://tapestry5-components.googlecode.com
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Atenciosamente,
> > > >>
> > > >> Marcelo Lotif
> > > >>
> > > >
> > > >
> > > >
> > > > --
> > > > with regards
> > > > Sven Homburg
> > > > http://tapestry5-components.googlecode.com
> > > >
> > >
> > >
> > >
> > > --
> > > with regards
> > > Sven Homburg
> > > http://tapestry5-components.googlecode.com
> > >
> >
> >
> >
> >
> > --
> > Atenciosamente,
> >
> > Marcelo Lotif
> >
>
>
>
> --
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

答复: T5: Select component + onchange()

Posted by 滕训华 <te...@magic-sw.com.cn>.
Hi,Sven:
	I use your example code in my project,but when I return Chinese to
javascript function and use alert to display it.it can not display normally,
how can I slove this problem,thanks.

My code:

	TextStreamResponse onChange(TblCustomerInfo changedCustomer){
    	String utfStr="";
    	try{
    		utfStr=new String("滕训华".getBytes(),"UTF-8");
    	}
    	catch(UnsupportedEncodingException e){
    	
    	}
    	return new  TextStreamResponse("text/html",utfStr);
    	
    }

My javascript code:
	
		function customerChangeEvent(response){
			
			alert(response);
			
		}
-----邮件原件-----
发件人: Sven Homburg [mailto:homburgs@googlemail.com] 
发送时间: 2008年4月25日 2:54
收件人: Tapestry users
主题: Re: T5: Select component + onchange()

here some sample code sequences

your page class (simplified):

@Component(parameters={"event=change"
"onCompleteCallback=onSelect1Changed"})
@Mixins("t5components/OnEvent")
private Select _select1

@Component
private Select _select2

@OnEvent(component = "select1", value = "change")
JSONObject select1ElementChanged(String value)
{
JSONObject json = new JSONObject();
json.put("result", new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c',
'value c'], ['d', 'value d']]"));
return json;
}


your page tml (simplified):

<select t:id="select1">
<option value="1">first value</option>
</select>

<select t:id="select2">
</select>

<script type="text/javascript">
function onSelect1Changed(response)
{
var json = response.evalJSON();
var array = $A(json.result)

array.each(function(item){

// create new option for select tag "select2" and fill value attribute with
"item[0]"
// and fill option.innerText with "item[1]"

})
}
</script>



2008/4/24, Marcelo Lotif <ml...@gmail.com>:
>
> Yeah, i know this, but none of these responses suit to my needs (maybe a
> Page response, but this will force a reload)... i tried to return a block
> with the part of the code that i was trying to change, but i had no
success
>
> And i don't have the enough knowledge of the JSON api and javascript...
>
> So i'm using the onchange='this.form.submit()'...
>
> =)
>
>
> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>
> > the JSONObject/JSONArray response too
> >
> > 2008/4/24, Sven Homburg <ho...@googlemail.com>:
> > >
> > > the return type is not limited to StreamResponse.
> > > all you can respond all that tapestry allowes here
> > > http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
> > > its up to you
> > >
> > > 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
> > >>
> > >> I had the same issue as Leon some days ago (and this seems to be a
> very
> > >> common issue), and i tried your component. It's very good, with some
> > ajax,
> > >> but the return type is a little bit limited for what i was trying to
> > >> achieve(update a combo with information from another combo, which has
> > your
> > >> mixin). The only way to do it was hardcoding the select in my java(or
> > >> javascript, whatever), that was too creepy for me.
> > >>
> > >> My questions:
> > >> 1 - Is there any way of change my page data with something more
> > elaborate
> > >> than TextStreamResponse?
> > >> 1 - Is there any efforts on adding some similar behavior to future
> > >> releases?
> > >>
> > >> Thank you!
> > >>
> > >> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
> > >>
> > >>
> > >> > try this
> > >> >
> > >> >
> > >>
> >
>
http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/
commons/mixins/OnEvent.html
> > >> >
> > >> > 2008/4/24, Leon Derks <le...@cumquat.nl>:
> > >> > >
> > >> > > Hello
> > >> > >
> > >> > > Is it possible to catch the onChange event from a select
component
> > in
> > >> the
> > >> > > java  page?
> > >> > >
> > >> > > I would expect something like: onChangeFromSelect(long id) {....}
> > >> > >
> > >> > > Because I want to update information on my page, based on the
> value
> > >> that
> > >> > is
> > >> > > selected.
> > >> > >
> > >> > > How can I do that?
> > >> > >
> > >> > > Leon
> > >> > >
> > >> > >
> > >> > >
> > ---------------------------------------------------------------------
> > >> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >> > >
> > >> > >
> > >> >
> > >> >
> > >> > --
> > >> > with regards
> > >> > Sven Homburg
> > >> > http://tapestry5-components.googlecode.com
> > >> >
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> Atenciosamente,
> > >>
> > >> Marcelo Lotif
> > >>
> > >
> > >
> > >
> > > --
> > > with regards
> > > Sven Homburg
> > > http://tapestry5-components.googlecode.com
> > >
> >
> >
> >
> > --
> > with regards
> > Sven Homburg
> > http://tapestry5-components.googlecode.com
> >
>
>
>
>
> --
> Atenciosamente,
>
> Marcelo Lotif
>



-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com


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


Re: T5: Select component + onchange()

Posted by Sven Homburg <ho...@googlemail.com>.
here some sample code sequences

your page class (simplified):

@Component(parameters={"event=change"
"onCompleteCallback=onSelect1Changed"})
@Mixins("t5components/OnEvent")
private Select _select1

@Component
private Select _select2

@OnEvent(component = "select1", value = "change")
JSONObject select1ElementChanged(String value)
{
JSONObject json = new JSONObject();
json.put("result", new JSONArray("[['a', 'value a'], ['b', 'value b'], ['c',
'value c'], ['d', 'value d']]"));
return json;
}


your page tml (simplified):

<select t:id="select1">
<option value="1">first value</option>
</select>

<select t:id="select2">
</select>

<script type="text/javascript">
function onSelect1Changed(response)
{
var json = response.evalJSON();
var array = $A(json.result)

array.each(function(item){

// create new option for select tag "select2" and fill value attribute with
"item[0]"
// and fill option.innerText with "item[1]"

})
}
</script>



2008/4/24, Marcelo Lotif <ml...@gmail.com>:
>
> Yeah, i know this, but none of these responses suit to my needs (maybe a
> Page response, but this will force a reload)... i tried to return a block
> with the part of the code that i was trying to change, but i had no success
>
> And i don't have the enough knowledge of the JSON api and javascript...
>
> So i'm using the onchange='this.form.submit()'...
>
> =)
>
>
> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>
> > the JSONObject/JSONArray response too
> >
> > 2008/4/24, Sven Homburg <ho...@googlemail.com>:
> > >
> > > the return type is not limited to StreamResponse.
> > > all you can respond all that tapestry allowes here
> > > http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
> > > its up to you
> > >
> > > 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
> > >>
> > >> I had the same issue as Leon some days ago (and this seems to be a
> very
> > >> common issue), and i tried your component. It's very good, with some
> > ajax,
> > >> but the return type is a little bit limited for what i was trying to
> > >> achieve(update a combo with information from another combo, which has
> > your
> > >> mixin). The only way to do it was hardcoding the select in my java(or
> > >> javascript, whatever), that was too creepy for me.
> > >>
> > >> My questions:
> > >> 1 - Is there any way of change my page data with something more
> > elaborate
> > >> than TextStreamResponse?
> > >> 1 - Is there any efforts on adding some similar behavior to future
> > >> releases?
> > >>
> > >> Thank you!
> > >>
> > >> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
> > >>
> > >>
> > >> > try this
> > >> >
> > >> >
> > >>
> >
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
> > >> >
> > >> > 2008/4/24, Leon Derks <le...@cumquat.nl>:
> > >> > >
> > >> > > Hello
> > >> > >
> > >> > > Is it possible to catch the onChange event from a select component
> > in
> > >> the
> > >> > > java  page?
> > >> > >
> > >> > > I would expect something like: onChangeFromSelect(long id) {....}
> > >> > >
> > >> > > Because I want to update information on my page, based on the
> value
> > >> that
> > >> > is
> > >> > > selected.
> > >> > >
> > >> > > How can I do that?
> > >> > >
> > >> > > Leon
> > >> > >
> > >> > >
> > >> > >
> > ---------------------------------------------------------------------
> > >> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >> > >
> > >> > >
> > >> >
> > >> >
> > >> > --
> > >> > with regards
> > >> > Sven Homburg
> > >> > http://tapestry5-components.googlecode.com
> > >> >
> > >>
> > >>
> > >>
> > >>
> > >> --
> > >> Atenciosamente,
> > >>
> > >> Marcelo Lotif
> > >>
> > >
> > >
> > >
> > > --
> > > with regards
> > > Sven Homburg
> > > http://tapestry5-components.googlecode.com
> > >
> >
> >
> >
> > --
> > with regards
> > Sven Homburg
> > http://tapestry5-components.googlecode.com
> >
>
>
>
>
> --
> Atenciosamente,
>
> Marcelo Lotif
>



-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Re: T5: Select component + onchange()

Posted by Marcelo Lotif <ml...@gmail.com>.
hmmm, I thought about it earlier, but i did not search for a JIRA... this
would be really nice!

and nice piece of code Sven, I'll try to get this working and take off the
workaround with submit...

2008/4/25 Geoff Callender <ge...@gmail.com>:

> It seems to me that Zones would make it very simple.  Perhaps you would
> like to vote for this issue:
>
>        "Add Zone parameter to Select component"
>        https://issues.apache.org/jira/browse/TAPESTRY-2361
>
> Cheers,
>
> Geoff
> http://files.doublenegative.com.au/jumpstart/
>
>
> On 25/04/2008, at 12:04 AM, Marcelo Lotif wrote:
>
>  Yeah, i know this, but none of these responses suit to my needs (maybe a
>> Page response, but this will force a reload)... i tried to return a block
>> with the part of the code that i was trying to change, but i had no
>> success
>>
>> And i don't have the enough knowledge of the JSON api and javascript...
>>
>> So i'm using the onchange='this.form.submit()'...
>>
>> =)
>>
>> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>>
>>  the JSONObject/JSONArray response too
>>>
>>> 2008/4/24, Sven Homburg <ho...@googlemail.com>:
>>>
>>>>
>>>> the return type is not limited to StreamResponse.
>>>> all you can respond all that tapestry allowes here
>>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
>>>> its up to you
>>>>
>>>> 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
>>>>
>>>>>
>>>>> I had the same issue as Leon some days ago (and this seems to be a very
>>>>> common issue), and i tried your component. It's very good, with some
>>>>>
>>>> ajax,
>>>
>>>> but the return type is a little bit limited for what i was trying to
>>>>> achieve(update a combo with information from another combo, which has
>>>>>
>>>> your
>>>
>>>> mixin). The only way to do it was hardcoding the select in my java(or
>>>>> javascript, whatever), that was too creepy for me.
>>>>>
>>>>> My questions:
>>>>> 1 - Is there any way of change my page data with something more
>>>>>
>>>> elaborate
>>>
>>>> than TextStreamResponse?
>>>>> 1 - Is there any efforts on adding some similar behavior to future
>>>>> releases?
>>>>>
>>>>> Thank you!
>>>>>
>>>>> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>>>>>
>>>>>
>>>>>  try this
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
>>>
>>>>
>>>>>> 2008/4/24, Leon Derks <le...@cumquat.nl>:
>>>>>>
>>>>>>>
>>>>>>> Hello
>>>>>>>
>>>>>>> Is it possible to catch the onChange event from a select component
>>>>>>>
>>>>>> in
>>>
>>>> the
>>>>>
>>>>>> java  page?
>>>>>>>
>>>>>>> I would expect something like: onChangeFromSelect(long id) {....}
>>>>>>>
>>>>>>> Because I want to update information on my page, based on the value
>>>>>>>
>>>>>> that
>>>>>
>>>>>> is
>>>>>>
>>>>>>> selected.
>>>>>>>
>>>>>>> How can I do that?
>>>>>>>
>>>>>>> Leon
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>> with regards
>>>>>> Sven Homburg
>>>>>> http://tapestry5-components.googlecode.com
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Atenciosamente,
>>>>>
>>>>> Marcelo Lotif
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> with regards
>>>> Sven Homburg
>>>> http://tapestry5-components.googlecode.com
>>>>
>>>>
>>>
>>>
>>> --
>>> with regards
>>> Sven Homburg
>>> http://tapestry5-components.googlecode.com
>>>
>>>
>>
>>
>> --
>> Atenciosamente,
>> Marcelo Lotif
>>
>
>


-- 
Atenciosamente,
Marcelo Lotif

Re: T5: Select component + onchange()

Posted by Geoff Callender <ge...@gmail.com>.
It seems to me that Zones would make it very simple.  Perhaps you  
would like to vote for this issue:

	"Add Zone parameter to Select component"
	https://issues.apache.org/jira/browse/TAPESTRY-2361

Cheers,

Geoff
http://files.doublenegative.com.au/jumpstart/

On 25/04/2008, at 12:04 AM, Marcelo Lotif wrote:

> Yeah, i know this, but none of these responses suit to my needs  
> (maybe a
> Page response, but this will force a reload)... i tried to return a  
> block
> with the part of the code that i was trying to change, but i had no  
> success
>
> And i don't have the enough knowledge of the JSON api and  
> javascript...
>
> So i'm using the onchange='this.form.submit()'...
>
> =)
>
> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>
>> the JSONObject/JSONArray response too
>>
>> 2008/4/24, Sven Homburg <ho...@googlemail.com>:
>>>
>>> the return type is not limited to StreamResponse.
>>> all you can respond all that tapestry allowes here
>>> http://tapestry.apache.org/tapestry5/tapestry-core/guide/ 
>>> pagenav.html
>>> its up to you
>>>
>>> 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
>>>>
>>>> I had the same issue as Leon some days ago (and this seems to be  
>>>> a very
>>>> common issue), and i tried your component. It's very good, with  
>>>> some
>> ajax,
>>>> but the return type is a little bit limited for what i was trying  
>>>> to
>>>> achieve(update a combo with information from another combo, which  
>>>> has
>> your
>>>> mixin). The only way to do it was hardcoding the select in my  
>>>> java(or
>>>> javascript, whatever), that was too creepy for me.
>>>>
>>>> My questions:
>>>> 1 - Is there any way of change my page data with something more
>> elaborate
>>>> than TextStreamResponse?
>>>> 1 - Is there any efforts on adding some similar behavior to future
>>>> releases?
>>>>
>>>> Thank you!
>>>>
>>>> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>>>>
>>>>
>>>>> try this
>>>>>
>>>>>
>>>>
>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
>>>>>
>>>>> 2008/4/24, Leon Derks <le...@cumquat.nl>:
>>>>>>
>>>>>> Hello
>>>>>>
>>>>>> Is it possible to catch the onChange event from a select  
>>>>>> component
>> in
>>>> the
>>>>>> java  page?
>>>>>>
>>>>>> I would expect something like: onChangeFromSelect(long id) {....}
>>>>>>
>>>>>> Because I want to update information on my page, based on the  
>>>>>> value
>>>> that
>>>>> is
>>>>>> selected.
>>>>>>
>>>>>> How can I do that?
>>>>>>
>>>>>> Leon
>>>>>>
>>>>>>
>>>>>>
>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> with regards
>>>>> Sven Homburg
>>>>> http://tapestry5-components.googlecode.com
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Atenciosamente,
>>>>
>>>> Marcelo Lotif
>>>>
>>>
>>>
>>>
>>> --
>>> with regards
>>> Sven Homburg
>>> http://tapestry5-components.googlecode.com
>>>
>>
>>
>>
>> --
>> with regards
>> Sven Homburg
>> http://tapestry5-components.googlecode.com
>>
>
>
>
> -- 
> Atenciosamente,
> Marcelo Lotif


Re: T5: Select component + onchange()

Posted by Marcelo Lotif <ml...@gmail.com>.
Yeah, i know this, but none of these responses suit to my needs (maybe a
Page response, but this will force a reload)... i tried to return a block
with the part of the code that i was trying to change, but i had no success

And i don't have the enough knowledge of the JSON api and javascript...

So i'm using the onchange='this.form.submit()'...

=)

2008/4/24 Sven Homburg <ho...@googlemail.com>:

> the JSONObject/JSONArray response too
>
> 2008/4/24, Sven Homburg <ho...@googlemail.com>:
> >
> > the return type is not limited to StreamResponse.
> > all you can respond all that tapestry allowes here
> > http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
> > its up to you
> >
> > 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
> >>
> >> I had the same issue as Leon some days ago (and this seems to be a very
> >> common issue), and i tried your component. It's very good, with some
> ajax,
> >> but the return type is a little bit limited for what i was trying to
> >> achieve(update a combo with information from another combo, which has
> your
> >> mixin). The only way to do it was hardcoding the select in my java(or
> >> javascript, whatever), that was too creepy for me.
> >>
> >> My questions:
> >> 1 - Is there any way of change my page data with something more
> elaborate
> >> than TextStreamResponse?
> >> 1 - Is there any efforts on adding some similar behavior to future
> >> releases?
> >>
> >> Thank you!
> >>
> >> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
> >>
> >>
> >> > try this
> >> >
> >> >
> >>
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
> >> >
> >> > 2008/4/24, Leon Derks <le...@cumquat.nl>:
> >> > >
> >> > > Hello
> >> > >
> >> > > Is it possible to catch the onChange event from a select component
> in
> >> the
> >> > > java  page?
> >> > >
> >> > > I would expect something like: onChangeFromSelect(long id) {....}
> >> > >
> >> > > Because I want to update information on my page, based on the value
> >> that
> >> > is
> >> > > selected.
> >> > >
> >> > > How can I do that?
> >> > >
> >> > > Leon
> >> > >
> >> > >
> >> > >
> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >> > >
> >> > >
> >> >
> >> >
> >> > --
> >> > with regards
> >> > Sven Homburg
> >> > http://tapestry5-components.googlecode.com
> >> >
> >>
> >>
> >>
> >>
> >> --
> >> Atenciosamente,
> >>
> >> Marcelo Lotif
> >>
> >
> >
> >
> > --
> > with regards
> > Sven Homburg
> > http://tapestry5-components.googlecode.com
> >
>
>
>
> --
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com
>



-- 
Atenciosamente,
Marcelo Lotif

Re: T5: Select component + onchange()

Posted by Sven Homburg <ho...@googlemail.com>.
the JSONObject/JSONArray response too

2008/4/24, Sven Homburg <ho...@googlemail.com>:
>
> the return type is not limited to StreamResponse.
> all you can respond all that tapestry allowes here
> http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
> its up to you
>
> 2008/4/24, Marcelo Lotif <ml...@gmail.com>:
>>
>> I had the same issue as Leon some days ago (and this seems to be a very
>> common issue), and i tried your component. It's very good, with some ajax,
>> but the return type is a little bit limited for what i was trying to
>> achieve(update a combo with information from another combo, which has your
>> mixin). The only way to do it was hardcoding the select in my java(or
>> javascript, whatever), that was too creepy for me.
>>
>> My questions:
>> 1 - Is there any way of change my page data with something more elaborate
>> than TextStreamResponse?
>> 1 - Is there any efforts on adding some similar behavior to future
>> releases?
>>
>> Thank you!
>>
>> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>>
>>
>> > try this
>> >
>> >
>> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
>> >
>> > 2008/4/24, Leon Derks <le...@cumquat.nl>:
>> > >
>> > > Hello
>> > >
>> > > Is it possible to catch the onChange event from a select component in
>> the
>> > > java  page?
>> > >
>> > > I would expect something like: onChangeFromSelect(long id) {....}
>> > >
>> > > Because I want to update information on my page, based on the value
>> that
>> > is
>> > > selected.
>> > >
>> > > How can I do that?
>> > >
>> > > Leon
>> > >
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > > For additional commands, e-mail: users-help@tapestry.apache.org
>> > >
>> > >
>> >
>> >
>> > --
>> > with regards
>> > Sven Homburg
>> > http://tapestry5-components.googlecode.com
>> >
>>
>>
>>
>>
>> --
>> Atenciosamente,
>>
>> Marcelo Lotif
>>
>
>
>
> --
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com
>



-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Re: T5: Select component + onchange()

Posted by Sven Homburg <ho...@googlemail.com>.
the return type is not limited to StreamResponse.
all you can respond all that tapestry allowes here
http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html
its up to you

2008/4/24, Marcelo Lotif <ml...@gmail.com>:
>
> I had the same issue as Leon some days ago (and this seems to be a very
> common issue), and i tried your component. It's very good, with some ajax,
> but the return type is a little bit limited for what i was trying to
> achieve(update a combo with information from another combo, which has your
> mixin). The only way to do it was hardcoding the select in my java(or
> javascript, whatever), that was too creepy for me.
>
> My questions:
> 1 - Is there any way of change my page data with something more elaborate
> than TextStreamResponse?
> 1 - Is there any efforts on adding some similar behavior to future
> releases?
>
> Thank you!
>
> 2008/4/24 Sven Homburg <ho...@googlemail.com>:
>
>
> > try this
> >
> >
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
> >
> > 2008/4/24, Leon Derks <le...@cumquat.nl>:
> > >
> > > Hello
> > >
> > > Is it possible to catch the onChange event from a select component in
> the
> > > java  page?
> > >
> > > I would expect something like: onChangeFromSelect(long id) {....}
> > >
> > > Because I want to update information on my page, based on the value
> that
> > is
> > > selected.
> > >
> > > How can I do that?
> > >
> > > Leon
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > with regards
> > Sven Homburg
> > http://tapestry5-components.googlecode.com
> >
>
>
>
>
> --
> Atenciosamente,
>
> Marcelo Lotif
>



-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com

Re: T5: Select component + onchange()

Posted by Marcelo Lotif <ml...@gmail.com>.
I had the same issue as Leon some days ago (and this seems to be a very
common issue), and i tried your component. It's very good, with some ajax,
but the return type is a little bit limited for what i was trying to
achieve(update a combo with information from another combo, which has your
mixin). The only way to do it was hardcoding the select in my java(or
javascript, whatever), that was too creepy for me.

My questions:
1 - Is there any way of change my page data with something more elaborate
than TextStreamResponse?
1 - Is there any efforts on adding some similar behavior to future releases?

Thank you!

2008/4/24 Sven Homburg <ho...@googlemail.com>:

> try this
>
> http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html
>
> 2008/4/24, Leon Derks <le...@cumquat.nl>:
> >
> > Hello
> >
> > Is it possible to catch the onChange event from a select component in the
> > java  page?
> >
> > I would expect something like: onChangeFromSelect(long id) {....}
> >
> > Because I want to update information on my page, based on the value that
> is
> > selected.
> >
> > How can I do that?
> >
> > Leon
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> with regards
> Sven Homburg
> http://tapestry5-components.googlecode.com
>



-- 
Atenciosamente,
Marcelo Lotif

Re: T5: Select component + onchange()

Posted by Sven Homburg <ho...@googlemail.com>.
try this
http://87.193.218.134:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/mixins/OnEvent.html

2008/4/24, Leon Derks <le...@cumquat.nl>:
>
> Hello
>
> Is it possible to catch the onChange event from a select component in the
> java  page?
>
> I would expect something like: onChangeFromSelect(long id) {....}
>
> Because I want to update information on my page, based on the value that is
> selected.
>
> How can I do that?
>
> Leon
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
with regards
Sven Homburg
http://tapestry5-components.googlecode.com