Re: Tapestry 5.1 exception "Could not find a coercion from type ..." on form submit

2009-06-12 Thread Robert Zeigler

Hi,

There was a change from using pkencoder to valueencoder (it's noted in  
the upgrade notes) in 5.1 for loops contained in forms.

See: http://tapestry.apache.org/tapestry5.1/upgrade.html
Particularly, the section:

"Release 5.1.0.0
Primary Key Encoder

This is the change between releases that is most likely to affect your  
upgrade."



Robert


On Jun 12, 2009, at 6/1210:23 AM , m!ga wrote:



Hi everyone. We just started migration from tapestry 5.0 to 5.1 and  
found a

lot of strange exeptions. Here is one of them.

page class:

public class Test {

@SuppressWarnings({"unused", "UnusedDeclaration"})
@Component(id = "form")
private Form form;

@Property
private SomeClass someClass;

@Property
private SomeClass[] someClasses = {new SomeClass("1"),new
SomeClass("2"),new SomeClass("3"),new SomeClass("4"),new  
SomeClass("5")};



public class SomeClass
{
private String s = "SomeClass ";

public SomeClass(String s)
{
this.s += s;
}
public String toString()
{
return s;
}
}
}


tml file:

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>



${someClass}





Works fine unless you try to submit form. It throws something like  
that:


Caused by: java.lang.IllegalArgumentException: Could not find a  
coercion
from type java.lang.String to type ru.kupivip.pages.shop.Test 
$SomeClass.

Available coe
rcions: Double --> Float, Float --> Double...bla bla bla...

It can be solved by not-so-good-looking-code like this:

private SomeClass someClass;

public Object getSomeClass()
{
return someClass;
}

public void setSomeClass(Object maybeSomeClass)
{
		someClass = maybeSomeClass != null && maybeSomeClass instanceof  
SomeClass

? (SomeClass) maybeSomeClass : null;
}

I've debugged the setter ant it seems that it is called 2 times:
1st time after onActivate phase
2nd time after onSubmit/onActivate

and 1st time the argument maybeSomeClass is not instance of  
SomeClass but

its toString() value!


--
View this message in context: 
http://www.nabble.com/Tapestry-5.1-exception--%22Could-not-find-a-coercion-from-type-...%22-on-form-submit-tp24001080p24001080.html
Sent from the Tapestry - User mailing list archive at Nabble.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: Switch from Prototype to jQuery?

2009-06-12 Thread Angelo Chen

Hi Onno,

I like what you are doing, keep us posted about your testing project,
Prototype free t5 app is something I'm dreaming of:)


Onno Scheffers-3 wrote:
> 
>>
>>
>>  Look forward to seeing what you come up with and I hope you enjoy the
>>> challenge!
>>>
>>
>> Me too! :) It's wonderful to know that people want to contribute to the
>> framework we love. ;)
> 
> 
> 
> Thanks guys.
> If anyone is interested, I'll be documenting my progress here:
> http://piraya-blog.blogspot.com
> 
> Current status: I have a web-project up and running and I'm able to switch
> between Prototype-mode and Non-prototype-mode (which leaves out the
> prototype libraries).
> $('elementId').activate is now Tapestry.activate('elementId') which means
> the first bit of Prototype-specific code is converted to plain Javascript.
> 
> Time to call it a day :)
> 
> 
> regards,
> 
> Onno
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Switch-from-Prototype-to-jQuery--tp21750338p24008860.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: Decoration passed by parameter. Possible?

2009-06-12 Thread Lukasz Jazgar
2009/6/12 Sergey Didenko :
> Could you help me, I can't understand how it is wired together.
>
> What is passed as its "by" parameter.

Generally, Block with  inside, which I name "decorator".

> Where the class Decorate is used?

Take a look at my former post.

Page.tml has ComplexComponent and passes to it block (="decorator") by
"titleDecorator" parameter.
Inside ComplexComponent template, there is Decorate component
surrounding part of template. "Decorator" from "titleDecorator"
parameter is passed by "by" parameter to Decorate.
Responsibility of Decorate component is to render its body inside
block (="decorator") passed by "by" parameter.

If you want, I can send you sources of Decorate and DecoratedBody
components, a little bit improved against DH's version.

Regards
Lukasz

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



Re: Switch from Prototype to jQuery?

2009-06-12 Thread Luther Baker
>
> It would be very nice to have Tapestry components be more Javascript
> framework agnostic, but pushing Howard (and the other committers too, they
> exist!, hehehe) to do this and not working on other issues (after all, this
> is all about fixing something that already works, just doesn't work as good
> as we wished) wouldn't be a wise thing to do.


Great thread and I'm really not trying to take away from the momentum - but
per this last idea ... I'd keep in mind that the one of Tapestry's goal is
to increase marketshare.

I'd suggest that, while Javascript agnosticism may not be the top priority
amongst *current* users, I think that in general, it ranks up there (along
with documentation) as being pretty important going forward. It is really
quite an integral part of anything Web 2.0ish.

< $0.02.

-Luther


Re: Switch from Prototype to jQuery?

2009-06-12 Thread Onno Scheffers
>
>
>  Look forward to seeing what you come up with and I hope you enjoy the
>> challenge!
>>
>
> Me too! :) It's wonderful to know that people want to contribute to the
> framework we love. ;)



Thanks guys.
If anyone is interested, I'll be documenting my progress here:
http://piraya-blog.blogspot.com

Current status: I have a web-project up and running and I'm able to switch
between Prototype-mode and Non-prototype-mode (which leaves out the
prototype libraries).
$('elementId').activate is now Tapestry.activate('elementId') which means
the first bit of Prototype-specific code is converted to plain Javascript.

Time to call it a day :)


regards,

Onno


Re: T5.1: get the current page context from a component

2009-06-12 Thread Thiago H. de Paula Figueiredo
Em Fri, 12 Jun 2009 18:54:59 -0300, Sergey Didenko  
 escreveu:



And call onPassivate() through reflection, right?


Yes. But we can try to find a bfile a JIRA for a better way of getting  
that info without using reflection.



I missed this case because did not expect my "live" page to extend
interface Component that is returned from componentResources.getPage()


