Re: child component lookup
Solved - I had to use @MixinAfter. Thanks everyone! On Sat, Apr 16, 2016 at 9:14 AM, Ilya Obshadko wrote: > Well, this is actually quite straightforward approach. However I have > encountered a problem that looks weird. This is my mixin code: > > *public* *class* ModalIntegration { > > @InjectContainer > > *private* Form form; > > > *void* afterRender ( MarkupWriter markupWriter ) { > > markupWriter.attributes ( "data-submission-failed", form.getHasErrors > () ); > > } > > } > > It's supposed to render an additional form attribute which modal JS later > can use to determine if it should dismiss or not. > Somehow this attribute is being rendered not on the form itself, as I > naturally expected, but on the form's parent element (containing zone). > > Is there any explanation for that? I'm using 5.4-beta6. > > > On Sat, Apr 16, 2016 at 1:08 AM, Thiago H de Paula Figueiredo < > thiag...@gmail.com> wrote: > >> On Fri, 15 Apr 2016 17:34:03 -0300, Barry Books wrote: >> >> yes >>> >> >> Tapestry mixins may not be easy to understand at first, but when you do, >> you realize how powerful they are, specially when combined with a class >> transformation when you need to apply them to several component instances >> at once. :) >> >> >> >>> On Friday, April 15, 2016, Ilya Obshadko >>> wrote: >>> >>> Barry, thanks for your suggestion - I think this is what I need. Do you mean an implementation of ComponentClassTransformWorker2? On Fri, Apr 15, 2016 at 2:12 PM, Barry Books >>> > wrote: > I'm not exactly sure I understand the requirements but I think you could do > this with a mixin on the form. At the very least this would allow > communication with the form mixin and the modal via the Environment > service. The modal could put something in the environment and the mixin > could add some status. No status means no form. The mixin could be applied > to all forms via a worker. > > On Friday, April 15, 2016, Ilya Obshadko >>> > wrote: > > > Is there any way to search for specific component down the component > > hierarchy? > > > > Consider the following use case: > > > > - I have a component responsible for rendering Bootstrap modal > > - this modal may (or may not) contain a form > > - if modal contains a form and submission is successful, the modal should > > be automatically dismissed > > - it modal contains a form and submission is unsuccessful, the modal > should > > not close (regardless of client validation being on/off) > > > > I've been looking around ComponentSource/ComponentResources classes, but > > couldn't find anything relevant yet. > > > > Environment service can't help either, because modal is a form's parent > and > > at the time of modal rendering FormSupport is not yet available. > > > > -- > > Ilya Obshadko > > > -- Ilya Obshadko >> >> -- >> Thiago H. de Paula Figueiredo >> Tapestry, Java and Hibernate consultant and developer >> http://machina.com.br >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > > -- > Ilya Obshadko > > -- Ilya Obshadko
Re: child component lookup
Well, this is actually quite straightforward approach. However I have encountered a problem that looks weird. This is my mixin code: *public* *class* ModalIntegration { @InjectContainer *private* Form form; *void* afterRender ( MarkupWriter markupWriter ) { markupWriter.attributes ( "data-submission-failed", form.getHasErrors () ); } } It's supposed to render an additional form attribute which modal JS later can use to determine if it should dismiss or not. Somehow this attribute is being rendered not on the form itself, as I naturally expected, but on the form's parent element (containing zone). Is there any explanation for that? I'm using 5.4-beta6. On Sat, Apr 16, 2016 at 1:08 AM, Thiago H de Paula Figueiredo < thiag...@gmail.com> wrote: > On Fri, 15 Apr 2016 17:34:03 -0300, Barry Books wrote: > > yes >> > > Tapestry mixins may not be easy to understand at first, but when you do, > you realize how powerful they are, specially when combined with a class > transformation when you need to apply them to several component instances > at once. :) > > > >> On Friday, April 15, 2016, Ilya Obshadko wrote: >> >> Barry, thanks for your suggestion - I think this is what I need. >>> >>> Do you mean an implementation of ComponentClassTransformWorker2? >>> >>> On Fri, Apr 15, 2016 at 2:12 PM, Barry Books >> > wrote: >>> >>> > I'm not exactly sure I understand the requirements but I think you >>> could >>> do >>> > this with a mixin on the form. At the very least this would allow >>> > communication with the form mixin and the modal via the Environment >>> > service. The modal could put something in the environment and the mixin >>> > could add some status. No status means no form. The mixin could be >>> applied >>> > to all forms via a worker. >>> > >>> > On Friday, April 15, 2016, Ilya Obshadko >> > >>> wrote: >>> > >>> > > Is there any way to search for specific component down the component >>> > > hierarchy? >>> > > >>> > > Consider the following use case: >>> > > >>> > > - I have a component responsible for rendering Bootstrap modal >>> > > - this modal may (or may not) contain a form >>> > > - if modal contains a form and submission is successful, the modal >>> should >>> > > be automatically dismissed >>> > > - it modal contains a form and submission is unsuccessful, the modal >>> > should >>> > > not close (regardless of client validation being on/off) >>> > > >>> > > I've been looking around ComponentSource/ComponentResources classes, >>> but >>> > > couldn't find anything relevant yet. >>> > > >>> > > Environment service can't help either, because modal is a form's >>> parent >>> > and >>> > > at the time of modal rendering FormSupport is not yet available. >>> > > >>> > > -- >>> > > Ilya Obshadko >>> > > >>> > >>> >>> >>> >>> -- >>> Ilya Obshadko >>> >>> > > -- > Thiago H. de Paula Figueiredo > Tapestry, Java and Hibernate consultant and developer > http://machina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Ilya Obshadko
Re: child component lookup
On Fri, 15 Apr 2016 17:34:03 -0300, Barry Books wrote: yes Tapestry mixins may not be easy to understand at first, but when you do, you realize how powerful they are, specially when combined with a class transformation when you need to apply them to several component instances at once. :) On Friday, April 15, 2016, Ilya Obshadko wrote: Barry, thanks for your suggestion - I think this is what I need. Do you mean an implementation of ComponentClassTransformWorker2? On Fri, Apr 15, 2016 at 2:12 PM, Barry Books > wrote: > I'm not exactly sure I understand the requirements but I think you could do > this with a mixin on the form. At the very least this would allow > communication with the form mixin and the modal via the Environment > service. The modal could put something in the environment and the mixin > could add some status. No status means no form. The mixin could be applied > to all forms via a worker. > > On Friday, April 15, 2016, Ilya Obshadko > wrote: > > > Is there any way to search for specific component down the component > > hierarchy? > > > > Consider the following use case: > > > > - I have a component responsible for rendering Bootstrap modal > > - this modal may (or may not) contain a form > > - if modal contains a form and submission is successful, the modal should > > be automatically dismissed > > - it modal contains a form and submission is unsuccessful, the modal > should > > not close (regardless of client validation being on/off) > > > > I've been looking around ComponentSource/ComponentResources classes, but > > couldn't find anything relevant yet. > > > > Environment service can't help either, because modal is a form's parent > and > > at the time of modal rendering FormSupport is not yet available. > > > > -- > > Ilya Obshadko > > > -- Ilya Obshadko -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: child component lookup
yes On Friday, April 15, 2016, Ilya Obshadko wrote: > Barry, thanks for your suggestion - I think this is what I need. > > Do you mean an implementation of ComponentClassTransformWorker2? > > On Fri, Apr 15, 2016 at 2:12 PM, Barry Books > wrote: > > > I'm not exactly sure I understand the requirements but I think you could > do > > this with a mixin on the form. At the very least this would allow > > communication with the form mixin and the modal via the Environment > > service. The modal could put something in the environment and the mixin > > could add some status. No status means no form. The mixin could be > applied > > to all forms via a worker. > > > > On Friday, April 15, 2016, Ilya Obshadko > > wrote: > > > > > Is there any way to search for specific component down the component > > > hierarchy? > > > > > > Consider the following use case: > > > > > > - I have a component responsible for rendering Bootstrap modal > > > - this modal may (or may not) contain a form > > > - if modal contains a form and submission is successful, the modal > should > > > be automatically dismissed > > > - it modal contains a form and submission is unsuccessful, the modal > > should > > > not close (regardless of client validation being on/off) > > > > > > I've been looking around ComponentSource/ComponentResources classes, > but > > > couldn't find anything relevant yet. > > > > > > Environment service can't help either, because modal is a form's parent > > and > > > at the time of modal rendering FormSupport is not yet available. > > > > > > -- > > > Ilya Obshadko > > > > > > > > > -- > Ilya Obshadko >
Re: child component lookup
Pavel, thanks! My point is to handle this on modal level: this should be completely transparent for the form itself. On Fri, Apr 15, 2016 at 2:33 PM, Pavel Chernyak wrote: > Ilya, greetings. > > As for submit button i search inside modal body for form component or > specify form name in modal component. > So, after clicking button form submits. > Onsuccess i invoke hideModal function(via hidemodal event). > OnFailure i do nothing except updating formzone to show messages/errors > e.t.c. > If you want i can send you some examples. > > > On 15 April 2016 at 14:27, Ilya Obshadko wrote: > > > Barry, thanks for your suggestion - I think this is what I need. > > > > Do you mean an implementation of ComponentClassTransformWorker2? > > > > On Fri, Apr 15, 2016 at 2:12 PM, Barry Books wrote: > > > > > I'm not exactly sure I understand the requirements but I think you > could > > do > > > this with a mixin on the form. At the very least this would allow > > > communication with the form mixin and the modal via the Environment > > > service. The modal could put something in the environment and the mixin > > > could add some status. No status means no form. The mixin could be > > applied > > > to all forms via a worker. > > > > > > On Friday, April 15, 2016, Ilya Obshadko wrote: > > > > > > > Is there any way to search for specific component down the component > > > > hierarchy? > > > > > > > > Consider the following use case: > > > > > > > > - I have a component responsible for rendering Bootstrap modal > > > > - this modal may (or may not) contain a form > > > > - if modal contains a form and submission is successful, the modal > > should > > > > be automatically dismissed > > > > - it modal contains a form and submission is unsuccessful, the modal > > > should > > > > not close (regardless of client validation being on/off) > > > > > > > > I've been looking around ComponentSource/ComponentResources classes, > > but > > > > couldn't find anything relevant yet. > > > > > > > > Environment service can't help either, because modal is a form's > parent > > > and > > > > at the time of modal rendering FormSupport is not yet available. > > > > > > > > -- > > > > Ilya Obshadko > > > > > > > > > > > > > > > -- > > Ilya Obshadko > > > > > > -- > С уважением, > Черняк Павел Александрович > -- Ilya Obshadko
Re: child component lookup
Ilya, greetings. As for submit button i search inside modal body for form component or specify form name in modal component. So, after clicking button form submits. Onsuccess i invoke hideModal function(via hidemodal event). OnFailure i do nothing except updating formzone to show messages/errors e.t.c. If you want i can send you some examples. On 15 April 2016 at 14:27, Ilya Obshadko wrote: > Barry, thanks for your suggestion - I think this is what I need. > > Do you mean an implementation of ComponentClassTransformWorker2? > > On Fri, Apr 15, 2016 at 2:12 PM, Barry Books wrote: > > > I'm not exactly sure I understand the requirements but I think you could > do > > this with a mixin on the form. At the very least this would allow > > communication with the form mixin and the modal via the Environment > > service. The modal could put something in the environment and the mixin > > could add some status. No status means no form. The mixin could be > applied > > to all forms via a worker. > > > > On Friday, April 15, 2016, Ilya Obshadko wrote: > > > > > Is there any way to search for specific component down the component > > > hierarchy? > > > > > > Consider the following use case: > > > > > > - I have a component responsible for rendering Bootstrap modal > > > - this modal may (or may not) contain a form > > > - if modal contains a form and submission is successful, the modal > should > > > be automatically dismissed > > > - it modal contains a form and submission is unsuccessful, the modal > > should > > > not close (regardless of client validation being on/off) > > > > > > I've been looking around ComponentSource/ComponentResources classes, > but > > > couldn't find anything relevant yet. > > > > > > Environment service can't help either, because modal is a form's parent > > and > > > at the time of modal rendering FormSupport is not yet available. > > > > > > -- > > > Ilya Obshadko > > > > > > > > > -- > Ilya Obshadko > -- С уважением, Черняк Павел Александрович
Re: child component lookup
Barry, thanks for your suggestion - I think this is what I need. Do you mean an implementation of ComponentClassTransformWorker2? On Fri, Apr 15, 2016 at 2:12 PM, Barry Books wrote: > I'm not exactly sure I understand the requirements but I think you could do > this with a mixin on the form. At the very least this would allow > communication with the form mixin and the modal via the Environment > service. The modal could put something in the environment and the mixin > could add some status. No status means no form. The mixin could be applied > to all forms via a worker. > > On Friday, April 15, 2016, Ilya Obshadko wrote: > > > Is there any way to search for specific component down the component > > hierarchy? > > > > Consider the following use case: > > > > - I have a component responsible for rendering Bootstrap modal > > - this modal may (or may not) contain a form > > - if modal contains a form and submission is successful, the modal should > > be automatically dismissed > > - it modal contains a form and submission is unsuccessful, the modal > should > > not close (regardless of client validation being on/off) > > > > I've been looking around ComponentSource/ComponentResources classes, but > > couldn't find anything relevant yet. > > > > Environment service can't help either, because modal is a form's parent > and > > at the time of modal rendering FormSupport is not yet available. > > > > -- > > Ilya Obshadko > > > -- Ilya Obshadko
Re: child component lookup
I'm not exactly sure I understand the requirements but I think you could do this with a mixin on the form. At the very least this would allow communication with the form mixin and the modal via the Environment service. The modal could put something in the environment and the mixin could add some status. No status means no form. The mixin could be applied to all forms via a worker. On Friday, April 15, 2016, Ilya Obshadko wrote: > Is there any way to search for specific component down the component > hierarchy? > > Consider the following use case: > > - I have a component responsible for rendering Bootstrap modal > - this modal may (or may not) contain a form > - if modal contains a form and submission is successful, the modal should > be automatically dismissed > - it modal contains a form and submission is unsuccessful, the modal should > not close (regardless of client validation being on/off) > > I've been looking around ComponentSource/ComponentResources classes, but > couldn't find anything relevant yet. > > Environment service can't help either, because modal is a form's parent and > at the time of modal rendering FormSupport is not yet available. > > -- > Ilya Obshadko >
child component lookup
Is there any way to search for specific component down the component hierarchy? Consider the following use case: - I have a component responsible for rendering Bootstrap modal - this modal may (or may not) contain a form - if modal contains a form and submission is successful, the modal should be automatically dismissed - it modal contains a form and submission is unsuccessful, the modal should not close (regardless of client validation being on/off) I've been looking around ComponentSource/ComponentResources classes, but couldn't find anything relevant yet. Environment service can't help either, because modal is a form's parent and at the time of modal rendering FormSupport is not yet available. -- Ilya Obshadko
(solved ?) tapestry 4.1.6 and pergmen question
I write this so it goes on web archives and maybe (even though is not probabile) one day someone will find it useful. The solution is to avoid this https://wiki.apache.org/tapestry/EasyBrowserRedirection never raise that exception. Instead use PageRedirectException in case you want to pass parameters to the page put them in the session and remove them in rendering phase of the page you are redirecting to finally be sure PageRedirectException also in the the page you are redirecting to because it will not be trapped an Tapestry Exception page will be showed. --- It seems I have found the glitch. Following this suggestion https://wiki.apache.org/tapestry/EasyBrowserRedirection I had implented redirection in a pageBeginRender method (I'm talking about T 4.1.6, sorry about that) Now it seems that when the excpetion is raised PermGen occupation is increased. It seems there is a difference with this regard raising the exception in a listener instead that in pageBeginrender. Anyone feels its memory activated on this? Il 07/04/2016 17:37, Kalle Korhonen ha scritto: > On Thu, Apr 7, 2016 at 12:33 AM, Ivano Luberti wrote: > >> Kalle, Chris, thanks for your answers. >> Unfortunately the problem is not related to webapp reloading even >> restarting the Tomcat service leads to out of PermGen in a few days, >> PermGen itself is quite large and I already use UseConcMarkSweepGC. Down >> The cause of the space consumption seems to be the presence of a lot of >> classes of this type >> org.apache.tapestry.enhance.ClassFactoryClassLoader >> > That's a symptom, not a cause. > > >> It seems that the more request the application serves the more PermGen >> increases and that's led me to think that the page pool is never cleaned up >> or at least not well cleanedup. >> > Most likely, you have a permgen memory leak. Are you using streams and/or > threads on your pages and are they properly closed, even in case of > exceptions? I can't tell you how many memory leaks I've plugged over the > years in thread and stream handling. Invariably, the errors are in your own > code. See https://plumbr.eu/blog/memory-leaks/what-is-a-permgen-leak for > possible causes for a permgen memory leak. Also, you are in luck because > Tomcat 6 added some useful tools for detecting memory leaks (see > http://wiki.apache.org/tomcat/MemoryLeakProtection, and Tomcat 7 and up is > even able to recover from some of them). Take a heap dump of the stressed > out system and load it in your VisualVM. > > Kalle > > > >> Il 06/04/2016 23:24, Kalle Korhonen ha scritto: >>> If you run out of permgen space very quickly, then it's indicative that >> the >>> allocated permgen space is simply too small. Perhaps the new version of >>> Tomcat requires more of it for itself, leaving less for your application. >>> Is the webapp restarted at times? If so, that can easily cause permgen >>> space to fill up because of the way OGNL works. And even if you are not >>> restarting the app, you need to exercise all parts of your web >> application >>> to find out the true permgen space consumption of it. >>> >>> Kalle >>> >>> On Wed, Apr 6, 2016 at 1:49 PM, Ivano Luberti >> wrote: Hey Tony, if you don't mind, can you send me all the configuration options of Java and Tomcat you are using? So tomcat6.conf and server.xml files? No one else on the list can share its thoughts? Il 05/04/2016 23:03, Ivano Luberti ha scritto: > Hi Tony thanks for the quick answer: > > Il 05/04/2016 21:50, Tony Nelson ha scritto: >> I still have a Tapestry 4 app running with Tomcat 6.0.41, and it runs well enough with: >> -XX:MaxPermSize=1024m > with that setting it fails but... >> I also have >> >> -Xmx12g -Xms4g -XX:+UsseConcMarkSweepGC -XX:+UseParNewGC > I have only -Xmx2g > > I use > > -XX:+UseConcMarkSweepGC > > but not > > -XX:+UseParNewGC > > > but this last one doesn't seem to have an influence on PermGen, does >> it? > -- == dott. Ivano Mario Luberti Archimede Informatica societa' cooperativa a r. l. Sede Operativa Via Gereschi 36 - 56126- Pisa tel.: +39-050- 580959 tel/fax: +39-050-8932061 web: www.archicoop.it == - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org >> -- >> == >> dott. Ivano Mario Luberti >> Archimede Informatica societa' cooperativa a r. l. >> Sede Operativa >> Via Gereschi 36 - 56126- Pisa >> tel.: +39-050- 580959 >> tel/fax: +39-050-8932061 >> web: www.archicoop.it >> == >> >> >> >>