Re: Accessing protected instrumented fields

2012-04-14 Thread Olaf Tomczak
Great news Howard,

I'll try the fix right away. Thanks for your awesome work!

--
Olaf Tomczak

2012/4/13 Steve Eynon 

> Oh sweet. That is good news, cheers!
> --
> Steve Eynon
> ---
> "If at first you don't succeed,
>so much for skydiving!"
>
>
>
>
> On 13 April 2012 06:47, Howard Lewis Ship  wrote:
> > Turns out its mutable fields that don't work.  I was fooled because my
> > tests mistakenly only attempted injected fields.
> >
> > In any case, it is fixed in 5.3.3-rc-3.
> >
> > On Wed, Apr 11, 2012 at 9:20 PM, Steve Eynon
> >  wrote:
> >> Hello,
> >>
> >> Directly accessing instrumented fields (@Parameter etc...) from
> >> subclasses does not work. This is fine, but I do wish T5 complained
> >> bitterly when it finds a instrumented field marked as non-public.
> >>
> >> Olaf found similar problems here (TAP5-1860):
> >>
> http://tapestry.1045711.n5.nabble.com/Protected-page-properties-confusion-td5607824.html
> >>
> >> We've come a cropper with this a couple of times when young'uns mark a
> >> @Parameter field as protected and accesses it from a subclass. The
> >> nasty gotcha being, that once the field is shadowed in DevMode, it
> >> works fine! But then fails spectacularly in ProdMode with an NPE as
> >> the actual field instance is never set!
> >>
> >> I know this is all related to TAP5-1801 and the T5.3.2 release but I'm
> >> not really sure what it was supposed to address. If, as I suspect, we
> >> shouldn't mark instrumented fields as protected could the
> >> documentation be updated to say so? (
> >>
> http://tapestry.apache.org/component-classes.html#ComponentClasses-InstanceVariables
> >> )
> >>
> >> Cheers,
> >>
> >> Steve.
> >> --
> >> Steve Eynon
> >> ---
> >> "If at first you don't succeed,
> >>so much for skydiving!"
> >>
> >> -
> >> 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
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Protected page properties confusion

2012-03-30 Thread Olaf Tomczak
Guys,

After reading the announcement about
https://issues.apache.org/jira/browse/TAP5-1801 I decided to start using
protected properties in my pages. I wanted to be able to create some
properties in a base page and then use them in the page's subclass.
Unfortunately I encountered a problem - when I set a protected property in
a subclass and the read it in a superclass the property is not set. I've
submitted a bug here: https://issues.apache.org/jira/browse/TAP5-1860 but
since I don't see anyone confirming this issue I think that maybe I
misunderstood the idea of this improvement. So please advise..

Thanks,
Olaf


Re: CSS for all pages

2011-09-28 Thread Olaf Tomczak
The other way to do this is (simpler in my opinion) to implement your own
JavaScriptStack (List getStylesheets() method) and make a
contribution to JavaScriptStackSource in your module.

Cheers, Olaf

2011/9/28 Wechsung, Wulf 

> Exactly, Steve!
> You solution is great! Thanks a lot :)
>
>
> -Original Message-
> From: Steve Eynon [mailto:steve.ey...@alienfactory.co.uk]
> Sent: Mittwoch, 28. September 2011 19:53
> To: Tapestry users
> Subject: Re: CSS for all pages
>
> Ah, cheers Thiago!
>
> I think Wulf was saying the CSS was part of a separate module he
> wouldn't have direct access to the Layout component - in that case he
> could use the Worker to single out the Layout and just add the Mixin
> to that.
>
> -- Forwarded message --
> From: Thiago H. de Paula Figueiredo 
> Date: 29 September 2011 01:27
> Subject: Re: CSS for all pages
> To: Steve Eynon 
>
> Awesome use of a component class transformation and a mixin, Steve! :)
>
> Wulf, I'd say almost all Tapestry projects have a Layout component
> used in all pages, so @Import'ing your CSS or JavaScript in it makes
> them being added to all pages.
>
>
> On Wed, 28 Sep 2011 13:39:56 -0300, Steve Eynon
>  wrote:
>
> > There may be an easier way, but you could have a worker to add a Mixin
> > / Component to each page which has no markup, but @Import's your CSS.
> >
> > In T5.3 it's :
> >
> > public class EmbedCssMixinInEveryPageWorker implements
> > ComponentClassTransformWorker2 {
> >public void transform(PlasticClass plasticClass,
> > TransformationSupport support, MutableComponentModel model) {
> >if (model.isPage())
> >model.addMixinClassName(CssMixin.class.getName());
> >}
> > }
> >
> > @Import(stylesheet="context:myApp.css")
> > public class CssMixin {
> > }
> >
> > in your module, add
> >
> > public static void
> >
> contributeComponentClassTransformWorker(OrderedConfiguration
> > configuration) {
> >configuration.addInstance("CssMixin",
> EmbedCssMixinInEveryPageWorker.class);
> > }
> >
> > Steve.
> >
> > On 29 September 2011 00:24, Wechsung, Wulf 
> wrote:
> >>
> >> Hello Guys,
> >>
> >> I was wondering if it is at all possible to add a global (ie included in
> all pages) CSS from a module. Basically just like the tapestry framework
>  adds the default.css to any page in your tapestry web app I would like to
> have a webapp that loads a module that includes a CSS in all the pages of
> the app. The use-case is that I need to add some CSS fixes that should go
> into all apps that use the module auto-magically as is the case with filters
> and services.
> >>
> >> Thanks and kind Regards,
> >> Wulf
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer, and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
> 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: Value of select type