The magic of Tapestry modifying our component classes in runtime . . .  
long live Javassist! :)



Thanks for your answers!


It's a pleasure to help. :)

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: T5.1: get the current page context from a component

2009-06-12 Thread Sergey Didenko
And call onPassivate() through reflection, right?

I missed this case because did not expect my "live" page to extend
interface Component that is returned from componentResources.getPage()

Thanks for your answers!

On Sat, Jun 13, 2009 at 12:26 AM, Thiago H. de Paula
Figueiredo wrote:
> Em Fri, 12 Jun 2009 18:18:10 -0300, Sergey Didenko
>  escreveu:
>
>> Well, how I can inject not just ConcretePage but the current page? So
>> the component can be reused on different pages.
>
> @Inject ComponentResources and then call its getPage() method. You may need
> to cast the returned object.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> 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.1: get the current page context from a component

2009-06-12 Thread Thiago H. de Paula Figueiredo
Em Fri, 12 Jun 2009 18:18:10 -0300, Sergey Didenko  
 escreveu:



Well, how I can inject not just ConcretePage but the current page? So
the component can be reused on different pages.


@Inject ComponentResources and then call its getPage() method. You may  
need to cast the returned object.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



[Tapestry Central] Back from Tapestry 5 Training / Madison, WI

2009-06-12 Thread Howard
Just got back last night from training in Madison WI. This was
primarily an intro to Tapestry 5 for Tapestry 4 developers (and a
couple of new-to-web-programming developers) and a lot of hands on pair
programming to get them going with their conversion work. It was a lot
of fun, and as usual, I learned a bit.
I have a couple of weeks respite now before OSCON which will be
followed with training in York, UK, then Estonia, then London.
I'm continuing to hold off on code changes to Tapestry 5, though I hit
enough minor annoyances that I'm considering a 5.1 bug fix release
before starting 5.2 in earnest.
I have a backlog of work related to Tapestry360 and then my main
emphasis is going to be Documentation, Screencasts, Articles,
Documentation and Documentation, plus some additional Documentation. It
may be a while before I start with new features for 5.2.

--
Posted By Howard to Tapestry Central at 6/12/2009 12:56:00 PM

Re: T5.1: get the current page context from a component

2009-06-12 Thread Sergey Didenko
Well, how I can inject not just ConcretePage but the current page? So
the component can be reused on different pages.

> You could also inject the container into the component, and then reference
> your context somehow directly.


Using "inherit" binding also means parameter declaration as I
understand from a very brief documentation.

>
> Never tried it, but  isn't the inherited: binding what you are looking for?
>

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



T5 enhancement: Redirecting from ComponentEventLinkEncoder.decodePageRenderRequest()

2009-06-12 Thread Blower, Andy
I recently moved authentication for our project in method advice for the 
ComponentEventLinkEncoder method decodePageRenderRequest() because some other 
method advice to the same method has some modified URL processing and it saves 
duplicating it in an authentication dispatcher. In some situations this method 
advice needs to redirect to a single sign on server rather than render a page, 
so I have had to override the standard T5 PageRenderDispatcher to allow this.

Does anyone else think this is more generally useful and might be a good 
enhancement to the standard T5 PageRenderDispatcher? Or is this a very specific 
edge case? I'm tempted to raise a JIRA issue, but thought I'd test the water 
first.


The code uses an extension of EmptyEventContext called RedirectEventContext to 
indicate a redirect should take place (bit of hack to avoid API change) and 
looks like this:

public boolean dispatch(Request request, Response response) throws IOException
{
PageRenderRequestParameters parameters = 
linkEncoder.decodePageRenderRequest(request);

if (parameters == null)  return false;

if (parameters.getActivationContext() instanceof 
RedirectEventContext)   // New block
{

response.sendRedirect(parameters.getLogicalPageName());
return true;
}

componentRequestHandler.handlePageRender(parameters);

return true;
}


Re: best book for T5

2009-06-12 Thread Thiago H. de Paula Figueiredo
Em Fri, 12 Jun 2009 17:03:30 -0300, Blower, Andy  
 escreveu:


I meant Igor's book translated to English Thiago... there must be a  
bigger market for an English version IMO, so his publishers would be  
crazy not to do one surely, and I hope to see it soon. :-D


I know. My German knowledge is null, so unfortunately I can't help him,  
except reviewing it. :)



Not that I wouldn't welcome another of course.


I agree. :)

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



RE: best book for T5

2009-06-12 Thread Blower, Andy
I meant Igor's book translated to English Thiago... there must be a bigger 
market for an English version IMO, so his publishers would be crazy not to do 
one surely, and I hope to see it soon. :-D

Not that I wouldn't welcome another of course.

> -Original Message-
> From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com]
> Sent: 12 June 2009 21:00
> To: Tapestry users
> Subject: Re: best book for T5
> 
> Em Fri, 12 Jun 2009 16:52:46 -0300, Blower, Andy
>  escreveu:
> 
> > I can't believe that there wouldn't be an even bigger market for a
> well
> > written T5 book in English, so I hope to see it soon!
> 
> I would love to be a co-author in a Tapestry 5 book, but I don't have
> the
> resources nor I want to do this alone.
> 
> > Love that cover, awesome.
> 
> One of the most beautiful ones I've seen in a technical book. :)
> 
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> -
> 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: best book for T5

2009-06-12 Thread Thiago H. de Paula Figueiredo
Em Fri, 12 Jun 2009 16:52:46 -0300, Blower, Andy  
 escreveu:


I can't believe that there wouldn't be an even bigger market for a well  
written T5 book in English, so I hope to see it soon!


I would love to be a co-author in a Tapestry 5 book, but I don't have the  
resources nor I want to do this alone.



Love that cover, awesome.


One of the most beautiful ones I've seen in a technical book. :)

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: Switch from Prototype to jQuery?

2009-06-12 Thread Thiago H. de Paula Figueiredo
Em Fri, 12 Jun 2009 16:50:44 -0300, Blower, Andy  
 escreveu:


