Re: MethodInvocation.didThrowCheckedException returns true when there is a RuntimeException

2012-11-19 Thread Howard Lewis Ship
Ill have to take a peek at the javadoc and tests to see what's up.
On Monday, November 19, 2012, fmaylinch wrote:

> My advised method throws an exception that (indirectly) extends
> RuntimeException. And I don't catch it -- not before getting to the
> advisor. I catch it afterwards, and that's when I noticed the wrapped
> exception (wrapped by "rethrow").
>
> I debugged the code and I get to the line where it says "throw rtEx;". Is
> that even possible? I am asking for a RuntimeException exception and I get
> one. I should always get "null", shouldn't I.
>
> Thanks for your help.
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/MethodInvocation-didThrowCheckedException-returns-true-when-there-is-a-RuntimeException-tp5718086p5718118.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.



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


Re: Update the tapestry site

2012-11-19 Thread Joost Schouten (mailing lists)
My confluence username: joost [a] yanomo [period] com

Sam Ruby mailed me on August 9th 2011

-

Dear Joost Schouten,

This message acknowledges receipt of your ICLA, which has been filed in the 
Apache Software Foundation records.

If you have been voted in as a committer, please advise the project PMC that 
your ICLA has been filed.

Warm Regards,

-- Sam Ruby
Assistant Secretary, Apache Software Foundation
---


On Nov 20, 2012, at 12:31 AM, Dragan Sahpaski wrote:

> On Tue, Nov 20, 2012 at 12:24 AM, Joost Schouten (mailing lists) <
> joost...@jsportal.com> wrote:
> 
>> Looking at the apache license page I remembered I have already submitted
>> my CLA a few years ago with apache. So the next question is: Who can I give
>> my confluence username/email to setup the appropriate rights?
>> 
> 
> After you send it to apache you get a confirmation email that you can
> forward here to the list and ask for access. Post your username in the same
> message.
> 
> 
>> 
>> Cheers,
>> Joost
>> 
>> 
>> On Nov 19, 2012, at 11:21 PM, Dragan Sahpaski wrote:
>> 
>>> Done,
>>> You can get access by filling an apache ICLA (don't have to be a
>> comitter).
>>> Read more here http://www.apache.org/licenses/
>>> 
>>> Cheers,
>>> Dragan Sahpaski
>>> 
>>> 
>>> 
>>> On Mon, Nov 19, 2012 at 10:45 PM, Joost Schouten (mailing lists) <
>>> joost...@jsportal.com> wrote:
>>> 
 Hi Muhammad,
 
 I can see this is a somewhat minimal question. I guess I'm asking this
>> to
 one of the comitters as I would like to update the Yanomo screenshot
>> found
 at http://tapestry.apache.org/applications.html as it is outdated. As I
 have no editing rights at
 https://cwiki.apache.org/confluence/display/TAPESTRY/Applications# I
 can't do this myself.
 
 Sorry for the under specified question ;-)
 
 Cheers,
 Joost
 
 
 On Nov 19, 2012, at 10:39 PM, Muhammad Gelbana wrote:
 
> What do you mean by "Yanomo screenshot on the Tapetsry site", what is
 that ?
> 
> On Mon, Nov 19, 2012 at 11:18 PM, Joost Schouten (mailing lists) <
> joost...@jsportal.com> wrote:
> 
>> Hi,
>> 
>> The Yanomo screenshot on the Tapetsry site is outdated and we have a
 nice
>> new fancy one. I believe I need to be a confluence admin to make this
>> update right? How can I become one or who do I talk to?
>> 
>> Thanks,
>> Joost
>> -
>> 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: Update the tapestry site

2012-11-19 Thread Dragan Sahpaski
On Tue, Nov 20, 2012 at 12:24 AM, Joost Schouten (mailing lists) <
joost...@jsportal.com> wrote:

> Looking at the apache license page I remembered I have already submitted
> my CLA a few years ago with apache. So the next question is: Who can I give
> my confluence username/email to setup the appropriate rights?
>

After you send it to apache you get a confirmation email that you can
forward here to the list and ask for access. Post your username in the same
message.


>
> Cheers,
> Joost
>
>
> On Nov 19, 2012, at 11:21 PM, Dragan Sahpaski wrote:
>
> > Done,
> > You can get access by filling an apache ICLA (don't have to be a
> comitter).
> > Read more here http://www.apache.org/licenses/
> >
> > Cheers,
> > Dragan Sahpaski
> >
> >
> >
> > On Mon, Nov 19, 2012 at 10:45 PM, Joost Schouten (mailing lists) <
> > joost...@jsportal.com> wrote:
> >
> >> Hi Muhammad,
> >>
> >> I can see this is a somewhat minimal question. I guess I'm asking this
> to
> >> one of the comitters as I would like to update the Yanomo screenshot
> found
> >> at http://tapestry.apache.org/applications.html as it is outdated. As I
> >> have no editing rights at
> >> https://cwiki.apache.org/confluence/display/TAPESTRY/Applications# I
> >> can't do this myself.
> >>
> >> Sorry for the under specified question ;-)
> >>
> >> Cheers,
> >> Joost
> >>
> >>
> >> On Nov 19, 2012, at 10:39 PM, Muhammad Gelbana wrote:
> >>
> >>> What do you mean by "Yanomo screenshot on the Tapetsry site", what is
> >> that ?
> >>>
> >>> On Mon, Nov 19, 2012 at 11:18 PM, Joost Schouten (mailing lists) <
> >>> joost...@jsportal.com> wrote:
> >>>
>  Hi,
> 
>  The Yanomo screenshot on the Tapetsry site is outdated and we have a
> >> nice
>  new fancy one. I believe I need to be a confluence admin to make this
>  update right? How can I become one or who do I talk to?
> 
>  Thanks,
>  Joost
>  -
>  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: Update the tapestry site

2012-11-19 Thread Joost Schouten (mailing lists)
Looking at the apache license page I remembered I have already submitted my CLA 
a few years ago with apache. So the next question is: Who can I give my 
confluence username/email to setup the appropriate rights?

Cheers,
Joost


On Nov 19, 2012, at 11:21 PM, Dragan Sahpaski wrote:

> Done,
> You can get access by filling an apache ICLA (don't have to be a comitter).
> Read more here http://www.apache.org/licenses/
> 
> Cheers,
> Dragan Sahpaski
> 
> 
> 
> On Mon, Nov 19, 2012 at 10:45 PM, Joost Schouten (mailing lists) <
> joost...@jsportal.com> wrote:
> 
>> Hi Muhammad,
>> 
>> I can see this is a somewhat minimal question. I guess I'm asking this to
>> one of the comitters as I would like to update the Yanomo screenshot found
>> at http://tapestry.apache.org/applications.html as it is outdated. As I
>> have no editing rights at
>> https://cwiki.apache.org/confluence/display/TAPESTRY/Applications# I
>> can't do this myself.
>> 
>> Sorry for the under specified question ;-)
>> 
>> Cheers,
>> Joost
>> 
>> 
>> On Nov 19, 2012, at 10:39 PM, Muhammad Gelbana wrote:
>> 
>>> What do you mean by "Yanomo screenshot on the Tapetsry site", what is
>> that ?
>>> 
>>> On Mon, Nov 19, 2012 at 11:18 PM, Joost Schouten (mailing lists) <
>>> joost...@jsportal.com> wrote:
>>> 
 Hi,
 
 The Yanomo screenshot on the Tapetsry site is outdated and we have a
>> nice
 new fancy one. I believe I need to be a confluence admin to make this
 update right? How can I become one or who do I talk to?
 
 Thanks,
 Joost
 -
 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: Update the tapestry site

2012-11-19 Thread Joost Schouten (mailing lists)
That's quick! Thanks!

I'll go the ICLA way regardless as I was hoping to share a screenshot of the 
actual internal power as the public website is not the Tapestry part.

Cheers,
Joost


On Nov 19, 2012, at 11:21 PM, Dragan Sahpaski wrote:

> Done,
> You can get access by filling an apache ICLA (don't have to be a comitter).
> Read more here http://www.apache.org/licenses/
> 
> Cheers,
> Dragan Sahpaski
> 
> 
> 
> On Mon, Nov 19, 2012 at 10:45 PM, Joost Schouten (mailing lists) <
> joost...@jsportal.com> wrote:
> 
>> Hi Muhammad,
>> 
>> I can see this is a somewhat minimal question. I guess I'm asking this to
>> one of the comitters as I would like to update the Yanomo screenshot found
>> at http://tapestry.apache.org/applications.html as it is outdated. As I
>> have no editing rights at
>> https://cwiki.apache.org/confluence/display/TAPESTRY/Applications# I
>> can't do this myself.
>> 
>> Sorry for the under specified question ;-)
>> 
>> Cheers,
>> Joost
>> 
>> 
>> On Nov 19, 2012, at 10:39 PM, Muhammad Gelbana wrote:
>> 
>>> What do you mean by "Yanomo screenshot on the Tapetsry site", what is
>> that ?
>>> 
>>> On Mon, Nov 19, 2012 at 11:18 PM, Joost Schouten (mailing lists) <
>>> joost...@jsportal.com> wrote:
>>> 
 Hi,
 
 The Yanomo screenshot on the Tapetsry site is outdated and we have a
>> nice
 new fancy one. I believe I need to be a confluence admin to make this
 update right? How can I become one or who do I talk to?
 
 Thanks,
 Joost
 -
 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: Update the tapestry site

2012-11-19 Thread Dragan Sahpaski
Done,
You can get access by filling an apache ICLA (don't have to be a comitter).
Read more here http://www.apache.org/licenses/

Cheers,
Dragan Sahpaski



On Mon, Nov 19, 2012 at 10:45 PM, Joost Schouten (mailing lists) <
joost...@jsportal.com> wrote:

> Hi Muhammad,
>
> I can see this is a somewhat minimal question. I guess I'm asking this to
> one of the comitters as I would like to update the Yanomo screenshot found
> at http://tapestry.apache.org/applications.html as it is outdated. As I
> have no editing rights at
> https://cwiki.apache.org/confluence/display/TAPESTRY/Applications# I
> can't do this myself.
>
> Sorry for the under specified question ;-)
>
> Cheers,
> Joost
>
>
> On Nov 19, 2012, at 10:39 PM, Muhammad Gelbana wrote:
>
> > What do you mean by "Yanomo screenshot on the Tapetsry site", what is
> that ?
> >
> > On Mon, Nov 19, 2012 at 11:18 PM, Joost Schouten (mailing lists) <
> > joost...@jsportal.com> wrote:
> >
> >> Hi,
> >>
> >> The Yanomo screenshot on the Tapetsry site is outdated and we have a
> nice
> >> new fancy one. I believe I need to be a confluence admin to make this
> >> update right? How can I become one or who do I talk to?
> >>
> >> Thanks,
> >> Joost
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
>
>


Re: Update the tapestry site

2012-11-19 Thread Joost Schouten (mailing lists)
Hi Muhammad,

I can see this is a somewhat minimal question. I guess I'm asking this to one 
of the comitters as I would like to update the Yanomo screenshot found at 
http://tapestry.apache.org/applications.html as it is outdated. As I have no 
editing rights at 
https://cwiki.apache.org/confluence/display/TAPESTRY/Applications# I can't do 
this myself.

Sorry for the under specified question ;-)

Cheers,
Joost


On Nov 19, 2012, at 10:39 PM, Muhammad Gelbana wrote:

> What do you mean by "Yanomo screenshot on the Tapetsry site", what is that ?
> 
> On Mon, Nov 19, 2012 at 11:18 PM, Joost Schouten (mailing lists) <
> joost...@jsportal.com> wrote:
> 
>> Hi,
>> 
>> The Yanomo screenshot on the Tapetsry site is outdated and we have a nice
>> new fancy one. I believe I need to be a confluence admin to make this
>> update right? How can I become one or who do I talk to?
>> 
>> Thanks,
>> Joost
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 



Re: Update the tapestry site

2012-11-19 Thread Muhammad Gelbana
What do you mean by "Yanomo screenshot on the Tapetsry site", what is that ?

On Mon, Nov 19, 2012 at 11:18 PM, Joost Schouten (mailing lists) <
joost...@jsportal.com> wrote:

> Hi,
>
> The Yanomo screenshot on the Tapetsry site is outdated and we have a nice
> new fancy one. I believe I need to be a confluence admin to make this
> update right? How can I become one or who do I talk to?
>
> Thanks,
> Joost
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Update the tapestry site

2012-11-19 Thread Joost Schouten (mailing lists)
Hi,

The Yanomo screenshot on the Tapetsry site is outdated and we have a nice new 
fancy one. I believe I need to be a confluence admin to make this update right? 
How can I become one or who do I talk to?

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



Re: [5.3.6] Validation errors are only shown on the second submit

2012-11-19 Thread Muhammad Gelbana
I will recklessly assume I have fully comprehended your mixin. I couldn't
get it to work thought since my zones are initially empty (filled later
through ajax or a t:delegate if the page is refreshed) and your mixin
operates on components being rendered. Also I have my fields in
*t:block* elements
and they aren't rendered initially by nature of course.

I'm fairly new to these methods so I'm stuck here and I have no ideas to
workaround this. Don't you think this deserves a JIRA as at least an
improvement if not a bug ? Or may be any other ideas ?

And thanks a million for your help :)

On Mon, Nov 19, 2012 at 5:44 PM, Ivan Khalopik  wrote:

> All this because of changed form controls names after ajax update (some
> hash added to the end). After form submission this controls saves their
> state for changed names (with hash) and then are rendered to client with
> normal names(without hash). As they searches for erros by name they can not
> find any.
> I have my solution for such sittuations, to fix control names, make them
> static. I've described this here:
>
> http://mutabra.blogspot.com/2012/09/tapestry-fixed-control-name-fixin.html
>
> On Mon, Nov 19, 2012 at 6:37 PM, Muhammad Gelbana  >wrote:
>
> > I use  for each field.
> >
> > Here is some more enlightening investigation results, based on the fact
> > that the form's fields are changed using ajax, once the fields are
> updated,
> > the fields errors are shown only after the first submission and the same
> > happens every time the form field's are changed. So it has something to
> do
> > with binding the fields with the "validation tracker on the client side".
> >
> > In another words, on the second submission, the page is fully loaded so
> the
> > "client side validation tracker" is setup right and bound to the fields.
> > But when I update the form's fields using ajax, it's broken. I have a
> > feeling this could be wrong but its my very best guess so far.
> >
> > On Mon, Nov 19, 2012 at 5:33 PM, Ivan Khalopik 
> > wrote:
> >
> > > Do you use  component to show errors for whole form or just
> use
> > > separate  components to show errors for particular field?
> > >
> > > On Mon, Nov 19, 2012 at 6:28 PM, Muhammad Gelbana  > > >wrote:
> > >
> > > > When I first load my page, some form's fields are changed through
> ajax
> > > and
> > > > then I submit the form (Without ajax) with empty fields to force it
> > into
> > > > validation errors. But no errors are shown. If just submit the form
> > > again,
> > > > exactly as it was the last time, the errors are shown !
> > > >
> > > > That's how I inject my components
> > > > private static final int MULTIPLE_BRAS_LOOP_END = 20;
> > > >
> > > > > @InjectComponent
> > > > > private TextField dnsServerField, domainNameField;
> > > > > @InjectComponent("testConfigurationForm")
> > > > > private Form testForm;
> > > >
> > > >
> > > > I checked the form using .getHasErrors() and it returned true on both
> > > > submits. It's only that on the first submit, nothing is shown for the
> > > > client !
> > > >
> > > > I also forced the form into 2 different validation errors and only
> the
> > > > second submission's error was shown, so its not like showing
> validation
> > > > errors for previous submissions. Even more, this strange behavior
> stops
> > > > after the first submission, everything works as expected !
> > > >
> > >
> > >
> > >
> > > --
> > > BR
> > > Ivan
> > >
> >
>
>
>
> --
> BR
> Ivan
>


Re: MethodInvocation.didThrowCheckedException returns true when there is a RuntimeException

2012-11-19 Thread Howard Lewis Ship
RuntimeExceptions are supposed to pass through; they are not caught by the
MethodInvocation.  Checked exceptions are caught, and turn on the
didThrowCheckedException flag. Is it possible that the exception you threw
was caught and rethrown as a checked exception?


On Mon, Nov 19, 2012 at 1:59 AM, fmaylinch  wrote:

> Hello,
>
> We implemented a method advisor to handle transactions and found that the
> method *MethodInvocation.didThrowCheckedException* returns true when the
> advised method throws a *RuntimeException*. Is this the expected behaviour?
>
> Since we didn't expect that, we did this workaround:
>
> private class TransactionMethodAdvice implements MethodAdvice
> {
> @Override
> public void advise(MethodInvocation invocation)
> {
> ...
>
> if (invocation.didThrowCheckedException())
> {
> // TODO: Tapestry bug??
> final RuntimeException rtEx =
>
> invocation.getCheckedException(RuntimeException.class);
> if (rtEx != null)
> throw rtEx;
> else
> invocation.rethrow();
> }
>
> ...
> }
> }
>
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/MethodInvocation-didThrowCheckedException-returns-true-when-there-is-a-RuntimeException-tp5718086.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
>
>


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


Re: Tapestry jpa transactions

2012-11-19 Thread Lenny Primak
Sounds like you should be using the full JEE stack. We use it along with Shiro 
security
And we have custom menu components ( was very easy to create ) that do what you 
are trying to do. 

On Nov 19, 2012, at 11:45 AM, "John"  wrote:

> In the tapestry jpa docs we are instructed to provide annotations to manage 
> transaction commitment into the DAO interface classes, e.g.
> 
>  @CommitAfter
>   @PersistenceContext(unitName = "DemoUnit")
>   void add(User user);
> I'm not liking this much as I don't want to explose details of the 
> implementation in my service interfaces. Is there a workaround? Can I just 
> put the annotaions on my DAO Impl classes for example?
> 
> John

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



Re: Tapestry jpa transactions

2012-11-19 Thread Thiago H de Paula Figueiredo

On Mon, 19 Nov 2012 14:45:48 -0200, John  wrote:

In the tapestry jpa docs we are instructed to provide annotations to  
manage transaction commitment into the DAO interface classes, e.g.


  @CommitAfter
   @PersistenceContext(unitName = "DemoUnit")
   void add(User user);
I'm not liking this much as I don't want to explose details of the  
implementation in my service interfaces.


I don't like that either.


Is there a workaround?


I don't think so.


Can I just put the annotaions on my DAO Impl classes for example?


Not now. Please post a JIRA for that. I'd love to see this Tapestry-IoC  
problem fixed too.


--
Thiago H. de Paula Figueiredo

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



Tapestry jpa transactions

2012-11-19 Thread John
In the tapestry jpa docs we are instructed to provide annotations to manage 
transaction commitment into the DAO interface classes, e.g.

  @CommitAfter
   @PersistenceContext(unitName = "DemoUnit")
   void add(User user);
I'm not liking this much as I don't want to explose details of the 
implementation in my service interfaces. Is there a workaround? Can I just put 
the annotaions on my DAO Impl classes for example?

John

Re: [5.3.6] Validation errors are only shown on the second submit

2012-11-19 Thread Ivan Khalopik
All this because of changed form controls names after ajax update (some
hash added to the end). After form submission this controls saves their
state for changed names (with hash) and then are rendered to client with
normal names(without hash). As they searches for erros by name they can not
find any.
I have my solution for such sittuations, to fix control names, make them
static. I've described this here:

http://mutabra.blogspot.com/2012/09/tapestry-fixed-control-name-fixin.html

On Mon, Nov 19, 2012 at 6:37 PM, Muhammad Gelbana wrote:

> I use  for each field.
>
> Here is some more enlightening investigation results, based on the fact
> that the form's fields are changed using ajax, once the fields are updated,
> the fields errors are shown only after the first submission and the same
> happens every time the form field's are changed. So it has something to do
> with binding the fields with the "validation tracker on the client side".
>
> In another words, on the second submission, the page is fully loaded so the
> "client side validation tracker" is setup right and bound to the fields.
> But when I update the form's fields using ajax, it's broken. I have a
> feeling this could be wrong but its my very best guess so far.
>
> On Mon, Nov 19, 2012 at 5:33 PM, Ivan Khalopik 
> wrote:
>
> > Do you use  component to show errors for whole form or just use
> > separate  components to show errors for particular field?
> >
> > On Mon, Nov 19, 2012 at 6:28 PM, Muhammad Gelbana  > >wrote:
> >
> > > When I first load my page, some form's fields are changed through ajax
> > and
> > > then I submit the form (Without ajax) with empty fields to force it
> into
> > > validation errors. But no errors are shown. If just submit the form
> > again,
> > > exactly as it was the last time, the errors are shown !
> > >
> > > That's how I inject my components
> > > private static final int MULTIPLE_BRAS_LOOP_END = 20;
> > >
> > > > @InjectComponent
> > > > private TextField dnsServerField, domainNameField;
> > > > @InjectComponent("testConfigurationForm")
> > > > private Form testForm;
> > >
> > >
> > > I checked the form using .getHasErrors() and it returned true on both
> > > submits. It's only that on the first submit, nothing is shown for the
> > > client !
> > >
> > > I also forced the form into 2 different validation errors and only the
> > > second submission's error was shown, so its not like showing validation
> > > errors for previous submissions. Even more, this strange behavior stops
> > > after the first submission, everything works as expected !
> > >
> >
> >
> >
> > --
> > BR
> > Ivan
> >
>



