Re: Tapestry 5.3.5

2012-08-30 Thread robert baker
Tapestry Team,

It should be explicitly said: Thanks for the continued development on
Tapestry 5.

Les Baker

On Thu, Aug 30, 2012 at 2:42 PM, Christian Riedel
 wrote:
> Yay, that would make 2 more releases before christmas!
>
>
> Am 30.08.2012 um 19:47 schrieb Howard Lewis Ship:
>
>> Catch it while it's hot!  Yet another bug fix release for 5.3:
>>
>> Apache Tapestry 5.3.5
>>
>> http://tapestry.apache.org/2012/08/30/announcing-tapestry-535.html
>>
>> There may be an issue with DateField inside Internet Explorer that
>> will have to be addressed in 5.3.6.  Since the switch from SVN to Git
>> (and from Maven to Gradle) it has become much easier to backport fixes
>> and generate releases.  We've created six releases since last November
>> ... that's about one every two months.
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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



Hidden component semantics changed (was Re: [5.3.4] Ordering of Actions...)

2012-08-05 Thread robert baker
Howard (and list),

After doing some more research, I found the issue, and it didn't have
anything to do with the ordering of render phases (I apologize for
that).

What happened was that the ValueEncoder in question was coded to
create a blank object (i.e. "null object" pattern) on a null value in
its toValue implementation. Due to the fix for issue TAP5-832 [1] the
data flow was changed to include NullFieldStrategy, like the TextField
does, and bypass the ValueEncoder if the Strategy returns null. The
bypass caused the null value and the resulting "null term in property"
exception, and the fix was to pass a "blank string" NullFieldStrategy
(returns "") to the Hidden component.

Hopefully, a brief note could be included in the 5.3 migration notes
to check one's ValueEncoders that participate in Hidden component
persistence.

(Yes, I definitely am looking forward to what's coming in 5.4 even
just based on the "JavaScript Rewrite" document that was posted.)

Thanks,
Les Baker

[1] https://issues.apache.org/jira/browse/TAP5-832

On Fri, Aug 3, 2012 at 1:43 PM, Howard Lewis Ship  wrote:
> And, BTW, because having the server-side figure all this stuff out
> based on the meager flow of data possible from a HTTP Form submission
> is impossible (at least, once you add DHTML/Ajax to the picture) ...
> that's why 5.4 is looking to move away from FormFragment and a lot of
> the other stuff, to encourage client forms to submit JSON via Ajax and
> manage what goes to the server more directly, possibly using an MVC
> framework such as Bootstrap ... and that reasoning came out of our
> discussion at the training last year!
>
> On Fri, Aug 3, 2012 at 10:42 AM, Howard Lewis Ship  wrote:
>> Looks odd; the Hidden field should render first, and write its
>> ComponentActions into the Form first, and should then be processed
>> first.
>>
>> Is your template really this simple, or is there more FormFragment,
>> etc., trickiness in there?  That might affect the ordering if the
>> Hidden and the TextField were in different fragments (as each fragment
>> has its own t:formdata, and order of operations is not well defined).
>>
>> On Fri, Aug 3, 2012 at 1:27 AM, robert baker  wrote:
>>> It occurred to me after I typed this that my assumptions were probably
>>> wrong, so please disregard.
>>>
>>> Apologies,
>>> Les Baker
>>>
>>> On Fri, Aug 3, 2012 at 4:04 AM, robert baker  
>>> wrote:
>>>> Hi,
>>>>
>>>> I've stumbled on an interesting problem in trying to upgrade to 5.3.4
>>>> that I am stumped. I am getting a "null term in property expression"
>>>> exception with some template markup that looks like the following:
>>>>
>>>> ...
>>>> 
>>>> 
>>>> ...
>>>>
>>>> Just to be clear: the "primaryCode" object is wired up in the page
>>>> class and has a getCode method. There is also an appropriate
>>>> ValueEncoder contributed to the ValueEncoderSource service, it is
>>>> getting instantiated, and in its toValue() method, the encoder will
>>>> try to retrieve the object from a DAO and return a "blank object"
>>>> (non-null) otherwise.
>>>>
>>>> After doing some digging, the toValue method on the above ValueEncoder
>>>> doesn't get called (in time). Looking at the sources for the TextField
>>>> and Hidden components:
>>>> * The ComponentAction in the TextField that writes to its value
>>>> parameter during form submission gets queued up during the SetupRender
>>>> phase (see corelib/base/AbstractField.java line 164), however
>>>> * The ComponentAction in the Hidden component that restores its value
>>>> parameter gets queued up during BeginRender (see
>>>> corelib/components/Hidden.java line 121). Therefore,
>>>> * During form submission, the TextField's Action executes before the
>>>> Hidden's Action, but it should execute in the opposite order.
>>>>
>>>> Is this an unintended consequence, or something that I am missing?
>>>> This can be worked around, but it seems like it would be a common use
>>>> case.
>>>>
>>>> Thanks,
>>>> Les Baker
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>
>>
>>
>> --
>&g