That sounds fine, I would be more bothered if it was to take up a  
massive amount of Howards' time meaning that he had less time to push  
Tapestry forward in other areas.


That's exactly something I was tyring to say but couldn't find how to  
write them.
It would be very nice to have Tapestry components be more Javascript  
framework agnostic, but pushing Howard (and the other committers too, they  
exist!, hehehe) to do this and not working on other issues (after all,  
this is all about fixing something that already works, just doesn't work  
as good as we wished) wouldn't be a wise thing to do.


Look forward to seeing what you come up with and I hope you enjoy the  
challenge!


Me too! :) It's wonderful to know that people want to contribute to the  
framework we love. ;)


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



RE: best book for T5

2009-06-12 Thread Blower, Andy
I can't believe that there wouldn't be an even bigger market for a well written 
T5 book in English, so I hope to see it soon!

Love that cover, awesome.

> -Original Message-
> From: Igor Drobiazko [mailto:igor.drobia...@gmail.com]
> Sent: 12 June 2009 07:41
> To: Tapestry users
> Subject: Re: best book for T5
> 
> Well, the only one book about t5 is
> http://www.amazon.com/Tapestry-Applications-step-step-developer-
> friendly/dp/1847193072/ref=sr_1_1?ie=UTF8&s=books&qid=1244788318&sr=8-1
> 
> But this one is out dated-and covers a very early beta version of
> Tapestry
> 5.
> 
> Right now I'm writing a new one which covers 5.1.0.5 but the book is
> written
> in German:
> http://www.amazon.de/Tapestry-Die-Entwicklung-Webanwendungen-
> Leichtigkeit/dp/3827328446/ref=sr_1_3?ie=UTF8&s=books&qid=1244788645&sr
> =8-3
> 
> Who knows, maybe my publisher will translate it in English if there
> will be
> a market.
> 
> 
> On Fri, Jun 12, 2009 at 5:20 AM, haipeng du 
> wrote:
> 
> > What is the best book for T5. Tutorial from t5 website is too simple.
> > Thanks.
> >
> > --
> > Haipeng Du
> > Salt Lake City
> >
> 
> 
> 
> --
> Best regards,
> 
> Igor Drobiazko


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



RE: Switch from Prototype to jQuery?

2009-06-12 Thread Blower, Andy
That sounds fine, I would be more bothered if it was to take up a massive 
amount of Howards' time meaning that he had less time to push Tapestry forward 
in other areas.

Look forward to seeing what you come up with and I hope you enjoy the challenge!

> -Original Message-
> From: Onno Scheffers [mailto:o...@piraya.nl]
> Sent: 12 June 2009 10:15
> To: Tapestry users
> Subject: Re: Switch from Prototype to jQuery?
> 
> On Thu, Jun 11, 2009 at 11:37 PM, Blower, Andy
> wrote:
> 
> > I'd just like to echo everything Robert said in this message.
> 
> 
> Hi Andy,
> 
> don't worry. I've read Roberts message and his concerns are valid. I'm
> aware
> this whole thing won't be easy but it's not impossible.
> Besides, if we keep ignoring the issue entirely, nothing happens. I can
> at
> least try and see what I can come up with. Whether it works or not or
> whether it ever ends up in the Tapestry production release doesn't
> really
> matter to me. It's an interesting project to dive into in my spare time
> :o)
> 
> 
> regards,
> 
> Onno


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



Re: T5.1: get the current page context from a component

2009-06-12 Thread Thiago H. de Paula Figueiredo
Em Fri, 12 Jun 2009 16:32:51 -0300, Andy Pahne   
escreveu:


You could also inject the container into the component, and then  
reference your context somehow directly.


Calling onPassivate() directly? ;)

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: T5.1: get the current page context from a component

2009-06-12 Thread Andy Pahne


Never tried it, but  isn't the inherited: binding what you are looking for?

You could also inject the container into the component, and then 
reference your context somehow directly.


Andy




Sergey Didenko schrieb:

Hi,

Is there a way to get the page context from a subcomponent? Right now
I pass it as a component parameter, but that looks ugly.

Regards, Sergey.

-
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



T5.1: get the current page context from a component

2009-06-12 Thread Sergey Didenko
Hi,

Is there a way to get the page context from a subcomponent? Right now
I pass it as a component parameter, but that looks ugly.

Regards, Sergey.

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



Modify 'title', 'rel'... attributes on link html element.

2009-06-12 Thread Cordenier Christophe
Hello,

Yesterday I discover the ClientInfrastructure service and how easy it is to add 
our own resources on the Tapestry5 CSS and JS stack.
But I need to add a title on some of my css links, and it was frustrating not 
being able to achieve this in a simple way, idem with the 'rel' attribute which 
is set in the "IncludedStylesheet" class that has package visibility and is 
declared as internal.

I end up by modifying the 'link' using a MarkupRendererFilter and the 
MarkupWriter class.

Did I miss something ?

Thanks in advance,
Christophe.



Ce message et les pi?ces jointes sont confidentiels et r?serv?s ? l'usage 
exclusif de ses destinataires. Il peut ?galement ?tre prot?g? par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
imm?diatement l'exp?diteur et de le d?truire. L'int?grit? du message ne pouvant 
?tre assur?e sur Internet, la responsabilit? du groupe Atos Origin ne pourra 
?tre recherch?e quant au contenu de ce message. Bien que les meilleurs efforts 
soient faits pour maintenir cette transmission exempte de tout virus, 
l'exp?diteur ne donne aucune garantie ? cet ?gard et sa responsabilit? ne 
saurait ?tre recherch?e pour tout dommage r?sultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos Origin group liability cannot be triggered 
for the message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.


Re: How to show a Select component in a zone ?

2009-06-12 Thread Thibaut Gadiolet
Thank you Thiago,

Putting the entire Form in my zone is definitely not an ideal solution (I'd
like to show a part of my form, not the whole form)

I tried to use FormFragment with the triggerFragment mixin, but you can just
trigger show() and hide() from a checkbox or a radioButton.
Is there a way to show my Select component from an actionLink, without
rewrite javascript code? (using FormFragment)

Thibaut