-- 
BR
Ivan


Re: [5.3.6] Validation errors are only shown on the second submit

2012-11-19 Thread Muhammad Gelbana
By "changing" or "updating" the form fields I do *NOT* mean entering some
values into them of course, but I mean reloading the fields using ajax, to
load a whole another set of fields.

On Mon, Nov 19, 2012 at 5:37 PM, Muhammad Gelbana wrote:

> I use  for each field.
>
> Here is some more enlightening investigation results, based on the fact
> that the form's fields are changed using ajax, once the fields are updated,
> the fields errors are shown only after the first submission and the same
> happens every time the form field's are changed. So it has something to do
> with binding the fields with the "validation tracker on the client side".
>
> In another words, on the second submission, the page is fully loaded so
> the "client side validation tracker" is setup right and bound to the
> fields. But when I update the form's fields using ajax, it's broken. I have
> a feeling this could be wrong but its my very best guess so far.
>
>
> On Mon, Nov 19, 2012 at 5:33 PM, Ivan Khalopik wrote:
>
>> Do you use  component to show errors for whole form or just use
>> separate  components to show errors for particular field?
>>
>> On Mon, Nov 19, 2012 at 6:28 PM, Muhammad Gelbana > >wrote:
>>
>> > When I first load my page, some form's fields are changed through ajax
>> and
>> > then I submit the form (Without ajax) with empty fields to force it into
>> > validation errors. But no errors are shown. If just submit the form
>> again,
>> > exactly as it was the last time, the errors are shown !
>> >
>> > That's how I inject my components
>> > private static final int MULTIPLE_BRAS_LOOP_END = 20;
>> >
>> > > @InjectComponent
>> > > private TextField dnsServerField, domainNameField;
>> > > @InjectComponent("testConfigurationForm")
>> > > private Form testForm;
>> >
>> >
>> > I checked the form using .getHasErrors() and it returned true on both
>> > submits. It's only that on the first submit, nothing is shown for the
>> > client !
>> >
>> > I also forced the form into 2 different validation errors and only the
>> > second submission's error was shown, so its not like showing validation
>> > errors for previous submissions. Even more, this strange behavior stops
>> > after the first submission, everything works as expected !
>> >
>>
>>
>>
>> --
>> BR
>> Ivan
>>
>
>


Re: [5.3.6] Validation errors are only shown on the second submit

2012-11-19 Thread Muhammad Gelbana
I use  for each field.

Here is some more enlightening investigation results, based on the fact
that the form's fields are changed using ajax, once the fields are updated,
the fields errors are shown only after the first submission and the same
happens every time the form field's are changed. So it has something to do
with binding the fields with the "validation tracker on the client side".

In another words, on the second submission, the page is fully loaded so the
"client side validation tracker" is setup right and bound to the fields.
But when I update the form's fields using ajax, it's broken. I have a
feeling this could be wrong but its my very best guess so far.

On Mon, Nov 19, 2012 at 5:33 PM, Ivan Khalopik  wrote:

> Do you use  component to show errors for whole form or just use
> separate  components to show errors for particular field?
>
> On Mon, Nov 19, 2012 at 6:28 PM, Muhammad Gelbana  >wrote:
>
> > When I first load my page, some form's fields are changed through ajax
> and
> > then I submit the form (Without ajax) with empty fields to force it into
> > validation errors. But no errors are shown. If just submit the form
> again,
> > exactly as it was the last time, the errors are shown !
> >
> > That's how I inject my components
> > private static final int MULTIPLE_BRAS_LOOP_END = 20;
> >
> > > @InjectComponent
> > > private TextField dnsServerField, domainNameField;
> > > @InjectComponent("testConfigurationForm")
> > > private Form testForm;
> >
> >
> > I checked the form using .getHasErrors() and it returned true on both
> > submits. It's only that on the first submit, nothing is shown for the
> > client !
> >
> > I also forced the form into 2 different validation errors and only the
> > second submission's error was shown, so its not like showing validation
> > errors for previous submissions. Even more, this strange behavior stops
> > after the first submission, everything works as expected !
> >
>
>
>
> --
> BR
> Ivan
>


Re: [5.3.6] Validation errors are only shown on the second submit

2012-11-19 Thread Ivan Khalopik
Do you use  component to show errors for whole form or just use
separate  components to show errors for particular field?

On Mon, Nov 19, 2012 at 6:28 PM, Muhammad Gelbana wrote:

> When I first load my page, some form's fields are changed through ajax and
> then I submit the form (Without ajax) with empty fields to force it into
> validation errors. But no errors are shown. If just submit the form again,
> exactly as it was the last time, the errors are shown !
>
> That's how I inject my components
> private static final int MULTIPLE_BRAS_LOOP_END = 20;
>
> > @InjectComponent
> > private TextField dnsServerField, domainNameField;
> > @InjectComponent("testConfigurationForm")
> > private Form testForm;
>
>
> I checked the form using .getHasErrors() and it returned true on both
> submits. It's only that on the first submit, nothing is shown for the
> client !
>
> I also forced the form into 2 different validation errors and only the
> second submission's error was shown, so its not like showing validation
> errors for previous submissions. Even more, this strange behavior stops
> after the first submission, everything works as expected !
>



-- 
BR
Ivan


Re: BeanEditForm and hibernate

2012-11-19 Thread Ivan Khalopik
Sorry, I have made mistake, you will need EventConstants.VALIDATE event
instead of EventConstants.VALIDATE_FORM, and also you need component id.
But to specify this component id you have to override property editor as
I've mentioned before.

On Mon, Nov 19, 2012 at 6:01 PM, Nicolas Barrera  wrote:

