You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shing Hing Man <ma...@yahoo.com> on 2005/04/12 13:15:48 UTC

ANN : Revised Tooltip component

Dear all,
   The last version of my tooltip component has a bug 
regarding to the positioning of the tooltip when there
is scrolling. This has been fixed. The position of the
tooltip is now in sync with the scrollbars.

The following features have been added.
1) A staticFlag parameter to indicate whether the
tooltip would move with the mouse.
2) A timeout parameter to specify how long  the
tooltip would be visible.

The tooltip component has only been tested on 
Mozillia 1.5 and IE 6.

A revised demo is available on

http://gauss.demon.co.uk/tapestryDemo/

The source and binary could be downloaded from
http://equalitylearning.org/Tassel/app

regards,
Shing



Home page :
  http://uk.geocities.com/matmsh/index.html

Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Re: Page as abstract class or not

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 12, 2005, at 10:25 AM, Joey Gibson wrote:
> On 4/12/2005 08:49, Erik Hatcher wrote:
>>> 2. Directly in the Page class, in this case, the page does not need 
>>> to
>>> be abstract. I then have to write my own getter and setter.
>>
>>
>> And in this case you also need to clear the values in initialize()
>> (which gets called *after* the page is done and is being initialized 
>> to
>> be put back into the page pool).
>
> So are you saying that if you implement a getter/setter yourself, and
> you have instance variables, you have to reset/unset these instance
> variables by overriding the initialize() method?

Yes.  Emphatically yes!  Otherwise another user will see that data as 
that same page instance will be used for another request.

In Struts, for example, the same issue applies with Action's.  They are 
not to maintain their own state unless you want the hassle of managing 
it fully knowing how things are pooled.

>  I don't remember seeing
> that in Howard's book.

I'm sure its in there, but I don't have the book handy to provide a 
reference.

>> Yes - use <property-specification> and do not use instance variables.
>
> The only way to get at data that is more complicated that a simple
> variable like, say, the address from the current person, is to provide
> your own getter, right? Or provide a getter to return the person and 
> get
> at the address using ognl, which seems a bit sloppy to me.

I'm not following exactly.  If your page has a <property-specification> 
for a Person object, components could easily get at "person.address" 
with OGNL expressions.

Instance variables aren't bad, it just requires that you manage the 
state knowing that the page instance will likely be reused by another 
request.

>>>  What do I gain by going with the  <property-specification> ?
>>
>> Peace of mind.
>
> I use <property-specification> when I don't need anything other than a
> variable, don't care what it's called, etc. But for more complicated
> operations, this isn't an option, is it? Am I missing something?

That's not the case.  <property-specification> works for any type of 
object, and OGNL expressions can get at any piece of that object.  This 
topic is more on the .java side of things and whether to use abstract 
getters/setters for a property or to implement your own concrete 
getters/setters and maintain data in instance variables.

	Erik


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


Re: Page as abstract class or not

Posted by Joey Gibson <jo...@joeygibson.com>.
On 4/12/2005 08:49, Erik Hatcher wrote:
>> 2. Directly in the Page class, in this case, the page does not need to
>> be abstract. I then have to write my own getter and setter.
> 
> 
> And in this case you also need to clear the values in initialize()
> (which gets called *after* the page is done and is being initialized to
> be put back into the page pool).

So are you saying that if you implement a getter/setter yourself, and
you have instance variables, you have to reset/unset these instance
variables by overriding the initialize() method? I don't remember seeing
that in Howard's book.


> Yes - use <property-specification> and do not use instance variables.

The only way to get at data that is more complicated that a simple
variable like, say, the address from the current person, is to provide
your own getter, right? Or provide a getter to return the person and get
at the address using ognl, which seems a bit sloppy to me.

>>  What do I gain by going with the  <property-specification> ?
> 
> Peace of mind.

I use <property-specification> when I don't need anything other than a
variable, don't care what it's called, etc. But for more complicated
operations, this isn't an option, is it? Am I missing something?

Joey


-- 
When the gun smoke settles, we'll sing a victory tune
 and we'll all meet back at the local saloon...

Jobkabob: http://www.jobkabob.com
Jobkabob News: http://www.jobkabob.com/news

http://www.joeygibson.com/blog
http://www.joeygibson.com/blog/life/Wisdom.html


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


Re: Page as abstract class or not

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 12, 2005, at 8:06 AM, Bruno Haas wrote:
> I have written a "hello world" tapestry application that works fine. 
> Being new to the whole tapestry framework, I have a question that I 
> could not find an answer for in the user/developer's manual:
>
> It looks like page properties can be defined two ways:
>
> 1. In the page spec using <property-specification>, in this case, the 
> page class needs to be abstract and the getter and setter for the 
> property need to be defined abstract too. Tapestry will then 
> apparently automatically instanciate a derived calls implementing the 
> getter and setter.

You do not need to implement abstract getters/setters to get/set a 
property.  You can use getProperty/setProperty also.  I prefer this 
myself as the abstract thing annoys me.

> 2. Directly in the Page class, in this case, the page does not need to 
> be abstract. I then have to write my own getter and setter.

And in this case you also need to clear the values in initialize() 
(which gets called *after* the page is done and is being initialized to 
be put back into the page pool).

> So what is the actual difference between those two ways of doing 
> things ?

The difference is who manages the state of the properties.  
<property-specification> is managed by Tapestry.  Putting in your own 
concrete getters/setters and having instance variables to hold that 
mean you have to manage the state yourself or risk other requests 
getting unintended data.

>  Is there a recommended way ?

Yes - use <property-specification> and do not use instance variables.

>  What do I gain by going with the  <property-specification> ?

Peace of mind.

	Erik


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


Page as abstract class or not

Posted by Bruno Haas <gr...@laposte.net>.
Hi,

I have written a "hello world" tapestry application that works fine. 
Being new to the whole tapestry framework, I have a question that I 
could not find an answer for in the user/developer's manual:

It looks like page properties can be defined two ways:

1. In the page spec using <property-specification>, in this case, the 
page class needs to be abstract and the getter and setter for the 
property need to be defined abstract too. Tapestry will then apparently 
automatically instanciate a derived calls implementing the getter and 
setter.

2. Directly in the Page class, in this case, the page does not need to 
be abstract. I then have to write my own getter and setter.

So what is the actual difference between those two ways of doing things 
? Is there a recommended way ? What do I gain by going with the  
<property-specification> ?

Thanks a lot
Bruno

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


Re: ANN : Revised Tooltip component

Posted by liigo <li...@hotpop.com>.
在 Tue, 12 Apr 2005 19:15:48 +0800,Shing Hing Man <ma...@yahoo.com> 写道:

> The tooltip component has only been tested on
> Mozillia 1.5 and IE 6.

It works ok in opera!

> A revised demo is available on
> http://gauss.demon.co.uk/tapestryDemo/
> The source and binary could be downloaded from
> http://equalitylearning.org/Tassel/app
> regards,
> Shing




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