On Thu, Jun 11, 2009 at 10:20 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> Em Thu, 11 Jun 2009 20:21:23 -0300, Thibaut Gadiolet <
> thibaut.gadio...@gmail.com> escreveu:
>
> 
>>
>>
>>
>
> It's not an ideal solution, but try putting the whole form inside the zone.
> Any field component needs to be rendered inside a Form being rendered,
> hence your situation.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Decoration passed by parameter. Possible?

2009-06-12 Thread Sergey Didenko
Could you help me, I can't understand how it is wired together.

Where the class Decorate is used? What is passed as its "by"
parameter. Should "t:complexcomponent" be "t:decorate"?

On Wed, Jun 10, 2009 at 6:57 AM, DH wrote:
> Well, a simple implementation here may be like:
>
> public class Decorate {
>   �...@parameter(required = true)
>    private Object by;
>
>   �...@inject
>    private ComponentResources componentResources;
>
>   �...@inject
>    private Environment environment;
>
>    Object beginRender()
>    {
>        environment.push(Block.class, componentResources.getBody());
>        return by;
>    }
>
>    // in your case, should not render the body, orelse there will be two 
> cases rendered.
>    boolean beforeRenderBody() {
>        return false;
>    }
> }
>
> public class DecoratedBody {
>
>   �...@inject
>    private Environment environment;
>
>    Object beginRender()
>    {
>        return environment.peek(Block.class);
>    }
> }
>
>
> I've test and it works.
> 
>  
>  aaa  bbb
>  
> 
>
> 
>  
>   
> 
>
> They all work and show what I need.
>
> DH
>
> - Original Message -
> From: "Lukasz Jazgar" 
> To: "Tapestry users" 
> Sent: Saturday, June 06, 2009 5:24 AM
> Subject: Re: Decoration passed by parameter. Possible?
>
>
> 2009/6/5 Lukasz Jazgar :
>> Suppose, I have a component:
>>
>> ComplexComponent.tml
>> 
>> ...
>> a lot of tags and components
>> ...
>> 
>> .. complex content ..
>> 
>> ...
>> a lot of other tags and components
>> ...
>> 
>>
>> ComplexComponent is very usefull. I use it repeatedly on pages. BUT in
>> some cases I need "title" to be hyperlink to Tapestry page, in other
>> cases hyperlink to another page, sometimes external hyperlink or
>> "mailto:"; link. In other cases I need decorate it by border, complex
>> and unrealizable by only CSS. And finally, I'd like to have
>> possibility to define any other surrounding of title in the future,
>> preferably without changing ComplexComponent.
>>
>
> I imagine such a solution:
>
> ComplexComponent.java
> @Parameter
> @Property
> Block titleDecorator;
>
> ComplexComponent.tml
> 
>  ...
>  a lot of tags and components
>  ...
>    
>          
>              .. complex content ..
>          
>    
>  ...
>  a lot of other tags and components
>  ...
> 
>
> Page.tml
> 
>   
>        
>   
> 
>
> Legend:
> decorate - component a little bit similar to delagate
>  - special tag like  but relative to
> containing Block.
>
> It's a pity, that it is only imagination.
> Is it possible to do something similar now?
> If not, is it technically possible to make such a improvement in
> future versions? It would be very powerful feature.
>
>
> Lukasz
>
> -
> 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: Decoration passed by parameter. Possible?

2009-06-12 Thread Lukasz Jazgar
Great!
I'm impressed by simplicity of this solution and by power of Tapestry, again.
Thanks a lot.

Lukasz

2009/6/10 DH :
> Well, a simple implementation here may be like:
>
> public class Decorate {
>   �...@parameter(required = true)
>    private Object by;
>
>   �...@inject
>    private ComponentResources componentResources;
>
>   �...@inject
>    private Environment environment;
>
>    Object beginRender()
>    {
>        environment.push(Block.class, componentResources.getBody());
>        return by;
>    }
>
>    // in your case, should not render the body, orelse there will be two 
> cases rendered.
>    boolean beforeRenderBody() {
>        return false;
>    }
> }
>
> public class DecoratedBody {
>
>   �...@inject
>    private Environment environment;
>
>    Object beginRender()
>    {
>        return environment.peek(Block.class);
>    }
> }
>
>
> I've test and it works.
> 
>  
>  aaa  bbb
>  
> 
>
> 
>  
>   
> 
>
> They all work and show what I need.
>
> DH
>
> - Original Message -
> From: "Lukasz Jazgar" 
> To: "Tapestry users" 
> Sent: Saturday, June 06, 2009 5:24 AM
> Subject: Re: Decoration passed by parameter. Possible?
>
>
> 2009/6/5 Lukasz Jazgar :
>> Suppose, I have a component:
>>
>> ComplexComponent.tml
>> 
>> ...
>> a lot of tags and components
>> ...
>> 
>> .. complex content ..
>> 
>> ...
>> a lot of other tags and components
>> ...
>> 
>>
>> ComplexComponent is very usefull. I use it repeatedly on pages. BUT in
>> some cases I need "title" to be hyperlink to Tapestry page, in other
>> cases hyperlink to another page, sometimes external hyperlink or
>> "mailto:"; link. In other cases I need decorate it by border, complex
>> and unrealizable by only CSS. And finally, I'd like to have
>> possibility to define any other surrounding of title in the future,
>> preferably without changing ComplexComponent.
>>
>
> I imagine such a solution:
>
> ComplexComponent.java
> @Parameter
> @Property
> Block titleDecorator;
>
> ComplexComponent.tml
> 
>  ...
>  a lot of tags and components
>  ...
>    
>          
>              .. complex content ..
>          
>    
>  ...
>  a lot of other tags and components
>  ...
> 
>
> Page.tml
> 
>   
>        
>   
> 
>
> Legend:
> decorate - component a little bit similar to delagate
>  - special tag like  but relative to
> containing Block.
>
> It's a pity, that it is only imagination.
> Is it possible to do something similar now?
> If not, is it technically possible to make such a improvement in
> future versions? It would be very powerful feature.
>
>
> Lukasz
>
> -
> 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



Tapestry 5.1 exception "Could not find a coercion from type ..." on form submit

