Update using javascript for coral touch ui tag based auto complete

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

14-11-2019

Hi,

Based on the link Update using javascript for coral touch ui tag based auto complete

I am populating for dialog  on load using $(#TagIdcomp).find('ul.js-coral-Autocomplete-selectList > li[data-value="'+tagVal+'"]').click();

  But  on submit i need to capture the values from autocomplete dialog  in JavaScript. So that i could process those in java using ajax

Could you please provide inputs as what will the javascript code will be very helpul.

I have the tag

<tagRegion

         jcr:primaryType="nt:unstructured"

         sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete"

         fieldLabel=" Tag"

                                        multiple="{Boolean}true"

         name="../../tagsRegion"

        granite:id="TagIdcomp"

         mode="contains">

          <datasource

           jcr:primaryType="nt:unstructured"

           sling:resourceType="cq/gui/components/common/datasources/tags"/>

          <options

           jcr:primaryType="nt:unstructured"

           sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/list"/>

          <values

           jcr:primaryType="nt:unstructured"

           sling:resourceType="granite/ui/components/coral/foundation/form/autocomplete/tags"/>

                                    </tagRegion>

Thanks.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

958

Correct Answer

820

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

958

Correct Answer

820
Arun_Patidar
MVP

16-11-2019

var field = $form.find("input[name='../../tagsRegion']");

field.each(function( index ) {

   $( this ).val();

});

Answers (2)

Answers (2)

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

05-12-2019

Hi Arun,

Do you have any idea as how this could be solvedAEM 6.3 Coral touch ui pathfield for multiple values using javascript .

Any inputs on the post will help

Thanks

Avatar

Avatar

srinivas_chann1

Avatar

srinivas_chann1

srinivas_chann1

18-11-2019

Thanks Arun. Your response was very useful.

For multi selection values  i used

var multiTagValues=field .map(function(){return $(this).val();}).get();