You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Gunnar Eketrapp <gu...@gmail.com> on 2009/12/04 11:46:31 UTC

ZoneUpdater -> null strings ...

Hi!

I just copied Inge's ZoneUpdater and by magic my registration page started
to recieve events
for each key pressed in the field that I had instrumented with it.

BUT by some reason the string passed is null and I must have missed
something.

When I look at the JumpStart example I noticed that the field names have
underscores in them in the java class.
Is this needed ? Something with mixins ? I have never used underscores ....

What have I missed?

Thanks in advande
Gunnar Eketrapp

===============================================

JumpStart example ....


<form t:type="form" style="background-color: eee; padding: 15px">
		First Name:
		<input t:type="TextField" t:id="firstName" t:mixins="zoneUpdater"
zone="nameZone" event="firstNameChanged" clientEvent="keyup"/><br/>
		Last Name:
		<input t:type="TextField" t:id="lastName" t:mixins="zoneUpdater"
zone="nameZone" event="lastNameChanged"
clientEvent="keyup"/><br/><br/>

		<t:zone t:id="nameZone">
			Welcome ${name}.
		</t:zone><br/>

		Note that the following time field does not update because it's not
in the zone:  ${time}<br/>
		
 	</form>
 	
	References:


blic class AJAXOnEvent {

	@Property
	@Persist
	private String _firstName;

	@Property
	@Persist
	private String _lastName;

	@InjectComponent
	private Zone _nameZone;


-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Re: ZoneUpdater -> null strings ...

Posted by Gunnar Eketrapp <gu...@gmail.com>.
Hi!

I just copied the JumpStart example ... i.e. copied ZoneUpdater.java +
ZoneUpdater.js.

My html is also using jquery in noConflict() mode.

My tml looks like ...

.tml
====
<t:textfield t:id="username" t:mixins="zoneUpdater"
zone="usernameZone" event="usernameChanged"  clientEvent="keyup"
onfocus="ClearTextbox(this, '${message:username}');"
onblur="RestoreTextbox(this, '${message:username}');" />
<t:textfield t:id="alias"  t:mixins="zoneUpdater" zone="aliasZone"
event="aliasChanged"  clientEvent="keyup" onfocus="ClearTextbox(this,
'${message:alias}');" onblur="RestoreTextbox(this,
'${message:alias}');" />

Currently I have added a "dummy" in my action methods which works.

But it would be nice to sort it out.

/Gunnar

2009/12/5 Inge Solvoll <in...@gmail.com>