2009-06-12 Thread m!ga

Hi everyone. We just started migration from tapestry 5.0 to 5.1 and found a
lot of strange exeptions. Here is one of them.

page class:

public class Test {

@SuppressWarnings({"unused", "UnusedDeclaration"})
@Component(id = "form")
private Form form;

@Property
private SomeClass someClass;

@Property
private SomeClass[] someClasses = {new SomeClass("1"),new
SomeClass("2"),new SomeClass("3"),new SomeClass("4"),new SomeClass("5")};


public class SomeClass
{
private String s = "SomeClass ";

public SomeClass(String s)
{
this.s += s;
}
public String toString()
{
return s;
}
}
}


tml file:

http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";>



${someClass}
 




Works fine unless you try to submit form. It throws something like that:

Caused by: java.lang.IllegalArgumentException: Could not find a coercion
from type java.lang.String to type ru.kupivip.pages.shop.Test$SomeClass. 
Available coe
rcions: Double --> Float, Float --> Double...bla bla bla...

It can be solved by not-so-good-looking-code like this:

private SomeClass someClass;

public Object getSomeClass()
{
return someClass;
}

public void setSomeClass(Object maybeSomeClass)
{
someClass = maybeSomeClass != null && maybeSomeClass instanceof 
SomeClass
? (SomeClass) maybeSomeClass : null;
}

I've debugged the setter ant it seems that it is called 2 times:
1st time after onActivate phase
2nd time after onSubmit/onActivate 

and 1st time the argument maybeSomeClass is not instance of SomeClass but
its toString() value!


-- 
View this message in context: 
http://www.nabble.com/Tapestry-5.1-exception--%22Could-not-find-a-coercion-from-type-...%22-on-form-submit-tp24001080p24001080.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: How to remove Blackbird.css

2009-06-12 Thread Peter Stavrinides
Hi Robert,

While the client side AJAX error reporting is a plus, I still want to be able 
to remove / customize / control in its entirety *anything that is displayed to 
end users! 

cheers,
Peter

 

- Original Message -
From: "Robert Zeigler" 
To: "Tapestry users" 
Sent: Saturday, 6 June, 2009 02:55:22 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: How to remove Blackbird.css

At the moment, no.
Blackbird is used not only for debugging, but also for ajax-related  
client-side notifications. Ie, if an ajax request fails for some  
reason, the client will be notified via a blackbird console.
You /do/ want your users to know that an issue occurred during an ajax  
request, right? Rather than just letting them sit there, wondering if  
something is going to happen? :)

Robert

On Jun 5, 2009, at 6/55:24 PM , Craig St. Jean wrote:

> Hello,Blackbird is nice, but I don't want any reference to it in  
> production.
> For example, the blackbird.css is included, even if I set production  
> mode
> to true.  Is there any way to remove this?
>
> Thank you!


-
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: Tapestry working with ZK component

2009-06-12 Thread Thiago H. de Paula Figueiredo
Nice!

One suggestion: instead of injecting RequestGlobals, you can inject
HttpServletRequest directly. ;)

-- 
Thiago

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



Re: Two Menu Components

2009-06-12 Thread Otho
Oops, sorry. My bad.

This doesn't work with components in this way.

If you want to update with Ajax I suggest you try donf jangs solution. The
following works on full page refresh.

You need to have MainMenu and SideMenu as components in your Layout.java

Layout.java

@Component
private MainMenu mainMenu;

@Component
private SideMenu sideMenu;


Object setupRender()
{

sideMenu.setSelectedMainMenuItem(mainMenu.getSelectedMenuItem());



  return null;
}


MainMenu.java

@Persist
private String selectedItem;

@Property
private List menuItems = Arrays.asList("home", "about", "help");

@Property
private String currentMenuItem;

public String getSelectedMenuItem()
{
  return selectedItem;
}

Object onActionFromMyMenu(String context)
{
   selectedItem = context;

   return null;
}

MainMenu.tml
...


${message:${currentMenuItem}-label}



MainMenu.properties

home-label=Start
about-label=About
help-label=Help


SideMenu.java

@Persist
private String selectedMainMenuItem;

public getSelectedMainMenuItem()
{
  return selectedMainMenuItem;
}

public setSelectedMainMenuItem(String value)
{
  selectedMainMenuItem=value;
}

The rest with the blocks can stay as it is in the first post.

If you don't write explicit getters and setters like I did in this second
example, it won't compile, since the getters and setters are only created at
runtime by Tapestry when using the @Property annotation. Sorry for being so
rash. I hope this helps, and as I said if you want Ajax, look at donf yangs
code.


2009/6/12 Eldred Mullany 

