Re: BeanEditForm onValidate()

2018-01-12 Thread Bob Harner
Does the userVerif.equals(user) clause actually result in true? If not,
then recordError wouldn't run, and validation would be considered to have
passed. Check User.java's equals method, or better yet, maybe just compare
the username strings directly.

On Jan 12, 2018 7:04 AM, "Christopher Dodunski"  wrote:

> Hi there,
>
> Below is my onValidate() method of a BeanEditForm for updating a user's
> profile, where I simply check that a user isn't changing his username to
> an already taken username.  The error output (below it) suggests that
> BeanEditForm is committing the change to the database even before
> onValidate() is called - certainly not what I wish to occur.
>
> Could someone please explain what is happening here, as it runs contrary
> to my understanding of form validation.  Thanks very much for your help.
>
>
> ==
> FORM VALIDATION METHOD
> ==
>
> /**
>  * Do the cross-field validation
>  * Record any error, and thereby prevent Tapestry from emitting a
> "success" event
>  */
> @Log
> public void onValidateFromUpdateForm(){
> LOG.debug("onValidateFromUpdateForm");
>
> LOG.debug("Form user: [" + user.getUserName() + "|" +
> user.getFirstName() + "|" + user.getLastName() + "]");  //For
> debugging only (delete)
>
> //Validate user name (remains unique)
> User userVerif =
> crudServiceDAO.findUniqueWithNamedQuery(User.BY_USERNAME,
> QueryParameters.with("userName", user.getUserName()).parameters());
>
> LOG.debug("Verify user: [" + userVerif.getUserName() + "|" +
> userVerif.getFirstName() + "|" + userVerif.getLastName() + "]");
> //For debugging only (delete)
>
> if(!userVerif.equals(user)){
> //User name already taken by someone else
> updateForm.recordError(messages.get("error.userNameTaken"));
> }
> }
>
>
> ==
> LOG OUTPUT
> ==
>
> 13-01-2018 00:28:09 DEBUG UpdateUser:74 - [ENTER]
> onValidateFromUpdateForm()
> 13-01-2018 00:28:09 DEBUG UpdateUser:177 - onValidateFromUpdateForm
> 13-01-2018 00:28:09 DEBUG UpdateUser:179 - Form user: [Kimmy|James|Cook]
> 13-01-2018 00:28:09 WARN  SqlExceptionHelper:145 - SQL Error: 1062,
> SQLState: 23000
> 13-01-2018 00:28:09 ERROR SqlExceptionHelper:147 - Duplicate entry 'Kimmy'
> for key 'UK_h029unq4qgmbvesub83df4vok'
> 13-01-2018 00:28:09 DEBUG UpdateUser:165 - [ FAIL]
> onValidateFromUpdateForm --
> org.hibernate.exception.ConstraintViolationException
> org.hibernate.exception.ConstraintViolationException: could not execute
> statement
> ...
> Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate
> entry 'Kimmy' for key 'UK_h029unq4qgmbvesub83df4vok'
> ...
> 13-01-2018 00:28:09 ERROR Registry:208 - could not execute statement
> 13-01-2018 00:28:09 ERROR Registry:209 - Operations trace:
> 13-01-2018 00:28:09 ERROR Registry:218 - [ 1] Handling traditional
> 'action' component event request for user/Update:updateform.form.
> 13-01-2018 00:28:09 ERROR Registry:218 - [ 2] Triggering event 'action' on
> user/Update:updateform.form
> 13-01-2018 00:28:09 ERROR Registry:218 - [ 3] Triggering event 'validate'
> on user/Update:updateform.form
> 13-01-2018 00:28:09 ERROR RequestExceptionHandler:236 - Processing of
> request failed with uncaught exception:
> org.apache.tapestry5.runtime.ComponentEventException: could not execute
> statement [at classpath:com/optomus/harbour/components/OptoEditForm.tml,
> line 2]
> org.apache.tapestry5.runtime.ComponentEventException: could not execute
> statement [at classpath:com/optomus/harbour/components/OptoEditForm.tml,
> line 2]
> ...
> Caused by: org.apache.tapestry5.ioc.internal.OperationException: could not
> execute statement [at
> classpath:com/optomus/harbour/components/OptoEditForm.tml, line 2]
> ...
> Caused by: org.apache.tapestry5.runtime.ComponentEventException: could not
> execute statement [at
> classpath:com/optomus/harbour/components/OptoEditForm.tml, line 2]
> ...
> Caused by: org.hibernate.exception.ConstraintViolationException: could not
> execute statement
> ...
> Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate
> entry 'Kimmy' for key 'UK_h029unq4qgmbvesub83df4vok'
> ...
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: [ANN] JumpStart 7 Released!