> The $N is probably a client encoding of null.
>
> Are you passing a context to the mixin? The provided context seems to be
> [null, 'XXX'], where XXX is replaced by your real value on the client.
>
> On Sat, Dec 5, 2009 at 12:49 AM, Gunnar Eketrapp
> <gu...@gmail.com>wrote:
>
> > When I added a dummy param to my event method the field string started to
> > come ...
> >
> > [DEBUG] pages.Register [ EXIT] onUserNameChanged [Block[....Register.tml,
> > line 152]]
> > [DEBUG] pages.Register [ENTER] onUserNameChanged(null, "xzd")
> >
> > But where does the $N come from ?
> >
> > /Gunnar
> >
> > 2009/12/5 Gunnar Eketrapp <gu...@gmail.com>
> >
> > > Hi!
> > >
> > > This is sent from my client when I pressed an 'a' in the username field
> > ...
> > >
> > >     http://localhost:8080/sv/register.username:usernamechanged/$N/a
> > >
> > >
> > > ... and I don't understand the $N part. Could that be the problem !?
> > >
> > > /Gunnar
> > >
> > >
> > > 2009/12/4 Inge Solvoll <in...@gmail.com>
> > >
> > > Hi!
> > >>
> > >> To begin with, use firebug to track requests sent to the server on
> your
> > >> keypresses. See what the urls look like, and if they contain the
> strings
> > >> you
> > >> expect.
> > >>
> > >> Inge
> > >>
> > >> On Fri, Dec 4, 2009 at 1:26 PM, Gunnar Eketrapp
> > >> <gu...@gmail.com>wrote:
> > >>
> > >> > Hi and thanks for the reply! Sorry for being stupid but in the
> > JumpStart
> > >> > example ...
> > >> >
> > >> >
> > http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent
> > >> >
> > >> > ... the methods below gets called for each keypress with the actual
> > >> field
> > >> > content.
> > >> >
> > >> >        Object onFirstNameChanged(String firstName) {
> > >> >                _firstName = firstName;
> > >> >                return _nameZone.getBody();
> > >> >        }
> > >> >
> > >> >        Object onLastNameChanged(String lastName) {
> > >> >
> > >> >                _lastName = lastName;
> > >> >                return _nameZone.getBody();
> > >> >        }
> > >> >
> > >> >
> > >> > My event methods are called for each key but are passed null
> strings.
> > >> >
> > >> > What have I missed?
> > >> >
> > >> >
> > >> > Here are parts of my code ..
> > >> >
> > >> > .tml
> > >> > ====
> > >> >        <div class="formfield-wide">
> > >> >                <t:textfield t:id="username" t:mixins="zoneUpdater"
> > >> > zone="usernameZone" event="usernameChanged"  clientEvent="keyup"
> > >> > class="formfield-wide-input" onfocus="ClearTextbox(this,
> > >> > '${message:username}');" onblur="RestoreTextbox(this,
> > >> > '${message:username}');" />
> > >> >
> > >> >        </div>
> > >> >        <div class="formfield-wide">
> > >> >        <t:zone t:id="usernameZone">${usernameMessage}</t:zone>
> > >> >        </div>
> > >> >        <div class="formfield-wide">
> > >> >
> > >> >                <t:textfield t:id="alias"  t:mixins="zoneUpdater"
> > >> > zone="aliasZone" event="aliasChanged"  clientEvent="keyup"
> > >> > class="formfield-wide-input" onfocus="ClearTextbox(this,
> > >> > '${message:alias}');" onblur="RestoreTextbox(this,
> > >> > '${message:alias}');" />
> > >> >
> > >> >        </div>
> > >> >        <div class="formfield-wide">
> > >> >        <t:zone t:id="aliasZone">${aliasMessage}</t:zone>
> > >> >        </div>
> > >> >
> > >> > .java
> > >> > ======
> > >> >        @Log
> > >> >
> > >> >        Object onUserNameChanged(String userName) {
> > >> >                this.username = userName;
> > >> >                return usernameZone.getBody();
> > >> >        }
> > >> >
> > >> >        @Log
> > >> >        Object onAliasChanged(String alias) {
> > >> >                this.alias = alias;
> > >> >                return aliasZone.getBody();
> > >> >
> > >> >        }
> > >> >
> > >> >
> > >> > /Gunnar
> > >> >
> > >> >
> > >> > 2009/12/4 Thiago H. de Paula Figueiredo <th...@gmail.com>
> > >> >
> > >> > > Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp <
> > >> > > gunnar.eketrapp@gmail.com> escreveu:
> > >> > >
> > >> > >  Hi!
> > >> > >>
> > >> > >
> > >> > > Hi!
> > >> > >
> > >> > >  I just copied Inge's ZoneUpdater and by magic my registration
> page
> > >> > >> startedto recieve events for each key pressed in the field that I
> > had
> > >> > >> instrumented with it.
> > >> > >>
> > >> > >> BUT by some reason the string passed is null and I must have
> missed
> > >> > >> something.
> > >> > >>
> > >> > >
> > >> > > If you don't submit the form, the entered values will not be sent
> to
> > >> the
> > >> > > page.
> > >> > >
> > >> > >
> > >> > >  When I look at the JumpStart example I noticed that the field
> names
> > >> have
> > >> > >> underscores in them in the java class.
> > >> > >> Is this needed ?
> > >> > >>
> > >> > >
> > >> > > No. This is just a convention that some people use.
> > >> > >
> > >> > > --
> > >> > > Thiago H. de Paula Figueiredo
> > >> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> > >> developer,
> > >> > > and instructor
> > >> > > Owner, software architect and developer, Ars Machina Tecnologia da
> > >> > > Informação Ltda.
> > >> > > http://www.arsmachina.com.br
> > >> > >
> > >> > >
> > ---------------------------------------------------------------------
> > >> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >> > >
> > >> > >
> > >> >
> > >> >
> > >> > --
> > >> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > >> > Allévägen 2A, 132 42 Saltsjö-Boo
> > >> >
> > >>
> > >
> > >
> > >
> > > --
> > > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > > Allévägen 2A, 132 42 Saltsjö-Boo
> > >
> >
> >
> >
> > --
> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > Allévägen 2A, 132 42 Saltsjö-Boo
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Re: ZoneUpdater -> null strings ...