> Hi Otho
>
> Thank you for the feedback, I am trying this example, but notice that I
> get a transformation exception if I inject my component as per your
> example. Complaining about it not having a serviceID ?
>
> Using T5 5.1.0.5
>
> How do I provide a serviceID to ComponentResourcesInjectionProvider ?
>
> Thank you
>
> -Original Message-
> From: Otho [mailto:taa...@googlemail.com]
> Sent: Thursday, June 11, 2009 3:33 PM
> To: Tapestry users
> Subject: Re: Two Menu Components
>
> Create an eventhandler in your MainMenu component which fires on select
> and
> gives the selected menuitem as context.
>
> For example
>
> class MainMenu
> @Inject
> private SideMenu sideMenu;
>
> Object onActionFromYourMenu(String context)
> {
>   sideMenu.setSelectedMainMenuItem(context);
>
>   return null;
> }
>
> class SideMenu
>
> @Property
> @Persist
> private String selectedMainMenuItem;
>
> @Inject
> private Block whateverBlock;
>
> @Property
> @Persist
> private Block displayBlock;
>
> Object setupRender()
> {
>  if(selectedMainMenuItem.equals("whatever")
>displayBlock = whateverBlock;
>
> ...
>
>  return null;
> }
>
> SideMenu.tml
>
> 
> 
> 
>
> 
> 
> Whatver has to be done
> 
> 
>
>
> 2009/6/11 Eldred Mullany 
>
> > Hi All
> >
> >
> >
> > I need some advice on how to get two menu components to talk to each
> > other. The fist component is a top menu with a whole lot of links,
> when
> > an action link is fired(from the first menu component) I want to pass
> a
> > parameter string to the second component (sub-menu) which will render
> > based on the parameter it's been passed to it.
> >
> >
> >
> > So in other words second menu component is dependent on the first.
> >
> >
> >
> > Its pretty much high level but some advice would be useful. Perhaps a
> > component listener of some sort?
> >
> >
> >
> > Any ideas ?
> >
> >
> >
> > Thanks
> >
> > Eldred
> >
> >
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Re: best book for T5

2009-06-12 Thread Andreas Andreou
Yea, great news and nice cover!

On Fri, Jun 12, 2009 at 1:00 PM, nille
hammer wrote:
> Hi Igor,
>
> that is great news. Can't wait to get a copy of that. Be sure I will travel 
> to Düsseldorf to have it signed by you ;-)
>
> Greetings from Darmstadt and have a nice weekend, nillehammer
>
> ==
> http://www.winfonet.eu
>
> - original Nachricht 
>
> Betreff: Re: best book for T5
> Gesendet: Fr, 12. Jun 2009
> Von: Igor Drobiazko
>
>> Well, the only one book about t5 is
>> http://www.amazon.com/Tapestry-Applications-step-step-developer-friendly/dp/
>> 1847193072/ref=sr_1_1?ie=UTF8&s=books&qid=1244788318&sr=8-1
>>
>> But this one is out dated-and covers a very early beta version of Tapestry
>> 5.
>>
>> Right now I'm writing a new one which covers 5.1.0.5 but the book is
>> written
>> in German:
>> http://www.amazon.de/Tapestry-Die-Entwicklung-Webanwendungen-Leichtigkeit/dp
>> /3827328446/ref=sr_1_3?ie=UTF8&s=books&qid=1244788645&sr=8-3
>>
>> Who knows, maybe my publisher will translate it in English if there will be
>> a market.
>>
>>
>> On Fri, Jun 12, 2009 at 5:20 AM, haipeng du  wrote:
>>
>> > What is the best book for T5. Tutorial from t5 website is too simple.
>> > Thanks.
>> >
>> > --
>> > Haipeng Du
>> > Salt Lake City
>> >
>>
>>
>>
>> --
>> Best regards,
>>
>> Igor Drobiazko
>>
>
> --- original Nachricht Ende 
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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



Tapestry working with ZK component

2009-06-12 Thread Julien Ruchaud
Hi,

I played a little bit with ZK and Tapestry this morning and I achieved
something quite nice : I succeeded in inserting a ZK component in
Tapestry page, and this component can call Tapestry actions.

Here is how to do it :
1) Install ZK :
2) The Tapestry Component that allows including any ZK component :
public class ZkComponent {

@Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
private String name;

@Inject
private RequestGlobals requestGlobals;

@Inject
private ComponentResources resources;

boolean setupRender(MarkupWriter writer) throws ServletException, 
IOException {
HttpServletRequest request = requestGlobals.getHTTPServletRequest();
HttpServletResponse response = requestGlobals.getHTTPServletResponse();

request.setAttribute("resources", resources);
request.setAttribute("id", resources.getId());

CharResponseWrapper body = new CharResponseWrapper(response);
request.getRequestDispatcher(name + ".zul").include(request, body);

writer.writeRaw(body.toString());
return true;
}

public class CharResponseWrapper extends HttpServletResponseWrapper {
private CharArrayWriter output;

public String toString() {
return output.toString();
}
  
public CharResponseWrapper(HttpServletResponse response) {
super(response);
output = new CharArrayWriter();
}

public PrintWriter getWriter() {
return new PrintWriter(output);
}
}
}

3) Use in Tapestry page :



This will insert the test.zul component

4) ZK component with the Tapestry call :
This component is a button. When you click on it, it fires an event to call the 
Tapestry action displaying a JSONArray("This is a test : ", param); param 
beeing the button name.




import org.apache.tapestry5.ComponentEventCallback;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.internal.util.Holder;

ComponentResources resources = execution.getAttribute("resources");

// Get button with id
String id = execution.getAttribute("id");
Button btm = spaceOwner.getFellow(id);

void sendEventOnAction(){
Object result = onAction();
alert("result = " + result);
btm.label="ok";
}

Object onAction() {
// Manage trigger result
final Holder holder = Holder.create();
ComponentEventCallback callback = 
new ComponentEventCallback() {
public boolean handleResult(Object result) {
holder.put(result);
return true;
}
};

// Run event 
resources.triggerEvent("action", new Object[] {btm.label}, 
callback);
return holder.get();
}




5) Tapestry action

Object onAction(String param) {
return new JSONArray("This is a test : ", param);
}

I also tried with different ZK components, it seems to work pretty fine.

I hope this can help some people.

Best Regards,

Julien & Jean for translating :D

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



T5.1: Palette causing a NPE upon form submit

2009-06-12 Thread immutability

I've been trying to figure this out for a few hours I've got a strange
issue with the Palette component causing a NullPointerException upon form
submit, but only on form failure involving server-side validator's such as
the email validator (i.e. the form is submitted - onSubmit called but
onSuccess not called due to errors, and  are displayed). I'm
using Tapestry 5.1.0.5

