Selectbox with dynamic datasource in multifield
Hi,
I am facing an issue when having a selectbox with a custom datasource in a multifield.
When the dialog with this multifield is open the first time (no data for the multifield are present in the repo) then the dialog opens. The editor is able to select items in the selectboxes, add new selectboxes inside the multifield and so on. But when the dialog gets closed and the data are saved in the repo and the editor tries to open this dialog again, a javascript error occors and the dialog does not open anymore.
The interesting thing is, when I have the same dialog configuration but the selectbox has static items instead of a custom dataset then everything works fine.
Not working dialog configuration:
<myCustomMultifield
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
required="{Boolean}true"
fieldLabel="My Custom Multifield">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
emptyOption="{Boolean}true"
name="./selectBoxValues">
<datasource
jcr:primaryType="nt:unstructured"
sling:resourceType="/path-to-my-custom-datasource-servlet"/>
</field>
</lexicon-substance-references>
Working dialog configuration without custom datasource:
<myCustomMultifield
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
required="{Boolean}true"
fieldLabel="My Custom Multifield">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/select"
emptyOption="{Boolean}true"
name="./selectBoxValues">
<items jcr:primaryType="nt:unstructured">
<item1
jcr:primaryType="nt:unstructured"
text="Item 1"
value="item1"/>
<item2
jcr:primaryType="nt:unstructured"
text="Item 2"
value="item2"/>
<item3
jcr:primaryType="nt:unstructured"
text="Item 3"
value="item3"/>
</items>
</field>
</lexicon-substance-references>
Here the javascript error:
Uncaught TypeError: g is null
<anonymous> http://localhost:4502/libs/cq/gui/components/authoring/dialog/clientlibs/all.min.js line 7 > srcScript:56
jQuery 7
auto http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:662
jQuery 8
auto http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:661
jQuery 6
auto http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:660
openDialog http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:666
openEditDialog http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:737
_onFastDblClick http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:767
jQuery 7
onOverlayFastDblClick http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:779
jQuery 7
overlayManager http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:572
jQuery 8
overlayManager http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:571
<anonymous> http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:575
<anonymous> http://localhost:4502/libs/cq/gui/components/authoring/editors/clientlibs/core.min.js line 7 > srcScript:575
all.min.js line 7 > srcScript:56:92
Has anybody an idea how to solve this problem? Or is this a know bug?
regards
Reini