论坛

主页 » Liferay Portal » English » 3. Development

组合视图 统一视图 树状图
讨论主题 [ 上一个 | 下一个 ]
Susan Young
Multi-part interactive form development in Liferay
2012年4月4日 下午1:01
答复

Susan Young

等级: New Member

帖子: 17

加入日期: 2012年1月24日

最近的帖子

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
2012年4月4日 下午2:53
答复

Jelmer Kuperus

等级: Liferay Legend

帖子: 1192

加入日期: 2010年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)
David H Nebinger
RE: Multi-part interactive form development in Liferay
2012年4月5日 上午5:29
答复

David H Nebinger

Community Moderator

等级: Liferay Legend

帖子: 11100

加入日期: 2006年9月1日

最近的帖子

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
2012年4月5日 下午3:00
答复

Stian Sigvartsen

等级: Regular Member

帖子: 103

加入日期: 2010年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
RE: Multi-part interactive form development in Liferay
2012年4月10日 上午11:09
答复

Susan Young

等级: New Member

帖子: 17

加入日期: 2012年1月24日

最近的帖子

Thanks Stian, I will investigate this!

Susan