Posted by Inge Solvoll <in...@gmail.com>.
The $N is probably a client encoding of null.

Are you passing a context to the mixin? The provided context seems to be
[null, 'XXX'], where XXX is replaced by your real value on the client.

On Sat, Dec 5, 2009 at 12:49 AM, Gunnar Eketrapp
<gu...@gmail.com>wrote:

> When I added a dummy param to my event method the field string started to
> come ...
>
> [DEBUG] pages.Register [ EXIT] onUserNameChanged [Block[....Register.tml,
> line 152]]
> [DEBUG] pages.Register [ENTER] onUserNameChanged(null, "xzd")
>
> But where does the $N come from ?
>
> /Gunnar
>
> 2009/12/5 Gunnar Eketrapp <gu...@gmail.com>
>
> > Hi!
> >
> > This is sent from my client when I pressed an 'a' in the username field
> ...
> >
> >     http://localhost:8080/sv/register.username:usernamechanged/$N/a
> >
> >
> > ... and I don't understand the $N part. Could that be the problem !?
> >
> > /Gunnar
> >
> >
> > 2009/12/4 Inge Solvoll <in...@gmail.com>
> >
> > Hi!
> >>
> >> To begin with, use firebug to track requests sent to the server on your
> >> keypresses. See what the urls look like, and if they contain the strings
> >> you
> >> expect.
> >>
> >> Inge
> >>
> >> On Fri, Dec 4, 2009 at 1:26 PM, Gunnar Eketrapp
> >> <gu...@gmail.com>wrote:
> >>
> >> > Hi and thanks for the reply! Sorry for being stupid but in the
> JumpStart
> >> > example ...
> >> >
> >> >
> http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent
> >> >
> >> > ... the methods below gets called for each keypress with the actual
> >> field
> >> > content.
> >> >
> >> >        Object onFirstNameChanged(String firstName) {
> >> >                _firstName = firstName;
> >> >                return _nameZone.getBody();
> >> >        }
> >> >
> >> >        Object onLastNameChanged(String lastName) {
> >> >
> >> >                _lastName = lastName;
> >> >                return _nameZone.getBody();
> >> >        }
> >> >
> >> >
> >> > My event methods are called for each key but are passed null strings.
> >> >
> >> > What have I missed?
> >> >
> >> >
> >> > Here are parts of my code ..
> >> >
> >> > .tml
> >> > ====
> >> >        <div class="formfield-wide">
> >> >                <t:textfield t:id="username" t:mixins="zoneUpdater"
> >> > zone="usernameZone" event="usernameChanged"  clientEvent="keyup"
> >> > class="formfield-wide-input" onfocus="ClearTextbox(this,
> >> > '${message:username}');" onblur="RestoreTextbox(this,
> >> > '${message:username}');" />
> >> >
> >> >        </div>
> >> >        <div class="formfield-wide">
> >> >        <t:zone t:id="usernameZone">${usernameMessage}</t:zone>
> >> >        </div>
> >> >        <div class="formfield-wide">
> >> >
> >> >                <t:textfield t:id="alias"  t:mixins="zoneUpdater"
> >> > zone="aliasZone" event="aliasChanged"  clientEvent="keyup"
> >> > class="formfield-wide-input" onfocus="ClearTextbox(this,
> >> > '${message:alias}');" onblur="RestoreTextbox(this,
> >> > '${message:alias}');" />
> >> >
> >> >        </div>
> >> >        <div class="formfield-wide">
> >> >        <t:zone t:id="aliasZone">${aliasMessage}</t:zone>
> >> >        </div>
> >> >
> >> > .java
> >> > ======
> >> >        @Log
> >> >
> >> >        Object onUserNameChanged(String userName) {
> >> >                this.username = userName;
> >> >                return usernameZone.getBody();
> >> >        }
> >> >
> >> >        @Log
> >> >        Object onAliasChanged(String alias) {
> >> >                this.alias = alias;
> >> >                return aliasZone.getBody();
> >> >
> >> >        }
> >> >
> >> >
> >> > /Gunnar
> >> >
> >> >
> >> > 2009/12/4 Thiago H. de Paula Figueiredo <th...@gmail.com>
> >> >
> >> > > Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp <
> >> > > gunnar.eketrapp@gmail.com> escreveu:
> >> > >
> >> > >  Hi!
> >> > >>
> >> > >
> >> > > Hi!
> >> > >
> >> > >  I just copied Inge's ZoneUpdater and by magic my registration page
> >> > >> startedto recieve events for each key pressed in the field that I
> had
> >> > >> instrumented with it.
> >> > >>
> >> > >> BUT by some reason the string passed is null and I must have missed
> >> > >> something.
> >> > >>
> >> > >
> >> > > If you don't submit the form, the entered values will not be sent to
> >> the
> >> > > page.
> >> > >
> >> > >
> >> > >  When I look at the JumpStart example I noticed that the field names
> >> have
> >> > >> underscores in them in the java class.
> >> > >> Is this needed ?
> >> > >>
> >> > >
> >> > > No. This is just a convention that some people use.
> >> > >
> >> > > --
> >> > > Thiago H. de Paula Figueiredo
> >> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> >> developer,
> >> > > and instructor
> >> > > Owner, software architect and developer, Ars Machina Tecnologia da
> >> > > Informação Ltda.
> >> > > http://www.arsmachina.com.br
> >> > >
> >> > >
> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> > > For additional commands, e-mail: users-help@tapestry.apache.org
> >> > >
> >> > >
> >> >
> >> >
> >> > --
> >> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> >> > Allévägen 2A, 132 42 Saltsjö-Boo
> >> >
> >>
> >
> >
> >
> > --
> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > Allévägen 2A, 132 42 Saltsjö-Boo
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>

