Reg The listener in multifield

Avatar

Avatar
Validate 1
Level 2
prabhukarruppus
Level 2

Likes

4 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
prabhukarruppus
Level 2

Likes

4 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
prabhukarruppus
Level 2

17-01-2018

Hi All,

I need to write a listener for the following scenario:

Amount section is a multifield, Which contains Minimum Amount and Maximum Amount as a text field.

(Through listener we need to show a popup on submit if the maximum amount entered is less than minimum amount)

The screen shot for the dialog is as follows :

Screen Shot 2018-01-17 at 7.16.14 PM.png

For the above multifield scenerio I can't able to achieve the expected output.

The properties of AMOUNT, Minimum Amount And Maximum Amount Respectively

Screen Shot 2018-01-17 at 7.16.31 PM.png

Screen Shot 2018-01-17 at 7.16.46 PM.png

Screen Shot 2018-01-17 at 7.17.01 PM.png

Kindly guide me on to resolve this issue.

Thanks in advance.

Replies

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

277 likes

Total Posts

1,502 posts

Correct reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

277 likes

Total Posts

1,502 posts

Correct reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

17-01-2018

From the statement "For the above multifield scenerio I can't able to achieve the expected output."

Can you tell community what all approaches you tried so that it can be corrected.

Based on mentioned use case you can simply use beforesubmit event and execute you logic to validate amount

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/widgets-ap...

Avatar

Avatar
Validate 1
Level 2
prabhukarruppus
Level 2

Likes

4 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
prabhukarruppus
Level 2

Likes

4 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
prabhukarruppus
Level 2

17-01-2018

Hi,

This is the listener code i used

function(dialogObj){

var minAmount = dialogObj.getField("./amount[0].minAmount").getRawValue();

var maxAmount = dialogObj.getField("./amount[0].maxAmount").getRawValue();

if(minAmount.length>0){

  if(maxAmount.length>minAmount.length)

  {

  return true;

  }

  else

  {

  alert("Max amount should be greater then minimum amount..!!");

  return false;

  }

  }

}

Avatar

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

277 likes

Total Posts

1,502 posts

Correct reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 10
edubey
Level 10

Likes

277 likes

Total Posts

1,502 posts

Correct reply

392 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
edubey
Level 10

17-01-2018

Under which listener you have put up this code, I mean when this gets executed.

Avatar

Avatar
Validate 1
Level 2
prabhukarruppus
Level 2

Likes

4 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
prabhukarruppus
Level 2

Likes

4 likes

Total Posts

26 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
prabhukarruppus
Level 2

17-01-2018

While clicking on ok button in the dialog

Avatar

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile

Avatar
Validate 50
Level 6
cquser1
Level 6

Likes

75 likes

Total Posts

313 posts

Correct reply

15 solutions
Top badges earned
Validate 50
Validate 25
Validate 10
Validate 1
Give Back 50
View profile
cquser1
Level 6

17-01-2018

Hi,

The below article deals with comparison of fields, but not exact use-case as yours. Listing the below link,just in case it helps in any way.

Experiencing Adobe Experience Manager - Day CQ: AEM 61 - TouchUI Date Picker Validator Comparing Two...

Avatar

Avatar
Validate 1
Level 1
poornimab543386
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
poornimab543386
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
poornimab543386
Level 1

13-03-2018

Hi,

Can you please help if it is for Classic UI-multifield dialog