Re: T5: handling form events in sub-components?

2009-12-10 Thread Benny Law
Hi Jacob,

It sounds like you have nested forms which is not allowed.

Benny

On Thu, Dec 10, 2009 at 11:07 PM, Jacob Mouka  wrote:

> Hi all (apologies if this is really obvious, but I can't find the info in
> the docs/examples)
>
> I have some sub-components (with form elements) in a form and I want to do
> some actions when the form is submitted. I've tried something like
>
>void onSubmit() {
>System.out.println("submitted");
>}
>
> but it doesn't get called on the sub-components, only the parent component.
> What am I missing?
>
> Thanks, Jacob
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


T5: handling form events in sub-components?

2009-12-10 Thread Jacob Mouka
Hi all (apologies if this is really obvious, but I can't find the info  
in the docs/examples)


I have some sub-components (with form elements) in a form and I want  
to do some actions when the form is submitted. I've tried something like


void onSubmit() {
System.out.println("submitted");
}

but it doesn't get called on the sub-components, only the parent  
component. What am I missing?


Thanks, Jacob

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



t5.2.0-SNAPSHOT: Possible bug: form.onsubmit is being replaced by a tapestry onsubmit handler

2009-12-10 Thread buckofive

Hi All,

It seems tapestry is adding its own onsubmit handler directly to a form
element and overwriting mine.  Is this on purpose or a bug? (I want to use
my own direct handler so I can cancel the event before it gets fired to any
listeners).  I feel if tapestry is going to write any event handlers
directly to an element then it should 1st check to see if the handler has
already been defined and wrap it in a new function which calls the users
function after executint any tapestry functions (or maybe there is a better
way?).

Thanks in advance,
B

Here whats I have defined:

...
submit 
...


what tapestry renders is:


...
submit 
...



-- 
View this message in context: 
http://old.nabble.com/t5.2.0-SNAPSHOT%3A-Possible-bug%3A-form.onsubmit-is-being-replaced-by-a-tapestry-onsubmit-handler-tp26738147p26738147.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: Render block for Ajax component

2009-12-10 Thread Magnus Kvalheim
Ok, this is what I have so far:
1. Component that generates eventlink and adds javascript for ajax request.
2. Once ajax is invoked it will call the event method on parent
component(page)
3. Event method returns block and the result is shown in modal/tooltip

What's shown in the client is the json response.
{"content":"Hello world<\/h1>"}

The javascript library is obfuscated so I can't easily modify it :(

How can I return only the partial markup to client?

Any ideas?

2009/12/10 Magnus Kvalheim 

> Hi all,
>
> I'm trying to integrate thirdparty ajax libraries with Tapestry (5.1.0.5).
> These libraries uses Ajax.Request for getting content.
> Instead of getting a (whole) page, I'm trying to call an actionlink and
> return a block defined in the template.
>
> Many ajax libraries for showing a modal or tooltip uses the notation:
> new Tip(element, {
> ajax: {
>   url: '/page.htm'
> }
> });
>
> My question is: Is it possible to 'render' the block in the onAction method
> and return that? Perhaps as StreamResponse instead of returning block
> itself(JSON hash)?
>
>
> Thanks
> Magnus
>


GlassFish V3 Shipped Today

2009-12-10 Thread Pierce T. Wetter III

 I was wondering if anyones knows how the directions here change:

http://tapestry.apache.org/tapestry5/glassfish.html

 That is, I imagine that since V3 is more componentized, perhaps the stax and 
log4j installs are no longer necessary?

  Anyone done this?

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



Re: [T5] Permalinks

2009-12-10 Thread Thiago H. de Paula Figueiredo

Em Thu, 10 Dec 2009 16:49:25 -0200, blueboy6  escreveu:


TNX Thiago,
this really helped me a lot :)


You're welcome!

PS isn't url rewrite complicated to do when I have lots of diferent  
parts...
(TWR-234, A34-TDS and so on) because I would need to create rule for all  
of them, I just read all documentation and didn't find anything similar.


You don't need to create a rule for each of them, as long as you have a  
defined mapping between permalink and real URL.
You can think of URL rewriting as being string manipulation. The  
documentation just shows simple examples for easy understanding.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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: Tapestry 5 on Websphere 6.1

2009-12-10 Thread Howard Lewis Ship
Thanks for contributing back that useful information!  Looks nasty though!

On Thu, Dec 10, 2009 at 5:11 AM, Christian Köberl
 wrote:
