Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to disable the selection component ?

Avatar

Level 3

I have a selection component . I have made it mandatory (allowBlank : false).

In my selection changed listener function i am making the field disabled/enabled .

But even when it is disabled (Disabled : true) , since there is allowblank it still keeps alerting for the mandatory field  .

My requirement is that when the button is disabled it should not check for allowBlank property .Please help in doing this .

 

Thanks in advance

Harish

1 Accepted Solution

Avatar

Correct answer by
Level 8

As a workaround, in your listener you can also change the value for the allowblank property, so that when it's disabled it also allows a blank value, and when enabled it does not allow a blank value

scott

View solution in original post

3 Replies

Avatar

Correct answer by
Level 8

As a workaround, in your listener you can also change the value for the allowblank property, so that when it's disabled it also allows a blank value, and when enabled it does not allow a blank value

scott

Avatar

Level 3

Hi Scott,

I also have a similar kind of requirement. In a panel, I have a dropdown of approve and reject and if approve is selected, another dialogfieldset in the same panel opens to enter more options. But, all these options are mandatory fields having property allowBlank=false.

As you suggested, change the property allowBlank, but can you plz also tell how to acccess that particular property inside  a listener that I can put on the Approve/Reject field.

I need to disable the dialogfieldset when reject is selected, but it has all mandatory fields. So, when I click OK to submit the form, it gives an error "verify the marked fields.".

Please elaborate a little more on the workaround that you provided.

 

Thanks,

Ankush

Avatar

Level 8

well, it's a little difficult without knowing the particulars of your situation, but the event that the listener reacts to typically has some parameters, and you can use those parameters as a way to access items on the dialog.

What event are you listening to, and on what type of object?

scott