Background: I'm using Palette within a BeanEditForm when editing a User
instance to edit a list of groups (List) to which the user belongs (a
many-to-many relationship - I'm using Spring + Hibernate). The NPE is only
thrown when submitting form with errors that are not catched by the JS
validators, and are processed on the server, such as the email validator.
Also, the NPE is only thrown if there are some groups on the "selected"
side. Here's the first line from the stack trace:

Render queue error in
org.apache.tapestry5.internal.structure.renderphaseeventhandle...@79a340:
java.lang.NullPointerException

Here's the palette declaration:



The user instance is persisted in the page class, and is initially populated
in onActivate:

@Property
@Persist
private User user;

The selectGroups property, which is used for both model and encoder, is
initialized in page's onPrepare with each request. It is a
GenericSelectModel instance.

That said, the palette component works properly almost all the time. When I
edit a user instance, set all fields, select the groups and save, it all
works. It only fails with the NPE when I leave out the email field, causing
the server-side validation to display an error in . I've tried
to add logger statements to the getter for selectGroups, and whenever it is
actually called, both the selectGroups collection and user.groups
collections are non-null and properly populated. So I have no idea what
might be causing the NPE?

Any hints are highly appreciated! Below is a longer snippet from the stack
trace.

Thanks,
Rado




STACK TRACE:

12:35:34,081 ERROR Account:84 - Render queue error in
org.apache.tapestry5.internal.structure.renderphaseeventhandle...@c7014c:
java.lang.NullPointerException
java.lang.NullPointerException
at
org.apache.tapestry5.internal.util.SelectModelRenderer.option(SelectModelRenderer.java:49)
at
org.apache.tapestry5.corelib.components.Palette$SelectedRenderer.render(Palette.java:153)
at
org.apache.tapestry5.internal.structure.RenderPhaseEventHandler$1.render(RenderPhaseEventHandler.java:75)
at
org.apache.tapestry5.internal.services.RenderQueueImpl.run(RenderQueueImpl.java:74)
at
org.apache.tapestry5.internal.services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:121)
at 
$PageRenderQueue_121d408df33.render($PageRenderQueue_121d408df33.java)
at 
$PageRenderQueue_121d408df29.render($PageRenderQueue_121d408df29.java)
at
org.apache.tapestry5.internal.services.MarkupRendererTerminator.renderMarkup(MarkupRendererTerminator.java:37)
at
org.apache.tapestry5.services.TapestryModule$27.renderMarkup(TapestryModule.java:1748)
at
$MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java)
at
org.apache.tapestry5.services.TapestryModule$26.renderMarkup(TapestryModule.java:1732)
at
$MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java)
at
org.apache.tapestry5.services.TapestryModule$25.renderMarkup(TapestryModule.java:1714)
at
$MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java)
at
org.apache.tapestry5.services.TapestryModule$24.renderMarkup(TapestryModule.java:1700)
at
$MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java)
at
org.apache.tapestry5.services.TapestryModule$23.renderMarkup(TapestryModule.java:1681)
at
$MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java)
at
org.apache.tapestry5.services.TapestryModule$22.renderMarkup(TapestryModule.java:1662)
at
$MarkupRenderer_121d408df35.renderMarkup($MarkupRenderer_121d408df35.java)
at
$MarkupRenderer_121d408df32.renderMarkup($MarkupRenderer_121d408df32.java)
at
org.apache.tapestry5.internal.services.PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java:64)
at
$PageMarkupRenderer_121d408df2f.renderPageMarkup($PageMarkupRenderer_121d408df2f.java)
at
org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:61)
at
$PageResponseRenderer_121d408dea6.renderPageResponse($PageResponseRenderer_121d408dea6.java)
at
org.apache.tapestry5.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:63)
at
org.apache.tapestry5.services.TapestryModule$33.handle(TapestryModule.java:1943)
at
$PageRenderRequestHandler_121d408dea7.handle($PageRenderRequestHandler_121d408dea7.java)
at
$PageRenderRequestHandler_121d408de90.hand

RE: Two Menu Components

2009-06-12 Thread Eldred Mullany
Hi Otho 

Thank you for the feedback, I am trying this example, but notice that I
get a transformation exception if I inject my component as per your
example. Complaining about it not having a serviceID ? 

Using T5 5.1.0.5 

How do I provide a serviceID to ComponentResourcesInjectionProvider ?

Thank you 

-Original Message-
From: Otho [mailto:taa...@googlemail.com] 
Sent: Thursday, June 11, 2009 3:33 PM
To: Tapestry users
Subject: Re: Two Menu Components

Create an eventhandler in your MainMenu component which fires on select
and
gives the selected menuitem as context.

For example

class MainMenu
@Inject
private SideMenu sideMenu;

Object onActionFromYourMenu(String context)
{
   sideMenu.setSelectedMainMenuItem(context);

   return null;
}

class SideMenu

@Property
@Persist
private String selectedMainMenuItem;

@Inject
private Block whateverBlock;

@Property
@Persist
private Block displayBlock;

Object setupRender()
{
  if(selectedMainMenuItem.equals("whatever")
displayBlock = whateverBlock;

...

  return null;
}

SideMenu.tml







Whatver has to be done




2009/6/11 Eldred Mullany 

> Hi All
>
>
>
> I need some advice on how to get two menu components to talk to each
> other. The fist component is a top menu with a whole lot of links,
when
> an action link is fired(from the first menu component) I want to pass
a
> parameter string to the second component (sub-menu) which will render
> based on the parameter it's been passed to it.
>
>
>
> So in other words second menu component is dependent on the first.
>
>
>
> Its pretty much high level but some advice would be useful. Perhaps a
> component listener of some sort?
>
>
>
> Any ideas ?
>
>
>
> Thanks
>
> Eldred
>
>
>
>

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



Re: Re: best book for T5

2009-06-12 Thread nille hammer
Hi Igor,

that is great news. Can't wait to get a copy of that. Be sure I will travel to 
Düsseldorf to have it signed by you ;-)

Greetings from Darmstadt and have a nice weekend, nillehammer

==
http://www.winfonet.eu

- original Nachricht 

Betreff: Re: best book for T5
Gesendet: Fr, 12. Jun 2009
Von: Igor Drobiazko

> Well, the only one book about t5 is
> http://www.amazon.com/Tapestry-Applications-step-step-developer-friendly/dp/
> 1847193072/ref=sr_1_1?ie=UTF8&s=books&qid=1244788318&sr=8-1
> 
> But this one is out dated-and covers a very early beta version of Tapestry
> 5.
> 
> Right now I'm writing a new one which covers 5.1.0.5 but the book is
> written
> in German:
> http://www.amazon.de/Tapestry-Die-Entwicklung-Webanwendungen-Leichtigkeit/dp
> /3827328446/ref=sr_1_3?ie=UTF8&s=books&qid=1244788645&sr=8-3
> 
> Who knows, maybe my publisher will translate it in English if there will be
> a market.
> 
> 
> On Fri, Jun 12, 2009 at 5:20 AM, haipeng du  wrote:
> 
> > What is the best book for T5. Tutorial from t5 website is too simple.
> > Thanks.
> >
> > --
> > Haipeng Du
> > Salt Lake City
> >
> 
> 
> 
> -- 
> Best regards,
> 
> Igor Drobiazko
> 