>
> I put together a small howto for anyone who tries to run Tapestry 5 on a
> Websphere 6.1 (like we do yeah :) ):
>
> http://wiki.apache.org/tapestry/HowToRunTapestry5Websphere
>
> --
> Chris
> --
> View this message in context: 
> http://n2.nabble.com/Tapestry-5-on-Websphere-6-1-tp4145237p4145237.html
> Sent from the Tapestry Users 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
>
>



-- 
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



Re: [T5] Permalinks

2009-12-10 Thread blueboy6

TNX Thiago,

this really helped me a lot :)

PS
isn't url rewrite complicated to do when I have lots of diferent parts...
(TWR-234, A34-TDS and so on) because I would need to create rule for all of
them, I just read all documentation and didn't find anything similar.

:)



Thiago H. de Paula Figueiredo wrote:
> 
> Em Thu, 10 Dec 2009 14:53:22 -0200, blueboy6 
> escreveu:
> 
>> Hello everyone,
> 
> Hi!
> 
>> I have interesting question.
>> Is it posible to create permalinks for my pages like:
>> www.test.com/TY45-234
>> I know that there is activation context but I need to do this in this
>> shorter way.
> 
> Two suggestions:
> 
> 1) Have an Index page and use its activation context to redirect to the  
> proper page
> 2) Implement a URL rewriting rule the verifies the URL and changes it to  
> /view/TY45-234, for example. This approach has the advantage of not using  
> redirects.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
> and instructor
> Owner, software architect and developer, 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
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/-T5--Permalinks-tp26730696p26732522.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: [T5] Permalinks

2009-12-10 Thread Thiago H. de Paula Figueiredo

Em Thu, 10 Dec 2009 14:53:22 -0200, blueboy6  escreveu:


Hello everyone,


Hi!


I have interesting question.
Is it posible to create permalinks for my pages like:
www.test.com/TY45-234
I know that there is activation context but I need to do this in this
shorter way.


Two suggestions:

1) Have an Index page and use its activation context to redirect to the  
proper page
2) Implement a URL rewriting rule the verifies the URL and changes it to  
/view/TY45-234, for example. This approach has the advantage of not using  
redirects.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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] Permalinks

2009-12-10 Thread blueboy6

Hello everyone,

I have interesting question.

Is it posible to create permalinks for my pages like:

www.test.com/TY45-234

I know that there is activation context but I need to do this in this
shorter way.

Or at least to take this permalink and to send it to other page as
activation context.

Impatiently waiting for reply. :)

Bojan Cincur
-- 
View this message in context: 
http://old.nabble.com/-T5--Permalinks-tp26730696p26730696.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



Tapestry-Spring problem: ApplicationContext files from jar can't be found.

2009-12-10 Thread Juan E. Maya
Hello!

i am having some issues with the integration with Spring and Tapestry.
We have one web application that has several modules packed as jars in
the web-inf/lib. Each of those modules has its own application
context. In the web.xml we have the following configuration to load
the beans from spring:

 
contextConfigLocation

classpath*:*applicationContext*.xml



According to the Spring documentation this loads all the files in the
classpath that follow the pattern to the spring application context.

So far we have been developing the application like this in eclipse
but we have had always load the files directly from the classpath, not
from the jars and it works perfect. The problem comes when the
application is deploayed as a war with the modules as jars. The spring
files are not loaded.

I tried to used  tapestry's compatibility mode but i had the same problem.

Does anybody have faced the same problem?

Thanks a lot for your help!

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



Render block for Ajax component

2009-12-10 Thread Magnus Kvalheim
Hi all,

I'm trying to integrate thirdparty ajax libraries with Tapestry (5.1.0.5).
These libraries uses Ajax.Request for getting content.
Instead of getting a (whole) page, I'm trying to call an actionlink and
return a block defined in the template.

Many ajax libraries for showing a modal or tooltip uses the notation:
new Tip(element, {
ajax: {
  url: '/page.htm'
}
});

My question is: Is it possible to 'render' the block in the onAction method
and return that? Perhaps as StreamResponse instead of returning block
itself(JSON hash)?


Thanks
Magnus


Re: Validators / Translators question

2009-12-10 Thread Thiago H. de Paula Figueiredo
Em Thu, 10 Dec 2009 11:50:31 -0200, Jim O'Callaghan  
 escreveu:


Thanks Thiago.  I'm using the example at the link you specified, but  
found I needed to provide validators and translators to complete the  
approach, esp. the translator being missing / not bound was causing a  
NPE somewhere along the line.


The viewing block is just for viewing (Grid and BeanDisplay, no affecting  
how you edit the values.


If your address field is only used in one Grid, you could just override  
the viewing block for it using  inside the Grid.


I can update the block to display the fields (sub fields in ex. Address)  
but was wondering more about how the value is translated from what is  
posted back into an Address object - is that not what the Translator

would do?  I'm probably missing something obvious here ...


I can see two approaches:

1) Create an edition block for Address that has one TextField for each of  
its parts.
2) Create an edition block for Address that isn't really used. It would be  
there just to make Tapestry not complain about the lack of an edition  
block.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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: What about the EWDT book?

2009-12-10 Thread Boban Stojanovski
There is a new book about tapestry5 by Igor Drobiazko , its in german , but
i think it will get translated to english.
( source :
http://www.mail-archive.com/users@tapestry.apache.org/msg40439.html)
Its a more indepth look at building web apps with tapestry5  spring and
hibernate.
Somethnig the book by Alexander Kolesnikov was missing , although that is
great book and can get u started with tapestry quickly.



2009/12/10 Andreas Andreou 

> Yea, no point in getting Enjoying-Web-Development-with-Tapestry and
> afaict there won't be a T5 update for it since Kent has been inactive
> in this list for more than a year and a half.
>
>
> On Thu, Dec 10, 2009 at 11:07 AM, Juan E. Maya 
> wrote:
> > Alessandro although t4 and t5 are based on the same concepts i think
> > that u do things in quiet a different way and it's not worthy to buy
> > if u are planning to develop an application using t5.
> >
> > There have been rumors of 2 other new tapestry 5 books that could go
> > out. One would be an english translation from Igor's new book
> > (
> http://www.amazon.de/Tapestry-Die-Entwicklung-Webanwendungen-Leichtigkeit/dp/3827328446/ref=sr_1_1?ie=UTF8&s=books&qid=1260435889&sr=8-1-spell
> )
> >
> > and the other one would be a new one written by Howard.
> >
> >
> > On Thu, Dec 10, 2009 at 9:54 AM, Alessandro Bottoni
> >  wrote:
> >> Hello All,
> >> I'm studying Tapestry 5 and using it for a new project. I have already
> >> bought and read from cover to cover this fine book by Alexander
> Kolesnikov:
> >>
> >>
> http://www.amazon.com/Tapestry-Applications-step-step-developer-friendly/dp/1847193072/ref=sr_1_3?ie=UTF8&s=books&qid=1260433982&sr=1-3
> >>
> >> Now, I'm curious about this other book:
> >>
> >>
> http://www.amazon.com/Enjoying-Web-Development-Tapestry-Tong/dp/1411649133/ref=pd_sim_b_4
> >>
> >> Everybody seems to love it despite the fact that it deals with Tapestry
> >> 4 /only/. This is quite strange, given that T5 has a completely new code
> >> base and this should have made obsolete any document regarding the old
> >> version.
> >>
> >> Hence, I would be happy to hear your opinion about it. Is this book
> >> still worth its money (around 40US$), at the end of 2009, despite the
> >> fact that it was published in 2006/2007 (2nd and 3rd editions) and
> >> describes an old and maybe obsolete version of the framework?
> >>
> >> Is the difference between T4 and T5 so great to make this book useless?
> >>
> >> TIA
> >>
> >> PS: Should Mr. Ka Iok 'Kent' Tong (the author of this book) be on this
> >> list, can he please let us know if he plan to release a forth edition of
> >> his fine book, devoted to Tapestry 5?
> >> --
> >>
> >> Alessandro Bottoni
> >> Website: http://www.alessandrobottoni.it/
> >>
> >> "I am prepared for the worst, but hope the best."
> >> -- Benjamin Disraeli
> >>
> >>
> >>
> >>
> >> -
> >> 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
> >
> >
>
>
>
> --
> 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
>
>


-- 
Boban Stojanovski
PMF - Institute of informatics , Skopje


Re: Tapestry 5.1.0.5 FCKEDITOR PROBLEM

2009-12-10 Thread Boban Stojanovski
Problem Solved.
thank u
i modified my appmodule.java , according to joosts instructions , and it
worked.

my appmodule.java
..
public static void contributeRegexAuthorizer(Configuration conf)
{
conf.add("^.*png$");
conf.add("^.*jpg$");
conf.add("^.*jpeg$");
conf.add("^.*js$");
conf.add("^.*css$");

conf.add("org/chenillekit/.*\\.((css)|(js)|(jpg)|(jpeg)|(png)|(gif)|(html)|(ico)|(swf)|(xml))$");
}
..

I didnt want to use easy-fcke , as chenillekit libraries were already in our
web app.
Using easy-fcke was a backup option.

2009/12/10 Joost Schouten (ml) 

> I too had this problem and it was caused by the new (and very necessary)
> asset authorisation which prevents web access to your context root through
> your tapestry app. The default is fairly strict, and as it seems too strict
> for the FCKeditor in the chenillekit-tapestry package. I added the following
> [1] to my AppModule which fixed it. It tells T5 to allow requests to the
> chenillekit assets with the specified extensions (especially the html and
> xml once are needed as the images are already allowed I think).
>
> I think you should not need to do this as chenillekit should add this
> itself, but I assume it will in the next release. But maybe raise this issue
> in the chenillekit mailing list to be sure.
>
> Hope it helps,
> Joost
>
> [1]
> public static void contributeRegexAuthorizer(
>   Configuration configuration) {
>//should actually not be needed
>
> configuration.add("org/chenillekit/.*\\.((css)|(js)|(jpg)|(jpeg)|(png)|(gif)|(html)|(ico)|(swf)|(xml))$");
>
>   }
>
> Boban Stojanovski wrote:
>
>> Hi
>> can someone tell me how to implement a fckeditor in a tapestry webapp.
>>
>> i use maven.
>> The Pom.XML is a bit large so ill paste just the fckeditor part
>>
>> 
>> org.chenillekit
>> chenillekit-core
>> 1.2.0
>> jar
>> false
>> 
>> 
>> org.chenillekit
>> chenillekit-tapestry
>> 1.2.0
>> jar
>> false
>> 
>>
>> Chenillekit has a FCKeditor.
>>
>> I tried to use it in my web app but i have a problem.
>>
>> the *.java page
>> 
>> import org.chenillekit.tapestry.core.components.Editor;
>> 
>> @Property
>> @Persist
>> private String testValue;
>> @Component(parameters = {"value=testValue", "width=100%"})
>> private Editor editor;
>> 
>> the *.tml part of the page
>> 
>> 
>> 
>> this is a test input
>> 
>> 
>> ${testValue}
>> .
>>
>>
>> i get an error
>>
>> HTTP ERROR: 403
>>
>> org/chenillekit/tapestry/core/components/fckeditor/editor/fckeditor.html
>>
>>
>> RequestURI=/assets/classpath/959ef68b8f100eee/org/chenillekit/tapestry/core/components/fckeditor/editor/fckeditor.html
>>
>> Powered by Jetty://
>>
>> can anyone give me some advice about fixing the problem?
>>
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Boban Stojanovski
PMF - Institute of informatics , Skopje


RE: Validators / Translators question

2009-12-10 Thread Jim O'Callaghan
Thanks Thiago.  I'm using the example at the link you specified, but found I
needed to provide validators and translators to complete the approach, esp.
the translator being missing / not bound was causing a NPE somewhere along
the line.  I can update the block to display the fields (sub fields in ex.
Address) but was wondering more about how the value is translated from what
is posted back into an Address object - is that not what the Translator
would do?  I'm probably missing something obvious here ...

Regards,
Jim.

-Original Message-
From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com]
Sent: 10 December 2009 11:31
To: Tapestry users
Subject: Re: Validators / Translators question


