Home > User Voice > JavaScript function to create a field instance

JavaScript function to create a field instance NOT NOW
0

MVP

Hi,

this idea is surely not for the typical WEBCON user but I think everyone of the partners has run into at least one use case where the standard form layout is not enough. Sometime because of some specific requirements or where we wanted to provide additional options to guide the users through a large form.

I also tried and failed creating an "advanced validation dialog". I wanted to display a dialog in which the user had to set some fields. I mainly failed because I couldn't replicate the logic attached to the choose fields and similar.

Therefore I would think we could improve the user experience in some cases if we would have a JavaScript function which would have parameters for
- field name
- parent HTML element
- label HTML element.

If this is the customer DOM
<div id="myCustomFieldWrapper">
<div id="myCustomFieldLabelContainer></div>
<div id="myCustomFieldContainer></div>
</div>

The function would be called like this
CreateField("AttChoose1",document.getElementById("myCustomFieldContainer"),document.getElementById("myCustomFieldLabelContainer")


and it would create the minimal elements required for the field to be working inside the container:

<div id="myCustomFieldWrapper">
<div id="myCustomFieldLabelContainer>Translated label of the field</div>

<div id="myCustomFieldContainer>
<div id="" class="stylePanel stylePanelWithoutStyles"><div class="autocomplete-container picker-container"><div class="autocomplete"><div class="input-group-control"><div class="input-group-control__input input-group-control__input--disabled"><div class="autocomplete__control-row form-control autocomplete__control-row--disabled"><div class="autocomplete__control-row__input-wrapper autocomplete__control-row__input-wrapper--disabled"><input class="line-height-maintenance"><div class="autocomplete-input"><span class="autocomplete-input__inline-wrapper"><input aria-label="LatestChild" class="base-input autocomplete-input__input" disabled="" autocomplete="off" aria-autocomplete="list" spellcheck="false" value=""></span></div></div><div class="autocomplete__control-row__open-dropdown-icon autocomplete__control-row__open-dropdown-icon--disabled"><div class="webcon-icon"><i class="icon ms-Icon ms-Icon--ChevronDown ms-Icon--standard" aria-hidden="true" data-disabled="false"></i></div></div></div></div><div class="input-group-control__btn-group"></div></div></div></div><div class="typography typography-font-size-m typography-not-inherit"><ul class="attributeErrorsPanel"></ul></div></div>


</div>
</div>

I would "expect" that regular expressions, style and behavior, popup search, auto complete etc. are working. If the field is hidden either by a visibility restriction or a form rule the myCustomFieldContainer element would be empty.

Best regards,
Daniel

MVP

Similar to my user voice https://community.webcon.com/forum/thread/228 from February 2021 which is tagged as Under Review for a while.

The possibility of using fields in custom dialogs would increase the user experience in many perspectives.

The most flexible approach is likely a JavaScript based one as you describe.
On the other hand, a configurable, generic way comparable to the mass actions on reports would be easier to use for those users with less experience in the usage of JavaScript.

I'm up for any solution, as long we don't have to wait for too long.