Add items and then submit a form
Hi, I'm creating a page with a form. The form asks for personal information and also for information to add some items. For example General information Name: ___ Lastname: ___ Item information Item number: ___ Item description: __ Add item (button) Item number | Description 1 | something 2 | a thing Save (button) I tryed with nested forms but when I click on Add item validations on Name and LastName stop the submit. I thought on an ajax solution but i don't know how to do it. I mean, I need validations of general information and validations of item information. Could you give an idea of how to do something like this? I think it could be a standard problem. Thanks in advance. Tito
Re: Add items and then submit a form
Hi, nested form should work fine. I mean something like this: _ | main form | Name:.. | Lastname:... | | | | item (inner) form | | item number:... | | item number:... | | Add item button | |__ | | save button |___ Do you have this forms layout? 'Add item button' must be added to 'item form' and only to this form. Hi, I'm creating a page with a form. The form asks for personal information and also for information to add some items. For example General information Name: ___ Lastname: ___ Item information Item number: ___ Item description: __ Add item (button) Item number | Description 1 | something 2 | a thing Save (button) I tryed with nested forms but when I click on Add item validations on Name and LastName stop the submit. I thought on an ajax solution but i don't know how to do it. I mean, I need validations of general information and validations of item information. Could you give an idea of how to do something like this? I think it could be a standard problem. Thanks in advance. Tito - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: unit testing cookies after redirect
Hi, Have you verified that the cookie value is correct? In Cookie javadocs [1] it reads: With Version 0 cookies, values should not contain white space, brackets, parentheses, equals signs, commas, double quotes, slashes, question marks, at signs, colons, and semicolons. Empty values may not behave the same way on all browsers. I've had a similar issue to yours and it turned out that the value I was setting contained a semicolon, so setting the cookie always failed silently. best, Piotr [1] http://docs.oracle.com/javaee/6/api/javax/servlet/http/Cookie.html#setValue(java.lang.String) http://docs.oracle.com/javaee/6/api/javax/servlet/http/Cookie.html#setValue(java.lang.String) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/unit-testing-cookies-after-redirect-tp3995764p4214036.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: Add items and then submit a form
Yes, I have this layout. Is the first I tested. The problem with this is that when I click Add Item buttom information is not submitted because general validations stops it. I mean, if I don't complete name field i can't add items. It seems like inner form submit is submitting outer form. Thanks! On Mon, Dec 19, 2011 at 10:16 AM, Andrea Del Bene adelb...@ciseonweb.itwrote: Hi, nested form should work fine. I mean something like this: _ | main form | Name:.. | Lastname:... | | | | item (inner) form | | item number:... | | item number:... | | Add item button | |__ | | save button |___ Do you have this forms layout? 'Add item button' must be added to 'item form' and only to this form. Hi, I'm creating a page with a form. The form asks for personal information and also for information to add some items. For example General information Name: ___ Lastname: ___ Item information Item number: ___ Item description: __ Add item (button) Item number | Description 1 | something 2 | a thing Save (button) I tryed with nested forms but when I click on Add item validations on Name and LastName stop the submit. I thought on an ajax solution but i don't know how to do it. I mean, I need validations of general information and validations of item information. Could you give an idea of how to do something like this? I think it could be a standard problem. Thanks in advance. Tito --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Add items and then submit a form
This is strange end should not happened: https://cwiki.apache.org/WICKET/nested-forms.html. Maybe the problem is on code side. Can you show the initialization code for the two forms? Yes, I have this layout. Is the first I tested. The problem with this is that when I click Add Item buttom information is not submitted because general validations stops it. I mean, if I don't complete name field i can't add items. It seems like inner form submit is submitting outer form. Thanks! On Mon, Dec 19, 2011 at 10:16 AM, Andrea Del Beneadelb...@ciseonweb.itwrote: Hi, nested form should work fine. I mean something like this: _ |main form | Name:.. | Lastname:... | | | |item (inner) form | | item number:... | | item number:... | |Add item button | |__ | |save button |___ Do you have this forms layout? 'Add item button' must be added to 'item form' and only to this form. Hi, I'm creating a page with a form. The form asks for personal information and also for information to add some items. For example General information Name: ___ Lastname: ___ Item information Item number: ___ Item description: __ Add item (button) Item number | Description 1 | something 2 | a thing Save (button) I tryed with nested forms but when I click on Add item validations on Name and LastName stop the submit. I thought on an ajax solution but i don't know how to do it. I mean, I need validations of general information and validations of item information. Could you give an idea of how to do something like this? I think it could be a standard problem. Thanks in advance. Tito --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-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: reloading a component with ajax submit button
Hi, I know it's off topic but I didn't want to create a separate topic for a simple question. I've got an error on production server and I cannot reproduce on my development machine. The error says : woUploadFilesContainer:calculateButton (path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible org.apache.wicket.WicketRuntimeException: Submit Button stepTwoUploadFilesContainer:calculateButton (path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible Which can be the cause? The submit button is never hidden, but the container that holds it. Here is the button code: calculateButton = new CalculateButton(calculateButton, /wos/stepTwoUploadFiles/calculate); calculateButton.setDefaultFormProcessing(false); add(calculateButton); I suppose that this is the code where it enters from Form class from wicket sources : if (!component.isVisibleInHierarchy()) { throw new WicketRuntimeException(Submit Button + submittingComponent.getInputName() + (path= + component.getPageRelativePath() + ) is not visible); } Has anyone any idea? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/reloading-a-component-with-ajax-submit-button-tp1871126p4214331.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: Cannot reproduce a WicketRuntimeException.
Hi, I know it's off topic but I didn't want to create a separate topic for a simple question. I've got an error on production server and I cannot reproduce on my development machine. The error says : woUploadFilesContainer:calculateButton (path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible org.apache.wicket.WicketRuntimeException: Submit Button stepTwoUploadFilesContainer:calculateButton (path=inputForm:stepTwoUploadFilesContainer:calculateButton) is not visible Which can be the cause? The submit button is never hidden, but the container that holds it. Here is the button code: calculateButton = new CalculateButton(calculateButton, /wos/stepTwoUploadFiles/calculate); calculateButton.setDefaultFormProcessing(false); add(calculateButton); I suppose that this is the code where it enters from Form class from wicket sources : if (!component.isVisibleInHierarchy()) { throw new WicketRuntimeException(Submit Button + submittingComponent.getInputName() + (path= + component.getPageRelativePath() + ) is not visible); } Has anyone any idea? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cannot-reproduce-a-WicketRuntimeException-tp4185488p4214363.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: Add items and then submit a form
Here I have something like a QuickStart. In this reduced example I can verify this behavior. I checked that link but it seems to work different. In this case both submit button do the same. I'm using wicket 1.4.19. package com.keepcon.web.administration.users; import java.util.ArrayList; import java.util.Collection; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.RequiredTextField; import org.apache.wicket.markup.html.panel.FeedbackPanel; import org.apache.wicket.model.AbstractReadOnlyModel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.model.PropertyModel; public class NestedForms extends WebPage { @SuppressWarnings(unused) private String name; private final CollectionString values = new ArrayListString(); public NestedForms() { FormVoid outerForm = new FormVoid(outerForm); PropertyModelString nameModel = new PropertyModelString(this, name); outerForm.add(new RequiredTextFieldString(name, nameModel)); final IModelString valueModel = new ModelString(); FormVoid innerForm = new FormVoid(innerForm) { @Override protected void onSubmit() { values.add(valueModel.getObject()); valueModel.setObject(); } }; innerForm.add(new RequiredTextFieldString(value, valueModel)); outerForm.add(innerForm); outerForm.add(new Label(values, new AbstractReadOnlyModelString() { @Override public String getObject() { return NestedForms.this.values.toString(); } })); outerForm.add(new Label(nameSubmitted, nameModel)); add(outerForm); add(new FeedbackPanel(feedback)); } } !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd head/head body div wicket:id=feedback/div form wicket:id=outerForm table tr tdName:/td tdinput type=text wicket:id=name //td /tr /table form wicket:id=innerForm table tr tdValue:/td tdinput type=text wicket:id=value //td /tr tr tdinput type=submit value=Add //td td/td /tr /table /form table tr tdinput type=submit value=Save //td td/td /tr tr tdDatos subidos:/td td/td /tr tr tdName:/td tdspan wicket:id=nameSubmitted/span/td /tr tr tdValues:/td tdspan wicket:id=values/span/td /tr /table /form /body /html On Mon, Dec 19, 2011 at 11:10 AM, Andrea Del Bene adelb...@ciseonweb.itwrote: This is strange end should not happened: https://cwiki.apache.org/** WICKET/nested-forms.htmlhttps://cwiki.apache.org/WICKET/nested-forms.html. Maybe the problem is on code side. Can you show the initialization code for the two forms? Yes, I have this layout. Is the first I tested. The problem with this is that when I click Add Item buttom information is not submitted because general validations stops it. I mean, if I don't complete name field i can't add items. It seems like inner form submit is submitting outer form. Thanks! On Mon, Dec 19, 2011 at 10:16 AM, Andrea Del Beneadelb...@ciseonweb.it* *wrote: Hi, nested form should work fine. I mean something like this: _ |main form | Name:.. | Lastname:... | | | |item (inner) form | | item number:... | | item number:... | |Add item button | |__ | |save button |___ Do you have this forms layout? 'Add item button' must be added to 'item form' and only to this form. Hi, I'm creating a page with a form. The form asks for personal information and also for information to add some items. For example General information Name: ___ Lastname: ___ Item information Item number: ___ Item description: __ Add item (button) Item number | Description 1 | something 2 | a thing Save (button) I tryed with nested forms but when I click on Add item validations on Name and LastName stop the submit. I thought on an ajax solution but i don't know how to do it. I mean, I need validations of general information and validations of item information. Could you give an idea of how to do something like this? I think it could be a standard problem. Thanks in advance. Tito --** --**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apa**che.orghttp://apache.org users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
About making EJB's working in AuthenticatedWebSession.
Hello everyone, How could I make an @EJB working in an (Extend of) AuthenticatedWebSession? Somehow they keep staying null, while the EJB's just work in my webpages ( who are extended from WebPage ). Thanks in advance, Rick
Re: About making EJB's working in AuthenticatedWebSession.
In Wicket 1.5.3 only Components and Behaviors are auto injected. For everything else you need to call Innjector.get().inject(this) in the constructor. On Mon, Dec 19, 2011 at 6:32 PM, Rick van Son rick.van@foreyet.com wrote: Hello everyone, How could I make an @EJB working in an (Extend of) AuthenticatedWebSession? Somehow they keep staying null, while the EJB's just work in my webpages ( who are extended from WebPage ). Thanks in advance, Rick -- 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: Add items and then submit a form
I think this happens because you submit your forms with a simple HTML submit button, not mapped to a Wicket component. Try to explicitly add a submit component to the forms. I've added SubmitLink to both forms and forms are submitted as expected. HTML code: form wicket:id=form1 form wicket:id=form2 input type=submit value=form2 wicket:id=submit2/ /form input type=submit value=form1 (outer) wicket:id=submit1/ /form Java code: Form form1; add(form1 = new Form(form1){ @Override protected void onSubmit() { super.onSubmit(); System.out.println(form1); } }); form1.add(new SubmitLink(submit1)); Form form2; form1.add(form2 =new Form(form2){ @Override protected void onSubmit() { super.onSubmit(); System.out.println(form2); } }); form2.add(new SubmitLink(submit2)); Here I have something like a QuickStart. In this reduced example I can verify this behavior. I checked that link but it seems to work different. In this case both submit button do the same. I'm using wicket 1.4.19. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Add items and then submit a form
I think you are right. Using an AjaxButton it works a litle more like I want. Nevertheless I still have a problem, because outer form submits inner form. In my case I think that I need two separated forms, but the problem is how to put add button y save button in the correct place. I mean, the layout is what you mentioned but the behavior is more like two separated forms. Thank you! On Mon, Dec 19, 2011 at 2:04 PM, Andrea Del Bene adelb...@ciseonweb.itwrote: I think this happens because you submit your forms with a simple HTML submit button, not mapped to a Wicket component. Try to explicitly add a submit component to the forms. I've added SubmitLink to both forms and forms are submitted as expected. HTML code: form wicket:id=form1 form wicket:id=form2 input type=submit value=form2 wicket:id=submit2/ /form input type=submit value=form1 (outer) wicket:id=submit1/ /form Java code: Form form1; add(form1 = new Form(form1){ @Override protected void onSubmit() { super.onSubmit(); System.out.println(form1); } }); form1.add(new SubmitLink(submit1)); Form form2; form1.add(form2 =new Form(form2){ @Override protected void onSubmit() { super.onSubmit(); System.out.println(form2); } }); form2.add(new SubmitLink(submit2)); Here I have something like a QuickStart. In this reduced example I can verify this behavior. I checked that link but it seems to work different. In this case both submit button do the same. I'm using wicket 1.4.19. --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
freezing applications
Hello, our application is one page and everything is done by ajax. And tester says that when he comes from lunch all buttons are dead. Nothing happen when he clicks on links or buttons. I can't reproduce this behavior because on my machine I always get pageExpiredException (what is required). Is it possible to have dead wicket ajax components when server is running? We are running on Wicket 1.4.18. Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: freezing applications
Do you have a security filter? I think may be you have the session expired and ajax requests don't get wicket filter. On Mon, Dec 19, 2011 at 3:33 PM, danisevsky danisev...@gmail.com wrote: Hello, our application is one page and everything is done by ajax. And tester says that when he comes from lunch all buttons are dead. Nothing happen when he clicks on links or buttons. I can't reproduce this behavior because on my machine I always get pageExpiredException (what is required). Is it possible to have dead wicket ajax components when server is running? We are running on Wicket 1.4.18. Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
ModalWindow does not close cleanly
I found that if you have a modal window, and then you close it, it is not possible to reopen it anymore unless you have set a WindowClosedCallback. This is because WindowClosedBehavior.render() does not get called. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: ModalWindow does not close cleanly
WindowClosedBehavior does not have render()...? -igor On Mon, Dec 19, 2011 at 11:40 AM, Nelson Segura nsegu...@gmail.com wrote: I found that if you have a modal window, and then you close it, it is not possible to reopen it anymore unless you have set a WindowClosedCallback. This is because WindowClosedBehavior.render() does not get called. - 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: ModalWindow does not close cleanly
Sorry, I meant respond() ... On Mon, Dec 19, 2011 at 11:46 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: WindowClosedBehavior does not have render()...? -igor On Mon, Dec 19, 2011 at 11:40 AM, Nelson Segura nsegu...@gmail.com wrote: I found that if you have a modal window, and then you close it, it is not possible to reopen it anymore unless you have set a WindowClosedCallback. This is because WindowClosedBehavior.render() does not get called. - 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: About making EJB's working in AuthenticatedWebSession.
It worked like a charm. Thanks for the help Martin. 2011/12/19 Martin Grigorov In Wicket 1.5.3 only Components and Behaviors are auto injected. For everything else you need to call Innjector.get().inject(this) in the constructor. On Mon, Dec 19, 2011 at 6:32 PM, Rick van Son rick.van@foreyet.com wrote: Hello everyone, How could I make an @EJB working in an (Extend of) AuthenticatedWebSession? Somehow they keep staying null, while the EJB's just work in my webpages ( who are extended from WebPage ). Thanks in advance, Rick -- 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: ModalWindow does not close cleanly
i took the window closed callback out of the ModalWindowPage in wicket-examples and was able to close and reopen the modal...please create a quickstart and attach it to a jira issue. -igor On Mon, Dec 19, 2011 at 12:39 PM, Nelson Segura nsegu...@gmail.com wrote: Sorry, I meant respond() ... On Mon, Dec 19, 2011 at 11:46 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote: WindowClosedBehavior does not have render()...? -igor On Mon, Dec 19, 2011 at 11:40 AM, Nelson Segura nsegu...@gmail.com wrote: I found that if you have a modal window, and then you close it, it is not possible to reopen it anymore unless you have set a WindowClosedCallback. This is because WindowClosedBehavior.render() does not get called. - 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
AjaxFormComponentUpdatingBehavior, required fields and validation
Hi, I have form with few TextField and DropDownChoice components. All of them have added AjaxFormComponentUpdatingBehavior( onkeyup ) and are set as required. Some of them are wrapped in my custom objects, but it does not matter (validation and processing logic is in behavior). With this setup after every ajax update triggered with behaviour's onUpdate( AjaxRequestTarget ) or onError( AjaxRequestTarget ) I try to check if form components are valid and give instant feedback to user. Unfortunately results obtained from component's isValid() are wrong. Empty TextFields are almost always valid. Only after clearing TextField error is added to component, but after changing for example other TextField to whatever value (and thus triggering next validation check) isValid() on blank, required TextField returns true. Is this approach incorrect or am I missing something? Best regards, Michal Wegrzyn
Getting url for a page
Hi folks, On wicket 1.5.1 I have a page that calls a JSON service url in different package. For simplicity let's just say, Page resides in page package and services reside in services package. Layout is something as follows page: Page sercices: ServiceA ServiceB Page calls get urlFor for ServiceA. This works fine. ServiceA calls for urlFor ServiceB to include dynamic list of images and sets appropriate request parameters. In this case urlFor for serviceB returns the url relative to serviceA - which are in same package. However caller is in different package and breaks the link. In short I need either absolute url or url relative to Page in above scenario. How do I achieve this? Thanks, Niranjan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Getting url for a page
Hi Niranjan, Url url = RequestCycle.get().mapUrlFor(pageClass, parameters); String fullurl = RequestCycle.get().getUrlRenderer().renderFullUrl(url); François Le 20 déc. 2011 à 03:52, Niranjan Rao a écrit : Hi folks, On wicket 1.5.1 I have a page that calls a JSON service url in different package. For simplicity let's just say, Page resides in page package and services reside in services package. Layout is something as follows page: Page sercices: ServiceA ServiceB Page calls get urlFor for ServiceA. This works fine. ServiceA calls for urlFor ServiceB to include dynamic list of images and sets appropriate request parameters. In this case urlFor for serviceB returns the url relative to serviceA - which are in same package. However caller is in different package and breaks the link. In short I need either absolute url or url relative to Page in above scenario. How do I achieve this? Thanks, Niranjan - 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