留言板

Multi-part interactive form development in Liferay

Susan Young,修改在12 年前。

Multi-part interactive form development in Liferay

New Member 帖子: 17 加入日期: 12-1-25 最近的帖子
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
thumbnail
jelmer kuperus,修改在12 年前。

RE: Multi-part interactive form development in Liferay (答复)

Liferay Legend 帖子: 1191 加入日期: 10-3-10 最近的帖子
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)
thumbnail
David H Nebinger,修改在12 年前。

RE: Multi-part interactive form development in Liferay (答复)

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
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.
thumbnail
Stian Sigvartsen,修改在12 年前。

RE: Multi-part interactive form development in Liferay (答复)

Regular Member 帖子: 103 加入日期: 10-8-27 最近的帖子
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,修改在12 年前。

RE: Multi-part interactive form development in Liferay

New Member 帖子: 17 加入日期: 12-1-25 最近的帖子
Thanks Stian, I will investigate this!

Susan