On Feb 17, 2009, at 2/174:28 PM , Thiago H. de Paula Figueiredo wrote:

Em Tue, 17 Feb 2009 19:17:19 -0300, Piero Sartini <li...@pierosartini.de > escreveu:

Thank you so much.. it works! :-)

Does it work? Nice! I have never tried something like I suggested! :D

I will write down a short howto in the wiki tomorrow. (is the wiki open to everyone?)

Open to everyone and your howto will be very useful, as this kind of questions arises ofter in this mailing list.

But you are right... the code really looks not that nice compared to the elegance tapestry is providing in other areas. Maybe that's the reason why I was under the impression that there has to be another way.

Tapestry's issue trackes is also open to everyone: https://issues.apache.org/jira/browse/TAP5 . You can file a JIRA (issue) to ask for a better way to get a block from a page or component without having to @Inject it.

How about:

@Inject
private ComponentResources resources;

public Block getBlock() {
        return resources.getBlock("someid");
        //alternative:
        //return resources.findBlock("someid");
//difference: getBlock throws a runtime exception if no block with the matching id is found; findBlock returns null.
}

Cheers,

Robert

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

Reply via email to