Em Thu, 10 Dec 2009 09:01:05 -0200, Jim O'Callaghan
 escreveu:

> Hi,

Hi!

> Client - is it an incorrect approach to used Validators / Translators in
> this scenario and if so can anyone advise on how to abstract and reuse an
> embedded Address rendering approach?

Validators and translators are meant to be used with form fields, not
rendering. They're not used by Grid nor BeanDisplay.
To do what you want, you need to provide a viewing block to your Address
class. The corresponding documentation is
http://tapestry.apache.org/tapestry5.1/guide/beaneditform.html, section
"Adding New Property Editors".

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, software architect and developer, 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


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



Re: Date Validator

2009-12-10 Thread Nicolas Bouillon

Thiago H. de Paula Figueiredo a écrit :
 > Validation errors do not come from app.properties. They need to be put
in some other properties file in the classpath and then you must inform 
this to Tapestry through a contribution to the ValidationMessagesSource



public void 
contributeValidationMessagesSource(OrderedConfiguration 
configuration) {
configuration.add("somename", "path/to/your/file/in/classpath/"); // 
do not include the .properties suffix.

}


That looks nice ! I will give it a try :-)

Thank you.
Nicolas.




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



Tapestry 5 on Websphere 6.1

2009-12-10 Thread Christian Köberl

