Using the getForm().add(...) solves my problems and I have been able to get really nice small and clean sub-classes that just have a few components working in them.
The Feedback panel, save and cancel buttons along with the form and some default formatting are supplied in the parent class, then each sub-class can add its specific fields to edit by adding them to the parent form (via a getForm()) method instead of the subclass page. Works great. On Tue, Mar 23, 2010 at 1:07 AM, Jeremy Thomerson <jer...@wickettraining.com > wrote: > Martijn, they would still be in the form tag when rendered - see the > placement of the wicket:child tag. > > However, I think Igor is right - the transparent resolver may not work on a > form. I haven't used it for that, so I couldn't tell you. > > What it really boils down to is that you need the subclasses to add their > components to the form. You can either do it as I described in the first > post (getForm().add(...)). Or you may come up with some other way. Let us > know how it goes. > > -- > Jeremy Thomerson > http://www.wickettraining.com > > > > On Mon, Mar 22, 2010 at 5:12 AM, Martijn Dashorst < > martijn.dasho...@gmail.com> wrote: > > > I concur: the form fields need to be inside the <form> tag, otherwise > > the browser will not send them to the server. > > > > Martijn > > > > On Mon, Mar 22, 2010 at 6:00 AM, Igor Vaynberg <igor.vaynb...@gmail.com> > > wrote: > > > dont think that will work. it will work for rendering, but for > > > processing components it wont work because they really need to be > > > descendants of the form. > > > > > > -igor > > > > > > On Sun, Mar 21, 2010 at 7:08 PM, Jeremy Thomerson > > > <jer...@wickettraining.com> wrote: > > >> Sorry, override isTransparentResolver. The set method is only on > > Border. > > >> > > >> -- > > >> Jeremy Thomerson > > >> http://www.wickettraining.com > > >> > > >> > > >> > > >> On Sun, Mar 21, 2010 at 8:00 PM, Steve Mactaggart < > > >> steve.mactagg...@gmail.com> wrote: > > >> > > >>> Excellent, > > >>> > > >>> My simple test now seems to work if I do a getForm(). > > >>> Although I really like the thought of setTransparentResolver(), but > as > > >>> with Josh, I can't find it in 1.4.7.. > > >>> > > >>> I also have this problem with a Border object, I'll have to look into > > >>> seeing if I can get around the same problem by doing a getBorder(). > > >>> > > >>> Steve > > >>> > > >>> On Mon, Mar 22, 2010 at 11:40 AM, Jeremy Thomerson > > >>> <jer...@wickettraining.com> wrote: > > >>> > you need to be adding the components to the form. you're currently > > >>> adding > > >>> > them to the page itself. the component hierarchy is thus broken. > on > > >>> your > > >>> > child page, either do getForm().add(foo) [you'll need to expose a > > getForm > > >>> > method that returns the form from the parent page] or else on your > > parent > > >>> > page (BaseEditPage), setTransparentResolver(true) on the form and > add > > the > > >>> > form children to the page then. > > >>> > > > >>> > -- > > >>> > Jeremy Thomerson > > >>> > http://www.wickettraining.com > > >>> > > > >>> > > > >>> > > > >>> > On Sun, Mar 21, 2010 at 7:35 PM, Steve Mactaggart < > > >>> st...@whitesquaresoft.com > > >>> >> wrote: > > >>> > > > >>> >> Hi all, > > >>> >> > > >>> >> Before I go to far trying to prove I have a bug, I thought i'd > crowd > > >>> >> source an answer. > > >>> >> > > >>> >> We have a lot of "Edit" pages that have a lot of simmilar > structure, > > >>> >> and what I wanted to do is create a BaseEditPage that contains the > > >>> >> form, the save/cancel buttons, some layout stuff and a > > FeedbackPanel, > > >>> >> then extend it into UserEditPage that just adds the fields that > are > > >>> >> editable. > > >>> >> > > >>> >> I can get this working as long as I put all the HTML into the > > >>> >> UserEditPage.html file. > > >>> >> > > >>> >> Lets make this simple. Lets say that BaseEditPage extends > > >>> >> StandardPage, where StandardPage provides a standard header, > footer > > >>> >> and so all we have to worry about in the BaseEditPage is the > > "content" > > >>> >> of the page. > > >>> >> > > >>> >> My BaseEditPage html will look like: > > >>> >> > > >>> >> <wicket:extend> > > >>> >> <form wicket:id="form"> > > >>> >> <div wicket:id="feedback"/> > > >>> >> <wicket:child/> > > >>> >> > > >>> >> <input type="button" wicket:id="save"/> > > >>> >> <input type="button" wicket:id="cancel"/> > > >>> >> </form> > > >>> >> </wicket:extend> > > >>> >> > > >>> >> And the BaseEditPage.java is like: > > >>> >> > > >>> >> public class BaseEditPage extends StandardPage { > > >>> >> > > >>> >> Form form; > > >>> >> SubmitLink saveButton; > > >>> >> SubmitLink cancelButton; > > >>> >> FeedbackPanel feedbackPanel; > > >>> >> > > >>> >> public BaseEditPage() { > > >>> >> super(); > > >>> >> > > >>> >> form = new Form("form"); > > >>> >> > > >>> >> saveButton = new SubmitLink("save"); //onSubmit excluded to keep > > >>> >> example simple. > > >>> >> cancelButton = new SubmitLink("cancel"); > > >>> >> > > >>> >> feedbackPanel = new FeedbackPanel("feedback"); > > >>> >> > > >>> >> add(form); > > >>> >> > > >>> >> form.add(saveButton); > > >>> >> form.add(cancelButton); > > >>> >> form.add(feedbackPanel); > > >>> >> } > > >>> >> } > > >>> >> > > >>> >> Now I create my UserEditPage > > >>> >> > > >>> >> public UserEditPage extends BaseEditPage { > > >>> >> > > >>> >> RequiredTextField username; > > >>> >> > > >>> >> public UserEditPage() { > > >>> >> username = new RequiredTextField<String>("username", new > > >>> >> Model("test-username")); > > >>> >> > > >>> >> add(username); > > >>> >> } > > >>> >> > > >>> >> } > > >>> >> > > >>> >> And create the HTML for the page like: > > >>> >> <wicket:extend> > > >>> >> Username: <input type="text" wicket:id="username"/> > > >>> >> </wicket:extend> > > >>> >> > > >>> >> > > >>> >> When I run this simple example I get a messsage stating: > > >>> >> Unable to find component with id 'username' in [MarkupContainer > > >>> >> [Component id = _extend4]]. > > >>> >> > > >>> >> My guess is this is an issue processing the sub class due to the > > fact > > >>> >> that the <form> tag is still open. > > >>> >> > > >>> >> Is there any way to do this, or is this outside the scope of > Wicket? > > >>> >> > > >>> >> Cheers, > > >>> >> Steve > > >>> >> > > >>> >> > > --------------------------------------------------------------------- > > >>> >> 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 > > > > > > > > > > > > > > -- > > Become a Wicket expert, learn from the best: http://wicketinaction.com > > Apache Wicket 1.4 increases type safety for web applications > > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.4 > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > >