Hi All,
I have a dialog in which authors are supposed to enter some mandatory fields. One of the mandatory fields is a multifield widget.
For this multifield widget I have set "allowBlank = false", but whatever and howsoever values I add to this multifield widget, the validation always fails (See attached screenshot).
[img]image1.png[/img]
As a workaround I also tried using widget event mechanism making use of "beforesubmit" event but since I am using this dialog within a workflow "Dialog participant step", this event never gets fired. Although this event does get fired when used as a standard component dialog.
How could I solve this issue (multifield widget validation). It seems like a PRODUCT BUG to me (AEM 5.6.1).
If so please provide a hotfix or an alternate solution.
- Ankur
Solved! Go to Solution.
Views
Replies
Total Likes
If it does not work as per the AEM docs - then please file a bug here:
http://helpx.adobe.com/marketing-cloud/experience-manager.html
Views
Replies
Total Likes
it should work. Make sure you set the validation at right place. Can you try with maxLength property?
Views
Replies
Total Likes
Have you tried putting allowBlank=false on the fieldConfig element instead of the main multi-field widget.
Views
Replies
Total Likes
Yes, I have tried this option but it didn't work for me.
When I add "allowBlank" property on fieldconfig it works only when I expand this multifield for first level and leave this field blank. At the time of submit it displays me validation error ("Verify the value of mark field.").
But the Problem is If I don't expand this field & submit this dialog then validation doesn't work. I want at the time of dialog submit It will validate for minimum one value in this multifield.
- Ankur
Views
Replies
Total Likes
I am posting my dialog.xml file.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
xtype="dialog">
<items
jcr:primaryType="cq:WidgetCollection"
xtype="panel">
<customMultiField
jcr:primaryType="cq:Widget"
fieldDescription="Field for getting inputs from user"
fieldLabel="Select Options"
name="targetOption"
xtype="multifield">
<fieldConfig
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
options="/bin/target-list.2.html"
optionsRoot="2"
type="select"
xtype="selection"/>
</customMultiField>
</items>
</jcr:root>
I am using "dialog participant step" so my dialog looks like --
[img]dialog_1.jpg[/img]
If I click ok then no validation occur on this multifield because this field doesn't expended so fieldconfig validation never occur.
if I add "allowBlank" on dialog multifield then my xml looks like
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Dialog"
xtype="dialog">
<items
jcr:primaryType="cq:WidgetCollection"
xtype="panel">
<customMultiField
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldDescription="Field for getting inputs from user"
fieldLabel="Select Options"
name="targetOption"
xtype="multifield">
<fieldConfig
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
options="/bin/target-list.2.html"
optionsRoot="2"
type="select"
xtype="selection"/>
</customMultiField>
</items>
</jcr:root>
Now I add some value to this multified and try to submit, it again fails and validation error and field is marked red as shown-
[img]dialog_2.jpg[/img]
validation error is - "verify the value of marked field".
maxLength doesn't work for me.
-Ankur Chauhan
Views
Replies
Total Likes
If it does not work as per the AEM docs - then please file a bug here:
http://helpx.adobe.com/marketing-cloud/experience-manager.html
Views
Replies
Total Likes
This link is under maintenance.
Thanks to both of you for giving your time and attention.
Regards
Ankur Chauhan
Views
Replies
Total Likes
Hi Maintenance team,
I got the same issue on AEM6.1. I have taken time to solve this by add listeners
beforesubmit
{code}
<destinations jcr:primaryType="cq:Widget" fieldLabel="Destinations" name="./destinations" allowBlank="{Boolean}false" xtype="multifield"><fieldConfig jcr:primaryType="cq:Widget" allowBlank="{Boolean}false" xtype="editorialdestinationwidget"/><listeners jcr:primaryType="nt:unstructured" loadcontent="function(field, record) { if(record.get('destinations') == undefined) { field.addItem(); field.doLayout(); } }" /></destinations>
{code}
but it still doesn't work. Hope to get your pay attention on this issue. Many thanks.
Regards,
Hung Vu
Views
Replies
Total Likes
Views
Likes
Replies