I put together a small howto for anyone who tries to run Tapestry 5 on a
Websphere 6.1 (like we do yeah :) ):

http://wiki.apache.org/tapestry/HowToRunTapestry5Websphere

-- 
Chris
-- 
View this message in context: 
http://n2.nabble.com/Tapestry-5-on-Websphere-6-1-tp4145237p4145237.html
Sent from the Tapestry Users 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: Exception accessing T5 Registry from other servlet

2009-12-10 Thread Inge Solvoll
I succeeded on this in Struts now, it works nicely and I'm cleaning up the
registry by subclassing the struts action servlet and doing try-finally.

One problem left:

I'm using Sitemesh with T4. In my sitemesh decorator jsp, I'm referencing a
custom tag that references a T5 service that references
request.getSession(). Are you following me? :)

I'm getting the same error listed in this thread, request.getSession() gives
a nullpointer. When I remove the sitemesh filter, my T4 page renders as
expected. I've tried moving the sitemesh filter before and after the T5
filter, no change.



On Mon, Dec 7, 2009 at 7:42 PM, Howard Lewis Ship  wrote:

> I would put the cleanup in a try { } finally { } inside your servlet's
> doGet().
>
> On Mon, Dec 7, 2009 at 10:29 AM, Inge Solvoll 
> wrote:
> > Ok, let's see if I've understood this correctly:
> >
> > Tapestry has already invoked Registry.cleanupThread() for the current
> > (ignored) request before passing it on to some other servlet/resource.
> This
> > cleanup removed my Request/Response objects. Now when I put new
> > Request/Response instances back in the game with my mod, I need to
> perform
> > cleanup once more because Tapestry already did and gave away control. It
> no
> > longer knows when to clean up.
> >
> > Right?
> >
> > So now the only thing left to do is to find out where to put my cleanup
> > invocation. Hints anyone? I know I should be able to figure it out
> myself,
> > and I will try, but no harm done if anyone beats me to it :)
> >
> > Thanks for great help so far!
> > Inge
> >
> > On Mon, Dec 7, 2009 at 5:58 PM, Howard Lewis Ship 
> wrote:
> >
> >> On Mon, Dec 7, 2009 at 7:11 AM, Inge Solvoll 
> >> wrote:
> >> > Found something that seems to work by reading carefully through
> >> > TapestryModule.java, see code below. To me, it seems strange that I
> have
> >> to
> >> > do this. Do any of you guys see anything wrong with this?
> >> >
> >>
> >> Since it's not a Tapestry-related request, control has passed out of
> >> the TapestryFilter and on to other servlets within the web
> >> application. Tapestry has already cleaned up the RequestGlobals
> >> object, a per-thread service that stores the HttpServletRequest and
> >> (Tapestry) Request objects.
> >>
> >> You want to make sure to invoke the Registry.cleanupThread() method at
> >> the end of your request.
> >>
> >> I've been planning to add a simpler alternative to
> >> SessionStateObjects, an annotation that simply says "store this value
> >> in the session with this explicit key", to make coordinating a T5 app
> >> with a legacy app simpler.
> >>
> >>
> >> >  public void
> >> >
> >>
> contributeHttpServletRequestHandler(OrderedConfiguration
> >> > configuration, @Inject @Symbol(SymbolConstants.CHARSET) final String
> >> > applicationCharset, @Primary final SessionPersistedObjectAnalyzer
> >> analyzer,
> >> > final RequestGlobals requestGlobals) {
> >> >
> >> >HttpServletRequestFilter storeRequestResponse = new
> >> > HttpServletRequestFilter() {
> >> >
> >> >  public boolean service(HttpServletRequest servletRequest,
> >> > HttpServletResponse servletResponse, HttpServletRequestHandler
> handler)
> >> > throws IOException {
> >> >Request request = new RequestImpl(servletRequest,
> >> > applicationCharset, analyzer);
> >> >Response response = new ResponseImpl(servletResponse);
> >> >requestGlobals.storeRequestResponse(request, response);
> >> >return handler.service(servletRequest, servletResponse);
> >> >  }
> >> >};
> >> >
> >> >configuration.add("StoreRequestResponse", storeRequestResponse,
> >> > "before:*");
> >> >  }
> >> >
> >> >
> >> > On Mon, Dec 7, 2009 at 2:35 PM, Inge Solvoll  >> >wrote:
> >> >
> >> >> Thanks!
> >> >>
> >> >> Didn't work though. Tried running
> >> >> requestGlobals.storeServletRequestResponse before asm.get(...), still
> >> same
> >> >> error because requestGlobals.getRequest() is still null after storing
> >> >> httprequest.
> >> >>
> >> >> I discovered that requestGlobals.getHTTPServletRequest() returns a
> live
> >> and
> >> >> working request, while requestGlobals.getRequest() returns null. I
> also
> >> put
> >> >> a breakpoint in TapestryModule "StoreIntoGlobals", and it is run
> before
> >> my
> >> >> code.
> >> >>
> >> >> So, the Request and Response properties of requestGlobals aren't
> >> populated
> >> >> when using the Registry from another servlet i think. Am I right? Is
> >> there
> >> >> any way to make this work?
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On Mon, Dec 7, 2009 at 1:16 PM, Thiago H. de Paula Figueiredo <
> >> >> thiag...@gmail.com> wrote:
> >> >>
> >> >>> Em Mon, 07 Dec 2009 08:31:44 -0200, Inge Solvoll <
> >> inge.tapes...@gmail.com>
> >> >>> escreveu:
> >> >>>
> >> >>>  Hi!
> >> 
> >> >>>
> >> >>> Hi!
> >> >>>
> >> >>>
> >> >>>
> >>  Caused by: java.lang.NullPointerException
> >> at
> $Request_12568a717d3.getSession($Request_12568a717d3.java)
> >> at
> $R