Re: [5.3.4] Ordering of Actions between the TextField and Hidden components

2012-08-03 Thread robert baker
It occurred to me after I typed this that my assumptions were probably
wrong, so please disregard.

Apologies,
Les Baker

On Fri, Aug 3, 2012 at 4:04 AM, robert baker  wrote:
> Hi,
>
> I've stumbled on an interesting problem in trying to upgrade to 5.3.4
> that I am stumped. I am getting a "null term in property expression"
> exception with some template markup that looks like the following:
>
> ...
> 
> 
> ...
>
> Just to be clear: the "primaryCode" object is wired up in the page
> class and has a getCode method. There is also an appropriate
> ValueEncoder contributed to the ValueEncoderSource service, it is
> getting instantiated, and in its toValue() method, the encoder will
> try to retrieve the object from a DAO and return a "blank object"
> (non-null) otherwise.
>
> After doing some digging, the toValue method on the above ValueEncoder
> doesn't get called (in time). Looking at the sources for the TextField
> and Hidden components:
> * The ComponentAction in the TextField that writes to its value
> parameter during form submission gets queued up during the SetupRender
> phase (see corelib/base/AbstractField.java line 164), however
> * The ComponentAction in the Hidden component that restores its value
> parameter gets queued up during BeginRender (see
> corelib/components/Hidden.java line 121). Therefore,
> * During form submission, the TextField's Action executes before the
> Hidden's Action, but it should execute in the opposite order.
>
> Is this an unintended consequence, or something that I am missing?
> This can be worked around, but it seems like it would be a common use
> case.
>
> Thanks,
> Les Baker

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



[5.3.4] Ordering of Actions between the TextField and Hidden components

2012-08-03 Thread robert baker
Hi,

I've stumbled on an interesting problem in trying to upgrade to 5.3.4
that I am stumped. I am getting a "null term in property expression"
exception with some template markup that looks like the following:

...


...

Just to be clear: the "primaryCode" object is wired up in the page
class and has a getCode method. There is also an appropriate
ValueEncoder contributed to the ValueEncoderSource service, it is
getting instantiated, and in its toValue() method, the encoder will
try to retrieve the object from a DAO and return a "blank object"
(non-null) otherwise.

After doing some digging, the toValue method on the above ValueEncoder
doesn't get called (in time). Looking at the sources for the TextField
and Hidden components:
* The ComponentAction in the TextField that writes to its value
parameter during form submission gets queued up during the SetupRender
phase (see corelib/base/AbstractField.java line 164), however
* The ComponentAction in the Hidden component that restores its value
parameter gets queued up during BeginRender (see
corelib/components/Hidden.java line 121). Therefore,
* During form submission, the TextField's Action executes before the
Hidden's Action, but it should execute in the opposite order.

Is this an unintended consequence, or something that I am missing?
This can be worked around, but it seems like it would be a common use
case.

Thanks,
Les Baker

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



Re: [T5.2.6] Component class transformation on initialized private instance fields

2012-01-09 Thread robert baker
Hey I just wanted to thank you both (Josh and Thiago) before I forget;
this helped solve a tough production bug that was affecting a lot of
people.

I wanted to write a doc snippet to go in the Component Classes page in
the guide under "Transient Instance Variables" in a warning
box/pullout after the first paragraph, rewording and summing up what
you both have said:

"""
Never initialize an instance field to a mutable object at the point of
declaration.  If this is done, the instance created from that
initializer becomes the default value for that field and is reused
inside the component on every request.  This could cause state to
inadvertently be shared between different sessions in an application.
"""

I don't know who to send it to or if there is a documentation manager,
but the above is public domain if (s)he wants it.

Thanks,
Les Baker

On Thu, Jan 5, 2012 at 5:53 AM, Thiago H. de Paula Figueiredo
 wrote:
> On Thu, 05 Jan 2012 03:35:53 -0200, robert baker 
> wrote:
>
>> Hi all,
>
>
> Hi!
>
>
>> When a page/component is transformed (in version 5.2.6) and there is a
>> field like the following:
>>
>> private List aList = new ArrayList();
>
>
> You should never, never, never, ever initialize a component, page or mixin
> field in its declaration unless it's an atomic value (primitive types,
> String, wrappers, immutable data).
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br

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



Re: The best way to use Stacks to combine css and javascript?

2012-01-04 Thread robert baker
Would it be possible to put all three in one stack, or does 1.css and
3.css have conflicting rules?

I think the intended use of the stack functionality was to make an all
(or mostly) inclusive one for your entire app/library and re-use it in
many places; the rationale being that the savings in number of
requests (and the corresponding overhead) outweighs the slight
increase in size.


On Thu, Jan 5, 2012 at 12:05 AM, Bo Gao  wrote:
> I want to use stacks to combine many small Css and Javascript to reduce HTTP 
> requests.
> I see tapestry use this to combine many javascript files into a core.js.
>
> I have 2 pages for example:
>
> page1 depends on 1.css, 2.css
> page2 depends on 2.css, 3.css
>
> If I want to minimize HTTP request on these pages, what's the best way to 
> create stacks?
> In my thought, I create page1stack.java to combine 1.css and 2.css, and 
> page2stack.java to combine 2.css and 3.css.
> But I think it's not easy to use. I must create many stacks. Is there another 
> better way to use stack?
>
> Thanks.
>
>
> --
> Bo Gao
> eli...@gmail.com
>
>
>
>
>
>

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



[T5.2.6] Component class transformation on initialized private instance fields

2012-01-04 Thread robert baker
Hi all,

When a page/component is transformed (in version 5.2.6) and there is a
field like the following:

private List aList = new ArrayList();

Does the inline initialization claim the field at transformation-time
so that it is not cleared during request detachment?

("Claim" as in what the @Retain annotation would do in vers. 5.1.0.5 and prior.)

I looked in the online manual for information about this but didn't
find anything in the places I looked, and quickly got over my head
(for the short time I had) in the source.  I'm trying to debug a
problem (data bleeding over into other sessions) with a coworker's
page class and a "yes" answer to the above would complete the circle,
so to speak.

Thanks very much,
Les Baker

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



Re: ajax improvements in 5.3

2012-01-02 Thread robert baker
Hi,

Here's what I do to do to raise an arbitrary AJAX event on a component:
1. Inject ComponentResources into the component (let's say the
variable is named "resources").
2. In the component's setupRender handler, call
resources.createEventLink and store the returned Link in a field.  You
can bake or curry values into the returned Link (using the second
argument) so it will always call the event handler with those values.
3. Pass link.toUri() to client javascript you write using
JavaScriptSupport. I usually prefer to use addInitializerCall (in the
afterRender handler) and create an object in the Tapestry.Initializer
namespace in a separate JS file, passing a single configuration object
made with JSONObject in the component.
4. In the JavaScript, execute "new Ajax.Request" or
"Tapestry.ajaxRequest" on the URI (see prototype docs and/or
tapestry.js for details).
5. The event handler "onXyzzy" gets executed (assuming you passed
"xyzzy" to createEventLink).

Hope this helps,
Les Baker