2011-09-27 Thread Olaf Tomczak
Isn't this a simple typo?
you have property named 'gender'  not 'genger' in profileDO.

Cheers,
Olaf

2011/9/27 Taha Hafeez Siddiqi 

> Hi
>
> Two things.
>
> 1) why is there a gengerEnum property in Update.java when it is not in use
> ?
>
> 2)  Is there a setter/getter for genger in ProfileDO ?
>
> regards
> Taha
>
> On Sep 27, 2011, at 8:40 PM, Olga wrote:
>
> > Hello, i have this problem.
> >
> > I have object Profile, this object has field
> > private GenderEnum gender;
> >
> > When i need update Profile, i create form:
> >
> > Update.tml
> >
> > 
> > Gender:
> > 
> > > t:value="profileDO.genger"/>
> > 
> > 
> >
> > Update.java
> >
> > @Persist
> > private ProfileDO profileDO;
> > private GenderEnum gengerEnum;
> >
> > public SelectModel getGengeres() {
> >return new EnumSelectModel(GenderEnum.class, messages);
> > }
> >
> > public GenderEnum getGengerEnum() {
> > return gengerEnum;
> > }
> >
> > public void setGengerEnum(GenderEnum gengerEnum) {
> >this.gengerEnum = gengerEnum;
> > }
> >
> > Genger can be select o not. The problem is when i try to go to Update
> page i
> > have this error:
> >
> > Exception assembling root component of page Update: Could not convert
> > 'profileDO.genger' into a component parameter binding: Exception
> generating
> > conduit for expression 'profileDO.genger': Class
> > com.htc.identity.domain.model.ProfileDO does not contain a property (or
> > public field) named 'genger'.
> >
> >
> > What i do wrong?
> > Thanks.
> >
> >
> >
> > --
> > View this message in context:
> http://tapestry.1045711.n5.nabble.com/Value-of-select-type-tp4845726p4845726.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: Rewriting index.html using LinkTransformer

2011-02-04 Thread Olaf Tomczak
Thiago,

2011/2/4 Thiago H. de Paula Figueiredo :
> On Wed, 02 Feb 2011 07:04:54 -0200, Olaf Tomczak 
> wrote:
>
>> Hello,
>
> Hi!
>
>> I recently migrated to Tapestry 5.2 and decided to re-implement
>> URLRewriter rules as LinkTransformers. Unfortunately there's a
>> problem. I have to rewrite all requests to *.html pages and route them
>> to my Index page (since the application was previously using html
>> pages and some users have it bookmarked). The
>> PageRenderLinkTransformer works for this purpose except for index.html
>> page. Since Index is a page name, requests to index.html are
>> automatically treated as component event requests (component html of
>> Index page) and are not passed through my transformer. Is there a way
>> to work around this issue?
>
> I guess you hit a scenario which is not covered in LinkTransforms, as they
> only deal with event URL -> event URL and page URL -> page URL
> transformations, but not event URL (anything with a dot in it) -> page
> render URL nor vice-versa.

Thanks for confirming this for me. I've worked around the problem by
renaming "start page" to Main and creating PageRenderLinkTransformer
transforming /index to /main. I guess this works fine and does not
require using an external url rewriter.

Thanks,
Olaf Tomczak

>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Rewriting index.html using LinkTransformer

2011-02-02 Thread Olaf Tomczak
Hello,

I recently migrated to Tapestry 5.2 and decided to re-implement
URLRewriter rules as LinkTransformers. Unfortunately there's a
problem. I have to rewrite all requests to *.html pages and route them
to my Index page (since the application was previously using html
pages and some users have it bookmarked). The
PageRenderLinkTransformer works for this purpose except for index.html
page. Since Index is a page name, requests to index.html are
automatically treated as component event requests (component html of
Index page) and are not passed through my transformer. Is there a way
to work around this issue?

Thank you,
Olaf Tomczak

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