Re: Date Validator

2009-12-10 Thread Thiago H. de Paula Figueiredo
Em Thu, 10 Dec 2009 10:21:13 -0200, Nicolas Bouillon   
escreveu:



Hi,


Hi!

My problem I can't set the default message in case of validation error.  
I've always a [[missing key: date-must-be-in-future]], even if i put the  
key in my WEB-INF/app.properties.


Validation errors do not come from app.properties. They need to be put in  
some other properties file in the classpath and then you must inform this  
to Tapestry through a contribution to the ValidationMessagesSource



public void  
contributeValidationMessagesSource(OrderedConfiguration  
configuration) {
	configuration.add("somename", "path/to/your/file/in/classpath/"); // do  
not include the .properties suffix.

}



I can only add my message on a per-page-per-field basis ?


I guess not.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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



Date Validator

2009-12-10 Thread Nicolas Bouillon

Hi,

I'm trying to add a validator for the date field. I've created the 
validator "infuture" to verify the picked date is in the future


t:validate="required,infuture"/>


In my app module, i've added

/**
 * Contributes the set of validators:
 */
public static void contributeFieldValidatorSource(
MappedConfiguration configuration) {

configuration.add("infuture", new DateValidator());
}

And my DateValidator is

import java.util.Date;

import org.apache.tapestry5.Field;
import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.ValidationException;
import org.apache.tapestry5.ioc.MessageFormatter;
import org.apache.tapestry5.services.FormSupport;
import org.apache.tapestry5.validator.AbstractValidator;

public class DateValidator extends AbstractValidator {

public DateValidator() {
super(null, Date.class, "date-must-be-in-future");
}

public void render(Field field, Void constraintValue,
MessageFormatter formatter, MarkupWriter writer,
FormSupport formSupport) {
// TODO Auto-generated method stub

}

public void validate(Field field, Void constraintValue,
MessageFormatter formatter, Date value) throws 
ValidationException {

if (value.before(new Date())) {
throw new ValidationException(buildMessage(formatter, field));
}
}

private String buildMessage(MessageFormatter formatter, Field field) {
return formatter.format(field.getLabel());
}
}


It's a simple copy-paste adapt of other validator such as 
org.apache.tapestry5.validator.Email


That works well.

My problem I can't set the default message in case of validation error. 
I've always a [[missing key: date-must-be-in-future]], even if i put the 
key in my WEB-INF/app.properties.


Looking a source code, it seams the source of the message are in 
tapestry-code/org/apache/tapestry5/internal/ValidationMessages.properties.


I can only add my message on a per-page-per-field basis ? Any way to 
configure another global source of message, to put mine ?


Thanks for help.
Nicolas.





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



Re: Validators / Translators question

2009-12-10 Thread Thiago H. de Paula Figueiredo
Em Thu, 10 Dec 2009 09:01:05 -0200, Jim O'Callaghan  
 escreveu:



Hi,


Hi!


Client - is it an incorrect approach to used Validators / Translators in
this scenario and if so can anyone advise on how to abstract and reuse an
embedded Address rendering approach?


Validators and translators are meant to be used with form fields, not  
rendering. They're not used by Grid nor BeanDisplay.
To do what you want, you need to provide a viewing block to your Address  
class. The corresponding documentation is  
http://tapestry.apache.org/tapestry5.1/guide/beaneditform.html, section  
"Adding New Property Editors".


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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