2018-01-12 Thread Christopher Dodunski
Thank you Geoff for your continuing commitment to the Tapestry framework!


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



Re: [ANN] JumpStart 7 Released!

2018-01-12 Thread Nathan Quirynen

Hey,

Just wanted to say thanks for your wonderful Tapestry examples, as I 
have used it regularly in the past and I'm sure I will use it in the future!


Nathan

Op 11/01/2018 om 14:14 schreef JumpStart:

Hi all,

At long last, JumpStart 7 has officially been released, with a downloadable zip 
file, installation notes, and tips!

I am still as excited as ever about Tapestry, particularly since 5.4 which has 
been a stunning upgrade. Its adoption of jQuery, RequireJS, Bootstrap, and 
Less, has lifted productivity even further than before. In fact my team and I 
use JumpStart daily for product development. The delay has simply been due to 
the demands of working in a startup.

JumpStart can be used here:

http://jumpstart.doublenegative.com.au/jumpstart/ 


And downloaded here:

http://jumpstart.doublenegative.com.au/download.html

And as always, your comments and corrections are encouraged.

Cheers,

Geoff



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



BeanEditForm onValidate()

2018-01-12 Thread Christopher Dodunski
Hi there,

Below is my onValidate() method of a BeanEditForm for updating a user's
profile, where I simply check that a user isn't changing his username to
an already taken username.  The error output (below it) suggests that
BeanEditForm is committing the change to the database even before
onValidate() is called - certainly not what I wish to occur.

Could someone please explain what is happening here, as it runs contrary
to my understanding of form validation.  Thanks very much for your help.


==
FORM VALIDATION METHOD
==

/**
 * Do the cross-field validation
 * Record any error, and thereby prevent Tapestry from emitting a
"success" event
 */
@Log
public void onValidateFromUpdateForm(){
LOG.debug("onValidateFromUpdateForm");

LOG.debug("Form user: [" + user.getUserName() + "|" +
user.getFirstName() + "|" + user.getLastName() + "]");  //For
debugging only (delete)

//Validate user name (remains unique)
User userVerif =
crudServiceDAO.findUniqueWithNamedQuery(User.BY_USERNAME,
QueryParameters.with("userName", user.getUserName()).parameters());

LOG.debug("Verify user: [" + userVerif.getUserName() + "|" +
userVerif.getFirstName() + "|" + userVerif.getLastName() + "]"); 
//For debugging only (delete)

if(!userVerif.equals(user)){
//User name already taken by someone else
updateForm.recordError(messages.get("error.userNameTaken"));
}
}


==
LOG OUTPUT
==

