내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Disabling a textbox in Dialog if its value is not Null

Avatar

이전 커뮤니티 멤버

I want to disable a textbox in a dialog in page properties if its value is equal to not null or not blank.

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Level 1

Hi Rajat,

You can add a listener on loadcontent event & find the textbox using getByName method. Please find kind of method in below.

function(dialog) {
var multiField = dialog.getByName('txtName');

if(multiField  != null)
{
multiField.setDisabled(false);
}
}

Hope this helps you :-).

원본 게시물의 솔루션 보기

2 답변 개

Avatar

Level 6

Interesting case... If the property is empty, then the user can enter something. But as soon as the user has written something in the dialog, the textbox should be disabled.

How does the user change the values if it is wrong or needs to be changed?

But to answer your question. You use the dialogue listeners. An example, that is used a lot in this forum, is to look at /libs/foundation/components/list/dialog/items/list/items/listFrom/listeners and figure out how that works. This is a part of the Widget configuration and can be found at [1]. What you are trying to do is a Toggle.

/Ove

 

 

 

 

 

 

[1] http://dev.day.com/docs/en/cq/current/developing/widgets.html

Avatar

정확한 답변 작성자:
Level 1

Hi Rajat,

You can add a listener on loadcontent event & find the textbox using getByName method. Please find kind of method in below.

function(dialog) {
var multiField = dialog.getByName('txtName');

if(multiField  != null)
{
multiField.setDisabled(false);
}
}

Hope this helps you :-).