--- original Nachricht Ende 


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



RE: RequestCycle access without injecting

2009-06-12 Thread Howard.Kelsey
Hi 
Thanks for the advice but I've found that moving the TableColumns component 
below the TableRows in the .html fixed the issue. The sort still occurs in the 
rewind phase but after the rewind of the rows so the checkbox can get the row 
from the current page data.
Howard

-Original Message-
From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas 
Andreou
Sent: 11 June 2009 18:12
To: Tapestry users
Subject: Re: RequestCycle access without injecting

Why not make your ITableSortingState a service and inject IRequestCycle to that?

On Thu, Jun 11, 2009 at 7:27 PM,  wrote:
> Hi
>
> Is there any way to get hold of the RequestCycle in tapestry 4.0.x without 
> injecting it ie some static utility that can provide it. Basically I think 
> there is a bug with tables in that if you click a column heading to sort the 
> column the table values are sorted in the rewind.  This means that if you 
> have a checkbox which on rewind records which rows are selected however when 
> the rewind of the checkbox value occurs the values have been sorted so you 
> cannot find the item via PrimaryKeyConverter and I don’t want to provide a 
> Collection with all the results as this is a search so could be large.
>
> So I’ve tracked it down to BasicTableModelWrap.getCurrentPageRows so I was 
> thinking that if I could implement my own TableSortingState that could hold 
> ‘current’ and ‘future’(sorting info for the render) sorting info and if I 
> could workout there that we’re ‘rewinding’ then use the ‘current’ sorting 
> info and only update the current sorting info when we’re rendering.
>
> Any help would be greatly appreciated.
>
> Howard
>
>
>
> --
> This email and any files transmitted with it are confidential and proprietary 
> to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received 
> in error, use is prohibited. Please destroy, and notify sender. Sender does 
> not waive confidentiality or privilege. Internet communications cannot be 
> guaranteed to be timely, secure, error or virus-free. Algorithmics does not 
> accept liability for any errors or omissions. Any commitment intended to bind 
> Algorithmics must be reduced to writing and signed by an authorized signatory.
> --
>
>
> --
> This email and any files transmitted with it are confidential and proprietary 
> to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received 
> in error, use is prohibited. Please destroy, and notify sender. Sender does 
> not waive confidentiality or privilege. Internet communications cannot be 
> guaranteed to be timely, secure, error or virus-free. Algorithmics does not 
> accept liability for any errors or omissions. Any commitment intended to bind 
> Algorithmics must be reduced to writing and signed by an authorized signatory.
> --
>
>
> --
> This email and any files transmitted with it are confidential and proprietary 
> to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received 
> in error, use is prohibited. Please destroy, and notify sender. Sender does 
> not waive confidentiality or privilege. Internet communications cannot be 
> guaranteed to be timely, secure, error or virus-free. Algorithmics does not 
> accept liability for any errors or omissions. Any commitment intended to bind 
> Algorithmics must be reduced to writing and signed by an authorized signatory.
> --
>



-- 
Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

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


 
--
This email and any files transmitted with it are confidential and proprietary 
to Algorithmics Incorporated and its affiliates ("Algorithmics"). If received 
in error, use is prohibited. Please destroy, and notify sender. Sender does not 
waive confidentiality or privilege. Internet communications cannot be 
guaranteed to be timely, secure, error or virus-free. Algorithmics does not 
accept liability for any errors or omissions. Any commitment intended to bind 
Algorithmics must be reduced to writing and signed by an authorized signatory.
--

 
--
This email and any files transmitted with it are confidential and propriet

Re: Switch from Prototype to jQuery?

2009-06-12 Thread Onno Scheffers
On Thu, Jun 11, 2009 at 11:37 PM, Blower, Andy
wrote:

> I'd just like to echo everything Robert said in this message.


Hi Andy,

don't worry. I've read Roberts message and his concerns are valid. I'm aware
this whole thing won't be easy but it's not impossible.
Besides, if we keep ignoring the issue entirely, nothing happens. I can at
least try and see what I can come up with. Whether it works or not or
whether it ever ends up in the Tapestry production release doesn't really
matter to me. It's an interesting project to dive into in my spare time :o)


regards,

Onno


Dynamic grid editable

2009-06-12 Thread Jsebak

Hi,

I try to do an dynamic  editable grid, that means that I want to create a
grid that will be able to display and edit a set of data which name, type
and structure are unknown at compilation time. My need is that my grid
should be able to dynamically detect on runtime the type and the structure
of data and adapt its rendering and its behavior depending on that
structure.

I have  this code to add dynamically column of my grid:


this.gridModel =
this.beanModelSource.createDisplayModel(Feature.class, this.messages);

this.cleanBeanModel();

for (LayerAttribute attribute : this.attributes) {

if (attribute.getReadAccess()) {

if (logger.isDebugEnabled()) {
logger.debug("Adding property to grid model : " +
attribute.getLabel());
}
PropertyConduit conduit =
this.propertyConduitFactory.getPropertyConduit(
attribute, this.messages);


PropertyModel attributeModel =
this.gridModel.add(attribute.getName(), conduit);
attributeModel.label(attribute.getLabel());
}
}


it works well.


now I want to configure the cell renderer of my grid , by default is a 
I want to transform to  or other tag, in order to transform my grid
to editable grid.
the only way , I find a solution using a  component but my
columns are added dynamically and the name and type of all columns are
variable and unknown so I cannot use it.

Do you think how such a component could be implemented and how ? How I can
change this cell renderer ? Is there a solution to dynamically create and
add t:parameters or similar components in Java to construct my grid
rendering ?

Many Thanks,

Regards,

-- 
View this message in context: 
http://www.nabble.com/Dynamic-grid-editable-tp23994816p23994816.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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