> Thank you so much Ivan,
>
> I 'd rather use option number 1 as I like to leave transaction management
> as I 've already got it.
>
> Related to the first option you mentioned and the code you posted...
> it's not necessary to override the name property with  ain't it?
>
> cheers,
>
> Nicolás.-
>
>
> On Mon, Nov 19, 2012 at 8:11 AM, Ivan Khalopik 
> wrote:
>
> > You can try 2 options:
> >
> > 1. Use validation by name to prevent name changes before request to DB.
> It
> > will be executed before name property will be assigned to new value:
> >
> > @OnEvent(value=EventConstants.VALIDATE_FORM, component="nameField")
> > public void validateName() {
> >//...
> > }
> >
> > 
> >   
> > 
> > 
> >   
> > 
> >
> > 2. Retrieve profile in separate transaction with uncommited read
> isolation.
> >
> >
> > On Fri, Nov 16, 2012 at 5:15 PM, Nicolas Barrera 
> > wrote:
> >
> > > Hi all,
> > >
> > > I 'm not using the tapestry-hibernate module.
> > >
> > > I 'm using spring configured hibernate, tapestry-spring, and an open
> > > session in view spring filter.
> > >
> > > I can use BeanEditForm to create a new entity and save it, the problem
> is
> > > when trying to modify an existing entity.
> > >
> > > My problem is that during activation after submission I get an
> unmodified
> > > instance of the entity from the database,
> > > after that the beaneditform modifies the properties of that entity and
> > > during validation when the DAO performs a criteria query
> > > by name changes on the entity object are being flushed to the database.
> > >
> > > I wonder how does the tapestry-hibernate module handles these  kind of
> > > trouble,
> > >
> > > Here is my code:
> > >
> > > @OnEvent(value=EventConstants.ACTIVATE)
> > > > public void activate(Long profileId) {
> > > > profile = this.profileDAO.load(profileId);
> > > > }
> > > >
> > > > @OnEvent(value=EventConstants.PASSIVATE)
> > > > public Long passivate() {
> > > > return this.profile.getId();
> > > > }
> > > >
> > > > @Log
> > > > @OnEvent(value=EventConstants.VALIDATE_FORM)
> > > > public void validate() {
> > > > try {
> > > > // validating if the new name already exists, if it does
> > fail
> > > > validation
> > > > this.profileDAO.getByName(profile.getName());
> > > >
> > > >
> > >
> >
> this.profileForm.recordError(messages.get("error.profile.already.exists"));
> > > > } catch(ModelException me) {
> > > > // validation is expecting this exception, I know it's
> > nasty
> > > > but...
> > > > }
> > > >
> > > > }
> > > >
> > > > @OnEvent(value=EventConstants.SUCCESS)
> > > > public Object persistNewUser() throws ModelException {
> > > > this.profileDAO.save(profile);
> > > > return ListProfiles.class;
> > > > }
> > > >
> > >
> > > tried evicting the instance from the session on prepareForSubmit but
> then
> > > (as the entity is lazy) beaneditform fails trying to set the
> properties.
> > >
> > > Right now I 'll avoid using beaneditform for modification pages but I
> 'd
> > > definitely prefer using it!
> > >
> > > thank you so much,
> > >
> > > cheers
> > >
> > > Nicolás.-
> > >
> >
> >
> >
> > --
> > BR
> > Ivan
> >
>



-- 
BR
Ivan


Re: BeanEditForm and hibernate

2012-11-19 Thread Nicolas Barrera
Thank you so much Ivan,

I 'd rather use option number 1 as I like to leave transaction management
as I 've already got it.

Related to the first option you mentioned and the code you posted...
it's not necessary to override the name property with  ain't it?

cheers,

Nicolás.-


On Mon, Nov 19, 2012 at 8:11 AM, Ivan Khalopik  wrote:

> You can try 2 options:
>
> 1. Use validation by name to prevent name changes before request to DB. It
> will be executed before name property will be assigned to new value:
>
> @OnEvent(value=EventConstants.VALIDATE_FORM, component="nameField")
> public void validateName() {
>//...
> }
>
> 
>   
> 
> 
>   
> 
>
> 2. Retrieve profile in separate transaction with uncommited read isolation.
>
>
> On Fri, Nov 16, 2012 at 5:15 PM, Nicolas Barrera 
> wrote:
>
> > Hi all,
> >
> > I 'm not using the tapestry-hibernate module.
> >
> > I 'm using spring configured hibernate, tapestry-spring, and an open
> > session in view spring filter.
> >
> > I can use BeanEditForm to create a new entity and save it, the problem is
> > when trying to modify an existing entity.
> >
> > My problem is that during activation after submission I get an unmodified
> > instance of the entity from the database,
> > after that the beaneditform modifies the properties of that entity and
> > during validation when the DAO performs a criteria query
> > by name changes on the entity object are being flushed to the database.
> >
> > I wonder how does the tapestry-hibernate module handles these  kind of
> > trouble,
> >
> > Here is my code:
> >
> > @OnEvent(value=EventConstants.ACTIVATE)
> > > public void activate(Long profileId) {
> > > profile = this.profileDAO.load(profileId);
> > > }
> > >
> > > @OnEvent(value=EventConstants.PASSIVATE)
> > > public Long passivate() {
> > > return this.profile.getId();
> > > }
> > >
> > > @Log
> > > @OnEvent(value=EventConstants.VALIDATE_FORM)
> > > public void validate() {
> > > try {
> > > // validating if the new name already exists, if it does
> fail
> > > validation
> > > this.profileDAO.getByName(profile.getName());
> > >
> > >
> >
> this.profileForm.recordError(messages.get("error.profile.already.exists"));
> > > } catch(ModelException me) {
> > > // validation is expecting this exception, I know it's
> nasty
> > > but...
> > > }
> > >
> > > }
> > >
> > > @OnEvent(value=EventConstants.SUCCESS)
> > > public Object persistNewUser() throws ModelException {
> > > this.profileDAO.save(profile);
> > > return ListProfiles.class;
> > > }
> > >
> >
> > tried evicting the instance from the session on prepareForSubmit but then
> > (as the entity is lazy) beaneditform fails trying to set the properties.
> >
> > Right now I 'll avoid using beaneditform for modification pages but I 'd
> > definitely prefer using it!
> >
> > thank you so much,
> >
> > cheers
> >
> > Nicolás.-
> >
>
>
>
> --
> BR
> Ivan
>


Re: Changing to default localization without extension for the language

2012-11-19 Thread Ivan Khalopik
I don't understand your question.
But if you change locale using PersistentLocale service it will be
persisted in URL and be changed for next page request. The new localale
should also be configured in "tapestry.supported-locales" symbol.
If you want to chnge locale just for this request you can use
ThreadLocale#setLocale(...) method.
If you need both variants with safety and advantage of finding the closest
supported locale use LocalizationSetter#setLocaleFromLocaleName("en")

All message catalogs will be accessed by tapestry with right choose. Just
use .properties for default locale, _ro.properties to override properties
for ro locale, _en.properties for en locale.
If you want to change locale to default (not ro) use Locale.ROOT constant
for java 6, and new Locale("") for older versions.

On Mon, Nov 19, 2012 at 3:10 PM, o3005659  wrote:

> I have made localization ro and en. Ro is by default, however I didn't
> extend
> my property files with_ro extension, but I simply put
> thisispropertyfile.properties. Now I have implemented for English
>
>   public String onActionFromGoEnglish()
> {
> persistentLocale.set(new Locale("en"));
> return null;
> }
>
> however, I don't know how to access property files that have no _ro
> extension in example when user switches from en to ro. What to points my
> persistenLocale then?
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Changing-to-default-localization-without-extension-for-the-language-tp5718092.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
>
>


-- 
BR
Ivan


Changing to default localization without extension for the language

2012-11-19 Thread o3005659
I have made localization ro and en. Ro is by default, however I didn't extend
my property files with_ro extension, but I simply put
thisispropertyfile.properties. Now I have implemented for English

  public String onActionFromGoEnglish()
{
persistentLocale.set(new Locale("en"));
return null;
}

however, I don't know how to access property files that have no _ro
extension in example when user switches from en to ro. What to points my
persistenLocale then?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Changing-to-default-localization-without-extension-for-the-language-tp5718092.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.3.6] Form's recordError(Field, String) behavior

2012-11-19 Thread Muhammad Gelbana
Thanks a lot Ivan for the extra info.

On Mon, Nov 19, 2012 at 11:36 AM, Ivan Khalopik  wrote:

