Hi Chris,
Nice to see another person starting to develop with Wicket  :)

There should be no need to utilize hidden field components within Wicket due to its component oriented nature. This is because when you submit the form the request is redirected back to EXACTLY the same component instances that were used to render the form in the first place. Therefore you can just keep any state values that you would normally pass as hidden fields with the components that make up the form. Usually these would be held in the model.

This component oriented approach is where Wicket differs significantly from frameworks like struts. In struts, each request is a standalone thing and a new form object is created for each request and then forwarded to an action class which must determine which objects the form is for. In Wicket the request gets sent to the form components automatically by the framework, which is why Wicket is quicker to develop and requires significantly less code and programmer intervention than frameworks such as struts. Initially the Wicket approach seems very weird to developers used to working with requests and parameters (it took me a while to fully get my head around it), but once you forget about parameters and requests and think components it all becomes much clearer.

This approach also offers significant improvements over using hidden form fields as there is never any need to expose object ids, primary keys and so on in your HTML code because this information is contained within the components that are associated with the form.

I would question what you are trying to do if you need to run code before each request? In Wicket you should be unaware of the request and instead should focus on event listeners and components. If you can give a bit more detail about what you are trying to achieve, then we can perhaps give you fuller details of how you can achieve it with Wicket. (Alternatively it may be something that Wicket doesn't handle yet and in that case we want to know so that we can add the necessary support).

Regards,
Chris


Chris Tuck wrote:


A couple of questions.

How would you implement a hidden field form component in wicket: eg. <input type=hidden/>. I couldn't find this in the examples (although I might have missed it).

Where is the best place to insert code that needs to be run at the start of each request? For example in struts you could extend the ActionServlet class.

Thanks,

Chris






-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Wicket-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/wicket-user





------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Wicket-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to