Re: ZoneUpdater -> null strings ...

Posted by Gunnar Eketrapp <gu...@gmail.com>.
When I added a dummy param to my event method the field string started to
come ...

[DEBUG] pages.Register [ EXIT] onUserNameChanged [Block[....Register.tml,
line 152]]
[DEBUG] pages.Register [ENTER] onUserNameChanged(null, "xzd")

But where does the $N come from ?

/Gunnar

2009/12/5 Gunnar Eketrapp <gu...@gmail.com>

> Hi!
>
> This is sent from my client when I pressed an 'a' in the username field ...
>
>     http://localhost:8080/sv/register.username:usernamechanged/$N/a
>
>
> ... and I don't understand the $N part. Could that be the problem !?
>
> /Gunnar
>
>
> 2009/12/4 Inge Solvoll <in...@gmail.com>
>
> Hi!
>>
>> To begin with, use firebug to track requests sent to the server on your
>> keypresses. See what the urls look like, and if they contain the strings
>> you
>> expect.
>>
>> Inge
>>
>> On Fri, Dec 4, 2009 at 1:26 PM, Gunnar Eketrapp
>> <gu...@gmail.com>wrote:
>>
>> > Hi and thanks for the reply! Sorry for being stupid but in the JumpStart
>> > example ...
>> >
>> >   http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent
>> >
>> > ... the methods below gets called for each keypress with the actual
>> field
>> > content.
>> >
>> >        Object onFirstNameChanged(String firstName) {
>> >                _firstName = firstName;
>> >                return _nameZone.getBody();
>> >        }
>> >
>> >        Object onLastNameChanged(String lastName) {
>> >
>> >                _lastName = lastName;
>> >                return _nameZone.getBody();
>> >        }
>> >
>> >
>> > My event methods are called for each key but are passed null strings.
>> >
>> > What have I missed?
>> >
>> >
>> > Here are parts of my code ..
>> >
>> > .tml
>> > ====
>> >        <div class="formfield-wide">
>> >                <t:textfield t:id="username" t:mixins="zoneUpdater"
>> > zone="usernameZone" event="usernameChanged"  clientEvent="keyup"
>> > class="formfield-wide-input" onfocus="ClearTextbox(this,
>> > '${message:username}');" onblur="RestoreTextbox(this,
>> > '${message:username}');" />
>> >
>> >        </div>
>> >        <div class="formfield-wide">
>> >        <t:zone t:id="usernameZone">${usernameMessage}</t:zone>
>> >        </div>
>> >        <div class="formfield-wide">
>> >
>> >                <t:textfield t:id="alias"  t:mixins="zoneUpdater"
>> > zone="aliasZone" event="aliasChanged"  clientEvent="keyup"
>> > class="formfield-wide-input" onfocus="ClearTextbox(this,
>> > '${message:alias}');" onblur="RestoreTextbox(this,
>> > '${message:alias}');" />
>> >
>> >        </div>
>> >        <div class="formfield-wide">
>> >        <t:zone t:id="aliasZone">${aliasMessage}</t:zone>
>> >        </div>
>> >
>> > .java
>> > ======
>> >        @Log
>> >
>> >        Object onUserNameChanged(String userName) {
>> >                this.username = userName;
>> >                return usernameZone.getBody();
>> >        }
>> >
>> >        @Log
>> >        Object onAliasChanged(String alias) {
>> >                this.alias = alias;
>> >                return aliasZone.getBody();
>> >
>> >        }
>> >
>> >
>> > /Gunnar
>> >
>> >
>> > 2009/12/4 Thiago H. de Paula Figueiredo <th...@gmail.com>
>> >
>> > > Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp <
>> > > gunnar.eketrapp@gmail.com> escreveu:
>> > >
>> > >  Hi!
>> > >>
>> > >
>> > > Hi!
>> > >
>> > >  I just copied Inge's ZoneUpdater and by magic my registration page
>> > >> startedto recieve events for each key pressed in the field that I had
>> > >> instrumented with it.
>> > >>
>> > >> BUT by some reason the string passed is null and I must have missed
>> > >> something.
>> > >>
>> > >
>> > > If you don't submit the form, the entered values will not be sent to
>> the
>> > > page.
>> > >
>> > >
>> > >  When I look at the JumpStart example I noticed that the field names
>> have
>> > >> underscores in them in the java class.
>> > >> Is this needed ?
>> > >>
>> > >
>> > > No. This is just a convention that some people use.
>> > >
>> > > --
>> > > Thiago H. de Paula Figueiredo
>> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
>> developer,
>> > > and instructor
>> > > Owner, software architect and developer, Ars Machina Tecnologia da
>> > > Informação Ltda.
>> > > http://www.arsmachina.com.br
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > > For additional commands, e-mail: users-help@tapestry.apache.org
>> > >
>> > >
>> >
>> >
>> > --
>> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
>> > Allévägen 2A, 132 42 Saltsjö-Boo
>> >
>>
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Re: ZoneUpdater -> null strings ...