> When you use recordError(field, "Message") you have not only messages
> listed by  component but also this messages are connected to the
> fileds and can be used later:
>
> 1. You can remove  and use  component that
> will render error message for specified field, e.g.
> 
> DUT
>  />
> 
> 
>
> 2. You can remove  component and use ValidationDecorator service
> instead. You can configure it to highlight fields in error with red border
> and to render error messages to the right of this field, e.g. for
> bootstrap:
>
> public class BootstrapValidationDecorator extends BaseValidationDecorator {
> private final Environment environment;
> private final MarkupWriter markupWriter;
>
> public BootstrapValidationDecorator(Environment environment,
> MarkupWriter markupWriter) {
> this.environment = environment;
> this.markupWriter = markupWriter;
> }
>
> public void insideField(Field field) {
> if (inError(field)) {
> addErrorClass();
> }
> }
>
> public void afterField(Field field) {
> if (inError(field)) {
> markupWriter.element("span", "class", "help-inline");
> markupWriter.write(getError(field));
> markupWriter.end();
> }
> }
>
> private void addErrorClass() {
> Element element = markupWriter.getElement();
> do {
> element = element.getContainer();
> } while (!element.getAttribute("class").contains("control-group"));
> element.addClassName("error");
> }
>
> private boolean inError(Field field) {
> ValidationTracker tracker =
> environment.peekRequired(ValidationTracker.class);
> return tracker.inError(field);
> }
>
> private String getError(Field field) {
> ValidationTracker tracker =
> environment.peekRequired(ValidationTracker.class);
> return tracker.getError(field);
> }
> }
>
> On Mon, Nov 19, 2012 at 12:06 PM, Taha Siddiqi  >wrote:
>
> > These are two components t:error and t:errors. You have to use t:error.
> > t:errors doesn't have for component
> >
> >
> > On Nov 19, 2012, at 2:26 PM, Muhammad Gelbana wrote:
> >
> > > Thanks ! But unfortunately that didn't work either. All error
> components
> > > list all error messages whether they are bound to it or or even if the
> > > error component isn't bound at all (i.e. )!
> > > I checked tapestry jumpstart for guidance and found that I was using
> > > @InjectComponent instead of @Component but I didn't notice any
> difference
> > > so I assume there isn't.
> > >
> > > My template file looks like this:
> > >
> > >> 
> > >> 
> > >> ${testType} Options
> > >> 
> > >> 
> > >> 
> > >> DUT
> > >>  > >> t:value="testOptions('server.ip').value" />
> > >> 
> > >> 
> > >> 
> > >> Domain Name
> > >>  > >> t:value="testOptions('domain-name').value" />
> > >> 
> > >> 
> > >> 
> > >> 
> > >
> > >
> > > Withing my page, the form and form fields injection statements are:
> > >
> > >> @Component(id = "testConfigurationForm")
> > >> private Form testForm;
> > >> @Component
> > >> private TextField dnsServerField, domainNameField;
> > >
> > >
> > > That's how I record my errors
> > >
> > >> testForm.recordError(field, "Please provide a valid IPv4 address.");
> > >
> > >
> > > I even tried making sure that I'm not recording an error twice for both
> > > fields (Since the error message would be identical) I prefixed the
> error
> > > message with the field's label and it was clear that each error
> component
> > > is listing all errors even the ones not bound to it !
> > >
> > > Thanks again.
> > >
> > > On Mon, Nov 19, 2012 at 8:18 AM, Taha Siddiqi <
> tawus.tapes...@gmail.com
> > >wrote:
> > >
> > >> Hi
> > >>
> > >> Checkout the "for" parameter in
> > >>
> >
> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Error.html
> > .
> > >> You can specify a field there to retrieve error specific to that field
> > >>
> > >> regards
> > >> Taha
> > >>
> > >> On Nov 19, 2012, at 2:10 AM, Muhammad Gelbana wrote:
> > >>
> > >>> I have a form that submits by reloading the whole page. But my form's
> > >>> fields are in separate zones. Before submitting the form, these zones
> > get
> > >>> changed (i.e. different fields are shown with each zone update) till
> > the
> > >>> user is satisfied and then he submits the form in the manner
> mentioned.
> > >>>
> > >>> Now after I validate my fields and record errors using
> > recordError(Field,
> > >>> String), I don't find a difference between that method and using the
> > >> other
> > >>> one recordError(String). What is the difference if the t:error
> > component
> > >>> doesn't utilize the Field object passed to the first method to
> indicate
> > >> the
> > >>> difference between the error messages ?!
> > >>>
> > >>> I mean it always lists all error messages in a list without
> indicating
> >

Re: BeanEditForm and hibernate

2012-11-19 Thread Ivan Khalopik
You can try 2 options:

1. Use validation by name to prevent name changes before request to DB. It
will be executed before name property will be assigned to new value:

@OnEvent(value=EventConstants.VALIDATE_FORM, component="nameField")
public void validateName() {
   //...
}


  


  


2. Retrieve profile in separate transaction with uncommited read isolation.


On Fri, Nov 16, 2012 at 5:15 PM, Nicolas Barrera  wrote:

> Hi all,
>
> I 'm not using the tapestry-hibernate module.
>
> I 'm using spring configured hibernate, tapestry-spring, and an open
> session in view spring filter.
>
> I can use BeanEditForm to create a new entity and save it, the problem is
> when trying to modify an existing entity.
>
> My problem is that during activation after submission I get an unmodified
> instance of the entity from the database,
> after that the beaneditform modifies the properties of that entity and
> during validation when the DAO performs a criteria query
> by name changes on the entity object are being flushed to the database.
>
> I wonder how does the tapestry-hibernate module handles these  kind of
> trouble,
>
> Here is my code:
>
> @OnEvent(value=EventConstants.ACTIVATE)
> > public void activate(Long profileId) {
> > profile = this.profileDAO.load(profileId);
> > }
> >
> > @OnEvent(value=EventConstants.PASSIVATE)
> > public Long passivate() {
> > return this.profile.getId();
> > }
> >
> > @Log
> > @OnEvent(value=EventConstants.VALIDATE_FORM)
> > public void validate() {
> > try {
> > // validating if the new name already exists, if it does fail
> > validation
> > this.profileDAO.getByName(profile.getName());
> >
> >
> this.profileForm.recordError(messages.get("error.profile.already.exists"));
> > } catch(ModelException me) {
> > // validation is expecting this exception, I know it's nasty
> > but...
> > }
> >
> > }
> >
> > @OnEvent(value=EventConstants.SUCCESS)
> > public Object persistNewUser() throws ModelException {
> > this.profileDAO.save(profile);
> > return ListProfiles.class;
> > }
> >
>
> tried evicting the instance from the session on prepareForSubmit but then
> (as the entity is lazy) beaneditform fails trying to set the properties.
>
> Right now I 'll avoid using beaneditform for modification pages but I 'd
> definitely prefer using it!
>
> thank you so much,
>
> cheers
>
> Nicolás.-
>



-- 
BR
Ivan


Re: [t5.3.6] Form's recordError(Field, String) behavior

2012-11-19 Thread Ivan Khalopik
When you use recordError(field, "Message") you have not only messages
listed by  component but also this messages are connected to the
fileds and can be used later:

1. You can remove  and use  component that
will render error message for specified field, e.g.

DUT




