Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Susan Young
Multi-part interactive form development in Liferay
4. April 2012 13:01
Antwort

Susan Young

Rang: New Member

Nachrichten: 17

Eintrittsdatum: 24. Januar 2012

Neue Beiträge

Hi,

Apologies up front that this is such a broad or basic question but I'm hoping I can get some feedback on a general approach to take to this task, perhaps from someone who has tackled something similar. I'm using Liferay 5.2.3 (with no possibility of upgrading short-term because of an application dependency).

I need to create a multi-part form portlet in Liferay that can be used to collect information about potential use cases for a service portal. The portal is currently in prototype.

Intent is that the user will complete the form in sections, hitting 'next' at the end of each section and that some form selections may result in the creation of other form fields. For example, if the user selects for 4 types of ice cream, the form will dynamically generate a set of form fields that ask them to input the 4 flavors that they would like. If they want 2 types of ice cream, they get 2 input form fields that accept flavor information, etc. I guess you could think of this as a wizard-type interface.

The form field inputs will be saved to a custom table in the Liferay portal database (generated using Servicebuilder) and will also be emailed to an administrator. These actions will only occur when the user hits "submit" once they've completed the entire form.

My questions are:

  • In Liferay 5.2.3 what native technologies or application frameworks would make this task easiest? Should I just use native JSP/Javascript/Struts or JQuery/AJAX/Spring? I guess this is really a question about whether any challenges in integrating a framework like Spring will pay off in terms of accelerating development of this portlet. I have a relatively short time frame to develop it in prototype (couple of weeks).
  • Besides the web portlet, are there any other sample portlets I can draw on for an example of a multi-part form portlet? I'm looking now through the repositories and doc references but if anyone knows of a good example (even for a later version of Liferay), I'd really appreciate any information.


You can't really answer this question, I guess, without knowing my skill set. I've some experience using JSP/Javascript/Struts to build forms, but I don't have a lot of experience building multi-part dynamic forms of this type.

Many thanks,

Susan
Jelmer Kuperus
RE: Multi-part interactive form development in Liferay
4. April 2012 14:53
Antwort

Jelmer Kuperus

Rang: Liferay Legend

Nachrichten: 1192

Eintrittsdatum: 10. März 2010

Neue Beiträge

I think the term multi-part is kind of misleading here, since to me that implies a form that involves file uploads. But i digress
What you describe is definitely not the easiest of things to implement. I suggest using either a component framework (wicket, gwt, vaadin, jsf) or doing it all in javascript, it makes the task of form generation easier and more natural. Also these frameworks will manage the state of the process for you or keep all the state client side (in the case of gwt or a 100% javascript solution)
David H Nebinger
RE: Multi-part interactive form development in Liferay
5. April 2012 05:29
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 7484

Eintrittsdatum: 1. September 2006

Neue Beiträge

Rather than searching for multi-part form, search for a wizard, as that's really what you're describing here.

Basically you're going to use the portlet session to store up the incoming answers for the current part.

At the end, you'll take all of the info out of the session and persist to the database.

NP.
Stian Sigvartsen
RE: Multi-part interactive form development in Liferay
5. April 2012 15:00
Antwort

Stian Sigvartsen

Rang: Regular Member

Nachrichten: 100

Eintrittsdatum: 27. August 2010

Neue Beiträge

I think your requirements are met very easily by Orbeon forms (www.orbeon.com) which integrates very nicely with Liferay via a portlet filter approach. Orbeon is an implementation of XForms 1.1, which is ideal for implementing scenarios when you want to capture data valid to a certain XML schema. Essentially your portlet just needs to output XHTML (yes simple markup!) containing some elements in the XForms namespace that will be replaced by the Orbeon portlet filter with simple HTML controls, complimented by JavaScript for AJAX support.

You can quite simply develop your form to POST the validated form submission to a RESTful or SOAP webservice such as those generated by Liferay's service builder for persistence.

-Stian
Susan Young
RE: Multi-part interactive form development in Liferay
10. April 2012 11:09
Antwort

Susan Young

Rang: New Member

Nachrichten: 17

Eintrittsdatum: 24. Januar 2012

Neue Beiträge

Thanks Stian, I will investigate this!

Susan