Posted by Gunnar Eketrapp <gu...@gmail.com>.
Hi!

This is sent from my client when I pressed an 'a' in the username field ...

    http://localhost:8080/sv/register.username:usernamechanged/$N/a


... and I don't understand the $N part. Could that be the problem !?

/Gunnar


2009/12/4 Inge Solvoll <in...@gmail.com>

> Hi!
>
> To begin with, use firebug to track requests sent to the server on your
> keypresses. See what the urls look like, and if they contain the strings
> you
> expect.
>
> Inge
>
> On Fri, Dec 4, 2009 at 1:26 PM, Gunnar Eketrapp
> <gu...@gmail.com>wrote:
>
> > Hi and thanks for the reply! Sorry for being stupid but in the JumpStart
> > example ...
> >
> >   http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent
> >
> > ... the methods below gets called for each keypress with the actual field
> > content.
> >
> >        Object onFirstNameChanged(String firstName) {
> >                _firstName = firstName;
> >                return _nameZone.getBody();
> >        }
> >
> >        Object onLastNameChanged(String lastName) {
> >
> >                _lastName = lastName;
> >                return _nameZone.getBody();
> >        }
> >
> >
> > My event methods are called for each key but are passed null strings.
> >
> > What have I missed?
> >
> >
> > Here are parts of my code ..
> >
> > .tml
> > ====
> >        <div class="formfield-wide">
> >                <t:textfield t:id="username" t:mixins="zoneUpdater"
> > zone="usernameZone" event="usernameChanged"  clientEvent="keyup"
> > class="formfield-wide-input" onfocus="ClearTextbox(this,
> > '${message:username}');" onblur="RestoreTextbox(this,
> > '${message:username}');" />
> >
> >        </div>
> >        <div class="formfield-wide">
> >        <t:zone t:id="usernameZone">${usernameMessage}</t:zone>
> >        </div>
> >        <div class="formfield-wide">
> >
> >                <t:textfield t:id="alias"  t:mixins="zoneUpdater"
> > zone="aliasZone" event="aliasChanged"  clientEvent="keyup"
> > class="formfield-wide-input" onfocus="ClearTextbox(this,
> > '${message:alias}');" onblur="RestoreTextbox(this,
> > '${message:alias}');" />
> >
> >        </div>
> >        <div class="formfield-wide">
> >        <t:zone t:id="aliasZone">${aliasMessage}</t:zone>
> >        </div>
> >
> > .java
> > ======
> >        @Log
> >
> >        Object onUserNameChanged(String userName) {
> >                this.username = userName;
> >                return usernameZone.getBody();
> >        }
> >
> >        @Log
> >        Object onAliasChanged(String alias) {
> >                this.alias = alias;
> >                return aliasZone.getBody();
> >
> >        }
> >
> >
> > /Gunnar
> >
> >
> > 2009/12/4 Thiago H. de Paula Figueiredo <th...@gmail.com>
> >
> > > Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp <
> > > gunnar.eketrapp@gmail.com> escreveu:
> > >
> > >  Hi!
> > >>
> > >
> > > Hi!
> > >
> > >  I just copied Inge's ZoneUpdater and by magic my registration page
> > >> startedto recieve events for each key pressed in the field that I had
> > >> instrumented with it.
> > >>
> > >> BUT by some reason the string passed is null and I must have missed
> > >> something.
> > >>
> > >
> > > If you don't submit the form, the entered values will not be sent to
> the
> > > page.
> > >
> > >
> > >  When I look at the JumpStart example I noticed that the field names
> have
> > >> underscores in them in the java class.
> > >> Is this needed ?
> > >>
> > >
> > > No. This is just a convention that some people use.
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > > and instructor
> > > Owner, software architect and developer, Ars Machina Tecnologia da
> > > Informação Ltda.
> > > http://www.arsmachina.com.br
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > Allévägen 2A, 132 42 Saltsjö-Boo
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Re: ZoneUpdater -> null strings ...