2. You can remove  component and use ValidationDecorator service
instead. You can configure it to highlight fields in error with red border
and to render error messages to the right of this field, e.g. for bootstrap:

public class BootstrapValidationDecorator extends BaseValidationDecorator {
private final Environment environment;
private final MarkupWriter markupWriter;

public BootstrapValidationDecorator(Environment environment,
MarkupWriter markupWriter) {
this.environment = environment;
this.markupWriter = markupWriter;
}

public void insideField(Field field) {
if (inError(field)) {
addErrorClass();
}
}

public void afterField(Field field) {
if (inError(field)) {
markupWriter.element("span", "class", "help-inline");
markupWriter.write(getError(field));
markupWriter.end();
}
}

private void addErrorClass() {
Element element = markupWriter.getElement();
do {
element = element.getContainer();
} while (!element.getAttribute("class").contains("control-group"));
element.addClassName("error");
}

private boolean inError(Field field) {
ValidationTracker tracker =
environment.peekRequired(ValidationTracker.class);
return tracker.inError(field);
}

private String getError(Field field) {
ValidationTracker tracker =
environment.peekRequired(ValidationTracker.class);
return tracker.getError(field);
}
}

On Mon, Nov 19, 2012 at 12:06 PM, Taha Siddiqi wrote:

> These are two components t:error and t:errors. You have to use t:error.
> t:errors doesn't have for component
>
>
> On Nov 19, 2012, at 2:26 PM, Muhammad Gelbana wrote:
>
> > Thanks ! But unfortunately that didn't work either. All error components
> > list all error messages whether they are bound to it or or even if the
> > error component isn't bound at all (i.e. )!
> > I checked tapestry jumpstart for guidance and found that I was using
> > @InjectComponent instead of @Component but I didn't notice any difference
> > so I assume there isn't.
> >
> > My template file looks like this:
> >
> >> 
> >> 
> >> ${testType} Options
> >> 
> >> 
> >> 
> >> DUT
> >>  >> t:value="testOptions('server.ip').value" />
> >> 
> >> 
> >> 
> >> Domain Name
> >>  >> t:value="testOptions('domain-name').value" />
> >> 
> >> 
> >> 
> >> 
> >
> >
> > Withing my page, the form and form fields injection statements are:
> >
> >> @Component(id = "testConfigurationForm")
> >> private Form testForm;
> >> @Component
> >> private TextField dnsServerField, domainNameField;
> >
> >
> > That's how I record my errors
> >
> >> testForm.recordError(field, "Please provide a valid IPv4 address.");
> >
> >
> > I even tried making sure that I'm not recording an error twice for both
> > fields (Since the error message would be identical) I prefixed the error
> > message with the field's label and it was clear that each error component
> > is listing all errors even the ones not bound to it !
> >
> > Thanks again.
> >
> > On Mon, Nov 19, 2012 at 8:18 AM, Taha Siddiqi  >wrote:
> >
> >> Hi
> >>
> >> Checkout the "for" parameter in
> >>
> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Error.html
> .
> >> You can specify a field there to retrieve error specific to that field
> >>
> >> regards
> >> Taha
> >>
> >> On Nov 19, 2012, at 2:10 AM, Muhammad Gelbana wrote:
> >>
> >>> I have a form that submits by reloading the whole page. But my form's
> >>> fields are in separate zones. Before submitting the form, these zones
> get
> >>> changed (i.e. different fields are shown with each zone update) till
> the
> >>> user is satisfied and then he submits the form in the manner mentioned.
> >>>
> >>> Now after I validate my fields and record errors using
> recordError(Field,
> >>> String), I don't find a difference between that method and using the
> >> other
> >>> one recordError(String). What is the difference if the t:error
> component
> >>> doesn't utilize the Field object passed to the first method to indicate
> >> the
> >>> difference between the error messages ?!
> >>>
> >>> I mean it always lists all error messages in a list without indicating
> to
> >>> which field does this error message belong ? Shouldn't it be something
> >> like:
> >>>
> >>>
>  You must resolve these errors before proceeding:
> >>>
> >>> Field A:
>    . Error msg 1.
>    . Error msg 2.
>  Field C:
>    . Error msg 1.
>  Field B:
>    . Error msg 1.
>    . Error msg 2.
> >>>
> >>>
> >>> ?
> >>>
> >>> After checking the Error component source code, I think this deserves a
> >>> JIR

Re: [t5.3.6] Form's recordError(Field, String) behavior

2012-11-19 Thread Muhammad Gelbana
Have you got a spare gun and only one bullet ? You will have your gun back
of course but not the bullet.

Thank you :D

On Mon, Nov 19, 2012 at 11:06 AM, Taha Siddiqi wrote:

> These are two components t:error and t:errors. You have to use t:error.
> t:errors doesn't have for component
>
>
> On Nov 19, 2012, at 2:26 PM, Muhammad Gelbana wrote:
>
> > Thanks ! But unfortunately that didn't work either. All error components
> > list all error messages whether they are bound to it or or even if the
> > error component isn't bound at all (i.e. )!
> > I checked tapestry jumpstart for guidance and found that I was using
> > @InjectComponent instead of @Component but I didn't notice any difference
> > so I assume there isn't.
> >
> > My template file looks like this:
> >
> >> 
> >> 
> >> ${testType} Options
> >> 
> >> 
> >> 
> >> DUT
> >>  >> t:value="testOptions('server.ip').value" />
> >> 
> >> 
> >> 
> >> Domain Name
> >>  >> t:value="testOptions('domain-name').value" />
> >> 
> >> 
> >> 
> >> 
> >
> >
> > Withing my page, the form and form fields injection statements are:
> >
> >> @Component(id = "testConfigurationForm")
> >> private Form testForm;
> >> @Component
> >> private TextField dnsServerField, domainNameField;
> >
> >
> > That's how I record my errors
> >
> >> testForm.recordError(field, "Please provide a valid IPv4 address.");
> >
> >
> > I even tried making sure that I'm not recording an error twice for both
> > fields (Since the error message would be identical) I prefixed the error
> > message with the field's label and it was clear that each error component
> > is listing all errors even the ones not bound to it !
> >
> > Thanks again.
> >
> > On Mon, Nov 19, 2012 at 8:18 AM, Taha Siddiqi  >wrote:
> >
> >> Hi
> >>
> >> Checkout the "for" parameter in
> >>
> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Error.html
> .
> >> You can specify a field there to retrieve error specific to that field
> >>
> >> regards
> >> Taha
> >>
> >> On Nov 19, 2012, at 2:10 AM, Muhammad Gelbana wrote:
> >>
> >>> I have a form that submits by reloading the whole page. But my form's
> >>> fields are in separate zones. Before submitting the form, these zones
> get
> >>> changed (i.e. different fields are shown with each zone update) till
> the
> >>> user is satisfied and then he submits the form in the manner mentioned.
> >>>
> >>> Now after I validate my fields and record errors using
> recordError(Field,
> >>> String), I don't find a difference between that method and using the
> >> other
> >>> one recordError(String). What is the difference if the t:error
> component
> >>> doesn't utilize the Field object passed to the first method to indicate
> >> the
> >>> difference between the error messages ?!
> >>>
> >>> I mean it always lists all error messages in a list without indicating
> to
> >>> which field does this error message belong ? Shouldn't it be something
> >> like:
> >>>
> >>>
>  You must resolve these errors before proceeding:
> >>>
> >>> Field A:
>    . Error msg 1.
>    . Error msg 2.
>  Field C:
>    . Error msg 1.
>  Field B:
>    . Error msg 1.
>    . Error msg 2.
> >>>
> >>>
> >>> ?
> >>>
> >>> After checking the Error component source code, I think this deserves a
> >>> JIRA issue. Am I correct or did I miss something here ?
> >>
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [t5.3.6] Form's recordError(Field, String) behavior

2012-11-19 Thread Taha Siddiqi
These are two components t:error and t:errors. You have to use t:error. 
t:errors doesn't have for component


On Nov 19, 2012, at 2:26 PM, Muhammad Gelbana wrote:

> Thanks ! But unfortunately that didn't work either. All error components
> list all error messages whether they are bound to it or or even if the
> error component isn't bound at all (i.e. )!
> I checked tapestry jumpstart for guidance and found that I was using
> @InjectComponent instead of @Component but I didn't notice any difference
> so I assume there isn't.
> 
> My template file looks like this:
> 
>> 
>> 
>> ${testType} Options
>> 
>> 
>> 
>> DUT
>> > t:value="testOptions('server.ip').value" />
>> 
>> 
>> 
>> Domain Name
>> > t:value="testOptions('domain-name').value" />
>> 
>> 
>> 
>> 
> 
> 
> Withing my page, the form and form fields injection statements are:
> 
>> @Component(id = "testConfigurationForm")
>> private Form testForm;
>> @Component
>> private TextField dnsServerField, domainNameField;
> 
> 
> That's how I record my errors
> 
>> testForm.recordError(field, "Please provide a valid IPv4 address.");
> 
> 
> I even tried making sure that I'm not recording an error twice for both
> fields (Since the error message would be identical) I prefixed the error
> message with the field's label and it was clear that each error component
> is listing all errors even the ones not bound to it !
> 
> Thanks again.
> 
> On Mon, Nov 19, 2012 at 8:18 AM, Taha Siddiqi wrote:
> 
>> Hi
>> 
>> Checkout the "for" parameter in
>> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Error.html.
>> You can specify a field there to retrieve error specific to that field
>> 
>> regards
>> Taha
>> 
>> On Nov 19, 2012, at 2:10 AM, Muhammad Gelbana wrote:
>> 
>>> I have a form that submits by reloading the whole page. But my form's
>>> fields are in separate zones. Before submitting the form, these zones get
>>> changed (i.e. different fields are shown with each zone update) till the
>>> user is satisfied and then he submits the form in the manner mentioned.
>>> 
>>> Now after I validate my fields and record errors using recordError(Field,
>>> String), I don't find a difference between that method and using the
>> other
>>> one recordError(String). What is the difference if the t:error component
>>> doesn't utilize the Field object passed to the first method to indicate
>> the
>>> difference between the error messages ?!
>>> 
>>> I mean it always lists all error messages in a list without indicating to
>>> which field does this error message belong ? Shouldn't it be something
>> like:
>>> 
>>> 
 You must resolve these errors before proceeding:
>>> 
>>> Field A:
   . Error msg 1.
   . Error msg 2.
 Field C:
   . Error msg 1.
 Field B:
   . Error msg 1.
   . Error msg 2.
>>> 
>>> 
>>> ?
>>> 
>>> After checking the Error component source code, I think this deserves a
>>> JIRA issue. Am I correct or did I miss something here ?
>> 
>> 


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



Re: [t5.3.6] Form's recordError(Field, String) behavior

2012-11-19 Thread Muhammad Gelbana
Thanks ! But unfortunately that didn't work either. All error components
list all error messages whether they are bound to it or or even if the
error component isn't bound at all (i.e. )!
I checked tapestry jumpstart for guidance and found that I was using
@InjectComponent instead of @Component but I didn't notice any difference
so I assume there isn't.

My template file looks like this:

> 
> 
> ${testType} Options
> 
> 
> 
> DUT
>  t:value="testOptions('server.ip').value" />
> 
> 
> 
> Domain Name
>  t:value="testOptions('domain-name').value" />
> 
> 
> 
> 


Withing my page, the form and form fields injection statements are:

> @Component(id = "testConfigurationForm")
> private Form testForm;
> @Component
> private TextField dnsServerField, domainNameField;


That's how I record my errors

> testForm.recordError(field, "Please provide a valid IPv4 address.");


I even tried making sure that I'm not recording an error twice for both
fields (Since the error message would be identical) I prefixed the error
message with the field's label and it was clear that each error component
is listing all errors even the ones not bound to it !

Thanks again.

On Mon, Nov 19, 2012 at 8:18 AM, Taha Siddiqi wrote:

> Hi
>
> Checkout the "for" parameter in
> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Error.html.
> You can specify a field there to retrieve error specific to that field
>
> regards
> Taha
>
> On Nov 19, 2012, at 2:10 AM, Muhammad Gelbana wrote:
>
> > I have a form that submits by reloading the whole page. But my form's
> > fields are in separate zones. Before submitting the form, these zones get
> > changed (i.e. different fields are shown with each zone update) till the
> > user is satisfied and then he submits the form in the manner mentioned.
> >
> > Now after I validate my fields and record errors using recordError(Field,
> > String), I don't find a difference between that method and using the
> other
> > one recordError(String). What is the difference if the t:error component
> > doesn't utilize the Field object passed to the first method to indicate
> the
> > difference between the error messages ?!
> >
> > I mean it always lists all error messages in a list without indicating to
> > which field does this error message belong ? Shouldn't it be something
> like:
> >
> >
> >> You must resolve these errors before proceeding:
> >
> > Field A:
> >>. Error msg 1.
> >>. Error msg 2.
> >> Field C:
> >>. Error msg 1.
> >> Field B:
> >>. Error msg 1.
> >>. Error msg 2.
> >
> >
> > ?
> >
> > After checking the Error component source code, I think this deserves a
> > JIRA issue. Am I correct or did I miss something here ?
>
>


Re: How stable is 5.4 jsrewrite?

2012-11-19 Thread Lance Java
Thanks for the update... My approach will be to explicitly load jQuery myself
in noConflict() mode which I can then remove once tapestry includes jQuery
itself.

Cheers,
Lance.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-stable-is-5-4-jsrewrite-tp5718044p5718081.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: Problem with checkboxes in dynamic tables

2012-11-19 Thread Lance Java
Ok, so the problem is that you want to generate an eventlink that passes two
parameters. One parameter (context) is known when you call
componentResources.createEventLink(), the other is a clientside value (the
value of the checkbox).

Option 1:
Generate an event URL via componentResources.createEventLink("someEvent",
context, "XXX") and have some javascript on the client to replace "XXX" with
the boolean value of the checkbox.

Event handler:
void onSomeEvent(Item context, boolean value)


Option 2:
Generate an event URL via componentResources.createEventLink("someEvent",
context) and have some javascript to add a request parameter for the
boolean.

Event handler:
void onSomeEvent(Item context, @RequestParam("checkbox") boolean value)

The jumpstart link I gave you before uses option 2.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Problem-with-checkboxes-in-dynamic-tables-tp5718028p5718080.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