Re: AjaxSubmitLink not working

2017-02-15 Thread Richard W. Adams
This may not be the issue, but it's good practice to always include an 
onError method in the anonymous class. Once you add that, put a break 
point there & see what turns up.



From:   Entropy 
To: users@wicket.apache.org
Date:   02/15/2017 11:55 AM
Subject:AjaxSubmitLink not working



This email originated from outside of the company.  Please use discretion 
if opening attachments or clicking on links.

I have a header links section in my header that must build in a dynamic 
way. 

 AjaxSubmitLink link = new 
AjaxSubmitLink(linkName, formToSubmit) {
 @Override
 public void 
onSubmit(AjaxRequestTarget target, Form form) {
//control never gets here.
 }
 };

That is being built in a function call that is called from a loop (though 
I
don't think that matters).  The HTML (of one example):

  • Contact Information
  • In the wicket ajax debug window, I am getting this: INFO: focus removed from INFO: focus set on startLinkc INFO: Received ajax response (69 characters) INFO: INFO: Response processed successfully. INFO: refocus last focused component not needed/allowed Implying that it ran, but did nothing? There are no validators in place (yet) on the form. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-tp4677120.html Sent from the Users forum mailing list archive at Nabble.com. - 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. **

    Re: AjaxSubmitLink not working

    2017-02-15 Thread Entropy
    Okay, I just did.  Control does not get there either.  BTW, if onError is
    something we should always override, perhaps it should be abstract?
    
    Still mystified
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-tp4677120p4677122.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink not working

    2017-02-15 Thread Martin Grigorov
    On Wed, Feb 15, 2017 at 6:51 PM, Entropy  wrote:
    
    > I have a header links section in my header that must build in a dynamic
    > way.
    >
    > AjaxSubmitLink link = new AjaxSubmitLink(linkName,
    > formToSubmit) {
    > @Override
    > public void onSubmit(AjaxRequestTarget target,
    > Form form) {
    > //control never gets here.
    > }
    >
    
    Always override #onError() too !
    
    
    > };
    >
    > That is being built in a function call that is called from a loop (though I
    > don't think that matters).  The HTML (of one example):
    >
    > 
  • href="/contact">Contact Information
  • > > In the wicket ajax debug window, I am getting this: > > INFO: focus removed from > > INFO: focus set on startLinkc > > INFO: Received ajax response (69 characters) > > INFO: > > > INFO: Response processed successfully. > > INFO: refocus last focused component not needed/allowed > > Implying that it ran, but did nothing? There are no validators in place > (yet) on the form. > > > > -- > View this message in context: http://apache-wicket.1842946. > n4.nabble.com/AjaxSubmitLink-not-working-tp4677120.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2016-05-19 Thread Sebastien
    > but I am not getting feedback message when there is some error.
    
    In case of a redirection, you need to notify the message to the session,
    not to the page/component.
    ie: Session.get().warn(message);
    
    
    
    
    
    On Thu, May 19, 2016 at 11:04 AM, Martin Grigorov 
    wrote:
    
    > Hi,
    >
    > If you use AjaxLink then you don't submit any data. You may try
    > AjaxSubmitLink instead.
    >
    > Please give more information about "but setResponsePage is not working".
    >
    > Martin Grigorov
    > Wicket Training and Consulting
    > https://twitter.com/mtgrigorov
    >
    > On Thu, May 19, 2016 at 10:11 AM, Sarang  wrote:
    >
    > > Hello Josh,
    > >
    > > I am stuck in similar situation only. When I hit on the link, I want to
    > > show
    > > feedback message if there are some mandatory fields unfilled otherwise I
    > > want to redirect using setResponsePage. If i use AjaxLink then I get
    > > feedback message properly but setResponsePage is not working. When I use
    > > SubmitLink, setResponsePage works fine but I am not getting feedback
    > > message
    > > when there is some error.
    > >
    > > Can you please suggest how can I solve this ?
    > >
    > > Thanks,
    > > Sarang
    > >
    > > --
    > > View this message in context:
    > >
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4674751.html
    > > Sent from the Users forum mailing list archive at Nabble.com.
    > >
    > > -
    > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > > For additional commands, e-mail: users-h...@wicket.apache.org
    > >
    > >
    >
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2016-05-19 Thread Martin Grigorov
    Hi,
    
    If you use AjaxLink then you don't submit any data. You may try
    AjaxSubmitLink instead.
    
    Please give more information about "but setResponsePage is not working".
    
    Martin Grigorov
    Wicket Training and Consulting
    https://twitter.com/mtgrigorov
    
    On Thu, May 19, 2016 at 10:11 AM, Sarang  wrote:
    
    > Hello Josh,
    >
    > I am stuck in similar situation only. When I hit on the link, I want to
    > show
    > feedback message if there are some mandatory fields unfilled otherwise I
    > want to redirect using setResponsePage. If i use AjaxLink then I get
    > feedback message properly but setResponsePage is not working. When I use
    > SubmitLink, setResponsePage works fine but I am not getting feedback
    > message
    > when there is some error.
    >
    > Can you please suggest how can I solve this ?
    >
    > Thanks,
    > Sarang
    >
    > --
    > View this message in context:
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4674751.html
    > Sent from the Users forum mailing list archive at Nabble.com.
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2016-05-19 Thread Sarang
    Hello Josh,
    
    I am stuck in similar situation only. When I hit on the link, I want to show
    feedback message if there are some mandatory fields unfilled otherwise I
    want to redirect using setResponsePage. If i use AjaxLink then I get
    feedback message properly but setResponsePage is not working. When I use
    SubmitLink, setResponsePage works fine but I am not getting feedback message
    when there is some error.
    
    Can you please suggest how can I solve this ?
    
    Thanks,
    Sarang
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4674751.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink not working when fileUpload in Form

    2014-09-30 Thread cojy
    Hello,
    Thank you for your feedback. 
    So I took the example and started adding my code and it works !
    After multiple comparisons and some tests I found out that the problem is in
    the HTML and arises when the  is inside
    the   tags.
    So no issue whatsoever having the submit in the form, unless there is a
    fileUpload. That's still a bit weird.
    But anyway, problem solved, so thanks again !
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-when-fileUpload-in-Form-tp4667740p4667766.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink not working when fileUpload in Form

    2014-09-28 Thread Martin Grigorov
    Hi,
    
    The demo example at
    http://www.wicket-library.com/wicket-examples-6.0.x/ajax/upload seems to
    work fine.
    Take a look at its code (wicket-examples module) and see what is different
    with your code.
    
    Martin Grigorov
    Wicket Training and Consulting
    https://twitter.com/mtgrigorov
    
    On Sun, Sep 28, 2014 at 10:25 AM, cojy  wrote:
    
    > Hi,
    > When I am having a fileUpload in a form, the wicket ajax debug throw the
    > following error:
    >
    > "An error occurred while executing Ajax request:TypeError: object is not a
    > function"
    >
    > and my ajaxsubmitlink actions onSubmit() or onError() are not called (so
    > nothing happens).
    > I am not sure if I am doing something wrong, if this is expected or if this
    > is a bug.
    >
    > Here is a simple code that I used:
    >
    > TestPage.java:
    > public final class TestPage extends PersistancePanel {
    > public TestPage(String id, Eventmgr em) {
    > super(id);
    >
    > Form form = new TestPage.TestPageForm("eventCreationForm", em);
    > form.setMultiPart(true); // Enable multipart mode (need for uploads
    > file)
    > form.setMaxSize(Bytes.kilobytes(128));
    > form.setModel(new CompoundPropertyModel(em));
    > add(form);
    >
    > }
    >
    > public final class TestPageForm extends Form {
    > public TestPageForm(final String id, Eventmgr eventMgr) {
    > super(id);
    >
    > add(new FileUploadField("fileUpload"));
    >
    > final WebMarkupContainer wmc2 = new WebMarkupContainer("wmc");
    > wmc2.setOutputMarkupId(true);
    >
    > RefreshingView rv = new RefreshingView("subEventForm") {
    > @Override
    > //protected void populateItem(ListItem item) {
    > protected void populateItem(Item item) {
    >
    >
    > final Event event = (Event) item.getModelObject();
    >
    >
    > item.add(new TextArea<>("descr2", new
    > PropertyModel(event, "descr")));
    > }
    >
    > @Override
    > protected Iterator> getItemModels() {
    > return eventMgr.getILevents().iterator();
    > }
    >
    > };
    > rv.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
    > wmc2.add(rv);
    > add(wmc2);
    >
    > AjaxSubmitLink addSubevent = new AjaxSubmitLink("addSubevent",
    > this) {
    > @Override
    > public void onSubmit(AjaxRequestTarget target, Form form) {
    > eventMgr.getEvents().add(new Event());
    > System.out.println("OK");
    > target.add(wmc2);
    > }
    > };
    > addSubevent.setDefaultFormProcessing(false);
    > add(addSubevent);
    > }
    > @Override
    > protected void onSubmit() {
    > System.out.println("submit done");
    > }
    > }
    > }
    >
    > TestPage.html
    > 
    > 
    > 
    > CreateEvent
    > 
    > 
    > 
    >
    >
    > 
    >
    >
    >
    >
    >
    >  key="event.addposter"/>:
    >
    >
    >
    >
    >
    >
    > 
    >
    >
    >
    >
    >
    > :
    >  cols="40">
    >
    >
    >
    > 
    >
    >  + <#>   
    > 
    > 
    > 
    > 
    > 
    >
    > Thank you for your help,
    > Cojy.
    >
    > --
    > View this message in context:
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-not-working-when-fileUpload-in-Form-tp4667740.html
    > Sent from the Users forum mailing list archive at Nabble.com.
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    

    Re: AjaxSubmitLink and AjaxRequestTarget.appendJavaScript

    2013-08-30 Thread Martin Grigorov
    Hi,
    
    
    On Tue, Aug 27, 2013 at 5:21 PM, podmak  wrote:
    
    > hi,
    > I need add some js in my AjaxSubmitLink.onSubmit(AjaxRequestTarget target,
    > Form form) but it is not working. example on my onSubmit function:
    > @Override
    > protected void onSubmit (AjaxRequestTarget target, Form form)
    > {
    > super.onSubmit(target, form);
    > target.appendJavaScript("myJS");
    > }
    >
    > Is appendJavaScript working only in AjaxLink or?
    >
    
    No.
    It should work in this case too.
    Check the http response body with Firebug or similar tool.
    
    
    >
    > thanks
    >
    >
    >
    >
    > --
    > View this message in context:
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-and-AjaxRequestTarget-appendJavaScript-tp4661101.html
    > Sent from the Users forum mailing list archive at Nabble.com.
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    

    Re: AjaxSubmitLink Errors

    2013-06-24 Thread Martin Grigorov
    Hi,
    
    The AjaxSubmitLink just submits the data.
    Its #onError() is called when any of the submitted *form components* has an
    error.
    
    
    On Fri, Jun 21, 2013 at 7:39 PM, Richard W. Adams  wrote:
    
    > When AjaxSubmitLink.onError() is called, how does one determine what the
    > error was? Calling getFeedbackMessage() (tried on both the link & on the
    > form)  is returning null, & I can't see any other way to determine what
    > the error was...
    >
    > **
    >
    > 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.
    > **
    >
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2012-11-26 Thread sadiq81
    Thx for this post, it also helped me :)
    
    
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-setResponsePage-feedback-message-problem-on-new-page-tp1843719p4654214.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited

    2012-01-24 Thread Richard W. Adams
    If understand your problem correctly, the solution might be just to create 
    it as an AjaxButton & override the onSubmit & onError methods. We do that 
    in our app & works great.
    
    "RAM /abr./: Rarely Adequate Memory." 
    
    
    
    From:   chimaira 
    To: users@wicket.apache.org
    Date:   01/23/2012 05:53 PM
    Subject:AjaxSubmitLink :   Simple attribute modifier (confirm 
    javascript popup) never calld , form not submited
    
    
    
    Hello , sorry for my english ! 
    
    
    I m facing a probleme with AjaxSubmitLink on a form compoenent 
    
    I want to add a simple attribute modifier with a on click and a confirm 
    javascript popup, to get to user confirmation befor submiting.
    
    That works fine with a simple wicket button , but I want to use
    AjaxSubmitLink that way I can overrid the OnError methode and refresh my
    form feedback, so I create I class AjaxConfirmButton extends 
    AjaxSubmitLink.
    and in the constructor I add the behaviour (add( new
    SimpleAttributeModifier('onclick', "return confirm(...)").
    
    the probleme is the on click javascript is never calld and the form is 
    never
    submited.
    
    is there a way to fix this issue? 
     hanks a lot 
    
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4322492.html
    
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    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.
    **
    
    

    Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited

    2012-01-24 Thread chimaira
    
    I got it,
    
    Thanks for your help  
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323328.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited

    2012-01-24 Thread Martin Grigorov
    new AjaxLink() {
    
      protected IAjaxCallDecorator getAjaxCallDecorator() {return new
    JSConfirmDecorator(); }
    }
    
    On Tue, Jan 24, 2012 at 11:04 AM, chimaira  wrote:
    > Hi martin,
    > oops I thought the AjaxCallDecorator was a markup component,  sorry
    >
    > So how can I implement it in my AjaxLink ? By simply adding it in my
    > constructor?
    >
    >
    > Thanks again
    >
    > --
    > View this message in context: 
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323255.html
    > Sent from the Users forum mailing list archive at Nabble.com.
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    
    
    
    -- 
    Martin Grigorov
    jWeekend
    Training, Consulting, Development
    http://jWeekend.com
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited

    2012-01-24 Thread chimaira
    Hi martin, 
    oops I thought the AjaxCallDecorator was a markup component,  sorry
    
    So how can I implement it in my AjaxLink ? By simply adding it in my
    constructor? 
    
    
    Thanks again 
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323255.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited

    2012-01-24 Thread Martin Grigorov
    Hi,
    
    On Tue, Jan 24, 2012 at 10:27 AM, chimaira  wrote:
    > Thanks  Igor, But , how can I assign the markup Id ? There is no constructor
    > with a super(id) method !
    
    Which markup id you need ?
    
    
    @Override
       public CharSequence decorateScript(Component c, CharSequence script){
       return "if (!confirm('" +
    StringUtils.replace(confirmMessage, "'",
    "\'") + "')) return false;\n" + script;
    
    This is the code that generates the JavaScript. Here you receive the
    component (c), so you can use c.getMarkupId(), if this is the markup
    id you need.
    
    >
    > Thanks again
    >
    > --
    > View this message in context: 
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323167.html
    > Sent from the Users forum mailing list archive at Nabble.com.
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    
    
    
    -- 
    Martin Grigorov
    jWeekend
    Training, Consulting, Development
    http://jWeekend.com
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited

    2012-01-24 Thread chimaira
    Thanks  Igor, But , how can I assign the markup Id ? There is no constructor
    with a super(id) method ! 
    
    Thanks again
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4323167.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink : Simple attribute modifier (confirm javascript popup) never calld , form not submited

    2012-01-23 Thread Igor Vaynberg
    for ajax links you need to use an IAjaxCallDecorator to tweak the
    javascript. below is a possible impl.
    
    -igor
    
    public class JavascriptConfirmDecorator extends AjaxCallDecorator
    {
    private final String confirmMessage;
    
    public JavascriptConfirmDecorator(String confirmMessage){
    this.confirmMessage = confirmMessage;
    }
    
    @Override
    public CharSequence decorateScript(Component c, CharSequence script)
    {
    return "if (!confirm('" + 
    StringUtils.replace(confirmMessage, "'",
    "\'") + "')) return false;\n" + script;
    }
    }
    
    On Mon, Jan 23, 2012 at 3:53 PM, chimaira  wrote:
    > Hello , sorry for my english !
    >
    >
    > I m facing a probleme with AjaxSubmitLink on a form compoenent
    >
    > I want to add a simple attribute modifier with a on click and a confirm
    > javascript popup, to get to user confirmation befor submiting.
    >
    > That works fine with a simple wicket button , but I want to use
    > AjaxSubmitLink that way I can overrid the OnError methode and refresh my
    > form feedback, so I create I class AjaxConfirmButton extends AjaxSubmitLink.
    > and in the constructor I add the behaviour (add( new
    > SimpleAttributeModifier('onclick', "return confirm(...)").
    >
    > the probleme is the on click javascript is never calld and the form is never
    > submited.
    >
    > is there a way to fix this issue?
    >  hanks a lot
    >
    >
    > --
    > View this message in context: 
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-Simple-attribute-modifier-confirm-javascript-popup-never-calld-form-not-submited-tp4322492p4322492.html
    > Sent from the Users forum mailing list archive at Nabble.com.
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-19 Thread Martin Grigorov
    On Mon, Sep 19, 2011 at 5:14 AM, Wayne W  wrote:
    > The thing is I'm not doing anything special here, just straight wicket
    > form stuff AFAIK.
    >
    > Here is what is generated from wicket for the form and the link:
    >
    >  action="../../?wicket:interface=:2:users:addPersonContainer:addPersonPanel:userForm::IFormSubmitListener::"
    > method="post">
    The form id is different.
    Here is "userForm4e".
    Below is 'userForm1f' (wcall=wicketSubmitFormById('userForm1f' )
    > ...
    >
    > 
    >                                                Add this person or 
    > group
    >                                                
    >                                                
    >                                                 style="display:none">  src="../../images/icons/spinnerflat.gif">
    >                                        
    >
    >
    > As you may see we have an ajax call decorator as well.
    >
    >
    >
    >
    >
    > On Sat, Sep 17, 2011 at 3:59 AM, Igor Vaynberg  
    > wrote:
    >> no. i thikn it should be
    >>
    >> if (typeof(retVal)=="undefined") retVal=true;
    >>
    >> -igor
    >>
    >> On Fri, Sep 16, 2011 at 10:58 AM, Martin Grigorov  
    >> wrote:
    >>> return (typeOf retVal === "undefined" || retVal === true)
    >>>
    >>> in all other cases stop the submit
    >>>
    >>> looks OK ?
    >>>
    >>> On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov  
    >>> wrote:
     Yes, sounds like a good idea.
     What if the user code returns an object ?
    
     On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg  
     wrote:
    > i think in this case we should define the undefined to be true...
    >
    > -igor
    >
    > On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov  
    > wrote:
    >> it seems in your code you have  without
    >> returning anything. Since 'if (undefined)' is 'false' the call stops
    >> there.
    >>
    >> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  
    >> wrote:
    >>> and in what case does it not return anything?
    >>>
    >>>
    >>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  
    >>> wrote:
     It should return true or false.
     False if there is some reason to not submit the form, for example
     client side validation failed.
     True if everything is OK and the submit can proceed.
    
     On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  
     wrote:
    > Hi,
    >
    > I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    > AjaxSubmitLink is not working  (at least with one form).
    >
    > The form doesn't get submitted - the problem in wicket-ajax.js is 
    > (~line 1120):
    >
    > // Submits a form using ajax.
    >        // This method serializes a form and sends it as POST body.
    >        submitForm: function(form, submitButton) {
    >                var submittingAttribute = 'data-wicket-submitting';
    >                if (form.onsubmit && 
    > !form.getAttribute(submittingAttribute)) {
    >                        form.setAttribute(submittingAttribute, 
    > submittingAttribute);
    >                        var retValue = form.onsubmit();
    >                        form.removeAttribute(submittingAttribute);
    >                        if (!retValue) return;
    >                }
    >
    >
    > The problem is var retValue = form.onsubmit(); does not return any
    > value (retValue remains undefined) and hence it returns and doesn't do
    > the submit. I don't know enough about javascript to really understand
    > whats happening here. The form is fairly unremarkable.
    >
    > For now I've patch the wicket-ajax.js code and comment out the return,
    > and it works fine again. I notice this code here was not in 1.4.8. But
    > obviously this is not the solution.
    >
    > So I imagine it something to do with the form, but I don't know where
    > to start and look - what is normally returned by form.onsubmit();?
    > what can I look for?
    >
    > many thanks
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    
    
     --
     Martin Grigorov
     jWeekend
     Training, Consulting, Development
     http://jWeekend.com
    
     -
     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
    >>>
    >>>
    >>
    >>
    >>
    >> --
    >> Martin Grigorov
    >> jWeekend
    >> Training, Consulting, Development
    >>

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-18 Thread Wayne W
    The thing is I'm not doing anything special here, just straight wicket
    form stuff AFAIK.
    
    Here is what is generated from wicket for the form and the link:
    
    
    ...
    
    
    Add this person or 
    group
    
    
     
    
    
    
    As you may see we have an ajax call decorator as well.
    
    
    
    
    
    On Sat, Sep 17, 2011 at 3:59 AM, Igor Vaynberg  wrote:
    > no. i thikn it should be
    >
    > if (typeof(retVal)=="undefined") retVal=true;
    >
    > -igor
    >
    > On Fri, Sep 16, 2011 at 10:58 AM, Martin Grigorov  
    > wrote:
    >> return (typeOf retVal === "undefined" || retVal === true)
    >>
    >> in all other cases stop the submit
    >>
    >> looks OK ?
    >>
    >> On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov  
    >> wrote:
    >>> Yes, sounds like a good idea.
    >>> What if the user code returns an object ?
    >>>
    >>> On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg  
    >>> wrote:
     i think in this case we should define the undefined to be true...
    
     -igor
    
     On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov  
     wrote:
    > it seems in your code you have  without
    > returning anything. Since 'if (undefined)' is 'false' the call stops
    > there.
    >
    > On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  
    > wrote:
    >> and in what case does it not return anything?
    >>
    >>
    >> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  
    >> wrote:
    >>> It should return true or false.
    >>> False if there is some reason to not submit the form, for example
    >>> client side validation failed.
    >>> True if everything is OK and the submit can proceed.
    >>>
    >>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  
    >>> wrote:
     Hi,
    
     I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
     AjaxSubmitLink is not working  (at least with one form).
    
     The form doesn't get submitted - the problem in wicket-ajax.js is 
     (~line 1120):
    
     // Submits a form using ajax.
            // This method serializes a form and sends it as POST body.
            submitForm: function(form, submitButton) {
                    var submittingAttribute = 'data-wicket-submitting';
                    if (form.onsubmit && 
     !form.getAttribute(submittingAttribute)) {
                            form.setAttribute(submittingAttribute, 
     submittingAttribute);
                            var retValue = form.onsubmit();
                            form.removeAttribute(submittingAttribute);
                            if (!retValue) return;
                    }
    
    
     The problem is var retValue = form.onsubmit(); does not return any
     value (retValue remains undefined) and hence it returns and doesn't do
     the submit. I don't know enough about javascript to really understand
     whats happening here. The form is fairly unremarkable.
    
     For now I've patch the wicket-ajax.js code and comment out the return,
     and it works fine again. I notice this code here was not in 1.4.8. But
     obviously this is not the solution.
    
     So I imagine it something to do with the form, but I don't know where
     to start and look - what is normally returned by form.onsubmit();?
     what can I look for?
    
     many thanks
    
     -
     To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
     For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    >>>
    >>>
    >>>
    >>> --
    >>> Martin Grigorov
    >>> jWeekend
    >>> Training, Consulting, Development
    >>> http://jWeekend.com
    >>>
    >>> -
    >>> 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
    >>
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    > -
    > 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
    
    
    >>>
    >>>
    >>>
    >>> --
    >>> Martin G

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Igor Vaynberg
    no. i thikn it should be
    
    if (typeof(retVal)=="undefined") retVal=true;
    
    -igor
    
    On Fri, Sep 16, 2011 at 10:58 AM, Martin Grigorov  wrote:
    > return (typeOf retVal === "undefined" || retVal === true)
    >
    > in all other cases stop the submit
    >
    > looks OK ?
    >
    > On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov  wrote:
    >> Yes, sounds like a good idea.
    >> What if the user code returns an object ?
    >>
    >> On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg  
    >> wrote:
    >>> i think in this case we should define the undefined to be true...
    >>>
    >>> -igor
    >>>
    >>> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov  
    >>> wrote:
     it seems in your code you have  without
     returning anything. Since 'if (undefined)' is 'false' the call stops
     there.
    
     On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  
     wrote:
    > and in what case does it not return anything?
    >
    >
    > On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  
    > wrote:
    >> It should return true or false.
    >> False if there is some reason to not submit the form, for example
    >> client side validation failed.
    >> True if everything is OK and the submit can proceed.
    >>
    >> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  
    >> wrote:
    >>> Hi,
    >>>
    >>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    >>> AjaxSubmitLink is not working  (at least with one form).
    >>>
    >>> The form doesn't get submitted - the problem in wicket-ajax.js is 
    >>> (~line 1120):
    >>>
    >>> // Submits a form using ajax.
    >>>        // This method serializes a form and sends it as POST body.
    >>>        submitForm: function(form, submitButton) {
    >>>                var submittingAttribute = 'data-wicket-submitting';
    >>>                if (form.onsubmit && 
    >>> !form.getAttribute(submittingAttribute)) {
    >>>                        form.setAttribute(submittingAttribute, 
    >>> submittingAttribute);
    >>>                        var retValue = form.onsubmit();
    >>>                        form.removeAttribute(submittingAttribute);
    >>>                        if (!retValue) return;
    >>>                }
    >>>
    >>>
    >>> The problem is var retValue = form.onsubmit(); does not return any
    >>> value (retValue remains undefined) and hence it returns and doesn't do
    >>> the submit. I don't know enough about javascript to really understand
    >>> whats happening here. The form is fairly unremarkable.
    >>>
    >>> For now I've patch the wicket-ajax.js code and comment out the return,
    >>> and it works fine again. I notice this code here was not in 1.4.8. But
    >>> obviously this is not the solution.
    >>>
    >>> So I imagine it something to do with the form, but I don't know where
    >>> to start and look - what is normally returned by form.onsubmit();?
    >>> what can I look for?
    >>>
    >>> many thanks
    >>>
    >>> -
    >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >>> For additional commands, e-mail: users-h...@wicket.apache.org
    >>>
    >>>
    >>
    >>
    >>
    >> --
    >> Martin Grigorov
    >> jWeekend
    >> Training, Consulting, Development
    >> http://jWeekend.com
    >>
    >> -
    >> 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
    >
    >
    
    
    
     --
     Martin Grigorov
     jWeekend
     Training, Consulting, Development
     http://jWeekend.com
    
     -
     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
    >>>
    >>>
    >>
    >>
    >>
    >> --
    >> Martin Grigorov
    >> jWeekend
    >> Training, Consulting, Development
    >> http://jWeekend.com
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Igor Vaynberg
    then let the default behavior happen. only convert to "true" if the
    return type is undefiend.
    
    -igor
    
    On Fri, Sep 16, 2011 at 10:57 AM, Martin Grigorov  wrote:
    > Yes, sounds like a good idea.
    > What if the user code returns an object ?
    >
    > On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg  
    > wrote:
    >> i think in this case we should define the undefined to be true...
    >>
    >> -igor
    >>
    >> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov  
    >> wrote:
    >>> it seems in your code you have  without
    >>> returning anything. Since 'if (undefined)' is 'false' the call stops
    >>> there.
    >>>
    >>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  
    >>> wrote:
     and in what case does it not return anything?
    
    
     On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  
     wrote:
    > It should return true or false.
    > False if there is some reason to not submit the form, for example
    > client side validation failed.
    > True if everything is OK and the submit can proceed.
    >
    > On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  
    > wrote:
    >> Hi,
    >>
    >> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    >> AjaxSubmitLink is not working  (at least with one form).
    >>
    >> The form doesn't get submitted - the problem in wicket-ajax.js is (~line 
    >> 1120):
    >>
    >> // Submits a form using ajax.
    >>        // This method serializes a form and sends it as POST body.
    >>        submitForm: function(form, submitButton) {
    >>                var submittingAttribute = 'data-wicket-submitting';
    >>                if (form.onsubmit && 
    >> !form.getAttribute(submittingAttribute)) {
    >>                        form.setAttribute(submittingAttribute, 
    >> submittingAttribute);
    >>                        var retValue = form.onsubmit();
    >>                        form.removeAttribute(submittingAttribute);
    >>                        if (!retValue) return;
    >>                }
    >>
    >>
    >> The problem is var retValue = form.onsubmit(); does not return any
    >> value (retValue remains undefined) and hence it returns and doesn't do
    >> the submit. I don't know enough about javascript to really understand
    >> whats happening here. The form is fairly unremarkable.
    >>
    >> For now I've patch the wicket-ajax.js code and comment out the return,
    >> and it works fine again. I notice this code here was not in 1.4.8. But
    >> obviously this is not the solution.
    >>
    >> So I imagine it something to do with the form, but I don't know where
    >> to start and look - what is normally returned by form.onsubmit();?
    >> what can I look for?
    >>
    >> many thanks
    >>
    >> -
    >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >> For additional commands, e-mail: users-h...@wicket.apache.org
    >>
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    > -
    > 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
    
    
    >>>
    >>>
    >>>
    >>> --
    >>> Martin Grigorov
    >>> jWeekend
    >>> Training, Consulting, Development
    >>> http://jWeekend.com
    >>>
    >>> -
    >>> 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
    >>
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Martin Grigorov
    return (typeOf retVal === "undefined" || retVal === true)
    
    in all other cases stop the submit
    
    looks OK ?
    
    On Fri, Sep 16, 2011 at 8:57 PM, Martin Grigorov  wrote:
    > Yes, sounds like a good idea.
    > What if the user code returns an object ?
    >
    > On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg  
    > wrote:
    >> i think in this case we should define the undefined to be true...
    >>
    >> -igor
    >>
    >> On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov  
    >> wrote:
    >>> it seems in your code you have  without
    >>> returning anything. Since 'if (undefined)' is 'false' the call stops
    >>> there.
    >>>
    >>> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  
    >>> wrote:
     and in what case does it not return anything?
    
    
     On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  
     wrote:
    > It should return true or false.
    > False if there is some reason to not submit the form, for example
    > client side validation failed.
    > True if everything is OK and the submit can proceed.
    >
    > On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  
    > wrote:
    >> Hi,
    >>
    >> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    >> AjaxSubmitLink is not working  (at least with one form).
    >>
    >> The form doesn't get submitted - the problem in wicket-ajax.js is (~line 
    >> 1120):
    >>
    >> // Submits a form using ajax.
    >>        // This method serializes a form and sends it as POST body.
    >>        submitForm: function(form, submitButton) {
    >>                var submittingAttribute = 'data-wicket-submitting';
    >>                if (form.onsubmit && 
    >> !form.getAttribute(submittingAttribute)) {
    >>                        form.setAttribute(submittingAttribute, 
    >> submittingAttribute);
    >>                        var retValue = form.onsubmit();
    >>                        form.removeAttribute(submittingAttribute);
    >>                        if (!retValue) return;
    >>                }
    >>
    >>
    >> The problem is var retValue = form.onsubmit(); does not return any
    >> value (retValue remains undefined) and hence it returns and doesn't do
    >> the submit. I don't know enough about javascript to really understand
    >> whats happening here. The form is fairly unremarkable.
    >>
    >> For now I've patch the wicket-ajax.js code and comment out the return,
    >> and it works fine again. I notice this code here was not in 1.4.8. But
    >> obviously this is not the solution.
    >>
    >> So I imagine it something to do with the form, but I don't know where
    >> to start and look - what is normally returned by form.onsubmit();?
    >> what can I look for?
    >>
    >> many thanks
    >>
    >> -
    >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >> For additional commands, e-mail: users-h...@wicket.apache.org
    >>
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    > -
    > 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
    
    
    >>>
    >>>
    >>>
    >>> --
    >>> Martin Grigorov
    >>> jWeekend
    >>> Training, Consulting, Development
    >>> http://jWeekend.com
    >>>
    >>> -
    >>> 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
    >>
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    
    
    
    -- 
    Martin Grigorov
    jWeekend
    Training, Consulting, Development
    http://jWeekend.com
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Martin Grigorov
    Yes, sounds like a good idea.
    What if the user code returns an object ?
    
    On Fri, Sep 16, 2011 at 6:11 PM, Igor Vaynberg  wrote:
    > i think in this case we should define the undefined to be true...
    >
    > -igor
    >
    > On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov  wrote:
    >> it seems in your code you have  without
    >> returning anything. Since 'if (undefined)' is 'false' the call stops
    >> there.
    >>
    >> On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  wrote:
    >>> and in what case does it not return anything?
    >>>
    >>>
    >>> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  
    >>> wrote:
     It should return true or false.
     False if there is some reason to not submit the form, for example
     client side validation failed.
     True if everything is OK and the submit can proceed.
    
     On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  
     wrote:
    > Hi,
    >
    > I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    > AjaxSubmitLink is not working  (at least with one form).
    >
    > The form doesn't get submitted - the problem in wicket-ajax.js is (~line 
    > 1120):
    >
    > // Submits a form using ajax.
    >        // This method serializes a form and sends it as POST body.
    >        submitForm: function(form, submitButton) {
    >                var submittingAttribute = 'data-wicket-submitting';
    >                if (form.onsubmit && 
    > !form.getAttribute(submittingAttribute)) {
    >                        form.setAttribute(submittingAttribute, 
    > submittingAttribute);
    >                        var retValue = form.onsubmit();
    >                        form.removeAttribute(submittingAttribute);
    >                        if (!retValue) return;
    >                }
    >
    >
    > The problem is var retValue = form.onsubmit(); does not return any
    > value (retValue remains undefined) and hence it returns and doesn't do
    > the submit. I don't know enough about javascript to really understand
    > whats happening here. The form is fairly unremarkable.
    >
    > For now I've patch the wicket-ajax.js code and comment out the return,
    > and it works fine again. I notice this code here was not in 1.4.8. But
    > obviously this is not the solution.
    >
    > So I imagine it something to do with the form, but I don't know where
    > to start and look - what is normally returned by form.onsubmit();?
    > what can I look for?
    >
    > many thanks
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    
    
     --
     Martin Grigorov
     jWeekend
     Training, Consulting, Development
     http://jWeekend.com
    
     -
     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
    >>>
    >>>
    >>
    >>
    >>
    >> --
    >> Martin Grigorov
    >> jWeekend
    >> Training, Consulting, Development
    >> http://jWeekend.com
    >>
    >> -
    >> 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
    >
    >
    
    
    
    -- 
    Martin Grigorov
    jWeekend
    Training, Consulting, Development
    http://jWeekend.com
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Igor Vaynberg
    i think in this case we should define the undefined to be true...
    
    -igor
    
    On Fri, Sep 16, 2011 at 5:56 AM, Martin Grigorov  wrote:
    > it seems in your code you have  without
    > returning anything. Since 'if (undefined)' is 'false' the call stops
    > there.
    >
    > On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  wrote:
    >> and in what case does it not return anything?
    >>
    >>
    >> On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  
    >> wrote:
    >>> It should return true or false.
    >>> False if there is some reason to not submit the form, for example
    >>> client side validation failed.
    >>> True if everything is OK and the submit can proceed.
    >>>
    >>> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  
    >>> wrote:
     Hi,
    
     I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
     AjaxSubmitLink is not working  (at least with one form).
    
     The form doesn't get submitted - the problem in wicket-ajax.js is (~line 
     1120):
    
     // Submits a form using ajax.
            // This method serializes a form and sends it as POST body.
            submitForm: function(form, submitButton) {
                    var submittingAttribute = 'data-wicket-submitting';
                    if (form.onsubmit && 
     !form.getAttribute(submittingAttribute)) {
                            form.setAttribute(submittingAttribute, 
     submittingAttribute);
                            var retValue = form.onsubmit();
                            form.removeAttribute(submittingAttribute);
                            if (!retValue) return;
                    }
    
    
     The problem is var retValue = form.onsubmit(); does not return any
     value (retValue remains undefined) and hence it returns and doesn't do
     the submit. I don't know enough about javascript to really understand
     whats happening here. The form is fairly unremarkable.
    
     For now I've patch the wicket-ajax.js code and comment out the return,
     and it works fine again. I notice this code here was not in 1.4.8. But
     obviously this is not the solution.
    
     So I imagine it something to do with the form, but I don't know where
     to start and look - what is normally returned by form.onsubmit();?
     what can I look for?
    
     many thanks
    
     -
     To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
     For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    >>>
    >>>
    >>>
    >>> --
    >>> Martin Grigorov
    >>> jWeekend
    >>> Training, Consulting, Development
    >>> http://jWeekend.com
    >>>
    >>> -
    >>> 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
    >>
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Martin Grigorov
    it seems in your code you have  without
    returning anything. Since 'if (undefined)' is 'false' the call stops
    there.
    
    On Fri, Sep 16, 2011 at 3:25 PM, Wayne W  wrote:
    > and in what case does it not return anything?
    >
    >
    > On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  wrote:
    >> It should return true or false.
    >> False if there is some reason to not submit the form, for example
    >> client side validation failed.
    >> True if everything is OK and the submit can proceed.
    >>
    >> On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  wrote:
    >>> Hi,
    >>>
    >>> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    >>> AjaxSubmitLink is not working  (at least with one form).
    >>>
    >>> The form doesn't get submitted - the problem in wicket-ajax.js is (~line 
    >>> 1120):
    >>>
    >>> // Submits a form using ajax.
    >>>        // This method serializes a form and sends it as POST body.
    >>>        submitForm: function(form, submitButton) {
    >>>                var submittingAttribute = 'data-wicket-submitting';
    >>>                if (form.onsubmit && 
    >>> !form.getAttribute(submittingAttribute)) {
    >>>                        form.setAttribute(submittingAttribute, 
    >>> submittingAttribute);
    >>>                        var retValue = form.onsubmit();
    >>>                        form.removeAttribute(submittingAttribute);
    >>>                        if (!retValue) return;
    >>>                }
    >>>
    >>>
    >>> The problem is var retValue = form.onsubmit(); does not return any
    >>> value (retValue remains undefined) and hence it returns and doesn't do
    >>> the submit. I don't know enough about javascript to really understand
    >>> whats happening here. The form is fairly unremarkable.
    >>>
    >>> For now I've patch the wicket-ajax.js code and comment out the return,
    >>> and it works fine again. I notice this code here was not in 1.4.8. But
    >>> obviously this is not the solution.
    >>>
    >>> So I imagine it something to do with the form, but I don't know where
    >>> to start and look - what is normally returned by form.onsubmit();?
    >>> what can I look for?
    >>>
    >>> many thanks
    >>>
    >>> -
    >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >>> For additional commands, e-mail: users-h...@wicket.apache.org
    >>>
    >>>
    >>
    >>
    >>
    >> --
    >> Martin Grigorov
    >> jWeekend
    >> Training, Consulting, Development
    >> http://jWeekend.com
    >>
    >> -
    >> 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
    >
    >
    
    
    
    -- 
    Martin Grigorov
    jWeekend
    Training, Consulting, Development
    http://jWeekend.com
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Wayne W
    and in what case does it not return anything?
    
    
    On Fri, Sep 16, 2011 at 5:04 PM, Martin Grigorov  wrote:
    > It should return true or false.
    > False if there is some reason to not submit the form, for example
    > client side validation failed.
    > True if everything is OK and the submit can proceed.
    >
    > On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  wrote:
    >> Hi,
    >>
    >> I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    >> AjaxSubmitLink is not working  (at least with one form).
    >>
    >> The form doesn't get submitted - the problem in wicket-ajax.js is (~line 
    >> 1120):
    >>
    >> // Submits a form using ajax.
    >>        // This method serializes a form and sends it as POST body.
    >>        submitForm: function(form, submitButton) {
    >>                var submittingAttribute = 'data-wicket-submitting';
    >>                if (form.onsubmit && !form.getAttribute(submittingAttribute)) 
    >> {
    >>                        form.setAttribute(submittingAttribute, 
    >> submittingAttribute);
    >>                        var retValue = form.onsubmit();
    >>                        form.removeAttribute(submittingAttribute);
    >>                        if (!retValue) return;
    >>                }
    >>
    >>
    >> The problem is var retValue = form.onsubmit(); does not return any
    >> value (retValue remains undefined) and hence it returns and doesn't do
    >> the submit. I don't know enough about javascript to really understand
    >> whats happening here. The form is fairly unremarkable.
    >>
    >> For now I've patch the wicket-ajax.js code and comment out the return,
    >> and it works fine again. I notice this code here was not in 1.4.8. But
    >> obviously this is not the solution.
    >>
    >> So I imagine it something to do with the form, but I don't know where
    >> to start and look - what is normally returned by form.onsubmit();?
    >> what can I look for?
    >>
    >> many thanks
    >>
    >> -
    >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >> For additional commands, e-mail: users-h...@wicket.apache.org
    >>
    >>
    >
    >
    >
    > --
    > Martin Grigorov
    > jWeekend
    > Training, Consulting, Development
    > http://jWeekend.com
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink 1.4.18 issue/not working

    2011-09-16 Thread Martin Grigorov
    It should return true or false.
    False if there is some reason to not submit the form, for example
    client side validation failed.
    True if everything is OK and the submit can proceed.
    
    On Fri, Sep 16, 2011 at 6:21 AM, Wayne W  wrote:
    > Hi,
    >
    > I'm trying to upgrade from 1.4.8 to 1.4.18 and I'm finding that
    > AjaxSubmitLink is not working  (at least with one form).
    >
    > The form doesn't get submitted - the problem in wicket-ajax.js is (~line 
    > 1120):
    >
    > // Submits a form using ajax.
    >        // This method serializes a form and sends it as POST body.
    >        submitForm: function(form, submitButton) {
    >                var submittingAttribute = 'data-wicket-submitting';
    >                if (form.onsubmit && !form.getAttribute(submittingAttribute)) {
    >                        form.setAttribute(submittingAttribute, 
    > submittingAttribute);
    >                        var retValue = form.onsubmit();
    >                        form.removeAttribute(submittingAttribute);
    >                        if (!retValue) return;
    >                }
    >
    >
    > The problem is var retValue = form.onsubmit(); does not return any
    > value (retValue remains undefined) and hence it returns and doesn't do
    > the submit. I don't know enough about javascript to really understand
    > whats happening here. The form is fairly unremarkable.
    >
    > For now I've patch the wicket-ajax.js code and comment out the return,
    > and it works fine again. I notice this code here was not in 1.4.8. But
    > obviously this is not the solution.
    >
    > So I imagine it something to do with the form, but I don't know where
    > to start and look - what is normally returned by form.onsubmit();?
    > what can I look for?
    >
    > many thanks
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    
    
    -- 
    Martin Grigorov
    jWeekend
    Training, Consulting, Development
    http://jWeekend.com
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

    2011-06-05 Thread Tier
    Thanks, it's help me with my problem.
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3576210.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

    2011-06-03 Thread Andrea Del Bene
    
    Hi,
    I guess the problem is method save() which delays  closing of the form 
    and let you click few times consecutively. You can decorate your submit 
    link with an IAjaxCallDecorator in order to disable link on the first click:
    
    
    public class AjaxDisableComponentDecorator implements IAjaxCallDecorator{
    
    private Component componentToHide;
    
    public AjaxDisableComponentDecorator(Component componentToHide){
    this.componentToHide = componentToHide;
    }
    
    @Override
    public CharSequence decorateOnFailureScript(Component component, 
    CharSequence script) {
    
    //do nothing
    }
    
    @Override
    public CharSequence decorateOnSuccessScript(Component component, 
    CharSequence script) {
    
    //do nothing
    }
    
    @Override
    public CharSequence decorateScript(Component component, 
    CharSequence script) {
    return  "< disable component with 
    id=componentToHide.getMarkupId()>" + "';" +  script ;
    
    }
    
    }
    
    
    Hello,
    
    I have ModalWindow with form inside
    
    html:
    
    wicket:panel>
    
    ...
    
      
    
    
    
    
    java:
    
    add(okButton = new AjaxSubmitLink("closeOK", this)
    {
    @Override
    protected void onSubmit(AjaxRequestTarget target, 
    Form  form)
    {
    save();
    window.close(target);
    }
    });
    
    If I press button few times before it closes - it wicket will throw an
    exception
    
    org.apache.wicket.WicketRuntimeException: Submit Button closeOK
    (path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is
    not visible
      at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)
    
    Any ideas how fix this problem?
    
    --
    View this message in context: 
    http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.html
    Sent from the Users forum mailing list archive at Nabble.com.
    
    -
    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
    
    
    

    Re: AjaxSubmitLink in ModalWindow throws Submit Button is not visible exception

    2011-06-03 Thread Martin Grigorov
    Make the button disabled with JavaScript after the first click, or
    raise a flag at server side that it is clicked and all further clicks
    should be ignored if the flag is true
    
    On Fri, Jun 3, 2011 at 1:03 PM, Tier  wrote:
    > Hello,
    >
    > I have ModalWindow with form inside
    >
    > html:
    >
    > wicket:panel>
    >        
    >           ...
    >        
    >          
    >        
    >        
    > 
    >
    > java:
    >
    > add(okButton = new AjaxSubmitLink("closeOK", this)
    >                {
    >                        @Override
    >                        protected void onSubmit(AjaxRequestTarget target, 
    > Form form)
    >                        {
    >                                save();
    >                                window.close(target);
    >                        }
    >                });
    >
    > If I press button few times before it closes - it wicket will throw an
    > exception
    >
    > org.apache.wicket.WicketRuntimeException: Submit Button closeOK
    > (path=centralPanel:offerList:rejectOfferWindow:content:offerForm:closeOK) is
    > not visible
    >     at org.apache.wicket.markup.html.form.Form$2.component(Form.java:620)
    >
    > Any ideas how fix this problem?
    >
    > --
    > View this message in context: 
    > http://apache-wicket.1842946.n4.nabble.com/AjaxSubmitLink-in-ModalWindow-throws-Submit-Button-is-not-visible-exception-tp3570446p3570446.html
    > Sent from the Users forum mailing list archive at Nabble.com.
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    
    
    -- 
    Martin Grigorov
    jWeekend
    Training, Consulting, Development
    http://jWeekend.com
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink problem

    2010-10-27 Thread Pedro Santos
    use the formCoponent.getRawInput()
    
    On Wed, Oct 27, 2010 at 12:24 PM, Anna Simbirtsev wrote:
    
    > Hi,
    >
    > I am using AjaxSubmitLink and I have setDefaultFormProcessing(false)
    > to avoid form validation. The only problem is that none of the form
    > values get submitted. If I need to get the value of one of the fields,
    > how do I do that?
    >
    > Thanks,
    > Anna
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    
    -- 
    Pedro Henrique Oliveira dos Santos
    
    

    Re: AjaxSubmitLink javadocs

    2010-04-16 Thread Jeremy Thomerson
    Every little bit helps - look how long it's been and nobody noticed it and
    brought it to our attention - but it could have thrown some people off.
     Thanks for the help!
    
    I'll commit a fix this weekend when I get a few free minutes.  :)
    
    --
    Jeremy Thomerson
    http://www.wickettraining.com
    
    
    
    On Fri, Apr 16, 2010 at 3:03 AM, Xavier López  wrote:
    
    > Thanks for the answer, Jeremy.
    >
    > I just created issue https://issues.apache.org/jira/browse/WICKET-2837.
    >
    > I'm with you on what you state, it was obvious the only possible way to do
    > a
    > submit without JS is to have an html submit mechanism, anyway, I was just
    > being cautious in case I was missing something.
    > I'm just glad to contribute improving this great framework, even though
    > it's
    > on a lesser thing like this.
    >
    > Cheers,
    > Xavier
    >
    >
    > 2010/4/16 Jeremy Thomerson 
    >
    > > This appears to be an issue in the documentation of the AjaxSubmitLink.
    >  I
    > > just checked and the documentation is still the same in 1.4.  I will try
    > to
    > > verify this and fix it tomorrow.  In the meantime, it would be helpful if
    > > you opened a JIRA issue to keep track of this (post the link back to this
    > > thread).
    > >
    > > Anyway, the documentation is written as if this were a fallback component
    > > (i.e. AjaxFallbackLink).  However, it is not.  Obviously, if you do not
    > > have
    > > JS enabled, you can not submit a form with a link in the browser.  You
    > > could
    > > only submit it with a submit button.
    > >
    > > --
    > > Jeremy Thomerson
    > > http://www.wickettraining.com
    > >
    > >
    > >
    > > On Thu, Apr 15, 2010 at 4:12 AM, Xavier López 
    > wrote:
    > >
    > > > Hi,
    > > >
    > > > I'm a liitle confused about AjaxSubmitLink's JavaDoc, and the code
    > inside
    > > > it... I'm using Wicket 1.3.6:
    > > >
    > > > If/when javascript is turned off in the browser, or it doesn't support
    > > > > javascript, then the
    > > > > browser will not respond to the onclick event, using the href
    > directly.
    > > > > Wicket will then use a
    > > > > normal request target, and call the serverside onClick with a null
    > > {...@link
    > > > > AjaxRequestTarget}.
    > > > >
    > > >
    > > > First question is, does it really mean 'serverside onClick' ? Or should
    > > it
    > > > read 'serverside onSubmit' ?
    > > >
    > > > And then, in the code, I see :
    > > >
    > > > protected void onComponentTag(ComponentTag tag)
    > > > > {
    > > > > super.onComponentTag(tag);
    > > > >
    > > > > if (isLinkEnabled())
    > > > > {
    > > > > if (tag.getName().toLowerCase().equals("a"))
    > > > > {
    > > > > tag.put("href", "#");
    > > > > }
    > > > > }
    > > > > else
    > > > > {
    > > > > disableLink(tag);
    > > > > }
    > > > > }
    > > > >
    > > >
    > > > So it seems this component never gets to have anything else than # in
    > its
    > > > href, so it won't do anything when js is not enabled...
    > > >
    > > > Is this an error in the documentation ?
    > > >
    > > > Thanks,
    > > > Xavier
    > > >
    > >
    >
    >
    >
    > --
    > "Klein bottle for rent--inquire within."
    >
    
    

    Re: AjaxSubmitLink javadocs

    2010-04-16 Thread Xavier López
    Thanks for the answer, Jeremy.
    
    I just created issue https://issues.apache.org/jira/browse/WICKET-2837.
    
    I'm with you on what you state, it was obvious the only possible way to do a
    submit without JS is to have an html submit mechanism, anyway, I was just
    being cautious in case I was missing something.
    I'm just glad to contribute improving this great framework, even though it's
    on a lesser thing like this.
    
    Cheers,
    Xavier
    
    
    2010/4/16 Jeremy Thomerson 
    
    > This appears to be an issue in the documentation of the AjaxSubmitLink.  I
    > just checked and the documentation is still the same in 1.4.  I will try to
    > verify this and fix it tomorrow.  In the meantime, it would be helpful if
    > you opened a JIRA issue to keep track of this (post the link back to this
    > thread).
    >
    > Anyway, the documentation is written as if this were a fallback component
    > (i.e. AjaxFallbackLink).  However, it is not.  Obviously, if you do not
    > have
    > JS enabled, you can not submit a form with a link in the browser.  You
    > could
    > only submit it with a submit button.
    >
    > --
    > Jeremy Thomerson
    > http://www.wickettraining.com
    >
    >
    >
    > On Thu, Apr 15, 2010 at 4:12 AM, Xavier López  wrote:
    >
    > > Hi,
    > >
    > > I'm a liitle confused about AjaxSubmitLink's JavaDoc, and the code inside
    > > it... I'm using Wicket 1.3.6:
    > >
    > > If/when javascript is turned off in the browser, or it doesn't support
    > > > javascript, then the
    > > > browser will not respond to the onclick event, using the href directly.
    > > > Wicket will then use a
    > > > normal request target, and call the serverside onClick with a null
    > {...@link
    > > > AjaxRequestTarget}.
    > > >
    > >
    > > First question is, does it really mean 'serverside onClick' ? Or should
    > it
    > > read 'serverside onSubmit' ?
    > >
    > > And then, in the code, I see :
    > >
    > > protected void onComponentTag(ComponentTag tag)
    > > > {
    > > > super.onComponentTag(tag);
    > > >
    > > > if (isLinkEnabled())
    > > > {
    > > > if (tag.getName().toLowerCase().equals("a"))
    > > > {
    > > > tag.put("href", "#");
    > > > }
    > > > }
    > > > else
    > > > {
    > > > disableLink(tag);
    > > > }
    > > > }
    > > >
    > >
    > > So it seems this component never gets to have anything else than # in its
    > > href, so it won't do anything when js is not enabled...
    > >
    > > Is this an error in the documentation ?
    > >
    > > Thanks,
    > > Xavier
    > >
    >
    
    
    
    -- 
    "Klein bottle for rent--inquire within."
    
    

    Re: AjaxSubmitLink javadocs

    2010-04-15 Thread Jeremy Thomerson
    This appears to be an issue in the documentation of the AjaxSubmitLink.  I
    just checked and the documentation is still the same in 1.4.  I will try to
    verify this and fix it tomorrow.  In the meantime, it would be helpful if
    you opened a JIRA issue to keep track of this (post the link back to this
    thread).
    
    Anyway, the documentation is written as if this were a fallback component
    (i.e. AjaxFallbackLink).  However, it is not.  Obviously, if you do not have
    JS enabled, you can not submit a form with a link in the browser.  You could
    only submit it with a submit button.
    
    --
    Jeremy Thomerson
    http://www.wickettraining.com
    
    
    
    On Thu, Apr 15, 2010 at 4:12 AM, Xavier López  wrote:
    
    > Hi,
    >
    > I'm a liitle confused about AjaxSubmitLink's JavaDoc, and the code inside
    > it... I'm using Wicket 1.3.6:
    >
    > If/when javascript is turned off in the browser, or it doesn't support
    > > javascript, then the
    > > browser will not respond to the onclick event, using the href directly.
    > > Wicket will then use a
    > > normal request target, and call the serverside onClick with a null {...@link
    > > AjaxRequestTarget}.
    > >
    >
    > First question is, does it really mean 'serverside onClick' ? Or should it
    > read 'serverside onSubmit' ?
    >
    > And then, in the code, I see :
    >
    > protected void onComponentTag(ComponentTag tag)
    > > {
    > > super.onComponentTag(tag);
    > >
    > > if (isLinkEnabled())
    > > {
    > > if (tag.getName().toLowerCase().equals("a"))
    > > {
    > > tag.put("href", "#");
    > > }
    > > }
    > > else
    > > {
    > > disableLink(tag);
    > > }
    > > }
    > >
    >
    > So it seems this component never gets to have anything else than # in its
    > href, so it won't do anything when js is not enabled...
    >
    > Is this an error in the documentation ?
    >
    > Thanks,
    > Xavier
    >
    
    

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-03-27 Thread Anantha Kumaran
    https://issues.apache.org/jira/browse/WICKET-2807
    
    On Sat, Mar 27, 2010 at 11:50 AM, Igor Vaynberg wrote:
    
    > open an rfe
    >
    > -igor
    >
    > On Fri, Mar 26, 2010 at 11:12 PM, Richard Nichols 
    > wrote:
    > > Yeah, maybe one of the wicket devs could comment on whether this is
    > > expected behaviour?
    > >
    > > In any case, I have built a workaround as part of my open source
    > > http://code.google.com/p/visural-wicket/ project.
    > >
    > > See -
    > http://code.google.com/p/visural-wicket/source/browse/trunk/visural-wicket/src/com/visural/wicket/util/InvokeClientSideFormSubmitHandlerDecorator.java
    > >
    > > This AjaxCallDecorator will invoke the form's onsubmit handler prior
    > > to invoking the ajax call.
    > >
    > > So you can:
    > >
    > > add(new AjaxSubmitLink("blah") {
    > >@Override
    > >protected IAjaxCallDecorator getAjaxCallDecorator() {
    > >return new
    > InvokeClientSideFormSubmitHandlerDecorator(MyForm.this);
    > >}
    > > });
    > >
    > > And have any ajax submission work the same as SubmitLink / SubmitButton.
    > >
    > > On 26 March 2010 19:51, Anantha Kumaran 
    > wrote:
    > >> Did you get a resolution to this issue? I have the same problem.
    > >>
    > >>
    > >>currently i am using this techniques to do the my stuff.But it
    > >> breaks when the user press return key.
    > >>
    > >>  // save this so we can call it later
    > >> var wicketOnClick = ajaxSubmitLink.onclick;
    > >> ajaxSubmitLink.onclick = function() {
    > >> // do your stuff
    > >>  return wicketOnClick();
    > >> };
    > >>
    > >> Is this expected behavior I wonder, or a bug?
    > >>
    > >>>
    > >>> SubmitLink will call the 's onsubmit='???' handler,
    > >>> AjaxSubmitLink does not.
    > >>>
    > >>>
    > >> AFAIK AjaxSubmitLink doesn't fire the submit event. Is serializes the
    > form
    > >> data and then makes a post call. I guess this
    > >>  can't be fixed easily because wicket is using *inline event
    > registration
    > >> model*.
    > >>
    > >>
    > >>
    > >>
    > >>> On 4 January 2010 23:05, Anantha Kumaran 
    > wrote:
    > >>> > hi pieter
    > >>> >
    > >>> > my problem is that the AjaxSubmitLink is not behaving like the
    > SubmitLink
    > >>> > which calls the onsubmit before submitting
    > >>> > the form.currently i am using the mousedown(can't use onclick) of the
    > >>> > AjaxSubmitLink to do the validation stuffs but it breaks when the
    > user
    > >>> > submit the form by pressing the return.
    > >>> >
    > >>> >
    > >>> >
    > >>> >
    > >>> > On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe <
    > >>> > pieter.degrae...@systemworks.be> wrote:
    > >>> >
    > >>> >> If you want to do some additional stuff, you can do it in the form a
    > a
    > >>> >> Behaviour.. I did use such behaviour to ask a javascript confirm. If
    > >>> user
    > >>> >> does not confirm, the form is not submitted.
    > >>> >>
    > >>> >> new AttributeModifier("onclick", true, new Model("if
    > >>> (!confirm('" +
    > >>> >> msg + "')) { /* do some additional stuff if not confirmed*/return;}
    > else
    > >>> {
    > >>> >> /*do some stuff beform submitting the form*/}")) {
    > >>> >>@Override
    > >>> >>protected String newValue(String currentValue, String
    > >>> >> replacementValue) {
    > >>> >>return replacementValue + currentValue;
    > >>> >>}
    > >>> >>};
    > >>> >>
    > >>> >> On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran <
    > >>> ananthakuma...@gmail.com
    > >>> >> >wrote:
    > >>> >>
    > >>> >> > is there any way to do this on the client side.I want to do some
    > >>> client
    > >>> >> > side
    > >>> >> > stuff before submitting the form.
    > >>> >> >
    > >>> >> > On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson <
    > >>> >> > wicket.program...@gmail.com
    > >>> >> > > wrote:
    > >>> >> >
    > >>> >> > >
    > >>> >> > > form.add ( new AjaxSubmitLink(){
    > >>> >> > >
    > >>> >> > > protected void onSubmit(AjaxRequestTarget target, Form form){
    > >>> >> > >   // Add  feedback and do ajax stuff.
    > >>> >> > > }
    > >>> >> > >
    > >>> >> > > protected void onError(AjaxRequestTarget target, Form form){
    > >>> >> > >   // Add FeedbackPanel here
    > >>> >> > >   target.add( feedback );
    > >>> >> > > }});
    > >>> >> > > --
    > >>> >> > > View this message in context:
    > >>> >> > >
    > >>> >> >
    > >>> >>
    > >>>
    > http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    > >>> >> > > Sent from the Wicket - User mailing list archive at Nabble.com.
    > >>> >> > >
    > >>> >> > >
    > >>> >> > >
    > >>> -
    > >>> >> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > >>> >> > > For additional commands, e-mail: users-h...@wicket.apache.org
    > >>> >> > >
    > >>> >> > >
    > >>> >> >
    > >>> >>
    > >>> >>
    > >>> >>
    > >>> >> --
    > >>> >> Pieter Degraeuwe
    > >>> >> Systemworks bvba
    > >>> >> Belgiëlaan 61
    > >>> >> 9070 Destelbergen
    > >>> >> GSM: +32 (0)485/68.60.85
    > >>> >> Email: pieter.degrae...@systemworks.be
    > >>> >> visit us at http://www.systemworks.be
    > >>> >>
    > >>> >
    > >>>
    > >>>
    > >>>
    > >>> --
    > >>> Richard Nichols :: http://www.visural.com/ ::
    > >>> http://www.richardn

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-03-26 Thread Igor Vaynberg
    open an rfe
    
    -igor
    
    On Fri, Mar 26, 2010 at 11:12 PM, Richard Nichols  
    wrote:
    > Yeah, maybe one of the wicket devs could comment on whether this is
    > expected behaviour?
    >
    > In any case, I have built a workaround as part of my open source
    > http://code.google.com/p/visural-wicket/ project.
    >
    > See - 
    > http://code.google.com/p/visural-wicket/source/browse/trunk/visural-wicket/src/com/visural/wicket/util/InvokeClientSideFormSubmitHandlerDecorator.java
    >
    > This AjaxCallDecorator will invoke the form's onsubmit handler prior
    > to invoking the ajax call.
    >
    > So you can:
    >
    > add(new AjaxSubmitLink("blah") {
    >       �...@override
    >        protected IAjaxCallDecorator getAjaxCallDecorator() {
    >            return new InvokeClientSideFormSubmitHandlerDecorator(MyForm.this);
    >        }
    > });
    >
    > And have any ajax submission work the same as SubmitLink / SubmitButton.
    >
    > On 26 March 2010 19:51, Anantha Kumaran  wrote:
    >> Did you get a resolution to this issue? I have the same problem.
    >>
    >>
    >>        currently i am using this techniques to do the my stuff.But it
    >> breaks when the user press return key.
    >>
    >>              // save this so we can call it later
    >> var wicketOnClick = ajaxSubmitLink.onclick;
    >> ajaxSubmitLink.onclick = function() {
    >>                         // do your stuff
    >>  return wicketOnClick();
    >> };
    >>
    >> Is this expected behavior I wonder, or a bug?
    >>
    >>>
    >>> SubmitLink will call the 's onsubmit='???' handler,
    >>> AjaxSubmitLink does not.
    >>>
    >>>
    >> AFAIK AjaxSubmitLink doesn't fire the submit event. Is serializes the form
    >> data and then makes a post call. I guess this
    >>  can't be fixed easily because wicket is using *inline event registration
    >> model*.
    >>
    >>
    >>
    >>
    >>> On 4 January 2010 23:05, Anantha Kumaran  wrote:
    >>> > hi pieter
    >>> >
    >>> > my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
    >>> > which calls the onsubmit before submitting
    >>> > the form.currently i am using the mousedown(can't use onclick) of the
    >>> > AjaxSubmitLink to do the validation stuffs but it breaks when the user
    >>> > submit the form by pressing the return.
    >>> >
    >>> >
    >>> >
    >>> >
    >>> > On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe <
    >>> > pieter.degrae...@systemworks.be> wrote:
    >>> >
    >>> >> If you want to do some additional stuff, you can do it in the form a a
    >>> >> Behaviour.. I did use such behaviour to ask a javascript confirm. If
    >>> user
    >>> >> does not confirm, the form is not submitted.
    >>> >>
    >>> >> new AttributeModifier("onclick", true, new Model("if
    >>> (!confirm('" +
    >>> >> msg + "')) { /* do some additional stuff if not confirmed*/return;} else
    >>> {
    >>> >> /*do some stuff beform submitting the form*/}")) {
    >>> >>           �...@override
    >>> >>            protected String newValue(String currentValue, String
    >>> >> replacementValue) {
    >>> >>                return replacementValue + currentValue;
    >>> >>            }
    >>> >>        };
    >>> >>
    >>> >> On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran <
    >>> ananthakuma...@gmail.com
    >>> >> >wrote:
    >>> >>
    >>> >> > is there any way to do this on the client side.I want to do some
    >>> client
    >>> >> > side
    >>> >> > stuff before submitting the form.
    >>> >> >
    >>> >> > On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson <
    >>> >> > wicket.program...@gmail.com
    >>> >> > > wrote:
    >>> >> >
    >>> >> > >
    >>> >> > > form.add ( new AjaxSubmitLink(){
    >>> >> > >
    >>> >> > > protected void onSubmit(AjaxRequestTarget target, Form form){
    >>> >> > >   // Add  feedback and do ajax stuff.
    >>> >> > > }
    >>> >> > >
    >>> >> > > protected void onError(AjaxRequestTarget target, Form form){
    >>> >> > >   // Add FeedbackPanel here
    >>> >> > >   target.add( feedback );
    >>> >> > > }});
    >>> >> > > --
    >>> >> > > View this message in context:
    >>> >> > >
    >>> >> >
    >>> >>
    >>> http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    >>> >> > > Sent from the Wicket - User mailing list archive at Nabble.com.
    >>> >> > >
    >>> >> > >
    >>> >> > >
    >>> -
    >>> >> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >>> >> > > For additional commands, e-mail: users-h...@wicket.apache.org
    >>> >> > >
    >>> >> > >
    >>> >> >
    >>> >>
    >>> >>
    >>> >>
    >>> >> --
    >>> >> Pieter Degraeuwe
    >>> >> Systemworks bvba
    >>> >> Belgiëlaan 61
    >>> >> 9070 Destelbergen
    >>> >> GSM: +32 (0)485/68.60.85
    >>> >> Email: pieter.degrae...@systemworks.be
    >>> >> visit us at http://www.systemworks.be
    >>> >>
    >>> >
    >>>
    >>>
    >>>
    >>> --
    >>> Richard Nichols :: http://www.visural.com/ ::
    >>> http://www.richardnichols.net/
    >>>
    >>> -
    >>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >>> For additional commands, e-mail: users-h...@wicket.apache.org
    >>>
    >>>
    >>
    >>
    >> --
    >> 
    >> Anantha Kumaran(http://ananthakumaran.github.com)
    >>
    >
    >
    >
    > --
    > Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/
    >
    > ---

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-03-26 Thread Richard Nichols
    Yeah, maybe one of the wicket devs could comment on whether this is
    expected behaviour?
    
    In any case, I have built a workaround as part of my open source
    http://code.google.com/p/visural-wicket/ project.
    
    See - 
    http://code.google.com/p/visural-wicket/source/browse/trunk/visural-wicket/src/com/visural/wicket/util/InvokeClientSideFormSubmitHandlerDecorator.java
    
    This AjaxCallDecorator will invoke the form's onsubmit handler prior
    to invoking the ajax call.
    
    So you can:
    
    add(new AjaxSubmitLink("blah") {
    @Override
    protected IAjaxCallDecorator getAjaxCallDecorator() {
    return new InvokeClientSideFormSubmitHandlerDecorator(MyForm.this);
    }
    });
    
    And have any ajax submission work the same as SubmitLink / SubmitButton.
    
    On 26 March 2010 19:51, Anantha Kumaran  wrote:
    > Did you get a resolution to this issue? I have the same problem.
    >
    >
    >        currently i am using this techniques to do the my stuff.But it
    > breaks when the user press return key.
    >
    >              // save this so we can call it later
    > var wicketOnClick = ajaxSubmitLink.onclick;
    > ajaxSubmitLink.onclick = function() {
    >                         // do your stuff
    >  return wicketOnClick();
    > };
    >
    > Is this expected behavior I wonder, or a bug?
    >
    >>
    >> SubmitLink will call the 's onsubmit='???' handler,
    >> AjaxSubmitLink does not.
    >>
    >>
    > AFAIK AjaxSubmitLink doesn't fire the submit event. Is serializes the form
    > data and then makes a post call. I guess this
    >  can't be fixed easily because wicket is using *inline event registration
    > model*.
    >
    >
    >
    >
    >> On 4 January 2010 23:05, Anantha Kumaran  wrote:
    >> > hi pieter
    >> >
    >> > my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
    >> > which calls the onsubmit before submitting
    >> > the form.currently i am using the mousedown(can't use onclick) of the
    >> > AjaxSubmitLink to do the validation stuffs but it breaks when the user
    >> > submit the form by pressing the return.
    >> >
    >> >
    >> >
    >> >
    >> > On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe <
    >> > pieter.degrae...@systemworks.be> wrote:
    >> >
    >> >> If you want to do some additional stuff, you can do it in the form a a
    >> >> Behaviour.. I did use such behaviour to ask a javascript confirm. If
    >> user
    >> >> does not confirm, the form is not submitted.
    >> >>
    >> >> new AttributeModifier("onclick", true, new Model("if
    >> (!confirm('" +
    >> >> msg + "')) { /* do some additional stuff if not confirmed*/return;} else
    >> {
    >> >> /*do some stuff beform submitting the form*/}")) {
    >> >>           �...@override
    >> >>            protected String newValue(String currentValue, String
    >> >> replacementValue) {
    >> >>                return replacementValue + currentValue;
    >> >>            }
    >> >>        };
    >> >>
    >> >> On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran <
    >> ananthakuma...@gmail.com
    >> >> >wrote:
    >> >>
    >> >> > is there any way to do this on the client side.I want to do some
    >> client
    >> >> > side
    >> >> > stuff before submitting the form.
    >> >> >
    >> >> > On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson <
    >> >> > wicket.program...@gmail.com
    >> >> > > wrote:
    >> >> >
    >> >> > >
    >> >> > > form.add ( new AjaxSubmitLink(){
    >> >> > >
    >> >> > > protected void onSubmit(AjaxRequestTarget target, Form form){
    >> >> > >   // Add  feedback and do ajax stuff.
    >> >> > > }
    >> >> > >
    >> >> > > protected void onError(AjaxRequestTarget target, Form form){
    >> >> > >   // Add FeedbackPanel here
    >> >> > >   target.add( feedback );
    >> >> > > }});
    >> >> > > --
    >> >> > > View this message in context:
    >> >> > >
    >> >> >
    >> >>
    >> http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    >> >> > > Sent from the Wicket - User mailing list archive at Nabble.com.
    >> >> > >
    >> >> > >
    >> >> > >
    >> -
    >> >> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >> >> > > For additional commands, e-mail: users-h...@wicket.apache.org
    >> >> > >
    >> >> > >
    >> >> >
    >> >>
    >> >>
    >> >>
    >> >> --
    >> >> Pieter Degraeuwe
    >> >> Systemworks bvba
    >> >> Belgiëlaan 61
    >> >> 9070 Destelbergen
    >> >> GSM: +32 (0)485/68.60.85
    >> >> Email: pieter.degrae...@systemworks.be
    >> >> visit us at http://www.systemworks.be
    >> >>
    >> >
    >>
    >>
    >>
    >> --
    >> Richard Nichols :: http://www.visural.com/ ::
    >> http://www.richardnichols.net/
    >>
    >> -
    >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >> For additional commands, e-mail: users-h...@wicket.apache.org
    >>
    >>
    >
    >
    > --
    > 
    > Anantha Kumaran(http://ananthakumaran.github.com)
    >
    
    
    
    -- 
    Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-03-26 Thread Anantha Kumaran
    Did you get a resolution to this issue? I have the same problem.
    
    
    currently i am using this techniques to do the my stuff.But it
    breaks when the user press return key.
    
      // save this so we can call it later
    var wicketOnClick = ajaxSubmitLink.onclick;
    ajaxSubmitLink.onclick = function() {
     // do your stuff
     return wicketOnClick();
    };
    
    Is this expected behavior I wonder, or a bug?
    
    >
    > SubmitLink will call the 's onsubmit='???' handler,
    > AjaxSubmitLink does not.
    >
    >
    AFAIK AjaxSubmitLink doesn't fire the submit event. Is serializes the form
    data and then makes a post call. I guess this
     can't be fixed easily because wicket is using *inline event registration
    model*.
    
    
    
    
    > On 4 January 2010 23:05, Anantha Kumaran  wrote:
    > > hi pieter
    > >
    > > my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
    > > which calls the onsubmit before submitting
    > > the form.currently i am using the mousedown(can't use onclick) of the
    > > AjaxSubmitLink to do the validation stuffs but it breaks when the user
    > > submit the form by pressing the return.
    > >
    > >
    > >
    > >
    > > On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe <
    > > pieter.degrae...@systemworks.be> wrote:
    > >
    > >> If you want to do some additional stuff, you can do it in the form a a
    > >> Behaviour.. I did use such behaviour to ask a javascript confirm. If
    > user
    > >> does not confirm, the form is not submitted.
    > >>
    > >> new AttributeModifier("onclick", true, new Model("if
    > (!confirm('" +
    > >> msg + "')) { /* do some additional stuff if not confirmed*/return;} else
    > {
    > >> /*do some stuff beform submitting the form*/}")) {
    > >>@Override
    > >>protected String newValue(String currentValue, String
    > >> replacementValue) {
    > >>return replacementValue + currentValue;
    > >>}
    > >>};
    > >>
    > >> On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran <
    > ananthakuma...@gmail.com
    > >> >wrote:
    > >>
    > >> > is there any way to do this on the client side.I want to do some
    > client
    > >> > side
    > >> > stuff before submitting the form.
    > >> >
    > >> > On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson <
    > >> > wicket.program...@gmail.com
    > >> > > wrote:
    > >> >
    > >> > >
    > >> > > form.add ( new AjaxSubmitLink(){
    > >> > >
    > >> > > protected void onSubmit(AjaxRequestTarget target, Form form){
    > >> > >   // Add  feedback and do ajax stuff.
    > >> > > }
    > >> > >
    > >> > > protected void onError(AjaxRequestTarget target, Form form){
    > >> > >   // Add FeedbackPanel here
    > >> > >   target.add( feedback );
    > >> > > }});
    > >> > > --
    > >> > > View this message in context:
    > >> > >
    > >> >
    > >>
    > http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    > >> > > Sent from the Wicket - User mailing list archive at Nabble.com.
    > >> > >
    > >> > >
    > >> > >
    > -
    > >> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > >> > > For additional commands, e-mail: users-h...@wicket.apache.org
    > >> > >
    > >> > >
    > >> >
    > >>
    > >>
    > >>
    > >> --
    > >> Pieter Degraeuwe
    > >> Systemworks bvba
    > >> Belgiëlaan 61
    > >> 9070 Destelbergen
    > >> GSM: +32 (0)485/68.60.85
    > >> Email: pieter.degrae...@systemworks.be
    > >> visit us at http://www.systemworks.be
    > >>
    > >
    >
    >
    >
    > --
    > Richard Nichols :: http://www.visural.com/ ::
    > http://www.richardnichols.net/
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    
    -- 
    
    Anantha Kumaran(http://ananthakumaran.github.com)
    
    

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-03-24 Thread Richard Nichols
    Hi Anantha,
    
    Did you get a resolution to this issue? I have the same problem.
    
    Is this expected behavior I wonder, or a bug?
    
    SubmitLink will call the 's onsubmit='???' handler,
    AjaxSubmitLink does not.
    
    
    On 4 January 2010 23:05, Anantha Kumaran  wrote:
    > hi pieter
    >
    > my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
    > which calls the onsubmit before submitting
    > the form.currently i am using the mousedown(can't use onclick) of the
    > AjaxSubmitLink to do the validation stuffs but it breaks when the user
    > submit the form by pressing the return.
    >
    >
    >
    >
    > On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe <
    > pieter.degrae...@systemworks.be> wrote:
    >
    >> If you want to do some additional stuff, you can do it in the form a a
    >> Behaviour.. I did use such behaviour to ask a javascript confirm. If user
    >> does not confirm, the form is not submitted.
    >>
    >> new AttributeModifier("onclick", true, new Model("if (!confirm('" +
    >> msg + "')) { /* do some additional stuff if not confirmed*/return;} else {
    >> /*do some stuff beform submitting the form*/}")) {
    >>           �...@override
    >>            protected String newValue(String currentValue, String
    >> replacementValue) {
    >>                return replacementValue + currentValue;
    >>            }
    >>        };
    >>
    >> On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran > >wrote:
    >>
    >> > is there any way to do this on the client side.I want to do some client
    >> > side
    >> > stuff before submitting the form.
    >> >
    >> > On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson <
    >> > wicket.program...@gmail.com
    >> > > wrote:
    >> >
    >> > >
    >> > > form.add ( new AjaxSubmitLink(){
    >> > >
    >> > > protected void onSubmit(AjaxRequestTarget target, Form form){
    >> > >   // Add  feedback and do ajax stuff.
    >> > > }
    >> > >
    >> > > protected void onError(AjaxRequestTarget target, Form form){
    >> > >   // Add FeedbackPanel here
    >> > >   target.add( feedback );
    >> > > }});
    >> > > --
    >> > > View this message in context:
    >> > >
    >> >
    >> http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    >> > > Sent from the Wicket - User mailing list archive at Nabble.com.
    >> > >
    >> > >
    >> > > -
    >> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    >> > > For additional commands, e-mail: users-h...@wicket.apache.org
    >> > >
    >> > >
    >> >
    >>
    >>
    >>
    >> --
    >> Pieter Degraeuwe
    >> Systemworks bvba
    >> Belgiëlaan 61
    >> 9070 Destelbergen
    >> GSM: +32 (0)485/68.60.85
    >> Email: pieter.degrae...@systemworks.be
    >> visit us at http://www.systemworks.be
    >>
    >
    
    
    
    -- 
    Richard Nichols :: http://www.visural.com/ :: http://www.richardnichols.net/
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2010-01-27 Thread Wayne Pope
    thanks for the explanation. Works perfect now.
    
    much appreciated.
    
    On Wed, Jan 27, 2010 at 8:23 PM, Igor Vaynberg  wrote:
    > the former
    >
    > -igor
    >
    > On Wed, Jan 27, 2010 at 10:45 AM, Riyad Kalla  wrote:
    >> Igor, will FeedbackPanel correctly consume the messages from the session
    >> scope and remove them -- or do you have to manually remove them once they've
    >> been rendered?
    >>
    >> On Wed, Jan 27, 2010 at 11:42 AM, Igor Vaynberg 
    >> wrote:
    >>
    >>> the problem is that there is a redirect between your calling info()
    >>> and the feedback panel rendering. this is because thats the only way
    >>> to do it in ajax  - issue a window.location=...
    >>>
    >>> if you are doing feedback messages across requests then use
    >>> getsession().info(...)
    >>>
    >>> -igor
    >>>
    >>> On Wed, Jan 27, 2010 at 10:15 AM, Wayne Pope
    >>>  wrote:
    >>> > Hello all,
    >>> >
    >>> > Ok I cannot figure this one out.
    >>> > I have a  Page that contains a Form with a AjaxSubmitLink:
    >>> >
    >>> > AjaxSubmitLink submitLink= new AjaxSubmitLink("submitLink") {
    >>> >                       �...@override
    >>> >                        protected void onSubmit(AjaxRequestTarget target,
    >>> Form form) {
    >>> >
    >>> >
    >>>  info(getString("admin.paymentSuccesfull"));
    >>> >
    >>>  setResponsePage(Application.get().getHomePage());
    >>> >                        }
    >>> >
    >>> >                       �...@override
    >>> >                        protected void onError(AjaxRequestTarget target,
    >>> Form form) {
    >>> >                                target.addComponent(feedback);
    >>> >                        }
    >>> >                };
    >>> >
    >>> >
    >>> > On the home page I have a Panel that contains a FeedbackPanel - this
    >>> > feedback panel works fine when using elements on that page.
    >>> >
    >>> > However when submitting the form and displaying the home page I get
    >>> > the message in the logs:
    >>> >
    >>> > Component-targetted feedback message was left unrendered. This could
    >>> > be because you are missing a FeedbackPanel on the page.  Message:
    >>> > [FeedbackMessage message = " ...
    >>> >
    >>> > And the message is not displayed.
    >>> >
    >>> > Any ideas why wicket cannot find the feedback panel in the page? (its
    >>> > definitely there in a Panel)
    >>> >
    >>> > feedback panel is added as such:
    >>> > FeedbackPanel feedback = new FeedbackPanel("feedbackPanel");
    >>> > add(feedback);
    >>> >
    >>> >
    >>> > many thanks
    >>> > Wayne
    >>> >
    >>> > -
    >>> > 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
    >>>
    >>>
    >>
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2010-01-27 Thread Igor Vaynberg
    the former
    
    -igor
    
    On Wed, Jan 27, 2010 at 10:45 AM, Riyad Kalla  wrote:
    > Igor, will FeedbackPanel correctly consume the messages from the session
    > scope and remove them -- or do you have to manually remove them once they've
    > been rendered?
    >
    > On Wed, Jan 27, 2010 at 11:42 AM, Igor Vaynberg 
    > wrote:
    >
    >> the problem is that there is a redirect between your calling info()
    >> and the feedback panel rendering. this is because thats the only way
    >> to do it in ajax  - issue a window.location=...
    >>
    >> if you are doing feedback messages across requests then use
    >> getsession().info(...)
    >>
    >> -igor
    >>
    >> On Wed, Jan 27, 2010 at 10:15 AM, Wayne Pope
    >>  wrote:
    >> > Hello all,
    >> >
    >> > Ok I cannot figure this one out.
    >> > I have a  Page that contains a Form with a AjaxSubmitLink:
    >> >
    >> > AjaxSubmitLink submitLink= new AjaxSubmitLink("submitLink") {
    >> >                       �...@override
    >> >                        protected void onSubmit(AjaxRequestTarget target,
    >> Form form) {
    >> >
    >> >
    >>  info(getString("admin.paymentSuccesfull"));
    >> >
    >>  setResponsePage(Application.get().getHomePage());
    >> >                        }
    >> >
    >> >                       �...@override
    >> >                        protected void onError(AjaxRequestTarget target,
    >> Form form) {
    >> >                                target.addComponent(feedback);
    >> >                        }
    >> >                };
    >> >
    >> >
    >> > On the home page I have a Panel that contains a FeedbackPanel - this
    >> > feedback panel works fine when using elements on that page.
    >> >
    >> > However when submitting the form and displaying the home page I get
    >> > the message in the logs:
    >> >
    >> > Component-targetted feedback message was left unrendered. This could
    >> > be because you are missing a FeedbackPanel on the page.  Message:
    >> > [FeedbackMessage message = " ...
    >> >
    >> > And the message is not displayed.
    >> >
    >> > Any ideas why wicket cannot find the feedback panel in the page? (its
    >> > definitely there in a Panel)
    >> >
    >> > feedback panel is added as such:
    >> > FeedbackPanel feedback = new FeedbackPanel("feedbackPanel");
    >> > add(feedback);
    >> >
    >> >
    >> > many thanks
    >> > Wayne
    >> >
    >> > -
    >> > 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
    >>
    >>
    >
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2010-01-27 Thread Riyad Kalla
    Igor, will FeedbackPanel correctly consume the messages from the session
    scope and remove them -- or do you have to manually remove them once they've
    been rendered?
    
    On Wed, Jan 27, 2010 at 11:42 AM, Igor Vaynberg wrote:
    
    > the problem is that there is a redirect between your calling info()
    > and the feedback panel rendering. this is because thats the only way
    > to do it in ajax  - issue a window.location=...
    >
    > if you are doing feedback messages across requests then use
    > getsession().info(...)
    >
    > -igor
    >
    > On Wed, Jan 27, 2010 at 10:15 AM, Wayne Pope
    >  wrote:
    > > Hello all,
    > >
    > > Ok I cannot figure this one out.
    > > I have a  Page that contains a Form with a AjaxSubmitLink:
    > >
    > > AjaxSubmitLink submitLink= new AjaxSubmitLink("submitLink") {
    > >@Override
    > >protected void onSubmit(AjaxRequestTarget target,
    > Form form) {
    > >
    > >
    >  info(getString("admin.paymentSuccesfull"));
    > >
    >  setResponsePage(Application.get().getHomePage());
    > >}
    > >
    > >@Override
    > >protected void onError(AjaxRequestTarget target,
    > Form form) {
    > >target.addComponent(feedback);
    > >}
    > >};
    > >
    > >
    > > On the home page I have a Panel that contains a FeedbackPanel - this
    > > feedback panel works fine when using elements on that page.
    > >
    > > However when submitting the form and displaying the home page I get
    > > the message in the logs:
    > >
    > > Component-targetted feedback message was left unrendered. This could
    > > be because you are missing a FeedbackPanel on the page.  Message:
    > > [FeedbackMessage message = " ...
    > >
    > > And the message is not displayed.
    > >
    > > Any ideas why wicket cannot find the feedback panel in the page? (its
    > > definitely there in a Panel)
    > >
    > > feedback panel is added as such:
    > > FeedbackPanel feedback = new FeedbackPanel("feedbackPanel");
    > > add(feedback);
    > >
    > >
    > > many thanks
    > > Wayne
    > >
    > > -
    > > 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
    >
    >
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2010-01-27 Thread Igor Vaynberg
    the problem is that there is a redirect between your calling info()
    and the feedback panel rendering. this is because thats the only way
    to do it in ajax  - issue a window.location=...
    
    if you are doing feedback messages across requests then use
    getsession().info(...)
    
    -igor
    
    On Wed, Jan 27, 2010 at 10:15 AM, Wayne Pope
     wrote:
    > Hello all,
    >
    > Ok I cannot figure this one out.
    > I have a  Page that contains a Form with a AjaxSubmitLink:
    >
    > AjaxSubmitLink submitLink= new AjaxSubmitLink("submitLink") {
    >                       �...@override
    >                        protected void onSubmit(AjaxRequestTarget target, 
    > Form form) {
    >
    >                                info(getString("admin.paymentSuccesfull"));
    >                                
    > setResponsePage(Application.get().getHomePage());
    >                        }
    >
    >                       �...@override
    >                        protected void onError(AjaxRequestTarget target, 
    > Form form) {
    >                                target.addComponent(feedback);
    >                        }
    >                };
    >
    >
    > On the home page I have a Panel that contains a FeedbackPanel - this
    > feedback panel works fine when using elements on that page.
    >
    > However when submitting the form and displaying the home page I get
    > the message in the logs:
    >
    > Component-targetted feedback message was left unrendered. This could
    > be because you are missing a FeedbackPanel on the page.  Message:
    > [FeedbackMessage message = " ...
    >
    > And the message is not displayed.
    >
    > Any ideas why wicket cannot find the feedback panel in the page? (its
    > definitely there in a Panel)
    >
    > feedback panel is added as such:
    > FeedbackPanel feedback = new FeedbackPanel("feedbackPanel");
    > add(feedback);
    >
    >
    > many thanks
    > Wayne
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink + setResponsePage = feedback message problem on new page

    2010-01-27 Thread Josh Kamau
    Just wondering;
    
    Isnt ajax supposed to update components on the same page? If you want to
    redirect to another page then you dont need an ajax link.  Try with a normal
    link. Then try without setting response page but add the feedback panel on
    the same page.
    
    
    
    On Wed, Jan 27, 2010 at 9:15 PM, Wayne Pope <
    waynemailingli...@googlemail.com> wrote:
    
    > Hello all,
    >
    > Ok I cannot figure this one out.
    > I have a  Page that contains a Form with a AjaxSubmitLink:
    >
    > AjaxSubmitLink submitLink= new AjaxSubmitLink("submitLink") {
    >@Override
    >protected void onSubmit(AjaxRequestTarget target,
    > Form form) {
    >
    >info(getString("admin.paymentSuccesfull"));
    >
    >  setResponsePage(Application.get().getHomePage());
    >}
    >
    >@Override
    >protected void onError(AjaxRequestTarget target,
    > Form form) {
    >target.addComponent(feedback);
    >}
    >};
    >
    >
    > On the home page I have a Panel that contains a FeedbackPanel - this
    > feedback panel works fine when using elements on that page.
    >
    > However when submitting the form and displaying the home page I get
    > the message in the logs:
    >
    > Component-targetted feedback message was left unrendered. This could
    > be because you are missing a FeedbackPanel on the page.  Message:
    > [FeedbackMessage message = " ...
    >
    > And the message is not displayed.
    >
    > Any ideas why wicket cannot find the feedback panel in the page? (its
    > definitely there in a Panel)
    >
    > feedback panel is added as such:
    > FeedbackPanel feedback = new FeedbackPanel("feedbackPanel");
    > add(feedback);
    >
    >
    > many thanks
    > Wayne
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-01-04 Thread Anantha Kumaran
    hi pieter
    
    my problem is that the AjaxSubmitLink is not behaving like the SubmitLink
    which calls the onsubmit before submitting
    the form.currently i am using the mousedown(can't use onclick) of the
    AjaxSubmitLink to do the validation stuffs but it breaks when the user
    submit the form by pressing the return.
    
    
    
    
    On Mon, Jan 4, 2010 at 12:03 AM, Pieter Degraeuwe <
    pieter.degrae...@systemworks.be> wrote:
    
    > If you want to do some additional stuff, you can do it in the form a a
    > Behaviour.. I did use such behaviour to ask a javascript confirm. If user
    > does not confirm, the form is not submitted.
    >
    > new AttributeModifier("onclick", true, new Model("if (!confirm('" +
    > msg + "')) { /* do some additional stuff if not confirmed*/return;} else {
    > /*do some stuff beform submitting the form*/}")) {
    >@Override
    >protected String newValue(String currentValue, String
    > replacementValue) {
    >return replacementValue + currentValue;
    >}
    >};
    >
    > On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran  >wrote:
    >
    > > is there any way to do this on the client side.I want to do some client
    > > side
    > > stuff before submitting the form.
    > >
    > > On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson <
    > > wicket.program...@gmail.com
    > > > wrote:
    > >
    > > >
    > > > form.add ( new AjaxSubmitLink(){
    > > >
    > > > protected void onSubmit(AjaxRequestTarget target, Form form){
    > > >   // Add  feedback and do ajax stuff.
    > > > }
    > > >
    > > > protected void onError(AjaxRequestTarget target, Form form){
    > > >   // Add FeedbackPanel here
    > > >   target.add( feedback );
    > > > }});
    > > > --
    > > > View this message in context:
    > > >
    > >
    > http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    > > > Sent from the Wicket - User mailing list archive at Nabble.com.
    > > >
    > > >
    > > > -
    > > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > > > For additional commands, e-mail: users-h...@wicket.apache.org
    > > >
    > > >
    > >
    >
    >
    >
    > --
    > Pieter Degraeuwe
    > Systemworks bvba
    > Belgiëlaan 61
    > 9070 Destelbergen
    > GSM: +32 (0)485/68.60.85
    > Email: pieter.degrae...@systemworks.be
    > visit us at http://www.systemworks.be
    >
    
    

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-01-04 Thread Pieter Degraeuwe
    If you want to do some additional stuff, you can do it in the form a a
    Behaviour.. I did use such behaviour to ask a javascript confirm. If user
    does not confirm, the form is not submitted.
    
    new AttributeModifier("onclick", true, new Model("if (!confirm('" +
    msg + "')) { /* do some additional stuff if not confirmed*/return;} else {
    /*do some stuff beform submitting the form*/}")) {
    @Override
    protected String newValue(String currentValue, String
    replacementValue) {
    return replacementValue + currentValue;
    }
    };
    
    On Mon, Jan 4, 2010 at 5:30 AM, Anantha Kumaran wrote:
    
    > is there any way to do this on the client side.I want to do some client
    > side
    > stuff before submitting the form.
    >
    > On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson <
    > wicket.program...@gmail.com
    > > wrote:
    >
    > >
    > > form.add ( new AjaxSubmitLink(){
    > >
    > > protected void onSubmit(AjaxRequestTarget target, Form form){
    > >   // Add  feedback and do ajax stuff.
    > > }
    > >
    > > protected void onError(AjaxRequestTarget target, Form form){
    > >   // Add FeedbackPanel here
    > >   target.add( feedback );
    > > }});
    > > --
    > > View this message in context:
    > >
    > http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    > > Sent from the Wicket - User mailing list archive at Nabble.com.
    > >
    > >
    > > -
    > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > > For additional commands, e-mail: users-h...@wicket.apache.org
    > >
    > >
    >
    
    
    
    -- 
    Pieter Degraeuwe
    Systemworks bvba
    Belgiëlaan 61
    9070 Destelbergen
    GSM: +32 (0)485/68.60.85
    Email: pieter.degrae...@systemworks.be
    visit us at http://www.systemworks.be
    
    

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-01-03 Thread Anantha Kumaran
    is there any way to do this on the client side.I want to do some client side
    stuff before submitting the form.
    
    On Sun, Jan 3, 2010 at 9:36 AM, Mathias Nilsson  wrote:
    
    >
    > form.add ( new AjaxSubmitLink(){
    >
    > protected void onSubmit(AjaxRequestTarget target, Form form){
    >   // Add  feedback and do ajax stuff.
    > }
    >
    > protected void onError(AjaxRequestTarget target, Form form){
    >   // Add FeedbackPanel here
    >   target.add( feedback );
    > }});
    > --
    > View this message in context:
    > http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    > Sent from the Wicket - User mailing list archive at Nabble.com.
    >
    >
    > -
    > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    > For additional commands, e-mail: users-h...@wicket.apache.org
    >
    >
    
    

    Re: AjaxSubmitLink not calling the onsubmit event handler

    2010-01-03 Thread Mathias Nilsson
    
    form.add ( new AjaxSubmitLink(){
    
    protected void onSubmit(AjaxRequestTarget target, Form form){
       // Add  feedback and do ajax stuff.
    }
    
    protected void onError(AjaxRequestTarget target, Form form){
       // Add FeedbackPanel here
       target.add( feedback );
    }});
    -- 
    View this message in context: 
    http://old.nabble.com/AjaxSubmitLink-not-calling-the-onsubmit-event-handler-tp2718p27002962.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink does not work in 1.4-rc7

    2009-07-26 Thread Martin Makundi
    > you can always submit a patch you know.
    
    I haven't a clue how to fix it, unfortunately. This is the part I am
    most unfamiliar with in Wicket. I don't even know how it is supposed
    to work (=on code level).
    
    >
    > -Matej
    >
    > On Sun, Jul 26, 2009 at 8:53 PM, Martin
    > Makundi wrote:
    >>> the link works just fine, wicket tester doesnt work right.
    >>
    >> Sorry for the inconcise title, yes, the link works, the test doesn't.
    >> I am doing test-first approach so I sometimes exaggerate, but yes, the
    >> test does not work.
    >>
    >> **
    >> Martin
    >>
    >>>
    >>> On Sun, Jul 26, 2009 at 9:15 AM, Martin
    >>> Makundi wrote:
     Hi!
    
     AjaxSubmitLink does not work in 1.4-rc7
    
     Anybody know a workaround: 
     https://issues.apache.org/jira/browse/WICKET-2400
    
     ?
    
     **
     Martin
    
     -
     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
    >>>
    >>>
    >>
    >> -
    >> 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
    >
    >
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink does not work in 1.4-rc7

    2009-07-26 Thread Matej Knopp
    you can always submit a patch you know.
    
    -Matej
    
    On Sun, Jul 26, 2009 at 8:53 PM, Martin
    Makundi wrote:
    >> the link works just fine, wicket tester doesnt work right.
    >
    > Sorry for the inconcise title, yes, the link works, the test doesn't.
    > I am doing test-first approach so I sometimes exaggerate, but yes, the
    > test does not work.
    >
    > **
    > Martin
    >
    >>
    >> On Sun, Jul 26, 2009 at 9:15 AM, Martin
    >> Makundi wrote:
    >>> Hi!
    >>>
    >>> AjaxSubmitLink does not work in 1.4-rc7
    >>>
    >>> Anybody know a workaround: https://issues.apache.org/jira/browse/WICKET-2400
    >>>
    >>> ?
    >>>
    >>> **
    >>> Martin
    >>>
    >>> -
    >>> 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
    >>
    >>
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink does not work in 1.4-rc7

    2009-07-26 Thread Martin Makundi
    > the link works just fine, wicket tester doesnt work right.
    
    Sorry for the inconcise title, yes, the link works, the test doesn't.
    I am doing test-first approach so I sometimes exaggerate, but yes, the
    test does not work.
    
    **
    Martin
    
    >
    > On Sun, Jul 26, 2009 at 9:15 AM, Martin
    > Makundi wrote:
    >> Hi!
    >>
    >> AjaxSubmitLink does not work in 1.4-rc7
    >>
    >> Anybody know a workaround: https://issues.apache.org/jira/browse/WICKET-2400
    >>
    >> ?
    >>
    >> **
    >> Martin
    >>
    >> -
    >> 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
    >
    >
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink does not work in 1.4-rc7

    2009-07-26 Thread Igor Vaynberg
    the link works just fine, wicket tester doesnt work right.
    
    -igor
    
    On Sun, Jul 26, 2009 at 9:15 AM, Martin
    Makundi wrote:
    > Hi!
    >
    > AjaxSubmitLink does not work in 1.4-rc7
    >
    > Anybody know a workaround: https://issues.apache.org/jira/browse/WICKET-2400
    >
    > ?
    >
    > **
    > Martin
    >
    > -
    > 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
    
    
    

    RE: AjaxSubmitLink

    2009-06-19 Thread Jeremy Thomerson
    That's not the problem.  The problem is that setVisible(false) was called - so 
    that element isn't present on the rendered page at all.  He needs to call the 
    method that forces a placeholder to be rendered.
    
    
    Jeremy Thomerson
    http://www.wickettraining.com
    -- sent from a wireless device
    
    
    -Original Message-
    From: sander v F 
    Sent: Friday, June 19, 2009 2:06 AM
    To: users@wicket.apache.org
    Subject: Re: AjaxSubmitLink
    
    Like the error says: "Make sure you called component.setOutputMarkupId(true)
    on the component whose markup you are trying to update."
    That would be the component with id: 'verifyPanelWmc'.
    
    Your code:
    final WebMarkupContainer parent = new
    WebMarkupContainer("verifyPanelWmc");
    //parent.setOutputMarkupId(true);
    parent.setVisible(false);
    form.add(parent);
    
    I think you tried that already, but because the component is not visible,
    the component won't be rendered and written to the response. So there
    wouldn't be any component to update with ajax. That's why there's the error
    "Component with id [[verifyPanelWmc9]] a was not found while trying to
    perform markup update"
    
    You should try "setOutputMarkupPlaceholderTag(true)". This will create a
    placeholder so the component can be updated with ajax.
    
    
    
    
    
    2009/6/18 
    
    >  I am trying to use an AjaxSubmitLink to show a panel when a button is
    > clicked. I am receiving the following error when I try to submit the form:
    >
    > Wicket.Ajax.Call.processComponent: Component with id [[verifyPanelWmc9]] a
    > was not found while trying to perform markup update. Make sure you called
    > component.setOutputMarkupId(true) on the component whose markup you are
    > trying to update.
    >
    > My code is as follows:
    >
    > public class InitiateDeclarationPage extends EzdecBaseWebPage {
    > @SpringBean
    > private IDeclarationService declarationService;
    >
    > public InitiateDeclarationPage() {
    > final Declaration declaration = new
    > Declaration(EzdecSession.getCurrentUser().getAccount(),
    > EzdecSession.getCurrentUser(), "", County.COOK,
    > State.ILLINOIS);
    > add(new FeedbackPanel("feedback"));
    >
    > final Form form = new Form("initiateDeclarationForm", new
    > CompoundPropertyModel(declaration));
    >
    > form.add(new Button("submitButton") {
    > @Override
    > public void onSubmit() {
    > Declaration declaration = (Declaration)
    > form.getModelObject();
    > declaration.setStatus(Status.OPEN);
    > ParcelIdentification pin =
    > declarationService.findParcelIdentification(declaration.getPin());
    > if (pin == null) {
    > error("No PIN found for PIN " +
    > getFormattedPIN(declaration.getPin()));
    > } else {
    > if
    > (declarationService.initiateDeclaration(declaration)) {
    > EzdecSession.get().info("Declaration " +
    > declaration.getTxNumber() + " created");
    > setResponsePage(new DeclarationPage(declaration, 0,
    > pin));
    > } else {
    > error("Creating declaration with PIN: " +
    > declaration.getPin());
    > }
    > }
    > }
    > });
    >
    > final EzdecRequiredTextField pinText = new
    > EzdecRequiredTextField("pin");
    > form.add(pinText);
    >
    > form.add(new DropDownChoice("county",
    > Arrays.asList(County.values()))
    >  .setRequired(true)
    >  .setEnabled(false));
    >
    > final WebMarkupContainer parent = new
    > WebMarkupContainer("verifyPanelWmc");
    > //parent.setOutputMarkupId(true);
    > parent.setVisible(false);
    > form.add(parent);
    >
    > AjaxSubmitLink verifyPinLink = new AjaxSubmitLink("verifyPinLink")
    > {
    > @Override
    > public void onSubmit(AjaxRequestTarget target, Form form) {
    > Declaration declaration = (Declaration)
    > form.getModelObject();
    > ParcelIdentification pid =
    > declarationService.findParcelIdentification(declaration.getPin());
    > if (pid == null) {
    > error("No PIN found for PIN " + declaration.getPin());
    > } else {
    > //parent.setOutputMarkupId(true);
    > InitiateDeclarationVerifyPanel decVerifyPanel = new
    > InitiateDeclarationVerifyPanel("verifyPanel", pid);
    > decVerifyPanel.setOutputMarkupId(true);
    > decVerifyPanel.setVisible(true);
    >

    RE: AjaxSubmitLink

    2009-06-19 Thread Jeremy Thomerson
    Call
    setOutputMarkupPlaceholder(true)
    
    That's not the correct name for the method, but it's close enough - even 
    Googling for your error text will probably give you the answer.
    
    
    Jeremy Thomerson
    http://www.wickettraining.com
    -- sent from a wireless device
    
    
    -Original Message-
    From: jpalmer1...@mchsi.com
    Sent: Thursday, June 18, 2009 4:33 PM
    To: users@wicket.apache.org
    Subject: AjaxSubmitLink
    
    I am trying to use an AjaxSubmitLink to show a panel when a button is clicked. 
    I am receiving the following error when I try to submit the form:
    
    Wicket.Ajax.Call.processComponent: Component with id [[verifyPanelWmc9]] a was 
    not found while trying to perform markup update. Make sure you called 
    component.setOutputMarkupId(true) on the component whose markup you are trying 
    to update.
    
    My code is as follows:
    
    public class InitiateDeclarationPage extends EzdecBaseWebPage {
        @SpringBean
        private IDeclarationService declarationService;
    
        public InitiateDeclarationPage() {
        final Declaration declaration = new 
    Declaration(EzdecSession.getCurrentUser().getAccount(),
        EzdecSession.getCurrentUser(), "", County.COOK, State.ILLINOIS);
        add(new FeedbackPanel("feedback"));
    
        final Form form = new Form("initiateDeclarationForm", new 
    CompoundPropertyModel(declaration));
        
        form.add(new Button("submitButton") {
        @Override
        public void onSubmit() {
        Declaration declaration = (Declaration) form.getModelObject();
        declaration.setStatus(Status.OPEN);
        ParcelIdentification pin = 
    declarationService.findParcelIdentification(declaration.getPin());
        if (pin == null) {
        error("No PIN found for PIN " + 
    getFormattedPIN(declaration.getPin()));
        } else {
        if (declarationService.initiateDeclaration(declaration)) {
        EzdecSession.get().info("Declaration " + 
    declaration.getTxNumber() + " created");
        setResponsePage(new DeclarationPage(declaration, 0, 
    pin));
        } else {
        error("Creating declaration with PIN: " + 
    declaration.getPin());
        }
        }
        }
        });
    
        final EzdecRequiredTextField pinText = new 
    EzdecRequiredTextField("pin");
        form.add(pinText);
        
        form.add(new DropDownChoice("county", Arrays.asList(County.values()))
     .setRequired(true)
     .setEnabled(false));
    
        final WebMarkupContainer parent = new 
    WebMarkupContainer("verifyPanelWmc");
    //    parent.setOutputMarkupId(true);
        parent.setVisible(false);
        form.add(parent);
    
        AjaxSubmitLink verifyPinLink = new AjaxSubmitLink("verifyPinLink") {
        @Override
        public void onSubmit(AjaxRequestTarget target, Form form) {
        Declaration declaration = (Declaration) form.getModelObject();
        ParcelIdentification pid = 
    declarationService.findParcelIdentification(declaration.getPin());
        if (pid == null) {
        error("No PIN found for PIN " + declaration.getPin());
        } else {
    //    parent.setOutputMarkupId(true);
        InitiateDeclarationVerifyPanel decVerifyPanel = new 
    InitiateDeclarationVerifyPanel("verifyPanel", pid);
        decVerifyPanel.setOutputMarkupId(true);
        decVerifyPanel.setVisible(true);
        parent.add(decVerifyPanel);
        parent.setVisible(true);
        target.addComponent(decVerifyPanel);
    //    target.addComponent(parent);
        }
        }
        };
    
        form.add(verifyPinLink);
    
        add(form);
        }
    
    }
    
    Anyone know how I can get around this?
    
    

    Re: AjaxSubmitLink

    2009-06-19 Thread sander v F
    Like the error says: "Make sure you called component.setOutputMarkupId(true)
    on the component whose markup you are trying to update."
    That would be the component with id: 'verifyPanelWmc'.
    
    Your code:
    final WebMarkupContainer parent = new
    WebMarkupContainer("verifyPanelWmc");
    //parent.setOutputMarkupId(true);
    parent.setVisible(false);
    form.add(parent);
    
    I think you tried that already, but because the component is not visible,
    the component won't be rendered and written to the response. So there
    wouldn't be any component to update with ajax. That's why there's the error
    "Component with id [[verifyPanelWmc9]] a was not found while trying to
    perform markup update"
    
    You should try "setOutputMarkupPlaceholderTag(true)". This will create a
    placeholder so the component can be updated with ajax.
    
    
    
    
    
    2009/6/18 
    
    >  I am trying to use an AjaxSubmitLink to show a panel when a button is
    > clicked. I am receiving the following error when I try to submit the form:
    >
    > Wicket.Ajax.Call.processComponent: Component with id [[verifyPanelWmc9]] a
    > was not found while trying to perform markup update. Make sure you called
    > component.setOutputMarkupId(true) on the component whose markup you are
    > trying to update.
    >
    > My code is as follows:
    >
    > public class InitiateDeclarationPage extends EzdecBaseWebPage {
    > @SpringBean
    > private IDeclarationService declarationService;
    >
    > public InitiateDeclarationPage() {
    > final Declaration declaration = new
    > Declaration(EzdecSession.getCurrentUser().getAccount(),
    > EzdecSession.getCurrentUser(), "", County.COOK,
    > State.ILLINOIS);
    > add(new FeedbackPanel("feedback"));
    >
    > final Form form = new Form("initiateDeclarationForm", new
    > CompoundPropertyModel(declaration));
    >
    > form.add(new Button("submitButton") {
    > @Override
    > public void onSubmit() {
    > Declaration declaration = (Declaration)
    > form.getModelObject();
    > declaration.setStatus(Status.OPEN);
    > ParcelIdentification pin =
    > declarationService.findParcelIdentification(declaration.getPin());
    > if (pin == null) {
    > error("No PIN found for PIN " +
    > getFormattedPIN(declaration.getPin()));
    > } else {
    > if
    > (declarationService.initiateDeclaration(declaration)) {
    > EzdecSession.get().info("Declaration " +
    > declaration.getTxNumber() + " created");
    > setResponsePage(new DeclarationPage(declaration, 0,
    > pin));
    > } else {
    > error("Creating declaration with PIN: " +
    > declaration.getPin());
    > }
    > }
    > }
    > });
    >
    > final EzdecRequiredTextField pinText = new
    > EzdecRequiredTextField("pin");
    > form.add(pinText);
    >
    > form.add(new DropDownChoice("county",
    > Arrays.asList(County.values()))
    >  .setRequired(true)
    >  .setEnabled(false));
    >
    > final WebMarkupContainer parent = new
    > WebMarkupContainer("verifyPanelWmc");
    > //parent.setOutputMarkupId(true);
    > parent.setVisible(false);
    > form.add(parent);
    >
    > AjaxSubmitLink verifyPinLink = new AjaxSubmitLink("verifyPinLink")
    > {
    > @Override
    > public void onSubmit(AjaxRequestTarget target, Form form) {
    > Declaration declaration = (Declaration)
    > form.getModelObject();
    > ParcelIdentification pid =
    > declarationService.findParcelIdentification(declaration.getPin());
    > if (pid == null) {
    > error("No PIN found for PIN " + declaration.getPin());
    > } else {
    > //parent.setOutputMarkupId(true);
    > InitiateDeclarationVerifyPanel decVerifyPanel = new
    > InitiateDeclarationVerifyPanel("verifyPanel", pid);
    > decVerifyPanel.setOutputMarkupId(true);
    > decVerifyPanel.setVisible(true);
    > parent.add(decVerifyPanel);
    > parent.setVisible(true);
    > target.addComponent(decVerifyPanel);
    > //target.addComponent(parent);
    > }
    > }
    > };
    >
    > form.add(verifyPinLink);
    >
    > add(form);
    > }
    >
    > }
    >
    > Anyone know how I can get around this?
    >
    
    

    Re: AjaxSubmitLink submitting twice

    2009-02-18 Thread Matt Welch
    
    I finally did find the root of this problem and wanted to report back to
    other Wicket users in case they ever had a similar issue and found this
    thread in a search. It turns out that the problem is somehow related to the
    Firebug add-on for Firefox. Doing some searching, I can see that Firebug has
    had similar issue in the past, however they are supposed all fixed, but the
    issue was definitely related, at least in some way, to Firebug. 
    
    Firebug has a feature that allows you put logging statements into your
    javascript code with console.log() statements. If that feature was turned on
    (i.e. the "Console" option was checked in the "Net" tab of Firebug) then I
    would get the behavior I described. Turned off? Everything was fine.
    
    I was using Firebug 1.3.2 with Firefox 3.0. For some reason Firefox had
    never prompted me for an update as it had on my other computers. When I
    updated to Firefox 3.0.6 I could not longer reproduce the issue. 
    
    The moral, I guess, is to keep your browser up-to-date.
    
    Matt
    
    
    Matt Welch wrote:
    > 
    > The Nabble posting process correctly escaped all of the HTML tags except
    > the   which it rendered as HTML. I only just now figured out I needed to
    > use a "raw" tag. The raw HTML is below.
    > 
    > As expected though, this same code works fine in a quickstart. I never
    > suspected that it was a bug, which is why I didn't post a JIRA issue. I
    > knew something this simple wouldn't have been missed. It's clearly a
    > problem with our configuration, but I don't know where to start looking. 
    > 
    > Using this simple test page, the final rendered page contains no extra
    > javascript beyond the wicket stuff to support the button submission which
    > I know works. This test page isn't going through our security framework
    > because I extended WebPage instead of our application's SecureWebPage
    > (using wicket-security). That leaves servlet filters (Spring's
    > OpenSessionInView and the normal WicketFilter), our session implementation
    > or the WebApplication itself. 
    > 
    > Does anyone have any suggestions about where I might plop down a
    > breakpoint in an attempt to debug this issue?
    > 
    > -Matt
    > 
    > 
    >PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
    > http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
    > 
    >   
    > 
    >  # Search 
    >   
    > 
    > 
    > 
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-submitting-twice-tp21934491p22087057.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink submitting twice

    2009-02-10 Thread Igor Vaynberg
    just add Thread.dumpStack() to the onsubmit() and see the two places
    its being called from. you can also add something like
    System.out.println(getrequestcycle().getrequest()) to see if the same
    request is initiating both calls.
    
    
    -igor
    
    On Tue, Feb 10, 2009 at 2:35 PM, Matt Welch  wrote:
    >
    > The Nabble posting process correctly escaped all of the HTML tags except the
    > which it rendered as HTML. I only just now figured out I needed to use a
    > "raw" tag. The raw HTML is below.
    >
    > As expected though, this same code works fine in a quickstart. I never
    > suspected that it was a bug, which is why I didn't post a JIRA issue. I knew
    > something this simple wouldn't have been missed. It's clearly a problem with
    > our configuration, but I don't know where to start looking.
    >
    > Using this simple test page, the final rendered page contains no extra
    > javascript beyond the wicket stuff to support the button submission which I
    > know works. This test page isn't going through our security framework
    > because I extended WebPage instead of our application's SecureWebPage (using
    > wicket-security). That leaves servlet filters (Spring's OpenSessionInView
    > and the normal WicketFilter), our session implementation or the
    > WebApplication itself.
    >
    > Does anyone have any suggestions about where I might plop down a breakpoint
    > in an attempt to debug this issue?
    >
    > -Matt
    >
    >
    > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
    > http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
    > 
    >
    >
    > # Search
    >
    > 
    > 
    >
    >
    >
    >
    >
    >
    > igor.vaynberg wrote:
    >>
    >> your example markup does not contain "search" component. it is much
    >> better to open a jira issue and attach a quickstart that reproduces
    >> the problem.
    >>
    >> -igor
    >>
    >> On Tue, Feb 10, 2009 at 6:12 AM, Matt Welch  wrote:
    >>>
    >>> I'm stumped. We have an AjaxSubmitLink and when clicked, the onSubmit of
    >>> the
    >>> link is being executed twice. This is causing havok in our app. I've
    >>> winnowed it down to just the simplest example but I still see this taking
    >>> place. I'm not sure how to proceed. Here's the example code:
    >>> -
    >>> >>PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >>>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
    >>> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
    >>> 
    >>>
    >>>
    >>> # Search
    >>>
    >>> 
    >>> 
    >>> -
    >>> public class TestAjaxSubmitLink extends WebPage {
    >>>private String fieldValue;
    >>>
    >>>public TestAjaxSubmitLink() {
    >>>
    >>>Form form = new Form("testForm");
    >>>add(form);
    >>>final TextField search = new TextField("keyword", new
    >>> PropertyModel(this,
    >>> "fieldValue"));
    >>>
    >>>form.add(search);
    >>>form.add(new AjaxSubmitLink("search"){
    >>>protected void onSubmit(AjaxRequestTarget target,
    >>> Form form) {
    >>>System.out.println("Clicked Submit");
    >>>}
    >>>});
    >>>}
    >>> }
    >>> -
    >>>
    >>> We're using an older version of Wicket, but I tested this in 1.3.5 also
    >>> and
    >>> got the same behavior. I find it hard to believe that we would be the
    >>> first
    >>> to experience this behavior so I assume we're doing something wrong, but
    >>> I'm
    >>> just not sure what it is. Any advice?
    >>>
    >>> -Matt
    >>> --
    >>> View this message in context:
    >>> http://www.nabble.com/AjaxSubmitLink-submitting-twice-tp21934491p21934491.html
    >>> Sent from the Wicket - User mailing list archive at Nabble.com.
    >>>
    >>>
    >>> -
    >>> 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
    >>
    >>
    >>
    >
    > --
    > View this message in context: 
    > http://www.nabble.com/AjaxSubmitLink-submitting-twice-tp21934491p21944134.html
    > Sent from the Wicket - User mailing list archive at Nabble.com.
    >
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink submitting twice

    2009-02-10 Thread Matt Welch
    
    The Nabble posting process correctly escaped all of the HTML tags except the  
    which it rendered as HTML. I only just now figured out I needed to use a
    "raw" tag. The raw HTML is below.
    
    As expected though, this same code works fine in a quickstart. I never
    suspected that it was a bug, which is why I didn't post a JIRA issue. I knew
    something this simple wouldn't have been missed. It's clearly a problem with
    our configuration, but I don't know where to start looking. 
    
    Using this simple test page, the final rendered page contains no extra
    javascript beyond the wicket stuff to support the button submission which I
    know works. This test page isn't going through our security framework
    because I extended WebPage instead of our application's SecureWebPage (using
    wicket-security). That leaves servlet filters (Spring's OpenSessionInView
    and the normal WicketFilter), our session implementation or the
    WebApplication itself. 
    
    Does anyone have any suggestions about where I might plop down a breakpoint
    in an attempt to debug this issue?
    
    -Matt
    
    
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
    http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
    
    
    
     # Search 
    
    
    
    
    
    
    
    
    
    igor.vaynberg wrote:
    > 
    > your example markup does not contain "search" component. it is much
    > better to open a jira issue and attach a quickstart that reproduces
    > the problem.
    > 
    > -igor
    > 
    > On Tue, Feb 10, 2009 at 6:12 AM, Matt Welch  wrote:
    >>
    >> I'm stumped. We have an AjaxSubmitLink and when clicked, the onSubmit of
    >> the
    >> link is being executed twice. This is causing havok in our app. I've
    >> winnowed it down to just the simplest example but I still see this taking
    >> place. I'm not sure how to proceed. Here's the example code:
    >> -
    >> >PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >>"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
    >> http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
    >> 
    >>
    >>
    >> # Search
    >>
    >> 
    >> 
    >> -
    >> public class TestAjaxSubmitLink extends WebPage {
    >>private String fieldValue;
    >>
    >>public TestAjaxSubmitLink() {
    >>
    >>Form form = new Form("testForm");
    >>add(form);
    >>final TextField search = new TextField("keyword", new
    >> PropertyModel(this,
    >> "fieldValue"));
    >>
    >>form.add(search);
    >>form.add(new AjaxSubmitLink("search"){
    >>protected void onSubmit(AjaxRequestTarget target,
    >> Form form) {
    >>System.out.println("Clicked Submit");
    >>}
    >>});
    >>}
    >> }
    >> -
    >>
    >> We're using an older version of Wicket, but I tested this in 1.3.5 also
    >> and
    >> got the same behavior. I find it hard to believe that we would be the
    >> first
    >> to experience this behavior so I assume we're doing something wrong, but
    >> I'm
    >> just not sure what it is. Any advice?
    >>
    >> -Matt
    >> --
    >> View this message in context:
    >> http://www.nabble.com/AjaxSubmitLink-submitting-twice-tp21934491p21934491.html
    >> Sent from the Wicket - User mailing list archive at Nabble.com.
    >>
    >>
    >> -
    >> 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
    > 
    > 
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-submitting-twice-tp21934491p21944134.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
    For additional commands, e-mail: users-h...@wicket.apache.org
    
    
    

    Re: AjaxSubmitLink submitting twice

    2009-02-10 Thread Igor Vaynberg
    your example markup does not contain "search" component. it is much
    better to open a jira issue and attach a quickstart that reproduces
    the problem.
    
    -igor
    
    On Tue, Feb 10, 2009 at 6:12 AM, Matt Welch  wrote:
    >
    > I'm stumped. We have an AjaxSubmitLink and when clicked, the onSubmit of the
    > link is being executed twice. This is causing havok in our app. I've
    > winnowed it down to just the simplest example but I still see this taking
    > place. I'm not sure how to proceed. Here's the example code:
    > -
    > PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    >"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
    > http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
    > 
    >
    >
    > # Search
    >
    > 
    > 
    > -
    > public class TestAjaxSubmitLink extends WebPage {
    >private String fieldValue;
    >
    >public TestAjaxSubmitLink() {
    >
    >Form form = new Form("testForm");
    >add(form);
    >final TextField search = new TextField("keyword", new 
    > PropertyModel(this,
    > "fieldValue"));
    >
    >form.add(search);
    >form.add(new AjaxSubmitLink("search"){
    >protected void onSubmit(AjaxRequestTarget target, Form 
    > form) {
    >System.out.println("Clicked Submit");
    >}
    >});
    >}
    > }
    > -
    >
    > We're using an older version of Wicket, but I tested this in 1.3.5 also and
    > got the same behavior. I find it hard to believe that we would be the first
    > to experience this behavior so I assume we're doing something wrong, but I'm
    > just not sure what it is. Any advice?
    >
    > -Matt
    > --
    > View this message in context: 
    > http://www.nabble.com/AjaxSubmitLink-submitting-twice-tp21934491p21934491.html
    > Sent from the Wicket - User mailing list archive at Nabble.com.
    >
    >
    > -
    > 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
    
    
    

    Re: AjaxSubmitLink refreshing problem

    2008-09-04 Thread Mohan Thakare
    
    The image showing the area in which  AjaxSubmitLink is shown.
    As the number of links are increasing the scroll bar is work automatically
    in Fire Fox.
    but its not scrolled in Safari.
    In Safari link is added but its not showing the current link which is added
    at last.
    
    
    Mohan Thakare wrote:
    > 
    > ok. I will explain my problem in detail.
    > I have a WebMarkupContainer in which I showing a DataView.
    > DataView contains AjaxSubmitLink.
    > By clicking a specific button on page a new AjaxSubmitLink containing some
    > data is added to the DataView.
    > 
    >  http://www.nabble.com/file/p19310695/untitled.jpg 
    > each time I click on button a new link is added and the focus is on the
    > currently added link.
    > When the links are more than size of the specified area, the focus is
    > still on the current link.
    > and the list is scroll down automatically.
    > This is happens in Fire Fox. But do not work in Safari.
    > I want Safari should show this type of behavior.
    > Any solution??
    > 
    > 
    > 
    > 
    > 
    > 
    > 
    > alesp wrote:
    >> 
    >> I don't understand what you want to do. Can you explain the situation a
    >> little more? What do you mean by 'it' in "I need to make it work in
    >> Safari"?
    >> 
    >> 
    >> Mohan Thakare wrote:
    >>> 
    >>> you discuss in your problem that 
    >>> "The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    >>> the diagram) is working fine"
    >>> 
    >>> can you tell how is that possible.
    >>> how can I scroll my list and set the focus on current item.
    >>> Its possible in Fire Fox but not in Safari.
    >>> I need to make it work in Safari
    >>> Is there any solution available for this??
    >>> 
    >>> 
    >>> 
    >>> alesp wrote:
     
     Hello!
     Ok, this is the problem: I have the following wicket hierarchy:
     
     Panel
    |
     --> Form
     |
      --> WebMarkupContainer (setOutputMarkupId(true))
     ||
     |--> ListView (with a
     LoadableDetachableModel)
     |  |
     |   --> { populateItem {
     AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer)
     } }
      --> AutoCompleteTextField
     |
      --> AjaxSubmitLink (to "add" an element)
     
     The problem is that the "add" link (the AjaxSubmitLink at the bottom of
     the diagram) is working fine, but the "delete" is not, and the code is
     pretty the same (calling different methods). When I say it's not
     working I mean that I click the "delete" link and nothing happens
     (internally the element is removed properly but the page doesn't
     refresh the changes). The "add" link works, I press "add" and the list
     is refreshed with the new element.
     Trying to find out what's happening I copied the "onSubmit" method of
     the "delete" AjaxSubmitLink to the "add" link and again the list was
     properly refreshed, now with a delete action. So, I think that the
     problem is related to the location of the links in the hierarchy and
     something that I'm missing there.
     Any idea?
     
    >>> 
    >>> 
    >> 
    >> 
    > 
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19310892.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink refreshing problem

    2008-09-04 Thread Mohan Thakare
    
    ok. I will explain my problem in detail.
    I have a WebMarkupContainer in which I showing a DataView.
    DataView contains AjaxSubmitLink.
    By clicking a specific button on page a new AjaxSubmitLink containing some
    data is added to the DataView.
    
    http://www.nabble.com/file/p19310695/untitled.jpg 
    each time I click on button a new link is added and the focus is on the
    currently added link.
    When the links are more than size of the specified area, the focus is still
    on the current link.
    and the list is scroll down automatically.
    This is happens in Fire Fox. But do not work in Safari.
    I want Safari should show this type of behavior.
    Any solution??
    
    
    
    
    
    
    
    alesp wrote:
    > 
    > I don't understand what you want to do. Can you explain the situation a
    > little more? What do you mean by 'it' in "I need to make it work in
    > Safari"?
    > 
    > 
    > Mohan Thakare wrote:
    >> 
    >> you discuss in your problem that 
    >> "The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    >> the diagram) is working fine"
    >> 
    >> can you tell how is that possible.
    >> how can I scroll my list and set the focus on current item.
    >> Its possible in Fire Fox but not in Safari.
    >> I need to make it work in Safari
    >> Is there any solution available for this??
    >> 
    >> 
    >> 
    >> alesp wrote:
    >>> 
    >>> Hello!
    >>> Ok, this is the problem: I have the following wicket hierarchy:
    >>> 
    >>> Panel
    >>>|
    >>> --> Form
    >>> |
    >>>  --> WebMarkupContainer (setOutputMarkupId(true))
    >>> ||
    >>> |--> ListView (with a
    >>> LoadableDetachableModel)
    >>> |  |
    >>> |   --> { populateItem {
    >>> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer)
    >>> } }
    >>>  --> AutoCompleteTextField
    >>> |
    >>>  --> AjaxSubmitLink (to "add" an element)
    >>> 
    >>> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    >>> the diagram) is working fine, but the "delete" is not, and the code is
    >>> pretty the same (calling different methods). When I say it's not working
    >>> I mean that I click the "delete" link and nothing happens (internally
    >>> the element is removed properly but the page doesn't refresh the
    >>> changes). The "add" link works, I press "add" and the list is refreshed
    >>> with the new element.
    >>> Trying to find out what's happening I copied the "onSubmit" method of
    >>> the "delete" AjaxSubmitLink to the "add" link and again the list was
    >>> properly refreshed, now with a delete action. So, I think that the
    >>> problem is related to the location of the links in the hierarchy and
    >>> something that I'm missing there.
    >>> Any idea?
    >>> 
    >> 
    >> 
    > 
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19310695.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink refreshing problem

    2008-09-04 Thread alesp
    
    I don't understand what you want to do. Can you explain the situation a
    little more? What do you mean by 'it' in "I need to make it work in Safari"?
    
    
    Mohan Thakare wrote:
    > 
    > you discuss in your problem that 
    > "The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    > the diagram) is working fine"
    > 
    > can you tell how is that possible.
    > how can I scroll my list and set the focus on current item.
    > Its possible in Fire Fox but not in Safari.
    > I need to make it work in Safari
    > Is there any solution available for this??
    > 
    > 
    > 
    > alesp wrote:
    >> 
    >> Hello!
    >> Ok, this is the problem: I have the following wicket hierarchy:
    >> 
    >> Panel
    >>|
    >> --> Form
    >> |
    >>  --> WebMarkupContainer (setOutputMarkupId(true))
    >> ||
    >> |--> ListView (with a
    >> LoadableDetachableModel)
    >> |  |
    >> |   --> { populateItem {
    >> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
    >> }
    >>  --> AutoCompleteTextField
    >> |
    >>  --> AjaxSubmitLink (to "add" an element)
    >> 
    >> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    >> the diagram) is working fine, but the "delete" is not, and the code is
    >> pretty the same (calling different methods). When I say it's not working
    >> I mean that I click the "delete" link and nothing happens (internally the
    >> element is removed properly but the page doesn't refresh the changes).
    >> The "add" link works, I press "add" and the list is refreshed with the
    >> new element.
    >> Trying to find out what's happening I copied the "onSubmit" method of the
    >> "delete" AjaxSubmitLink to the "add" link and again the list was properly
    >> refreshed, now with a delete action. So, I think that the problem is
    >> related to the location of the links in the hierarchy and something that
    >> I'm missing there.
    >> Any idea?
    >> 
    > 
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19309030.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink refreshing problem

    2008-09-04 Thread Mohan Thakare
    
    you discuss in your problem that 
    "The problem is that the "add" link (the AjaxSubmitLink at the bottom of the
    diagram) is working fine"
    
    can you tell how is that possible.
    how can I scroll my list and set the focus on current item.
    Its possible in Fire Fox but not in Safari.
    I need to make it work in Safari
    Is there any solution available for this??
    
    
    
    alesp wrote:
    > 
    > Hello!
    > Ok, this is the problem: I have the following wicket hierarchy:
    > 
    > Panel
    >|
    > --> Form
    > |
    >  --> WebMarkupContainer (setOutputMarkupId(true))
    > ||
    > |--> ListView (with a
    > LoadableDetachableModel)
    > |  |
    > |   --> { populateItem {
    > AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
    > }
    >  --> AutoCompleteTextField
    > |
    >  --> AjaxSubmitLink (to "add" an element)
    > 
    > The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    > the diagram) is working fine, but the "delete" is not, and the code is
    > pretty the same (calling different methods). When I say it's not working I
    > mean that I click the "delete" link and nothing happens (internally the
    > element is removed properly but the page doesn't refresh the changes). The
    > "add" link works, I press "add" and the list is refreshed with the new
    > element.
    > Trying to find out what's happening I copied the "onSubmit" method of the
    > "delete" AjaxSubmitLink to the "add" link and again the list was properly
    > refreshed, now with a delete action. So, I think that the problem is
    > related to the location of the links in the hierarchy and something that
    > I'm missing there.
    > Any idea?
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p19309003.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitlink vs AjaxButton

    2008-08-12 Thread Milan Křápek
    Thaks. You are right. I thought I need just add the AjaxSubmitLink to form as a 
    Button but it must be set as default button. 
    
    Best regards
    
    Milan
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitlink vs AjaxButton

    2008-08-12 Thread Ryan O'Hara
    
    I think you'll need to call form.setDefaultButton(submitLink).
    
    Ryan
    
    On Aug 12, 2008, at 11:13 AM, Milan Křápek wrote:
    
    
    Hi
      In my web application I realized form submiting by AjaxButtons.  
    This wokrs great. I love the possibility to refresh just part of my  
    page after submiting the form. Then  I decided to refactor my  
    webapp tu use AjaxSubmitLink because I want to use some images and  
    texts instead of buttons.
      This works too, but one thing make me confused. When I was using  
    buttons I can submit my forms just by pressing the enter key, but  
    with AjaxSubmitlink this  feathure does not work.
      I try to debug it and get this results. When I use buttons and  
    press enter, Wicket call onSubmit method implemented by AjaxButton,  
    but when I use AjaxSubmitLinks and press enter, wicket call  
    onSubmit method on the form not on the link.
    
    
    Why? Has it some purpose, should I use AjaxSubmitLinks by another  
    way, or it is some bug?
    
    Thanks for any response.
    
    Milan
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink refreshing problem

    2008-06-12 Thread Timo Rantalaiho
    On Thu, 12 Jun 2008, alesp wrote:
    > Panel
    >|
    > --> Form
    > |
    >  --> WebMarkupContainer (setOutputMarkupId(true))
    > ||
    > |--> ListView (with a
    > LoadableDetachableModel)
    > |  |
    > |   --> { populateItem {
    > AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) } }
    >  --> AutoCompleteTextField
    > |
    >  --> AjaxSubmitLink (to "add" an element)
    > 
    > The problem is that the "add" link (the AjaxSubmitLink at the bottom of the
    > diagram) is working fine, but the "delete" is not, and the code is pretty
    
    What a cool diagram :) Have you called setReuseItems(true)
    for the ListView by any change? (If you have, I understand
    you should call removeAll to get the model changes to show:
      http://www.nabble.com/Re%3A-ListViews-in-a-form-question-p17786806.html 
    ) Have you checked that the stuff that the
    LoadableDetachableModel returns for the ListView is correct
    after the delete? Have you checked that the ListView reads
    the contents from the model on rendering for the ajax update?
    
    Putting a Thread.dumpStack() in the load implementation of
    your LoadableDetachableModel will probably show easily when
    the ListView refreshes its contents.
    
    Best wishes,
    Timo
    
    -- 
    Timo Rantalaiho   
    Reaktor Innovations Oyhttp://www.ri.fi/ >
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink refreshing problem

    2008-06-12 Thread alesp
    
    Hello jchappelle.
    Yes, I'm adding the WebMarkupContainer to the AjaxRequestTarget, but I'm
    going to look that method you mentioned, maybe the solution is there.
    Thanks.
    
    
    jchappelle wrote:
    > 
    > The ListView class has a method called removeLink that returns a Link that
    > will remove the item from the list. I have never used it but I just
    > figured I would point it out to you. Maybe looking at the source code of
    > that method could help.
    > 
    > Also, make sure you are adding your WebMarkupContainer to the
    > AjaxRequestTarget. Otherwise the Ajax call will not update that section of
    > your markup.
    > 
    > Josh
    > 
    > 
    > alesp wrote:
    >> 
    >> Hello!
    >> Ok, this is the problem: I have the following wicket hierarchy:
    >> 
    >> Panel
    >>|
    >> --> Form
    >> |
    >>  --> WebMarkupContainer (setOutputMarkupId(true))
    >> ||
    >> |--> ListView (with a
    >> LoadableDetachableModel)
    >> |  |
    >> |   --> { populateItem {
    >> AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
    >> }
    >>  --> AutoCompleteTextField
    >> |
    >>  --> AjaxSubmitLink (to "add" an element)
    >> 
    >> The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    >> the diagram) is working fine, but the "delete" is not, and the code is
    >> pretty the same (calling different methods). When I say it's not working
    >> I mean that I click the "delete" link and nothing happens (internally the
    >> element is removed properly but the page doesn't refresh the changes).
    >> The "add" link works, I press "add" and the list is refreshed with the
    >> new element.
    >> Trying to find out what's happening I copied the "onSubmit" method of the
    >> "delete" AjaxSubmitLink to the "add" link and again the list was properly
    >> refreshed, now with a delete action. So, I think that the problem is
    >> related to the location of the links in the hierarchy and something that
    >> I'm missing there.
    >> Any idea?
    >> 
    > 
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p17802573.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink refreshing problem

    2008-06-12 Thread jchappelle
    
    The ListView class has a method called removeLink that returns a Link that
    will remove the item from the list. I have never used it but I just figured
    I would point it out to you. Maybe looking at the source code of that method
    could help.
    
    Also, make sure you are adding your WebMarkupContainer to the
    AjaxRequestTarget. Otherwise the Ajax call will not update that section of
    your markup.
    
    Josh
    
    
    alesp wrote:
    > 
    > Hello!
    > Ok, this is the problem: I have the following wicket hierarchy:
    > 
    > Panel
    >|
    > --> Form
    > |
    >  --> WebMarkupContainer (setOutputMarkupId(true))
    > ||
    > |--> ListView (with a
    > LoadableDetachableModel)
    > |  |
    > |   --> { populateItem {
    > AjaxSubmitLink (to "delete" an element. Updates the WebMarkupContainer) }
    > }
    >  --> AutoCompleteTextField
    > |
    >  --> AjaxSubmitLink (to "add" an element)
    > 
    > The problem is that the "add" link (the AjaxSubmitLink at the bottom of
    > the diagram) is working fine, but the "delete" is not, and the code is
    > pretty the same (calling different methods). When I say it's not working I
    > mean that I click the "delete" link and nothing happens (internally the
    > element is removed properly but the page doesn't refresh the changes). The
    > "add" link works, I press "add" and the list is refreshed with the new
    > element.
    > Trying to find out what's happening I copied the "onSubmit" method of the
    > "delete" AjaxSubmitLink to the "add" link and again the list was properly
    > refreshed, now with a delete action. So, I think that the problem is
    > related to the location of the links in the hierarchy and something that
    > I'm missing there.
    > Any idea?
    > 
    
    -- 
    View this message in context: 
    http://www.nabble.com/AjaxSubmitLink-refreshing-problem-tp17801832p17802380.html
    Sent from the Wicket - User mailing list archive at Nabble.com.
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink accessing model object non-existent property

    2008-04-09 Thread Igor Vaynberg
    you can, just give the cpm reference to link as the model.
    
    -igor
    
    
    On Wed, Apr 9, 2008 at 1:31 AM, Tim Squires <[EMAIL PROTECTED]> wrote:
    > OK.  It's clicked.  I was hoping to have a simple ajaxed submit link
    >  without having to create a fake property on the model object.  No problem,
    >  I can see what I missed.
    >
    >  Thanks for your help Igor.
    >
    >  Tim
    >
    >
    >
    >  > you said it yourself:
    >  >
    >  > "Insure that the component identifier names match
    >  > the appropriate property names."
    >  >
    >  > what that says is that the model you get is the property of the model
    >  > object that is in the cpm with the name of component id.
    >  >
    >  > so since your links id is "foo" it will try to pull out the model
    >  > object from the cpm and call getfoo() on it, the result of which is
    >  > the model object of the link
    >  >
    >  > -igor
    >  >
    >  >
    >  > On Tue, Apr 8, 2008 at 12:52 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    >  >> I have read it - a few times over the last 3 years of using Wicket and
    >  >>  even bought the book ;)
    >  >>
    >  >>  It says
    >  >>
    >  >>  "To use a CompoundPropertyModel, simply set one as the model for a
    >  >>  container, such as a Form or a Page. Create the contained components
    >  >> with
    >  >>  no model of their own. Insure that the component identifier names match
    >  >>  the appropriate property names."
    >  >>
    >  >>  The AjaxSubmitLink is picking-up the parent forms compound property
    >  >> model
    >  >>  but only checking to see if the "mylink" property exists when onSubmit
    >  >>  calls getModelObject().
    >  >>
    >  >>  I would like to get the Forms model via getModelObject but because it
    >  >>  errors when called, I have to either set a false model on the
    >  >>  AjaxSubmitLink or get the model object outside of the onSubmit, assign
    >  >> it
    >  >>  to a final property and then use it in the onSubmit.
    >  >>
    >  >>  I'm happy to admit that I'm doing something wrong but I cannot see what
    >  >> it
    >  >>  is???
    >  >>
    >  >>  Thanks again,
    >  >>  Tim
    >  >>
    >  >>
    >  >>
    >  >>  > no, components do not randomly pick up models from their parents. i
    >  >>  > would suggest reading the models wiki page.
    >  >>  >
    >  >>  > -igor
    >  >>  >
    >  >>  >
    >  >>  > On Mon, Apr 7, 2008 at 3:11 PM, Tim <[EMAIL PROTECTED]> wrote:
    >  >>  >> Thanks Igor but should it not pick-up the model from the Form?
    >  >> There's
    >  >>  >> no
    >  >>  >>  constructor that takes a model.  Should the AjaxSubmitLink(id,
    >  >> form)
    >  >>  >>  constructor be used with the Form that it's being added to?  e..g
    >  >>  >>
    >  >>  >>  MyForm extends Form {
    >  >>  >>  public MyForm(){
    >  >>  >>  
    >  >>  >>  add( new AjaxSubmitLink("mylink",this){
    >  >>  >>  
    >  >>  >>  });
    >  >>  >>  }}
    >  >>  >>
    >  >>  >>  If it's already bound to a Form, should it not pick-up the model
    >  >> used
    >  >>  >> by
    >  >>  >>  the form?
    >  >>  >>
    >  >>  >>  Am I looking at the problem/solution the wrong way???
    >  >>  >>
    >  >>  >>  Thanks again,
    >  >>  >>  Tim
    >  >>  >>
    >  >>  >>
    >  >>  >>
    >  >>  >>  > you forgot to give ajaxsubmitlink a model, so getmodelobject()
    >  >> will
    >  >>  >>  > either return null or a compound model.confirm - neither of which
    >  >> i
    >  >>  >>  > think you want.
    >  >>  >>  >
    >  >>  >>  > -igor
    >  >>  >>  >
    >  >>  >>  >
    >  >>  >>  > On Mon, Apr 7, 2008 at 1:00 PM, Tim Squires <[EMAIL PROTECTED]>
    >  >> wrote:
    >  >>  >>  >> Hi,
    >  >>  >>  >>
    >  >>  >>  >>  When adding an AjaxSubmitLink, the onSubmit method tries to
    >  >> access
    >  >>  >> a
    >  >>  >>  >>  property of the model object that does not exists:
    >  >>  >>  >>
    >  >>  >>  >>  ---
    >  >>  >>  >> final AjaxSubmitLink confirmLink = new
    >  >>  >>  >>  AjaxSubmitLink("confirm") {
    >  >>  >>  >> @Override
    >  >>  >>  >> public void onSubmit(final AjaxRequestTarget
    >  >> target,
    >  >>  >>  >> final Form form) {
    >  >>  >>  >> if (((Will) getModelObject()).getExecutor()
    >  >> !=
    >  >>  >> null)
    >  >>  >>  >> {
    >  >>  >>  >> willModalWindow.show(target);
    >  >>  >>  >> } else {
    >  >>  >>  >> warn("Please choose an executor.");
    >  >>  >>  >> target.addComponent(feedback);
    >  >>  >>  >> }
    >  >>  >>  >> }
    >  >>  >>  >>
    >  >>  >>  >> @Override
    >  >>  >>  >> public void onError(final AjaxRequestTarget
    >  >> target,
    >  >>  >>  >> final Form form) {
    >  >>  >>  >> target.addComponent(feedback);
    >  >>  >>  >> }
    >  >>  >>  >> };
    >  >>  >>  >>
    >  >>  >>  >> add(confirmLink);
    >  >>  >>  >>  ---
    >  >>  >>  >>
    >  >>  >>  >>  It tries to access the "confirm" property of the Model, in this
    >  >>  >> case a
    >  >>  >>  >>  Will object.
    >  >>  >>  >>
    >  >>  >>  >>  ---
    >  >>  >>  >>  org.apache.wicket.WicketRuntimeException: No get method defined
    >  >> f

    Re: AjaxSubmitLink accessing model object non-existent property

    2008-04-09 Thread Tim Squires
    OK.  It's clicked.  I was hoping to have a simple ajaxed submit link
    without having to create a fake property on the model object.  No problem,
    I can see what I missed.
    
    Thanks for your help Igor.
    
    Tim
    
    > you said it yourself:
    >
    > "Insure that the component identifier names match
    > the appropriate property names."
    >
    > what that says is that the model you get is the property of the model
    > object that is in the cpm with the name of component id.
    >
    > so since your links id is "foo" it will try to pull out the model
    > object from the cpm and call getfoo() on it, the result of which is
    > the model object of the link
    >
    > -igor
    >
    >
    > On Tue, Apr 8, 2008 at 12:52 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    >> I have read it - a few times over the last 3 years of using Wicket and
    >>  even bought the book ;)
    >>
    >>  It says
    >>
    >>  "To use a CompoundPropertyModel, simply set one as the model for a
    >>  container, such as a Form or a Page. Create the contained components
    >> with
    >>  no model of their own. Insure that the component identifier names match
    >>  the appropriate property names."
    >>
    >>  The AjaxSubmitLink is picking-up the parent forms compound property
    >> model
    >>  but only checking to see if the "mylink" property exists when onSubmit
    >>  calls getModelObject().
    >>
    >>  I would like to get the Forms model via getModelObject but because it
    >>  errors when called, I have to either set a false model on the
    >>  AjaxSubmitLink or get the model object outside of the onSubmit, assign
    >> it
    >>  to a final property and then use it in the onSubmit.
    >>
    >>  I'm happy to admit that I'm doing something wrong but I cannot see what
    >> it
    >>  is???
    >>
    >>  Thanks again,
    >>  Tim
    >>
    >>
    >>
    >>  > no, components do not randomly pick up models from their parents. i
    >>  > would suggest reading the models wiki page.
    >>  >
    >>  > -igor
    >>  >
    >>  >
    >>  > On Mon, Apr 7, 2008 at 3:11 PM, Tim <[EMAIL PROTECTED]> wrote:
    >>  >> Thanks Igor but should it not pick-up the model from the Form?
    >> There's
    >>  >> no
    >>  >>  constructor that takes a model.  Should the AjaxSubmitLink(id,
    >> form)
    >>  >>  constructor be used with the Form that it's being added to?  e..g
    >>  >>
    >>  >>  MyForm extends Form {
    >>  >>  public MyForm(){
    >>  >>  
    >>  >>  add( new AjaxSubmitLink("mylink",this){
    >>  >>  
    >>  >>  });
    >>  >>  }}
    >>  >>
    >>  >>  If it's already bound to a Form, should it not pick-up the model
    >> used
    >>  >> by
    >>  >>  the form?
    >>  >>
    >>  >>  Am I looking at the problem/solution the wrong way???
    >>  >>
    >>  >>  Thanks again,
    >>  >>  Tim
    >>  >>
    >>  >>
    >>  >>
    >>  >>  > you forgot to give ajaxsubmitlink a model, so getmodelobject()
    >> will
    >>  >>  > either return null or a compound model.confirm - neither of which
    >> i
    >>  >>  > think you want.
    >>  >>  >
    >>  >>  > -igor
    >>  >>  >
    >>  >>  >
    >>  >>  > On Mon, Apr 7, 2008 at 1:00 PM, Tim Squires <[EMAIL PROTECTED]>
    >> wrote:
    >>  >>  >> Hi,
    >>  >>  >>
    >>  >>  >>  When adding an AjaxSubmitLink, the onSubmit method tries to
    >> access
    >>  >> a
    >>  >>  >>  property of the model object that does not exists:
    >>  >>  >>
    >>  >>  >>  ---
    >>  >>  >> final AjaxSubmitLink confirmLink = new
    >>  >>  >>  AjaxSubmitLink("confirm") {
    >>  >>  >> @Override
    >>  >>  >> public void onSubmit(final AjaxRequestTarget
    >> target,
    >>  >>  >> final Form form) {
    >>  >>  >> if (((Will) getModelObject()).getExecutor()
    >> !=
    >>  >> null)
    >>  >>  >> {
    >>  >>  >> willModalWindow.show(target);
    >>  >>  >> } else {
    >>  >>  >> warn("Please choose an executor.");
    >>  >>  >> target.addComponent(feedback);
    >>  >>  >> }
    >>  >>  >> }
    >>  >>  >>
    >>  >>  >> @Override
    >>  >>  >> public void onError(final AjaxRequestTarget
    >> target,
    >>  >>  >> final Form form) {
    >>  >>  >> target.addComponent(feedback);
    >>  >>  >> }
    >>  >>  >> };
    >>  >>  >>
    >>  >>  >> add(confirmLink);
    >>  >>  >>  ---
    >>  >>  >>
    >>  >>  >>  It tries to access the "confirm" property of the Model, in this
    >>  >> case a
    >>  >>  >>  Will object.
    >>  >>  >>
    >>  >>  >>  ---
    >>  >>  >>  org.apache.wicket.WicketRuntimeException: No get method defined
    >> for
    >>  >>  >> class:
    >>  >>  >>  class crystalmark.willfinder.model.Will expression: confirm
    >>  >>  >>  at
    >>  >>  >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
    >>  >>  >>  at
    >>  >>  >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
    >>  >>  >>  at
    >>  >>  >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
    >>  >>  >>  at
    >>  >>  >>  
    >> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractProper

    Re: AjaxSubmitLink accessing model object non-existent property

    2008-04-08 Thread Igor Vaynberg
    you said it yourself:
    
    "Insure that the component identifier names match
    the appropriate property names."
    
    what that says is that the model you get is the property of the model
    object that is in the cpm with the name of component id.
    
    so since your links id is "foo" it will try to pull out the model
    object from the cpm and call getfoo() on it, the result of which is
    the model object of the link
    
    -igor
    
    
    On Tue, Apr 8, 2008 at 12:52 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    > I have read it - a few times over the last 3 years of using Wicket and
    >  even bought the book ;)
    >
    >  It says
    >
    >  "To use a CompoundPropertyModel, simply set one as the model for a
    >  container, such as a Form or a Page. Create the contained components with
    >  no model of their own. Insure that the component identifier names match
    >  the appropriate property names."
    >
    >  The AjaxSubmitLink is picking-up the parent forms compound property model
    >  but only checking to see if the "mylink" property exists when onSubmit
    >  calls getModelObject().
    >
    >  I would like to get the Forms model via getModelObject but because it
    >  errors when called, I have to either set a false model on the
    >  AjaxSubmitLink or get the model object outside of the onSubmit, assign it
    >  to a final property and then use it in the onSubmit.
    >
    >  I'm happy to admit that I'm doing something wrong but I cannot see what it
    >  is???
    >
    >  Thanks again,
    >  Tim
    >
    >
    >
    >  > no, components do not randomly pick up models from their parents. i
    >  > would suggest reading the models wiki page.
    >  >
    >  > -igor
    >  >
    >  >
    >  > On Mon, Apr 7, 2008 at 3:11 PM, Tim <[EMAIL PROTECTED]> wrote:
    >  >> Thanks Igor but should it not pick-up the model from the Form?  There's
    >  >> no
    >  >>  constructor that takes a model.  Should the AjaxSubmitLink(id, form)
    >  >>  constructor be used with the Form that it's being added to?  e..g
    >  >>
    >  >>  MyForm extends Form {
    >  >>  public MyForm(){
    >  >>  
    >  >>  add( new AjaxSubmitLink("mylink",this){
    >  >>  
    >  >>  });
    >  >>  }}
    >  >>
    >  >>  If it's already bound to a Form, should it not pick-up the model used
    >  >> by
    >  >>  the form?
    >  >>
    >  >>  Am I looking at the problem/solution the wrong way???
    >  >>
    >  >>  Thanks again,
    >  >>  Tim
    >  >>
    >  >>
    >  >>
    >  >>  > you forgot to give ajaxsubmitlink a model, so getmodelobject() will
    >  >>  > either return null or a compound model.confirm - neither of which i
    >  >>  > think you want.
    >  >>  >
    >  >>  > -igor
    >  >>  >
    >  >>  >
    >  >>  > On Mon, Apr 7, 2008 at 1:00 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    >  >>  >> Hi,
    >  >>  >>
    >  >>  >>  When adding an AjaxSubmitLink, the onSubmit method tries to access
    >  >> a
    >  >>  >>  property of the model object that does not exists:
    >  >>  >>
    >  >>  >>  ---
    >  >>  >> final AjaxSubmitLink confirmLink = new
    >  >>  >>  AjaxSubmitLink("confirm") {
    >  >>  >> @Override
    >  >>  >> public void onSubmit(final AjaxRequestTarget target,
    >  >>  >> final Form form) {
    >  >>  >> if (((Will) getModelObject()).getExecutor() !=
    >  >> null)
    >  >>  >> {
    >  >>  >> willModalWindow.show(target);
    >  >>  >> } else {
    >  >>  >> warn("Please choose an executor.");
    >  >>  >> target.addComponent(feedback);
    >  >>  >> }
    >  >>  >> }
    >  >>  >>
    >  >>  >> @Override
    >  >>  >> public void onError(final AjaxRequestTarget target,
    >  >>  >> final Form form) {
    >  >>  >> target.addComponent(feedback);
    >  >>  >> }
    >  >>  >> };
    >  >>  >>
    >  >>  >> add(confirmLink);
    >  >>  >>  ---
    >  >>  >>
    >  >>  >>  It tries to access the "confirm" property of the Model, in this
    >  >> case a
    >  >>  >>  Will object.
    >  >>  >>
    >  >>  >>  ---
    >  >>  >>  org.apache.wicket.WicketRuntimeException: No get method defined for
    >  >>  >> class:
    >  >>  >>  class crystalmark.willfinder.model.Will expression: confirm
    >  >>  >>  at
    >  >>  >>  
    > org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
    >  >>  >>  at
    >  >>  >>  
    > org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
    >  >>  >>  at
    >  >>  >>  
    > org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
    >  >>  >>  at
    >  >>  >>  
    > org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
    >  >>  >>  at
    >  >> org.apache.wicket.Component.getModelObject(Component.java:1551)
    >  >>  >>  at
    >  >>  >>  
    > crystalmark.willfinder.page.components.EditWillPanel$EditWillForm$5.onSubmit(EditWillPanel.java:183)
    >  >>  >>  at
    >  >>  >>  
    > org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:94)
    >  >>  >>  at
    >  >>  >>  
    

    Re: AjaxSubmitLink accessing model object non-existent property

    2008-04-08 Thread Tim Squires
    I have read it - a few times over the last 3 years of using Wicket and
    even bought the book ;)
    
    It says
    
    "To use a CompoundPropertyModel, simply set one as the model for a
    container, such as a Form or a Page. Create the contained components with
    no model of their own. Insure that the component identifier names match
    the appropriate property names."
    
    The AjaxSubmitLink is picking-up the parent forms compound property model
    but only checking to see if the "mylink" property exists when onSubmit
    calls getModelObject().
    
    I would like to get the Forms model via getModelObject but because it
    errors when called, I have to either set a false model on the
    AjaxSubmitLink or get the model object outside of the onSubmit, assign it
    to a final property and then use it in the onSubmit.
    
    I'm happy to admit that I'm doing something wrong but I cannot see what it
    is???
    
    Thanks again,
    Tim
    
    > no, components do not randomly pick up models from their parents. i
    > would suggest reading the models wiki page.
    >
    > -igor
    >
    >
    > On Mon, Apr 7, 2008 at 3:11 PM, Tim <[EMAIL PROTECTED]> wrote:
    >> Thanks Igor but should it not pick-up the model from the Form?  There's
    >> no
    >>  constructor that takes a model.  Should the AjaxSubmitLink(id, form)
    >>  constructor be used with the Form that it's being added to?  e..g
    >>
    >>  MyForm extends Form {
    >>  public MyForm(){
    >>  
    >>  add( new AjaxSubmitLink("mylink",this){
    >>  
    >>  });
    >>  }}
    >>
    >>  If it's already bound to a Form, should it not pick-up the model used
    >> by
    >>  the form?
    >>
    >>  Am I looking at the problem/solution the wrong way???
    >>
    >>  Thanks again,
    >>  Tim
    >>
    >>
    >>
    >>  > you forgot to give ajaxsubmitlink a model, so getmodelobject() will
    >>  > either return null or a compound model.confirm - neither of which i
    >>  > think you want.
    >>  >
    >>  > -igor
    >>  >
    >>  >
    >>  > On Mon, Apr 7, 2008 at 1:00 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    >>  >> Hi,
    >>  >>
    >>  >>  When adding an AjaxSubmitLink, the onSubmit method tries to access
    >> a
    >>  >>  property of the model object that does not exists:
    >>  >>
    >>  >>  ---
    >>  >> final AjaxSubmitLink confirmLink = new
    >>  >>  AjaxSubmitLink("confirm") {
    >>  >> @Override
    >>  >> public void onSubmit(final AjaxRequestTarget target,
    >>  >> final Form form) {
    >>  >> if (((Will) getModelObject()).getExecutor() !=
    >> null)
    >>  >> {
    >>  >> willModalWindow.show(target);
    >>  >> } else {
    >>  >> warn("Please choose an executor.");
    >>  >> target.addComponent(feedback);
    >>  >> }
    >>  >> }
    >>  >>
    >>  >> @Override
    >>  >> public void onError(final AjaxRequestTarget target,
    >>  >> final Form form) {
    >>  >> target.addComponent(feedback);
    >>  >> }
    >>  >> };
    >>  >>
    >>  >> add(confirmLink);
    >>  >>  ---
    >>  >>
    >>  >>  It tries to access the "confirm" property of the Model, in this
    >> case a
    >>  >>  Will object.
    >>  >>
    >>  >>  ---
    >>  >>  org.apache.wicket.WicketRuntimeException: No get method defined for
    >>  >> class:
    >>  >>  class crystalmark.willfinder.model.Will expression: confirm
    >>  >>  at
    >>  >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
    >>  >>  at
    >>  >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
    >>  >>  at
    >>  >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
    >>  >>  at
    >>  >>  
    >> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
    >>  >>  at
    >> org.apache.wicket.Component.getModelObject(Component.java:1551)
    >>  >>  at
    >>  >>  
    >> crystalmark.willfinder.page.components.EditWillPanel$EditWillForm$5.onSubmit(EditWillPanel.java:183)
    >>  >>  at
    >>  >>  
    >> org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:94)
    >>  >>  at
    >>  >>  
    >> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:128)
    >>  >>  ---
    >>  >>
    >>  >>  It's only when using the getModelObject method.  If I get the Will
    >>  >> object
    >>  >>  from else-where it works fine.
    >>  >>
    >>  >>  Is this a problem with the way I'm using the model or a bug with
    >>  >>  AjaxSubmitLink?  Should I add it to jira?
    >>  >>
    >>  >>  Wicket 1.3.3 + JDK 1.6 + Tomcat 6
    >>  >>
    >>  >>  Thanks,
    >>  >>  Tim
    >>  >>  ---
    >>  >>  http://www.tnwdb.com - Wicket Wills!
    >>  >>
    >>  >>
    >>  >>  -
    >>  >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
    >>  >>  For additional commands, e-mail: [EMAIL PROTECTED]
    >>  >>
    >>  >>
    >>  >
    >>  > --

    Re: AjaxSubmitLink accessing model object non-existent property

    2008-04-07 Thread Igor Vaynberg
    no, components do not randomly pick up models from their parents. i
    would suggest reading the models wiki page.
    
    -igor
    
    
    On Mon, Apr 7, 2008 at 3:11 PM, Tim <[EMAIL PROTECTED]> wrote:
    > Thanks Igor but should it not pick-up the model from the Form?  There's no
    >  constructor that takes a model.  Should the AjaxSubmitLink(id, form)
    >  constructor be used with the Form that it's being added to?  e..g
    >
    >  MyForm extends Form {
    >  public MyForm(){
    >  
    >  add( new AjaxSubmitLink("mylink",this){
    >  
    >  });
    >  }}
    >
    >  If it's already bound to a Form, should it not pick-up the model used by
    >  the form?
    >
    >  Am I looking at the problem/solution the wrong way???
    >
    >  Thanks again,
    >  Tim
    >
    >
    >
    >  > you forgot to give ajaxsubmitlink a model, so getmodelobject() will
    >  > either return null or a compound model.confirm - neither of which i
    >  > think you want.
    >  >
    >  > -igor
    >  >
    >  >
    >  > On Mon, Apr 7, 2008 at 1:00 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    >  >> Hi,
    >  >>
    >  >>  When adding an AjaxSubmitLink, the onSubmit method tries to access a
    >  >>  property of the model object that does not exists:
    >  >>
    >  >>  ---
    >  >> final AjaxSubmitLink confirmLink = new
    >  >>  AjaxSubmitLink("confirm") {
    >  >> @Override
    >  >> public void onSubmit(final AjaxRequestTarget target,
    >  >> final Form form) {
    >  >> if (((Will) getModelObject()).getExecutor() != null)
    >  >> {
    >  >> willModalWindow.show(target);
    >  >> } else {
    >  >> warn("Please choose an executor.");
    >  >> target.addComponent(feedback);
    >  >> }
    >  >> }
    >  >>
    >  >> @Override
    >  >> public void onError(final AjaxRequestTarget target,
    >  >> final Form form) {
    >  >> target.addComponent(feedback);
    >  >> }
    >  >> };
    >  >>
    >  >> add(confirmLink);
    >  >>  ---
    >  >>
    >  >>  It tries to access the "confirm" property of the Model, in this case a
    >  >>  Will object.
    >  >>
    >  >>  ---
    >  >>  org.apache.wicket.WicketRuntimeException: No get method defined for
    >  >> class:
    >  >>  class crystalmark.willfinder.model.Will expression: confirm
    >  >>  at
    >  >>  
    > org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
    >  >>  at
    >  >>  
    > org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
    >  >>  at
    >  >>  
    > org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
    >  >>  at
    >  >>  
    > org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
    >  >>  at org.apache.wicket.Component.getModelObject(Component.java:1551)
    >  >>  at
    >  >>  
    > crystalmark.willfinder.page.components.EditWillPanel$EditWillForm$5.onSubmit(EditWillPanel.java:183)
    >  >>  at
    >  >>  
    > org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:94)
    >  >>  at
    >  >>  
    > org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:128)
    >  >>  ---
    >  >>
    >  >>  It's only when using the getModelObject method.  If I get the Will
    >  >> object
    >  >>  from else-where it works fine.
    >  >>
    >  >>  Is this a problem with the way I'm using the model or a bug with
    >  >>  AjaxSubmitLink?  Should I add it to jira?
    >  >>
    >  >>  Wicket 1.3.3 + JDK 1.6 + Tomcat 6
    >  >>
    >  >>  Thanks,
    >  >>  Tim
    >  >>  ---
    >  >>  http://www.tnwdb.com - Wicket Wills!
    >  >>
    >  >>
    >  >>  -
    >  >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
    >  >>  For additional commands, e-mail: [EMAIL PROTECTED]
    >  >>
    >  >>
    >  >
    >  > -
    >  > To unsubscribe, e-mail: [EMAIL PROTECTED]
    >  > For additional commands, e-mail: [EMAIL PROTECTED]
    >  >
    >  >
    >
    >
    >
    >  -
    >  To unsubscribe, e-mail: [EMAIL PROTECTED]
    >  For additional commands, e-mail: [EMAIL PROTECTED]
    >
    >
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink accessing model object non-existent property

    2008-04-07 Thread Tim
    Thanks Igor but should it not pick-up the model from the Form?  There's no
    constructor that takes a model.  Should the AjaxSubmitLink(id, form)
    constructor be used with the Form that it's being added to?  e..g
    
    MyForm extends Form {
    public MyForm(){
    
    add( new AjaxSubmitLink("mylink",this){
    
    });
    }}
    
    If it's already bound to a Form, should it not pick-up the model used by
    the form?
    
    Am I looking at the problem/solution the wrong way???
    
    Thanks again,
    Tim
    
    > you forgot to give ajaxsubmitlink a model, so getmodelobject() will
    > either return null or a compound model.confirm - neither of which i
    > think you want.
    >
    > -igor
    >
    >
    > On Mon, Apr 7, 2008 at 1:00 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    >> Hi,
    >>
    >>  When adding an AjaxSubmitLink, the onSubmit method tries to access a
    >>  property of the model object that does not exists:
    >>
    >>  ---
    >> final AjaxSubmitLink confirmLink = new
    >>  AjaxSubmitLink("confirm") {
    >> @Override
    >> public void onSubmit(final AjaxRequestTarget target,
    >> final Form form) {
    >> if (((Will) getModelObject()).getExecutor() != null)
    >> {
    >> willModalWindow.show(target);
    >> } else {
    >> warn("Please choose an executor.");
    >> target.addComponent(feedback);
    >> }
    >> }
    >>
    >> @Override
    >> public void onError(final AjaxRequestTarget target,
    >> final Form form) {
    >> target.addComponent(feedback);
    >> }
    >> };
    >>
    >> add(confirmLink);
    >>  ---
    >>
    >>  It tries to access the "confirm" property of the Model, in this case a
    >>  Will object.
    >>
    >>  ---
    >>  org.apache.wicket.WicketRuntimeException: No get method defined for
    >> class:
    >>  class crystalmark.willfinder.model.Will expression: confirm
    >>  at
    >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
    >>  at
    >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
    >>  at
    >>  
    >> org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
    >>  at
    >>  
    >> org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
    >>  at org.apache.wicket.Component.getModelObject(Component.java:1551)
    >>  at
    >>  
    >> crystalmark.willfinder.page.components.EditWillPanel$EditWillForm$5.onSubmit(EditWillPanel.java:183)
    >>  at
    >>  
    >> org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:94)
    >>  at
    >>  
    >> org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:128)
    >>  ---
    >>
    >>  It's only when using the getModelObject method.  If I get the Will
    >> object
    >>  from else-where it works fine.
    >>
    >>  Is this a problem with the way I'm using the model or a bug with
    >>  AjaxSubmitLink?  Should I add it to jira?
    >>
    >>  Wicket 1.3.3 + JDK 1.6 + Tomcat 6
    >>
    >>  Thanks,
    >>  Tim
    >>  ---
    >>  http://www.tnwdb.com - Wicket Wills!
    >>
    >>
    >>  -
    >>  To unsubscribe, e-mail: [EMAIL PROTECTED]
    >>  For additional commands, e-mail: [EMAIL PROTECTED]
    >>
    >>
    >
    > -
    > To unsubscribe, e-mail: [EMAIL PROTECTED]
    > For additional commands, e-mail: [EMAIL PROTECTED]
    >
    >
    
    
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink accessing model object non-existent property

    2008-04-07 Thread Igor Vaynberg
    you forgot to give ajaxsubmitlink a model, so getmodelobject() will
    either return null or a compound model.confirm - neither of which i
    think you want.
    
    -igor
    
    
    On Mon, Apr 7, 2008 at 1:00 PM, Tim Squires <[EMAIL PROTECTED]> wrote:
    > Hi,
    >
    >  When adding an AjaxSubmitLink, the onSubmit method tries to access a
    >  property of the model object that does not exists:
    >
    >  ---
    > final AjaxSubmitLink confirmLink = new
    >  AjaxSubmitLink("confirm") {
    > @Override
    > public void onSubmit(final AjaxRequestTarget target,
    > final Form form) {
    > if (((Will) getModelObject()).getExecutor() != null) {
    > willModalWindow.show(target);
    > } else {
    > warn("Please choose an executor.");
    > target.addComponent(feedback);
    > }
    > }
    >
    > @Override
    > public void onError(final AjaxRequestTarget target,
    > final Form form) {
    > target.addComponent(feedback);
    > }
    > };
    >
    > add(confirmLink);
    >  ---
    >
    >  It tries to access the "confirm" property of the Model, in this case a
    >  Will object.
    >
    >  ---
    >  org.apache.wicket.WicketRuntimeException: No get method defined for class:
    >  class crystalmark.willfinder.model.Will expression: confirm
    >  at
    >  
    > org.apache.wicket.util.lang.PropertyResolver.getGetAndSetter(PropertyResolver.java:433)
    >  at
    >  
    > org.apache.wicket.util.lang.PropertyResolver.getObjectAndGetSetter(PropertyResolver.java:275)
    >  at
    >  
    > org.apache.wicket.util.lang.PropertyResolver.getValue(PropertyResolver.java:84)
    >  at
    >  
    > org.apache.wicket.model.AbstractPropertyModel.getObject(AbstractPropertyModel.java:113)
    >  at org.apache.wicket.Component.getModelObject(Component.java:1551)
    >  at
    >  
    > crystalmark.willfinder.page.components.EditWillPanel$EditWillForm$5.onSubmit(EditWillPanel.java:183)
    >  at
    >  
    > org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink$1.onSubmit(AjaxSubmitLink.java:94)
    >  at
    >  
    > org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:128)
    >  ---
    >
    >  It's only when using the getModelObject method.  If I get the Will object
    >  from else-where it works fine.
    >
    >  Is this a problem with the way I'm using the model or a bug with
    >  AjaxSubmitLink?  Should I add it to jira?
    >
    >  Wicket 1.3.3 + JDK 1.6 + Tomcat 6
    >
    >  Thanks,
    >  Tim
    >  ---
    >  http://www.tnwdb.com - Wicket Wills!
    >
    >
    >  -
    >  To unsubscribe, e-mail: [EMAIL PROTECTED]
    >  For additional commands, e-mail: [EMAIL PROTECTED]
    >
    >
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]
    
    
    

    Re: AjaxSubmitLink does nothing in IE

    2007-09-10 Thread Matej Knopp
    Hi, there are some problems with your AjaxCallDecorator. You replace
    the button conponent, so this.onclick_ doesn't really point anywhere
    in onsuccess handler. Also there is a typo. I suggest using something
    like this:
    
    protected IAjaxCallDecorator getAjaxCallDecorator() {
    return new IAjaxCallDecorator() {
    public CharSequence decorateScript(CharSequence script) {
    return "this.onclick_=this.onclick;
    this.onclick=function() { return false; };" + script;
    }
    public CharSequence
    decorateOnSuccessScript(CharSequence script) {
    return "if (typeof(this.onclick_) !=
    'undefined') this.onclick=this.onclick_;" + script;
    }
    public CharSequence
    decorateOnFailureScript(CharSequence script) {
    return "if (typeof(this.onclick_) != 'undefined')
    this.onclick=this.onclick_;" + script;
    }
    };
    }
    
    With this code, I get no problem with IE (neither 6 or 7) and the
    quickstart works well.
    
    -Matej
    
    On 9/10/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
    > The quickstart (http://www.transcendenz.co.uk/quickstart.zip) that I built
    > works fine in IE so that's not it.
    > However I noticed the following in the Ajax Debug window :
    >
    > There seem to be 2 references to component id=feedback8
    >
    > .
    > INFO: Invoking pre-call handler(s)...
    > INFO: Received ajax response (8138 characters)
    > INFO:
    > 
    > 
    >
    > and then again after a header-contribution chunk in the form chunk which
    > encloses most of the code (it's a medium sized form so lots of
    > label/field/feedback chunks). Feedback8 happens to be the general
    > feedbaclPanel which shows errors occuring during submission.
    >
    > 

    Re: AjaxSubmitLink does nothing in IE

    2007-09-10 Thread Anthony J Webster
    The quickstart (http://www.transcendenz.co.uk/quickstart.zip) that I built 
    works fine in IE so that's not it.
    
    However I noticed the following in the Ajax Debug window :
    
    There seem to be 2 references to component id=feedback8
    
    .
    INFO: Invoking pre-call handler(s)...
    INFO: Received ajax response (8138 characters)
    INFO:
    
       
    
    and then again after a header-contribution chunk in the form chunk which 
    encloses most of the code (it's a medium sized form so lots of 
    label/field/feedback chunks). Feedback8 happens to be the general 
    feedbaclPanel which shows errors occuring during submission.
    
    
    

    Re: AjaxSubmitLink does nothing in IE

    2007-09-07 Thread Igor Vaynberg
    On 9/7/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
    >
    > That works fine. Thanks
    > However I've just noticed that this AjaxSubmitLink doesn't do anything in
    > IE
    > whereas in Firefox it works.
    > I check the Ajax debug window and the server *is* contacted and everything
    > however after recieving the response I get an "ERROR: Error while parsing
    > response: Unknown runtime error" in IE.
    >
    > Any Ideas?
    
    
    well clearly according to the message there is an unknown error!
    
    -igor
    
    
    
    Many Thanks
    >
    > Anthony
    >
    > - Original Message -
    > From: "Matej Knopp" <[EMAIL PROTECTED]>
    > To: 
    > Sent: Thursday, September 06, 2007 11:35 PM
    > Subject: Re: Creating a disableable AjaxSubmitLink
    >
    >
    > > Something like the following should work:
    > >
    > > decorateScript:
    > > "this.onclick_=this.onclick; this.onclick=function() { return false;
    > > };" + script;
    > >
    > > onSuccess,onFailureScript:
    > > this.onclick=this.onclick_; + script;
    > >
    > > -Matej
    > >
    > > On 9/6/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
    > >> Hi,
    > >>
    > >> I'm trying to create a disableable AjaxSubmitLink. When a user clicks
    > on
    > >> the link further clicks must not result in anything until the
    > >> 'submission' is complete. This call be achieved by adding "return
    > false;"
    > >> in a call decorator. However I'm stuggling with the re-enabling. I need
    > >> to strip the "return false" and put the original destination back.
    > >>
    > >> form.add(new AjaxSubmitLink("randomise", form) {
    > >>
    > >> protected void onSubmit(AjaxRequestTarget target, Form
    > form)
    > >> {
    > >>somethingLong();
    > >> }
    > >> protected IAjaxCallDecorator getAjaxCallDecorator() {
    > >> return new AjaxCallDecorator() {
    > >>
    > >> public CharSequence decorateScript(CharSequence
    > >> script) {
    > >> return "return false;" + script;
    > >> }
    > >> public CharSequence
    > >> decorateOnSuccessScript(CharSequence script) {
    > >> // NEED TO RESET TO PREVIOUS STATE
    > >> }
    > >> public CharSequence
    > >> decorateOnFailureScript(CharSequence script) {
    > >> // NEED TO RESET TO PREVIOUS STATE
    > >> }
    > >> };
    > >> }
    > >> });
    > >>
    > >> Any help would be most appreciated.
    > >>
    > >> Thanks in advance
    > >>
    > >> Anthony
    > >
    > > -
    > > To unsubscribe, e-mail: [EMAIL PROTECTED]
    > > For additional commands, e-mail: [EMAIL PROTECTED]
    > >
    > >
    >
    >
    >
    > -
    > To unsubscribe, e-mail: [EMAIL PROTECTED]
    > For additional commands, e-mail: [EMAIL PROTECTED]
    >
    >
    
    

    Re: AjaxSubmitLink does nothing in IE

    2007-09-07 Thread Matej Knopp
    Could be related to markup, or parsing the response. Jira issue and
    quickstart would help here.
    
    -Matej
    
    On 9/7/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
    > That works fine. Thanks
    > However I've just noticed that this AjaxSubmitLink doesn't do anything in IE
    > whereas in Firefox it works.
    > I check the Ajax debug window and the server *is* contacted and everything
    > however after recieving the response I get an "ERROR: Error while parsing
    > response: Unknown runtime error" in IE.
    >
    > Any Ideas?
    >
    > Many Thanks
    >
    > Anthony
    >
    > - Original Message -
    > From: "Matej Knopp" <[EMAIL PROTECTED]>
    > To: 
    > Sent: Thursday, September 06, 2007 11:35 PM
    > Subject: Re: Creating a disableable AjaxSubmitLink
    >
    >
    > > Something like the following should work:
    > >
    > > decorateScript:
    > > "this.onclick_=this.onclick; this.onclick=function() { return false;
    > > };" + script;
    > >
    > > onSuccess,onFailureScript:
    > > this.onclick=this.onclick_; + script;
    > >
    > > -Matej
    > >
    > > On 9/6/07, Anthony J Webster <[EMAIL PROTECTED]> wrote:
    > >> Hi,
    > >>
    > >> I'm trying to create a disableable AjaxSubmitLink. When a user clicks on
    > >> the link further clicks must not result in anything until the
    > >> 'submission' is complete. This call be achieved by adding "return false;"
    > >> in a call decorator. However I'm stuggling with the re-enabling. I need
    > >> to strip the "return false" and put the original destination back.
    > >>
    > >> form.add(new AjaxSubmitLink("randomise", form) {
    > >>
    > >> protected void onSubmit(AjaxRequestTarget target, Form form)
    > >> {
    > >>somethingLong();
    > >> }
    > >> protected IAjaxCallDecorator getAjaxCallDecorator() {
    > >> return new AjaxCallDecorator() {
    > >>
    > >> public CharSequence decorateScript(CharSequence
    > >> script) {
    > >> return "return false;" + script;
    > >> }
    > >> public CharSequence
    > >> decorateOnSuccessScript(CharSequence script) {
    > >> // NEED TO RESET TO PREVIOUS STATE
    > >> }
    > >> public CharSequence
    > >> decorateOnFailureScript(CharSequence script) {
    > >> // NEED TO RESET TO PREVIOUS STATE
    > >> }
    > >> };
    > >> }
    > >> });
    > >>
    > >> Any help would be most appreciated.
    > >>
    > >> Thanks in advance
    > >>
    > >> Anthony
    > >
    > > -
    > > To unsubscribe, e-mail: [EMAIL PROTECTED]
    > > For additional commands, e-mail: [EMAIL PROTECTED]
    > >
    > >
    >
    >
    >
    > -
    > To unsubscribe, e-mail: [EMAIL PROTECTED]
    > For additional commands, e-mail: [EMAIL PROTECTED]
    >
    >
    
    -
    To unsubscribe, e-mail: [EMAIL PROTECTED]
    For additional commands, e-mail: [EMAIL PROTECTED]