Posted by Inge Solvoll <in...@gmail.com>.
Hi!

To begin with, use firebug to track requests sent to the server on your
keypresses. See what the urls look like, and if they contain the strings you
expect.

Inge

On Fri, Dec 4, 2009 at 1:26 PM, Gunnar Eketrapp
<gu...@gmail.com>wrote:

> Hi and thanks for the reply! Sorry for being stupid but in the JumpStart
> example ...
>
>   http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent
>
> ... the methods below gets called for each keypress with the actual field
> content.
>
>        Object onFirstNameChanged(String firstName) {
>                _firstName = firstName;
>                return _nameZone.getBody();
>        }
>
>        Object onLastNameChanged(String lastName) {
>
>                _lastName = lastName;
>                return _nameZone.getBody();
>        }
>
>
> My event methods are called for each key but are passed null strings.
>
> What have I missed?
>
>
> Here are parts of my code ..
>
> .tml
> ====
>        <div class="formfield-wide">
>                <t:textfield t:id="username" t:mixins="zoneUpdater"
> zone="usernameZone" event="usernameChanged"  clientEvent="keyup"
> class="formfield-wide-input" onfocus="ClearTextbox(this,
> '${message:username}');" onblur="RestoreTextbox(this,
> '${message:username}');" />
>
>        </div>
>        <div class="formfield-wide">
>        <t:zone t:id="usernameZone">${usernameMessage}</t:zone>
>        </div>
>        <div class="formfield-wide">
>
>                <t:textfield t:id="alias"  t:mixins="zoneUpdater"
> zone="aliasZone" event="aliasChanged"  clientEvent="keyup"
> class="formfield-wide-input" onfocus="ClearTextbox(this,
> '${message:alias}');" onblur="RestoreTextbox(this,
> '${message:alias}');" />
>
>        </div>
>        <div class="formfield-wide">
>        <t:zone t:id="aliasZone">${aliasMessage}</t:zone>
>        </div>
>
> .java
> ======
>        @Log
>
>        Object onUserNameChanged(String userName) {
>                this.username = userName;
>                return usernameZone.getBody();
>        }
>
>        @Log
>        Object onAliasChanged(String alias) {
>                this.alias = alias;
>                return aliasZone.getBody();
>
>        }
>
>
> /Gunnar
>
>
> 2009/12/4 Thiago H. de Paula Figueiredo <th...@gmail.com>
>
> > Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp <
> > gunnar.eketrapp@gmail.com> escreveu:
> >
> >  Hi!
> >>
> >
> > Hi!
> >
> >  I just copied Inge's ZoneUpdater and by magic my registration page
> >> startedto recieve events for each key pressed in the field that I had
> >> instrumented with it.
> >>
> >> BUT by some reason the string passed is null and I must have missed
> >> something.
> >>
> >
> > If you don't submit the form, the entered values will not be sent to the
> > page.
> >
> >
> >  When I look at the JumpStart example I noticed that the field names have
> >> underscores in them in the java class.
> >> Is this needed ?
> >>
> >
> > No. This is just a convention that some people use.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> > and instructor
> > Owner, software architect and developer, Ars Machina Tecnologia da
> > Informação Ltda.
> > http://www.arsmachina.com.br
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>

