[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: Can EventLink be created as default for component parameters ?
From:       "Thiago H. de Paula Figueiredo" <thiagohp () gmail ! com>
Date:       2010-11-28 22:58:03
Message-ID: op.vmwkqyd018r83n () arsmachina
[Download RAW message or body]

On Sun, 28 Nov 2010 05:53:30 -0200, Alessio Gambi <agambi81@gmail.com>  
wrote:

> Hi folks,

Hi!

> I am stuck in this and apparently I am not able to understand why.
> I have a page containing a single component of type *TestEvent *(the  
> code is pasted below).
> Basically the component has a parameter (of type String) that must be  
> filled by default with an eventLink.

I'm sorry, but this doesn't make any sense. EventLink is a component, not  
a String. I guess you're confusing a component (EventLink) with the event  
itself (which is just a name, i.e., a String). And the return value of  
createEventLink is a Link, not an EventLink.

>     public String defaultLink(){
>         return resources.createEventLink("testEvent", new
> Object[]{}).toString();
>     }

What about just receiving the event *name* instead of an EventLink  
instance?
By the way, you can just use createEventLink("eventName") without passing  
other parameters. ;)

>     @BeginRender
>     void outputDiv(MarkupWriter writer){
>         writer.element("div", new Object[]{});

This line is way better written as writer.element("div"); ;)

-- 
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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic