Tap 5.3 Confusion

44 views
Skip to first unread message

Tony Nelson

unread,
Oct 3, 2011, 11:59:38 AM10/3/11
to tapestry...@googlegroups.com
At the moment I have a very simple login page with 2 inputs.  After upgrading to Tap5.3 and the latest jquery snapshot, my login stopped working because the validation javascript that gets generated is broken.

I've been trying to figure out the best way to troubleshoot this issue and ask for help, and I decided the best thing to do was create a simple demonstration of the problem.  So I created an a new empty app, copied my login.tml and login.java classes and created all the necessary support stuff to make the simple login page come up.

I put the demo app I made on github here:  https://github.com/hhubris/broken

If you clone that, and just execute: mvn jetty:run then navigate to localhost:8080/broken you will get my simple login page, and everything will work just fine.  Surprised the heck out of me.  Then I found the difference.

Edit pom.xml and change tapestry-core to tapestry-hibernate and restart jetty with: mvn clean jetty:run

Navigate to the login page again, and you will notice that the validation javascript is now broken.  It is missing the ids of the elements to be validated.

At this point, I'm not sure if the problem is with tap5 or with the jquery library, but I thought I'd start here.

I just noticed, that when the app runs with tapestry-core, the username input is generated like this:

<input class="username" value="f...@bar.com" id="username" name="username" type="text">

and when running with tapestry-hibernate it is generated like this:

<input class="username" value="f...@bar.com" type="text">

which is definitely missing the id attribute. That seems to be a likely cause of the problem.

Should I post this on the tap5 mailing list?

Thanks for any help or input.

Tony Nelson



Emmanuel DEMEY

unread,
Oct 3, 2011, 4:42:31 PM10/3/11
to tapestry...@googlegroups.com
Hi Tony

It is strange !! I reproduce your issue just when I have a full jQuery project. SO I think is due to Tapestry-jQuery. I disabled the javascript on my Google Chrome, and I have got the same issue. Something in one of the classes ? I do not know. 

This issue do not appear after each restart of jetty. I will be difficult to find the bug. Do you have an idea? Do you have the same issue in a full prototype application ? 

Emmanuel

Tony Nelson

unread,
Oct 3, 2011, 5:05:15 PM10/3/11
to tapestry...@googlegroups.com
I can't really confirm if this is related to tapestry-jquery or not.  I have found that I am able to avoid the problem completely by using the tapestry-core distribution instead of the tapestry-hibernate distribution, but of course, I need tapestry-hibernate.

It looks like the problem is caused by tapestry generating html without an id attribute.  I think the missing id causes the jquery library not to be able to read the attribute names when it is creating the validation initialization code.

I picked tapestry5 because of the tapestry5-jquery library.  I really don't want to mess with prototype in my application if I can avoid it.  I tried commenting out the jquery library in the pom and restarting and everything seemed to work.  Then I added the jquery library back in and everything still seemed to work fine.  Now I'm really confused.

I have posted this problem on the tapestry-users list as well.  I'm not sure what to try next.

Tony Nelson

unread,
Oct 3, 2011, 5:18:34 PM10/3/11
to tapestry...@googlegroups.com
Look at line 12 of pom.xml, does that say 5.3-beta-16 or 5.3-SNAPSHOT ?

I hadn't read the instructions on using the 5.3 betas so I just assumed it was a SNAPSHOT build.  Does changing to 5.3-beta-16 change anything?

Emmanuel DEMEY

unread,
Oct 4, 2011, 5:08:50 AM10/4/11
to tapestry...@googlegroups.com
That means 5.3-beta-16. It is the  latests stagging version of Tapestry. 

Emmanuel DEMEY

unread,
Oct 4, 2011, 5:10:26 AM10/4/11
to tapestry...@googlegroups.com
Yes you are right! If you do not have the id, we will have some issues with the validation. I added your issue to my to-do list and will have a look today. If you find something before me, please send me an email, or we can talk via google talk.

Tony Nelson

unread,
Oct 4, 2011, 8:20:58 AM10/4/11
to tapestry...@googlegroups.com
At one  point I had 5.3-SNAPSHOT because I failed to read the docs on how the betas worked.  I just wanted to rule that out as a possible cause of the problem.

Emmanuel DEMEY

unread,
Oct 4, 2011, 9:59:37 AM10/4/11
to tapestry...@googlegroups.com
I have just posted an answer tf ryour issue on the Tapestry Mailing list
Reply all
Reply to author
Forward
0 new messages