Re: ZoneUpdater -> null strings ...

Posted by Gunnar Eketrapp <gu...@gmail.com>.
Hi and thanks for the reply! Sorry for being stupid but in the JumpStart
example ...

   http://202.177.217.122:8080/jumpstart/examples/javascript/ajaxonevent

... the methods below gets called for each keypress with the actual field
content.

	Object onFirstNameChanged(String firstName) {
		_firstName = firstName;
		return _nameZone.getBody();
	}

	Object onLastNameChanged(String lastName) {

		_lastName = lastName;
		return _nameZone.getBody();
	}


My event methods are called for each key but are passed null strings.

What have I missed?


Here are parts of my code ..

.tml
====
        <div class="formfield-wide">
        	<t:textfield t:id="username" t:mixins="zoneUpdater"
zone="usernameZone" event="usernameChanged"  clientEvent="keyup"
class="formfield-wide-input" onfocus="ClearTextbox(this,
'${message:username}');" onblur="RestoreTextbox(this,
'${message:username}');" />

        </div>
        <div class="formfield-wide">
        <t:zone t:id="usernameZone">${usernameMessage}</t:zone>
        </div>
        <div class="formfield-wide">

        	<t:textfield t:id="alias"  t:mixins="zoneUpdater"
zone="aliasZone" event="aliasChanged"  clientEvent="keyup"
class="formfield-wide-input" onfocus="ClearTextbox(this,
'${message:alias}');" onblur="RestoreTextbox(this,
'${message:alias}');" />

        </div>
        <div class="formfield-wide">
        <t:zone t:id="aliasZone">${aliasMessage}</t:zone>
        </div>

.java
======
	@Log

	Object onUserNameChanged(String userName) {
		this.username = userName;
		return usernameZone.getBody();
	}

	@Log
	Object onAliasChanged(String alias) {
		this.alias = alias;
		return aliasZone.getBody();

	}


/Gunnar


2009/12/4 Thiago H. de Paula Figueiredo <th...@gmail.com>

> Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp <
> gunnar.eketrapp@gmail.com> escreveu:
>
>  Hi!
>>
>
> Hi!
>
>  I just copied Inge's ZoneUpdater and by magic my registration page
>> startedto recieve events for each key pressed in the field that I had
>> instrumented with it.
>>
>> BUT by some reason the string passed is null and I must have missed
>> something.
>>
>
> If you don't submit the form, the entered values will not be sent to the
> page.
>
>
>  When I look at the JumpStart example I noticed that the field names have
>> underscores in them in the java class.
>> Is this needed ?
>>
>
> No. This is just a convention that some people use.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo

Re: ZoneUpdater -> null strings ...

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 04 Dec 2009 08:46:31 -0200, Gunnar Eketrapp  
<gu...@gmail.com> escreveu:

> Hi!

Hi!

> I just copied Inge's ZoneUpdater and by magic my registration page  
> startedto recieve events for each key pressed in the field that I had  
> instrumented with it.
> BUT by some reason the string passed is null and I must have missed
> something.

If you don't submit the form, the entered values will not be sent to the  
page.

> When I look at the JumpStart example I noticed that the field names have
> underscores in them in the java class.
> Is this needed ?

No. This is just a convention that some people use.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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