Fórum

DDL Form with user attribute fields

thumbnail
ALi Reza Kazemi, modificado 8 Anos atrás.

DDL Form with user attribute fields

New Member Postagens: 12 Data de Entrada: 09/01/11 Postagens Recentes
Hi,
I am using liferay 6.1 GA 1 for building a simple web site for gathering information from authenticated users. I just create a simple Dynamic Data List Form to get small data from users like their name, last name, email and their C.V.
But I have a big problem, Although my users are authenticated users but I should ask their names and emails again in my form to have them in CSV Export.
I need to have some readonly field in Data Definition Of my form such as "User First Name" or "user Last Name", ....
So could anyone help me:
1-Does liferay DDL has these fields? if yes, where are them and how I could create them?
2-If I should develop the liferay source to create custom filed in DDL field list, How I could do that? should I change the liferay source or Alloy UI Source?

Thank you in advanced.
thumbnail
Tina Agrawal, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

Expert Postagens: 297 Data de Entrada: 03/01/08 Postagens Recentes
I have not tried it but try using a display template.
You can use the Java APIs to HTML to make it read only and then fill them with user details.

Tina
thumbnail
ALi Reza Kazemi, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

New Member Postagens: 12 Data de Entrada: 09/01/11 Postagens Recentes
I am not sure but may be display template could help us, But it would work only for one form.
I need a plan to have this ability in all of my forms.

thanks.
thumbnail
Tina Agrawal, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

Expert Postagens: 297 Data de Entrada: 03/01/08 Postagens Recentes
May be you can try this -

All the forms will have the same field name say email, firstName.
Write a JSP hook which will check the field names and if it matches then populate the values.

Tina
thumbnail
Krzysztof Gołębiowski, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

Liferay Master Postagens: 549 Data de Entrada: 25/06/11 Postagens Recentes
Hello Ali,
I such cases I usually create my own portlet to display the form and integrate it with Liferay's Dynamic Data Lists. Unfortunately DDL Form Template mechanism is not very flexible and does not allow you to do such things (however you can try to hack it, eg. put javascript somewhere on the page that creates new fields above the ones generated by DDL).

If you don't want to play with JSPs, I recommend Vaadin - you will create full-featured form with little effort. Using DDL's as backend storage engine frees you from managing the data.

Regards,
KG
thumbnail
ALi Reza Kazemi, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

New Member Postagens: 12 Data de Entrada: 09/01/11 Postagens Recentes
Hello Krzysztof,
Thank you for your reply, But i really want to have this ability on DDL, other solutions like writing a new portlet is not suitable for me, because i have more than one form like that.
DDL design panel is just a taglib in liferay source and it's source is available in alloyui. So it seems I should hack it for new fields, if it is possible.
Vaadin is a nice platform but unfortunately it does not support RTL languages.
Thank you for your suggestions.

Krzysztof Gołębiowski:
Hello Ali,
I such cases I usually create my own portlet to display the form and integrate it with Liferay's Dynamic Data Lists. Unfortunately DDL Form Template mechanism is not very flexible and does not allow you to do such things (however you can try to hack it, eg. put javascript somewhere on the page that creates new fields above the ones generated by DDL).

If you don't want to play with JSPs, I recommend Vaadin - you will create full-featured form with little effort. Using DDL's as backend storage engine frees you from managing the data.

Regards,
KG
thumbnail
Krzysztof Gołębiowski, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

Liferay Master Postagens: 549 Data de Entrada: 25/06/11 Postagens Recentes
ALi Reza Kazemi:
Hello Krzysztof,
Thank you for your reply, But i really want to have this ability on DDL, other solutions like writing a new portlet is not suitable for me, because i have more than one form like that.

If you need to have this feature reusable then that's true, writing custom portlet does not make any sense.
ALi Reza Kazemi:

DDL design panel is just a taglib in liferay source and it's source is available in alloyui. So it seems I should hack it for new fields, if it is possible.
Vaadin is a nice platform but unfortunately it does not support RTL languages.
Thank you for your suggestions.

I tried to use DDL forms several times to implement some of my requirements, but everytime it turned out that its missing some crucial feature and cannot be done this way. Also knowing Alloy UI has rather poor documentation, lots of bugs and it's not easy to extend, I usually ended up with custom portlets (even if they were based on DDLs). I used Orbeon for creating dynamic forms that are manageable by users without development skills (but that involves lots of work).

But... if you want to play with that and manage to add custom fields to Liferay's DDL form editor, please share your knowledge emoticon

Regards,
KG
S@d! K, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

New Member Postagens: 6 Data de Entrada: 01/09/15 Postagens Recentes
Krzysztof Gołębiowski:
Hello Ali,
I such cases I usually create my own portlet to display the form and integrate it with Liferay's Dynamic Data Lists. Unfortunately DDL Form Template mechanism is not very flexible and does not allow you to do such things (however you can try to hack it, eg. put javascript somewhere on the page that creates new fields above the ones generated by DDL).

If you don't want to play with JSPs, I recommend Vaadin - you will create full-featured form with little effort. Using DDL's as backend storage engine frees you from managing the data.

Regards,
KG


Hello KG,

Can you please share an example of what you said "In such cases I usually create my own portlet to display the form and integrate it with Liferay's Dynamic Data Lists."

Thanks
S@d! K, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

New Member Postagens: 6 Data de Entrada: 01/09/15 Postagens Recentes
Hello KG ,

Any help in this regard ? I want to change add form for dynamic data list. How can I integrate a form created in my portlet with dynamic data list.
Kaouther Ajala, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

New Member Postagens: 24 Data de Entrada: 10/02/15 Postagens Recentes
hi

i have the same problem can any body help me please!!!
S@d! K, modificado 8 Anos atrás.

RE: DDL Form with user attribute fields

New Member Postagens: 6 Data de Entrada: 01/09/15 Postagens Recentes
Kaouther Ajala:
hi

i have the same problem can any body help me please!!!


1. Create an add form for your DDL list in your portlet HTML page.
2. Get form inputs in portle file as
String userName = ParamUtil.getString(actionRequest, "userName");
String groupName= ParamUtil.getString(actionRequest, "groupName");

3. Put data in map and than save map in DDL.

// Set data in feilds
Map<String, Serializable> fieldsMap = new HashMap<String, Serializable>();
fieldsMap.put("USER_NAMR", userName );
fieldsMap.put("GROUP_NAME", groupName);

String userDDLListName = "USERS_DDL";

DDLRecordLocalServiceUtil.addRecord(context.getUserId(),
context.getScopeGroupId(),
Util.getRecordSetId(context, userDDLListName ),
DDLRecordConstants.DISPLAY_INDEX_DEFAULT, fieldsMap,
context);

// Utility
public class Util {
public static Long getRecordSetId (ServiceContext context , String ddlName ) throws SystemException{
Long id = 0L;
long gid = context.getScopeGroupId();
List<DDLRecordSet> ddl = DDLRecordSetLocalServiceUtil.getRecordSets(gid);

for(DDLRecordSet d : ddl){
if(d.getName().contains(ddlName)){
id = d.getRecordSetId();
}
}
return id;
}
}

Hope this helps.

Regards
Sad!