활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.
Hi Community
I was going through the documentation Link:- https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.form.PathField .
I am bit confuse between maskRe, regex, stripCharsRe config options. If some body could explain me these three with an example.
Thanks and Regards
Kautuk Sahni
해결되었습니다! 솔루션으로 이동.
maskRe is supposed to prevent certain characters from being entered into a field. I tried to get it working on a textfield but was unsuccessful due to a JS error. Basically you're supposed to be able to add a the property such as maskRe=/[a-zA-Z\s]*/ and this example will prevent any char other than letters and spaces from being entered into the field.
According to the docs (https://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.form.PathField):
maskRe
: filter out keystrokes before any validation occursHi Kautuk
regex: Take a look at my latest article published 1 hour back http://adobeaemclub.com/simple-way-to-restrict-image-type-in-pathfield-xtype/
stripCharsRe: If you want to remove some text from the value selected in Path field. To the above article if you add property with name stripCharsRe with value /content/ . After this if you select /content/dam/geometrixx/banners/banner-mono.png, in path field you will see only dam/geometrixx/banners/banner-mono.png as you are instructing aem to strip /content/
for maskRe : I will get back to you with better example
Thanks
maskRe is supposed to prevent certain characters from being entered into a field. I tried to get it working on a textfield but was unsuccessful due to a JS error. Basically you're supposed to be able to add a the property such as maskRe=/[a-zA-Z\s]*/ and this example will prevent any char other than letters and spaces from being entered into the field.
According to the docs (https://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.form.PathField):
maskRe
: filter out keystrokes before any validation occurs
Hi Praveen, Graham
This really help. Thank you for the detail answer.
Thanks and Regards
Kautuk Sahni
조회 수
답글
좋아요 수
I managed to get around the error by setting maskRe as a function, like the following:
maskRe="function(){return eval('/\\\\d/')}()"
It looks like in CQ.utils.Util.formatData only the 'regex' field is evaluated, not maskRe.
Hopefully that helps someone!
조회 수
답글
좋아요 수