Re: Validator Can't Find Form Submitting Component

2013-06-14 Thread Sven Meier

Please upgrade to 1.4.22 first and recheck the problem.

Sven

On 06/13/2013 05:49 PM, Richard W. Adams wrote:

[Re-sending, as I noticed my previous send was an accidental forward, so
probably ended up in the wrong thread. Also adding some more info]

I have a form inside a panel. The form is nested inside another form that
includes the panel. The panel form has a validator which is supposed to
validate only conditionally, depending on how the form was submitted.


When I submit the panel form via an AjaxSubmitLink, the call to
findSubmittingButton() inside the validator returns null, even though I
called panelForm.add(theLiink). Is this expected behavior? I know the
findSubmittingButton() method says button, but it returns an
IFormSubmittingComponent, so I would expect it could return either a
button or a submitting link.

I need to distinguish between the various links/buttons that can submit
the form. Is this not possible with an AjaxSubmitLink? I'm using Wicket
1.4.17.

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**




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



Form Submitting Component

2013-06-13 Thread Richard W. Adams
When I submit a form via an AjaxSubmitLink, form.findSubmittingButton() 
returns null, even though I called form.add(theLlink). Is this expected 
behavior? I know the findSubmittingButton() method says button, but it 
returns an IFormSubmittingComponent, so I would expect it could return 
either a button or a submitting link.

I need to distinguish between the various links/buttons that can submit 
the form. Is this not possible with an AjaxSubmitLink? I'm using Wicket 
1.4.17.




From:   Sven Meier s...@meiers.net
To: users@wicket.apache.org
Date:   06/13/2013 07:53 AM
Subject:Re: wicket and JPA



Please read 9.6 Detachable models of the Wicket Free Guide and come 
back with your questions.

Sven

On 06/13/2013 01:20 PM, Boris Brinza wrote:
 Hello to all,
 I have some fundamental issues with integration of jpa into wicket.
 I develop web application using wicket 6 and JPA (eclipselink). Maybe 
 next question is more JPA oriented, but nevertheless:

 Lets say i have
 class BaseDetailPageT extens BaseDO extends WebPage {
 protected T dbEntity;

 }

 where dbEntity is instance of jpa persisted object.
 BaseDetail page contains form for editing db entity using 
 CompoundPropertyModel.

 After i open detail page, entity is read from DB and page is displayed 
 (if edit button is pressed) or i create new instance of object (if add 
 button is pressed).

 After submit, if i want to add new record, everything is clear, i call 
 beginTX(), entityManager.persist(dbEntity), commitTX().

 But what about updating existing record?

 Every example for JPA shows some basic code like this:
 beginTX()
 dbObject.setXXX();
 dbObject.setYYY();
 commitTX()


 But how to integrate this into wicket form using compound property 
model?
 There is no such code for setting properties of db object, and jpa 
 does not have anything like entityManager.update().

 Now i use hack (by my opinion it';s a hack)

 beginTX()
 entityManaget.detach(dbObject);
 entityManager.merge(dbObject)
 commitTX()

 but i am not sure, if it's right solution (or i'm almost sure it's not 
 right attitude)

 Is there any tutorial how to integrate these frameworks, or some 
 simple opensource project to check how it's solved?

 Thanks for any advice,
 Boris




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



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




**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**


Validator Can't Find Form Submitting Component

2013-06-13 Thread Richard W. Adams
[Re-sending, as I noticed my previous send was an accidental forward, so 
probably ended up in the wrong thread. Also adding some more info]

I have a form inside a panel. The form is nested inside another form that 
includes the panel. The panel form has a validator which is supposed to 
validate only conditionally, depending on how the form was submitted.


When I submit the panel form via an AjaxSubmitLink, the call to 
findSubmittingButton() inside the validator returns null, even though I 
called panelForm.add(theLiink). Is this expected behavior? I know the 
findSubmittingButton() method says button, but it returns an 
IFormSubmittingComponent, so I would expect it could return either a 
button or a submitting link.

I need to distinguish between the various links/buttons that can submit 
the form. Is this not possible with an AjaxSubmitLink? I'm using Wicket 
1.4.17.

**

This email and any attachments may contain information that is confidential 
and/or privileged for the sole use of the intended recipient.  Any use, review, 
disclosure, copying, distribution or reliance by others, and any forwarding of 
this email or its contents, without the express permission of the sender is 
strictly prohibited by law.  If you are not the intended recipient, please 
contact the sender immediately, delete the e-mail and destroy all copies.
**