cancel
Showing results for 
Search instead for 
Did you mean: 

How to create dynamic multi-select list box in custom form

satheeshkumar
Champ in-the-making
Champ in-the-making
Hi All,

I have created a custom form with few text box fileds. I would like to add one more filed called multi-select box with dynamic list loaded into it.
The dynamic list I mean here is, looping through the specific sub folder of "Document Library" and create a list of folders available under this sub folder and pass it as a list to that multi-select box.
Is there any OOTB widgets available to be used, or do I need to write a custom widget, if so can you please help me with a sample example on how to do this.

Thanks in Advance.
11 REPLIES 11

Yes, muralidharand is right, you have incorrect JSON response.

Also I think you need to change url from "http://localhost:8080/alfresco/service/retrieve-library-list?retrieve=Product%20Library" to Alfresco.constants.PROXY_URI + "service/retrieve-library-list?retrieve=Product%20Library", if you don't do it you will see popup to fill login and password when your js code will be executed

Hi Murali, Can you please let me know the usage syntax of this CheckedMultiSelect in AIKAU.

I don't know the systax of how can I use this widget in AIKAU form.

I have tried with few other widgets like "MultipleEntryFormControl", "SimplePicker", I am able to generate the custom list and show in UI, but each one is creating different problems while submitting the form.

For Example,
With "SimplePicker" widget, I am getting Error while submitting the form,
//Error I see in the logs when I submit this form



2015-04-06 00:06:51,760 [DEBUG] org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:437) form.post.json.js Start

2015-04-06 00:06:51,762 [DEBUG] org.alfresco.repo.jscript.ScriptLogger.debug(ScriptLogger.java:50) json form submission for item:

2015-04-06 00:06:51,762 [DEBUG] org.alfresco.repo.jscript.ScriptLogger.debug(ScriptLogger.java:50)      kind = type

2015-04-06 00:06:51,763 [DEBUG] org.alfresco.repo.jscript.ScriptLogger.debug(ScriptLogger.java:50)      id = hccm:productTypeFolder

2015-04-06 00:06:51,860 [DEBUG] org.alfresco.repo.jscript.ScriptLogger.debug(ScriptLogger.java:50) java.lang.IllegalArgumentException: Node properties must be fully serializable, including values contained in collections.

   Property: Name: {http://www.mycompany.com/model/content/1.0}imageLibraryList

Title: null

Description: null

Default Value: null

DataType Name: {http://www.alfresco.org/model/dictionary/1.0}text

ContainerClass Name: {http://www.mycompany.com/model/content/1.0}productTypeFolder

isMultiValued: true

isMandatory: false

isMandatoryEnforced: false

isProtected: false

isIndexed: true

isStoredInIndex: false

isIndexedAtomically: true

indexTokenisationMode: TRUE



   Index:    0

   Value:    {"index":0,"prop_cm_name":"Images1","alfTopic":"4137d6fa-4ee5-4673-8657-5e707916c89aALF_ITEM_SELECTED","isLastItem":false}

2015-04-06 00:06:51,861 [DEBUG] org.alfresco.repo.jscript.ScriptLogger.debug(ScriptLogger.java:50) Returning 500 status code

2015-04-06 00:06:51,861 [DEBUG] org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:535) form.post.json.js End 101 ms

With "MultipleEntryFormControl", no issues in submitting the form, but the Xpath search ("lucene" and "fts-alfresco") of parent folder not retrieving the child folders created by the form with "MultipleEntryFormControl" widget in it.

So if you let me know the usage syntax of "CheckedMultiSelect", it would be greatly helpful to me.