On Tue, Jan 3, 2012 at 1:08 AM, Paul Stanton  wrote:
> Hi all,
>
> I've started using T5.3 for the latest project and am migrating some of the
> ajax api 'extensions' I had to write in order to become productive.
>
> I've noticed that much has improved since T5.1 and am eager to make sure
> that I am not missing out on further improvements by re-implementing my old
> hacks! I used to rely heavily on there being a "dummyZone" - an empty zone
> on every page used to wire up miscellaneous functionality.
>
> Specifically,
>
> 1. Is there a better way to invoke ajax requests (similar to eventlink)
> direct from javascript than the method detailed here:
> https://issues.apache.org/jira/browse/TAP5-1405
> ?
>
> 2. Is there a way to construct an ajax callback (ie eventlink, directlink,
> form etc) without a specifying a zone? - ie, is the 'zone' parameter still
> the only way to transform an eventlink into an async-eventlink and if a
> non-existant zone is specified, does it fail?
> (this would be handy when the ajax callback returns only javascript commands
> or when zone updates are generated dynamically and there is no definitive
> zone to update).
> - i think i logged a jira for this, but can't find it.
>
> Thanks, Paul.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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



Re: Show your Tapestry support!

2011-12-01 Thread robert baker
For what it's worth, I registered and put in my $(1/50).  Thanks
Howard for letting us know about the announcement.

Les Baker

On Thu, Dec 1, 2011 at 4:21 PM, Howard Lewis Ship  wrote:
> Ok folks, time to strike while the iron's hot.  Major release
> announcements are a great way to get people interested in Tapestry. I
> can't tell you how many times I've met with people who have "heard
> good things about Tapestry" but "don't know what it's all about".
> Seeing an outpouring of support on a release announcement is one way
> to tip the balance towards more people looking at Tapestry ... and
> that's good for *everyone*. The more people using Tapestry, the easier
> it is for me, and the other Tapestry committers, to continue extending
> and improving the project.
>
> So, if all you've ever done with Tapestry is take it, and not give
> back, then now's a very good time to start making a small
> contribution: a one line posting about Tapestry to the JavaLobby
> announcement!
>
> On Wed, Nov 30, 2011 at 5:13 PM, Howard Lewis Ship  wrote:
>> First five comments are nice, but I'd like to see 50, or 500, comments!
>>
>> On Wed, Nov 30, 2011 at 8:30 AM, Howard Lewis Ship  wrote:
>>> The Tapestry 5.3 announcement has hit JavaLobby:
>>>
>>> http://java.dzone.com/announcements/announcing-apache-tapestry-53
>>>
>>> Now is an excellent time to post a short comment showing your support
>>> for Tapestry.  It's a small thing you can do that can make a big, big
>>> difference in the long term.
>>>
>>> Please don't start any flamewars, or bash other frameworks, just say
>>> (in your own words) "Tapestry lets me get great results".
>>>
>>> Thanks!
>>>
>>> --
>>> Howard M. Lewis Ship
>>>
>>> Creator of Apache Tapestry
>>>
>>> The source for Tapestry training, mentoring and support. Contact me to
>>> learn how I can get you up and productive in Tapestry fast!
>>>
>>> (971) 678-5210
>>> http://howardlewisship.com
>>>
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

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



Re: [T5.2.6] Setting up IoC to allow ordered configuration of a pub/sub system

2011-11-29 Thread robert baker
Thiago,

I assume you were talking about the second part with the
contributeUserEventHub service contribution method?  The first snippet
of code works fine.

I had considered putting SessionTracker (the interface) in the
parameter list for the contribution method, but the consequences of
that is the SessionTracker interface must extend the UserEventListener
interface (the UserEventHub listener interface) to make the call to
addUserEventListener work without casting.

That means that SessionTracker clients have unnecessary methods in
their "API" that have to be documented not to be called by clients. I
didn't really want to do that.

I appreciate knowing that autobuild always makes a new instance,
though; that clarifies a few things.

Thanks again,
Les Baker

On Tue, Nov 29, 2011 at 3:09 PM, Thiago H. de Paula Figueiredo
 wrote:
> On Tue, 29 Nov 2011 18:04:33 -0200, robert baker 
> wrote:
>
>> Hi all,
>
>
> Hi!
>
>>    public static SessionTracker buildSessionTracker(
>>            @Autobuild SessionTrackerImpl sessionTrackerImpl,
>>            UserEventHub eventHub) {
>>
>>        eventHub.addUserEventListener(sessionTrackerImpl);
>>
>>        return sessionTrackerImpl;
>>    }
>>    public static void bind(ServiceBinder binder)
>>    {
>>        binder.bind(SessionTracker.class, SessionTrackerImpl.class);
>>        binder.bind(UserEventHub.class, UserEventHubImpl.class);
>>    }
>
>
> You shouldn't use @Autobuild for objects which are already configured as
> services, as @Autobuild will always instantiate a new instance. Without this
> annotation, this parameter will get the SessionTracker object from the
> Registry (i.e. the service registered in Tapestry-IoC).
>
> Try
> public static SessionTracker buildSessionTracker(SessionTracker
> sessionTracker,UserEventHub eventHub) (without @Autobuild)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br

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



[T5.2.6] Setting up IoC to allow ordered configuration of a pub/sub system

2011-11-29 Thread robert baker
Hi all,

I set up a service, UserEventHub, to send notifications of logon and
logoff application wide in our app.  Right now, one listener is wired
up to it, SessionTrackerImpl, an implementation class of another
service in my app, SessionTracker. (SessionTrackerImpl also implements
UserEventListener, the listener interface for the UserEventHub).  I
used a technique I saw in TapestryModule to wire the listener up;
here's what my AppModule.java looks like with regard to those two
services:


public class AppModule
{
public static void bind(ServiceBinder binder)
{
binder.bind(UserEventHub.class, UserEventHubImpl.class);
}

public static SessionTracker buildSessionTracker(
@Autobuild SessionTrackerImpl sessionTrackerImpl,
UserEventHub eventHub) {

eventHub.addUserEventListener(sessionTrackerImpl);

return sessionTrackerImpl;
}

// and so forth...
}


This works just fine.

However, let's say I wanted to have the ability to control the order
that objects get added, for example, as I add more objects to the hub,
I may want some listeners to get a log on notification before others
(say, for sake of argument, they were doing initialization where the
order of it was critical).  It seems like Tapestry IoC's configuration
facility would be the right solution for this.  Here's what I did:

public class AppModule
{
public static void bind(ServiceBinder binder)
{
binder.bind(SessionTracker.class, SessionTrackerImpl.class);
binder.bind(UserEventHub.class, UserEventHubImpl.class);
}

@Contribute(UserEventHub.class)
public static void contributeUserEventHub(
OrderedConfiguration configuration,
@Autobuild SessionTrackerImpl sessionTrackerImpl) {

configuration.add("SessionTracker", sessionTrackerImpl);
}
}


Now the service acts like it's getting built twice (which was causing
subtle, hair-tearing bugs).  I can kinda see how that is happening
(autobuilt parameter and the bind call), but how can I setup
contributions to UserEventHub that are also services themselves (that
need to be visible as such)?  Or is this even the right way to go
about this?

Does this make any sense?  Thanks so much in advance for any help provided.

Thanks,
Les Baker

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



Re: @Property and @Parameter

2011-08-29 Thread robert baker
Maybe I'm confused here, but @Parameter and @Property seem to be
orthogonal and not mutually exclusive.

(from the point-of-view of the component)
@Parameter : data flows from container to this field (and vice versa)
@Property : data flows from contained components to this field (and vice versa)

I've had components where both @Parameter and @Property were placed on
the same field, like when I wrapped a Checkbox.  (Though, most use
cases where you would put both annotations (like wrappers) seem to be
covered by publishing the necessary parameters.)

I think, though, the original problem that was put forth of having a
parameter constructor called at component instantiation time sounds
interesting.  I know that you can have a parameter programmatically
default if unbound, but I don't think there is a "shadow setter" that
you can wire to get called all the time for property-bound parameters.

Just my $.02

Thanks,
Les Baker

On Mon, Aug 29, 2011 at 10:52 AM, Taha Hafeez  wrote:
> Yes, please
>
> On Mon, Aug 29, 2011 at 8:20 PM, Jens Breitenstein  
> wrote:
>> Hi Taha, hi Josh!
>>
>> well, that's what my gut feeling told me too. Should I raise a jira issue?
>>
>>
>>
>> Am 29.08.11 16:36, schrieb Taha Hafeez:
>>>
>>> I agree.
>>>
>>> On Mon, Aug 29, 2011 at 7:41 PM, Josh Canfield
>>>  wrote:

 Sounds like a defect. If there is setter I can't think of a reason that
 @Parameter shouldn't use it.
 On Aug 29, 2011 6:15 AM, "Taha Hafeez"  wrote:
>
> @Parameters do not use setters. They create a conduit to set/get the
> values directly , so setters are never used.
>
> You can look at the code of ParameterWorker for details
>
> you can always use setupRender to setup things
>
> On Mon, Aug 29, 2011 at 6:16 PM, Jens Breitenstein

 wrote:
>>
>> Hi All!
>>
>> I tried to use a combination of @Property and @Parameter.
>>
>>
>> @Property(read = true, write = false)
>> @Parameter(required = true)
>> private String _myParam;
>>
>>
>> unfortunately it seems to be impossible to "intercept" a set in such a

 case
>>
>> // >>  NEVER CALLED
>> public void String setMyParam(final String param)
>> {
>>    _myParam = param;
>>    // do more...
>> }
>>
>>
>> Is there any reason this is not allowed?
>>
>>
>> Jens
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>>>
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
>
> --
> Regards
>
> Taha Hafeez Siddiqi (tawus)
> http://tawus.wordpress.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Does message catalog retrieval look at containing component/page catalogs?

2011-08-10 Thread robert baker
Hi all,

When you supply a message key, does Tapestry 5.1 scan the catalogs of
containing components and/or pages?

For example, if Index.tml contained component Foobar, and Foobar.tml
had a TextField with a t:id="xyzzy", would Index.properties get hit
for "xyzzy-label" after Foobar.properties gets examined? It doesn't
seem to (I know it looks at base class and the app catalogs).  I'm
doing a one-off component and it seems clunky to have to make a new
properties file just for one or two labels or error messages.

I searched the mailing list and didn't seem to find anything discussing this.

Thanks,
Les Baker

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



Tapestry principles/tips learned during training session

2011-08-06 Thread robert baker
Hi,

I've been in Tapestry training for the past week, have really enjoyed
it, and picked up some useful stuff along the way (if you've been
seeing "Clemson University" run across the tweet box, that was
connected with us).  Mr. Lewis-Ship really gave a broad and deep
overview of how Tapestry works (thank you!), and I thought I would
share some of the things I personally got out of it in hopes it would
help someone else learning the framework.


* Activation and passivation in Tapestry work in concert -- can't have
one w/o the other.
  - If you populate an instance variable on the page in onActivate,
return it back in onPassivate
  - PageLink asks for activation context using onPassivate if you
don't supply context parameter
  - May have to @InjectPage and supply what gets passivated beforehand
in some cases.

* Play around with page URLs and see what happens
  - What happens if you don't supply any activation context?
  - What happens if the activation context is garbage?
  - What happens if the activation context points to something you
shouldn't be able to access?

* Do work in baby steps -- just try to get *something* visible and
work from there.
  - Components should default as much as possible to aid this process.

* JavaScript is very sensitive about syntax and loose about semantics
-- watching Firebug debugger religiously during development of
non-trivial JS almost a must.
  - Any client-side IDs need to be passed down to client, or use
well-known class names on the client.

* Ajax: All about what happens when, and breaking up responsibility
between server and client.
  - Treat URLs going down to the client as immutable.
  - Can "bake in" data into the URL that will be passed back up as a
parameter on the handling method server-side using "context" parameter
on *Link, Form, ProgressiveDisplay components.
  - Keeping that in mind, what if you want to make an AJAX request
with dynamic number of parameters and/or with values not known at
render-time?  Use "parameters" object parameter on
Tapestry.ajaxRequest() to add query parameters to the AJAX request.

* If you're banging your head against the framework, it's okay to step
down to raw elements and do things manually.
  - Request service (and @RequestParameter on method parameters) and
template property expansions (e.g. ${blah}) a good bridge between page
class and raw elements (prop expands for render-time, request parms
for submit-time).

* Whatever tools you use, know them inside-out.


Thanks,
Les Baker

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