Validators / Translators question

2009-12-10 Thread Jim O'Callaghan
Hi,

I'm trying to simplify some pages using the Grid display for search results
and the BEF for input and want to find out if Validators / Translators are
intended to only operate on individual fields, or if the approach can be
used as a pattern to validate and display multiple fields within a single
translator - an example would be a Client entity that contains an Address
entity - I want to be able to throw the Client at a Grid or BEF and have
something render a multi-line address along with the other fields from the
Client - is it an incorrect approach to used Validators / Translators in
this scenario and if so can anyone advise on how to abstract and reuse an
embedded Address rendering approach?

Many thanks,
Jim.


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



Re: What about the EWDT book?

2009-12-10 Thread Andreas Andreou
Yea, no point in getting Enjoying-Web-Development-with-Tapestry and
afaict there won't be a T5 update for it since Kent has been inactive
in this list for more than a year and a half.


On Thu, Dec 10, 2009 at 11:07 AM, Juan E. Maya  wrote:
> Alessandro although t4 and t5 are based on the same concepts i think
> that u do things in quiet a different way and it's not worthy to buy
> if u are planning to develop an application using t5.
>
> There have been rumors of 2 other new tapestry 5 books that could go
> out. One would be an english translation from Igor's new book
> (http://www.amazon.de/Tapestry-Die-Entwicklung-Webanwendungen-Leichtigkeit/dp/3827328446/ref=sr_1_1?ie=UTF8&s=books&qid=1260435889&sr=8-1-spell)
>
> and the other one would be a new one written by Howard.
>
>
> On Thu, Dec 10, 2009 at 9:54 AM, Alessandro Bottoni
>  wrote:
>> Hello All,
>> I'm studying Tapestry 5 and using it for a new project. I have already
>> bought and read from cover to cover this fine book by Alexander Kolesnikov:
>>
>> http://www.amazon.com/Tapestry-Applications-step-step-developer-friendly/dp/1847193072/ref=sr_1_3?ie=UTF8&s=books&qid=1260433982&sr=1-3
>>
>> Now, I'm curious about this other book:
>>
>> http://www.amazon.com/Enjoying-Web-Development-Tapestry-Tong/dp/1411649133/ref=pd_sim_b_4
>>
>> Everybody seems to love it despite the fact that it deals with Tapestry
>> 4 /only/. This is quite strange, given that T5 has a completely new code
>> base and this should have made obsolete any document regarding the old
>> version.
>>
>> Hence, I would be happy to hear your opinion about it. Is this book
>> still worth its money (around 40US$), at the end of 2009, despite the
>> fact that it was published in 2006/2007 (2nd and 3rd editions) and
>> describes an old and maybe obsolete version of the framework?
>>
>> Is the difference between T4 and T5 so great to make this book useless?
>>
>> TIA
>>
>> PS: Should Mr. Ka Iok 'Kent' Tong (the author of this book) be on this
>> list, can he please let us know if he plan to release a forth edition of
>> his fine book, devoted to Tapestry 5?
>> --
>>
>> Alessandro Bottoni
>> Website: http://www.alessandrobottoni.it/
>>
>> "I am prepared for the worst, but hope the best."
>>     -- Benjamin Disraeli
>>
>>
>>
>>
>> -
>> 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
>
>



-- 
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



Re: What about the EWDT book?

2009-12-10 Thread Juan E. Maya
Alessandro although t4 and t5 are based on the same concepts i think
that u do things in quiet a different way and it's not worthy to buy
if u are planning to develop an application using t5.

There have been rumors of 2 other new tapestry 5 books that could go
out. One would be an english translation from Igor's new book
(http://www.amazon.de/Tapestry-Die-Entwicklung-Webanwendungen-Leichtigkeit/dp/3827328446/ref=sr_1_1?ie=UTF8&s=books&qid=1260435889&sr=8-1-spell)

and the other one would be a new one written by Howard.


On Thu, Dec 10, 2009 at 9:54 AM, Alessandro Bottoni
 wrote:
> Hello All,
> I'm studying Tapestry 5 and using it for a new project. I have already
> bought and read from cover to cover this fine book by Alexander Kolesnikov:
>
> http://www.amazon.com/Tapestry-Applications-step-step-developer-friendly/dp/1847193072/ref=sr_1_3?ie=UTF8&s=books&qid=1260433982&sr=1-3
>
> Now, I'm curious about this other book:
>
> http://www.amazon.com/Enjoying-Web-Development-Tapestry-Tong/dp/1411649133/ref=pd_sim_b_4
>
> Everybody seems to love it despite the fact that it deals with Tapestry
> 4 /only/. This is quite strange, given that T5 has a completely new code
> base and this should have made obsolete any document regarding the old
> version.
>
> Hence, I would be happy to hear your opinion about it. Is this book
> still worth its money (around 40US$), at the end of 2009, despite the
> fact that it was published in 2006/2007 (2nd and 3rd editions) and
> describes an old and maybe obsolete version of the framework?
>
> Is the difference between T4 and T5 so great to make this book useless?
>
> TIA
>
> PS: Should Mr. Ka Iok 'Kent' Tong (the author of this book) be on this
> list, can he please let us know if he plan to release a forth edition of
> his fine book, devoted to Tapestry 5?
> --
>
> Alessandro Bottoni
> Website: http://www.alessandrobottoni.it/
>
> "I am prepared for the worst, but hope the best."
>     -- Benjamin Disraeli
>
>
>
>
> -
> 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



What about the EWDT book?

2009-12-10 Thread Alessandro Bottoni
Hello All,
I'm studying Tapestry 5 and using it for a new project. I have already
bought and read from cover to cover this fine book by Alexander Kolesnikov:

http://www.amazon.com/Tapestry-Applications-step-step-developer-friendly/dp/1847193072/ref=sr_1_3?ie=UTF8&s=books&qid=1260433982&sr=1-3

Now, I'm curious about this other book:

http://www.amazon.com/Enjoying-Web-Development-Tapestry-Tong/dp/1411649133/ref=pd_sim_b_4

Everybody seems to love it despite the fact that it deals with Tapestry
4 /only/. This is quite strange, given that T5 has a completely new code
base and this should have made obsolete any document regarding the old
version.

Hence, I would be happy to hear your opinion about it. Is this book
still worth its money (around 40US$), at the end of 2009, despite the
fact that it was published in 2006/2007 (2nd and 3rd editions) and
describes an old and maybe obsolete version of the framework?

Is the difference between T4 and T5 so great to make this book useless?

TIA

PS: Should Mr. Ka Iok 'Kent' Tong (the author of this book) be on this
list, can he please let us know if he plan to release a forth edition of
his fine book, devoted to Tapestry 5?
-- 

Alessandro Bottoni
Website: http://www.alessandrobottoni.it/

"I am prepared for the worst, but hope the best."
 -- Benjamin Disraeli



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

Re: Tapestry 5.1.0.5 FCKEDITOR PROBLEM

2009-12-10 Thread Joost Schouten (ml)
I too had this problem and it was caused by the new (and very necessary) 
asset authorisation which prevents web access to your context root 
through your tapestry app. The default is fairly strict, and as it seems 
too strict for the FCKeditor in the chenillekit-tapestry package. I 
added the following [1] to my AppModule which fixed it. It tells T5 to 
allow requests to the chenillekit assets with the specified extensions 
(especially the html and xml once are needed as the images are already 
allowed I think).


I think you should not need to do this as chenillekit should add this 
itself, but I assume it will in the next release. But maybe raise this 
issue in the chenillekit mailing list to be sure.


Hope it helps,
Joost

[1]
public static void contributeRegexAuthorizer(
   Configuration configuration) {
//should actually not be needed
   
configuration.add("org/chenillekit/.*\\.((css)|(js)|(jpg)|(jpeg)|(png)|(gif)|(html)|(ico)|(swf)|(xml))$");

   }

Boban Stojanovski wrote:

Hi
can someone tell me how to implement a fckeditor in a tapestry webapp.

i use maven.
The Pom.XML is a bit large so ill paste just the fckeditor part


org.chenillekit
chenillekit-core
1.2.0
jar
false


org.chenillekit
chenillekit-tapestry
1.2.0
jar
false


Chenillekit has a FCKeditor.

I tried to use it in my web app but i have a problem.

the *.java page

import org.chenillekit.tapestry.core.components.Editor;

@Property
@Persist
private String testValue;
@Component(parameters = {"value=testValue", "width=100%"})
private Editor editor;

the *.tml part of the page



this is a test input


${testValue}
.


i get an error

HTTP ERROR: 403

org/chenillekit/tapestry/core/components/fckeditor/editor/fckeditor.html

RequestURI=/assets/classpath/959ef68b8f100eee/org/chenillekit/tapestry/core/components/fckeditor/editor/fckeditor.html

Powered by Jetty://

can anyone give me some advice about fixing the problem?

  



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