Aikau Dynamic form field value
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2015 11:11 AM
Hello,
We have a custom content type and we would like to develop a custom form to create objects of this type. One of the metadata properties is an ID that is automatically generated by a call to a custom webscript (kind of database sequence). This field is not editable by the user but we would like to display it in the custom dialog before creating the content. How can we achieve that using Aikau? Is there a way to pre-populate form fields with dynamic values like this ID?
Thank you in advance
Sergio
We have a custom content type and we would like to develop a custom form to create objects of this type. One of the metadata properties is an ID that is automatically generated by a call to a custom webscript (kind of database sequence). This field is not editable by the user but we would like to display it in the custom dialog before creating the content. How can we achieve that using Aikau? Is there a way to pre-populate form fields with dynamic values like this ID?
Thank you in advance
Sergio
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2015 11:08 PM
Hello,
You could create a behaviour attached to your custom Type and use the onCreate policy to populate your field.
You could create a behaviour attached to your custom Type and use the onCreate policy to populate your field.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2015 11:54 AM
Thank you Kavi for your response. This is an interesting alternative.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2015 04:59 AM
As an example of extending an existing widget you might want to look at the alfresco/forms/controls/RandomValueGenerator which extends the standard TextBox form control to generate a UUID as its value (if a value has not been provided). If you want the ID to be generated by a WebScript then you could extend an existing form control (as the RandomValueGenerator does) but instead of generating ID on the client you could make an XHR call to the WebScript to get the ID. Alternatively if this form is being presented on a new page then (rather than as a dialog) then you could generate the ID within the JavaScript controller for the page.
