There's been a few backwards-incompatible changes from 5.1 to 5.2, I
think it would be helpful to have a place where these are documented.
Since you can't edit the wiki until you sign and mail/fax/scan & email
a license agreement, we can document them here and let someone with
access make the wiki page for it.

This should probably be split in to a few sections, maybe like this:
1. necessary changes for all applications (eg changed behavior of
Link.toAbsoluteURI())
2. suggested changes for all applications (eg use IncludeStylesheet is
deprecated, use Import)

I'm not sure if there are any changes that meet these criteria, but if
there are they should be split up too:
3. necessary changes for applications that implemented/extended public apis
4. suggested changes for applications that implemented/extended public apis

Here are the ones I know of right now:
1. Necessary changes for all applications
 - Page classes with instance variables that are not thread safe must
be created in a method rather than declared. For example, creating an
instance variable "private final DateFormat format =
DateFormat.getDateInstance(DateFormat.MEDIUM, locale);" in a page and
using it will cause problems because DateFormat is not thread safe.
Instead, you must create the DateFormat in a method. See
https://cwiki.apache.org/confluence/display/TAPESTRY/Release+Notes+5.2.0
for details.

 - Link.toAbsoluteURI() now returns a full URI rather than just the
path. Previously it would return, for example, "/myapp/viewproduct/4".
Now it returns "http://example.com:8080/myapp/viewproduct/4";. All
calls to toAbsoluteURI() should be replaced with toURI(). (I got hit
with this problem - I was generating links for an RSS feed and
prepending http://mydomain.com, so after upgrading the URLs were
http://mydomain.comhttp://mydomain.com:8080/viewproduct/4)

 - Label component no longer outputs an id (credit to Andy Blower for
noticing). Previously valid code in 5.1.0.5:
<t:form>
<t:label for="search"/>
<t:textfield t:id="search" size="50"/>
</t:form>
Combined with Javascript that references the id:
jQuery('#search-label').text('This is the search label');

New javascript code for 5.2:
jQuery('label[for=search]').text('This is the search label');

2. Suggested changes for all applications:
 - Replace @IncludeStylesheet and @IncludeJavaScriptLibrary with @Import.

Donny

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

Reply via email to