13-01-2018 00:28:09 DEBUG UpdateUser:74 - [ENTER] onValidateFromUpdateForm()
13-01-2018 00:28:09 DEBUG UpdateUser:177 - onValidateFromUpdateForm
13-01-2018 00:28:09 DEBUG UpdateUser:179 - Form user: [Kimmy|James|Cook]
13-01-2018 00:28:09 WARN  SqlExceptionHelper:145 - SQL Error: 1062,
SQLState: 23000
13-01-2018 00:28:09 ERROR SqlExceptionHelper:147 - Duplicate entry 'Kimmy'
for key 'UK_h029unq4qgmbvesub83df4vok'
13-01-2018 00:28:09 DEBUG UpdateUser:165 - [ FAIL]
onValidateFromUpdateForm --
org.hibernate.exception.ConstraintViolationException
org.hibernate.exception.ConstraintViolationException: could not execute
statement
...
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate
entry 'Kimmy' for key 'UK_h029unq4qgmbvesub83df4vok'
...
13-01-2018 00:28:09 ERROR Registry:208 - could not execute statement
13-01-2018 00:28:09 ERROR Registry:209 - Operations trace:
13-01-2018 00:28:09 ERROR Registry:218 - [ 1] Handling traditional
'action' component event request for user/Update:updateform.form.
13-01-2018 00:28:09 ERROR Registry:218 - [ 2] Triggering event 'action' on
user/Update:updateform.form
13-01-2018 00:28:09 ERROR Registry:218 - [ 3] Triggering event 'validate'
on user/Update:updateform.form
13-01-2018 00:28:09 ERROR RequestExceptionHandler:236 - Processing of
request failed with uncaught exception:
org.apache.tapestry5.runtime.ComponentEventException: could not execute
statement [at classpath:com/optomus/harbour/components/OptoEditForm.tml,
line 2]
org.apache.tapestry5.runtime.ComponentEventException: could not execute
statement [at classpath:com/optomus/harbour/components/OptoEditForm.tml,
line 2]
...
Caused by: org.apache.tapestry5.ioc.internal.OperationException: could not
execute statement [at
classpath:com/optomus/harbour/components/OptoEditForm.tml, line 2]
...
Caused by: org.apache.tapestry5.runtime.ComponentEventException: could not
execute statement [at
classpath:com/optomus/harbour/components/OptoEditForm.tml, line 2]
...
Caused by: org.hibernate.exception.ConstraintViolationException: could not
execute statement
...
Caused by: java.sql.SQLIntegrityConstraintViolationException: Duplicate
entry 'Kimmy' for key 'UK_h029unq4qgmbvesub83df4vok'
...



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



Re: Conflict between Angular and prototype.js in a tapestry app

2018-01-12 Thread Thiago H. de Paula Figueiredo
On Fri, Jan 5, 2018 at 7:19 PM, Pratik Patel  wrote:

> Hello all,
>

Hello!

Short answer: there's no built-in way of having just one page having one
infrastructure which is different from the others.

Something you can try to do is to write a MarkupRendererFilter which
removes the 

Re: [ANN] JumpStart 7 Released!

2018-01-12 Thread Taha Hafeez
Thanks Geoff for your great work! 

> On 11 Jan 2018, at 18:44, JumpStart  
> wrote:
> 
> Hi all,
> 
> At long last, JumpStart 7 has officially been released, with a downloadable 
> zip file, installation notes, and tips!
> 
> I am still as excited as ever about Tapestry, particularly since 5.4 which 
> has been a stunning upgrade. Its adoption of jQuery, RequireJS, Bootstrap, 
> and Less, has lifted productivity even further than before. In fact my team 
> and I use JumpStart daily for product development. The delay has simply been 
> due to the demands of working in a startup.
> 
> JumpStart can be used here:
> 
>   http://jumpstart.doublenegative.com.au/jumpstart/ 
> 
> 
> And downloaded here:
> 
>   http://jumpstart.doublenegative.com.au/download.html
> 
> And as always, your comments and corrections are encouraged.
> 
> Cheers,
> 
> Geoff


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



Re: [ANN] JumpStart 7 Released!

2018-01-12 Thread Dmitry Gusev
Thanks for the great job, Geoff!

On Thu, Jan 11, 2018 at 4:14 PM, JumpStart <
geoff.callender.jumpst...@gmail.com> wrote:

> Hi all,
>
> At long last, JumpStart 7 has officially been released, with a
> downloadable zip file, installation notes, and tips!
>
> I am still as excited as ever about Tapestry, particularly since 5.4 which
> has been a stunning upgrade. Its adoption of jQuery, RequireJS, Bootstrap,
> and Less, has lifted productivity even further than before. In fact my team
> and I use JumpStart daily for product development. The delay has simply
> been due to the demands of working in a startup.
>
> JumpStart can be used here:
>
> http://jumpstart.doublenegative.com.au/jumpstart/ <
> http://jumpstart.doublenegative.com.au/jumpstart/>
>
> And downloaded here:
>
> http://jumpstart.doublenegative.com.au/download.html
>
> And as always, your comments and corrections are encouraged.
>
> Cheers,
>
> Geoff




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com