You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by membersound <me...@web.de> on 2012/11/24 13:53:09 UTC

How to detect if input field loses focus?

HI,

I know I can catch client events like t:clientEvent="keyup".
But how can I detect if the focus of an input field is lost (eg by TAB or
just by clicking into another input field)?

Thanks for any hints



--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-detect-if-input-field-loses-focus-tp5718225.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: How to detect if input field loses focus?

Posted by membersound <me...@web.de>.
Thanks, that's nice.

I also just found the ajax OnEvent example very useful.
Just changed the keyup event to "blur" and voila, that's exactly what I
needed.
(http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/onevent)



--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-detect-if-input-field-loses-focus-tp5718225p5718257.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: How to detect if input field loses focus?

Posted by Geoff Callender <ge...@gmail.com>.
Have a look at JumpStart's AjaxValidator mixin. It observes change of focus. You might need to observe blur and change too:

	http://localhost:8080/jumpstart/examples/ajax/validators1

Cheers,

Geoff

On 25/11/2012, at 5:39 AM, Thiago H de Paula Figueiredo wrote:

> On Sat, 24 Nov 2012 11:20:10 -0200, membersound <me...@web.de> wrote:
> 
>> Thanks, ok then let my question tapestry-related:
>> 
>> Is is possible to attach some kind of "listener" to a @Property String
>> variable? So that whenever the property is changed by interface, the
>> listener detects it and comes in?
> 
> Server-side, you have the validate event triggered by the form field components.
> 
>> I've done this with JSF sometimes, is it also possible in T without JS?
> 
> You really don't want to write any JavaScript code, right? :P
> 
> -- 
> Thiago H. de Paula Figueiredo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 


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


Re: How to detect if input field loses focus?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sat, 24 Nov 2012 11:20:10 -0200, membersound <me...@web.de> wrote:

> Thanks, ok then let my question tapestry-related:
>
> Is is possible to attach some kind of "listener" to a @Property String
> variable? So that whenever the property is changed by interface, the
> listener detects it and comes in?

Server-side, you have the validate event triggered by the form field  
components.

> I've done this with JSF sometimes, is it also possible in T without JS?

You really don't want to write any JavaScript code, right? :P

-- 
Thiago H. de Paula Figueiredo

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


Re: How to detect if input field loses focus?

Posted by membersound <me...@web.de>.
Thanks, ok then let my question tapestry-related:

Is is possible to attach some kind of "listener" to a @Property String
variable? So that whenever the property is changed by interface, the
listener detects it and comes in?

I've done this with JSF sometimes, is it also possible in T without JS? 



--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-detect-if-input-field-loses-focus-tp5718225p5718232.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: How to detect if input field loses focus?

Posted by Geoff Callender <ge...@gmail.com>.
I meant: 

	http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/reusable

On 25/11/2012, at 12:16 AM, Geoff Callender wrote:

> Yep, this really isn't a Tapestry question. In JavaScript you may need to listen to "focus", "blur", and "change" events. Perhaps this will help:
> 
> 	http://localhost:8080/jumpstart/examples/javascript/reusable
> 
> Cheers,
> 
> Geoff
> 
> On 25/11/2012, at 12:11 AM, membersound wrote:
> 
>> I thought this would be a clear question.
>> 
>> Ok, example:
>> <input t:type="TextField" t:id="firstName" t:mixins="zoneUpdater"
>> t:clientEvent="keyup" t:event="firstNameChanged" t:zone="nameZone" />
>> 
>> Instead of "keyup" I'm looking for some event that is triggered whenever the
>> user leaves the textfield (either but hitting TAB or clicking into another
>> field).
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-detect-if-input-field-loses-focus-tp5718225p5718228.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
>> 
> 


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


Re: How to detect if input field loses focus?

Posted by membersound <me...@web.de>.
Thanks, ok then let my question tapestry-related:

Is is possible to attach some kind of "listener" to a @Property String
variable? So that whenever the property is changed by interface, the
listener detects it and comes in?

I've done this with JSF sometimes, is it also possible in T without JS?



--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-detect-if-input-field-loses-focus-tp5718225p5718231.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: How to detect if input field loses focus?

Posted by Geoff Callender <ge...@gmail.com>.
Yep, this really isn't a Tapestry question. In JavaScript you may need to listen to "focus", "blur", and "change" events. Perhaps this will help:

	http://localhost:8080/jumpstart/examples/javascript/reusable

Cheers,

Geoff

On 25/11/2012, at 12:11 AM, membersound wrote:

> I thought this would be a clear question.
> 
> Ok, example:
> <input t:type="TextField" t:id="firstName" t:mixins="zoneUpdater"
> t:clientEvent="keyup" t:event="firstNameChanged" t:zone="nameZone" />
> 
> Instead of "keyup" I'm looking for some event that is triggered whenever the
> user leaves the textfield (either but hitting TAB or clicking into another
> field).
> 
> 
> 
> 
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-detect-if-input-field-loses-focus-tp5718225p5718228.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
> 


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


Re: How to detect if input field loses focus?

Posted by membersound <me...@web.de>.
I thought this would be a clear question.

Ok, example:
<input t:type="TextField" t:id="firstName" t:mixins="zoneUpdater"
t:clientEvent="keyup" t:event="firstNameChanged" t:zone="nameZone" />

Instead of "keyup" I'm looking for some event that is triggered whenever the
user leaves the textfield (either but hitting TAB or clicking into another
field).




--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-detect-if-input-field-loses-focus-tp5718225p5718228.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: How to detect if input field loses focus?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sat, 24 Nov 2012 10:53:09 -0200, membersound <me...@web.de> wrote:

> HI,

Hi!

> I know I can catch client events like t:clientEvent="keyup".
> But how can I detect if the focus of an input field is lost (eg by TAB or
> just by clicking into another input field)?

Due to your vague question, I'll give you a vague answer: plain old  
non-Tapestry-specific JavaScript. :)

-- 
Thiago H. de Paula Figueiredo

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


obtaining locale in page classes

Posted by John <jo...@quivinco.com>.
I want to format some numbers that are returned as String type properties on a page.

In the page class how do I detect the locale so that I can create the right formatter?

If I use a Grid and just returned the numbers as objects (Long or Integer) is there an easy way to get the Grid to format the numbers for me?