掲示板
Required custom fields
9年前 に Michele Zanarotti によって更新されました。
Required custom fields
Junior Member 投稿: 94 参加年月日: 12/02/20 最新の投稿
How to set a custom fields as required ?
When editing the custom field I have so many options except the 'required' attribute.
Do I have to create a custom Action with a hook ?
When editing the custom field I have so many options except the 'required' attribute.
Do I have to create a custom Action with a hook ?
9年前 に David H Nebinger によって更新されました。
RE: Required custom fields
Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Required is not really an aspect of the custom field, it is an aspect of the interface where you want the user(s) to enter or choose a value.
To that end you have to code in the enforcement of 'required'.
To that end you have to code in the enforcement of 'required'.
9年前 に Michele Zanarotti によって更新されました。
RE: Required custom fields
Junior Member 投稿: 94 参加年月日: 12/02/20 最新の投稿
Hello.
I'm striving to get this simple work done with <liferay-ui:custom-attribute> tag.
But it seems to have many restriction so I can't find a way to render this tag with a required attribute. I can't even set a custom label.
I know I should probably go with aui:input or hidden fields, but this forces me to traverse the entire custom field to render it properly based on its nature.
Server side I have no problem in managing that, but people doesn't understand it's required the first time they visit the form.
I'm striving to get this simple work done with <liferay-ui:custom-attribute> tag.
But it seems to have many restriction so I can't find a way to render this tag with a required attribute. I can't even set a custom label.
I know I should probably go with aui:input or hidden fields, but this forces me to traverse the entire custom field to render it properly based on its nature.
Server side I have no problem in managing that, but people doesn't understand it's required the first time they visit the form.
i think this will help
http://www.liferaysavvy.com/2014/01/objective-perform-form-validation-in.html
to get ( build ) custom field name : _portletId_ExpandoAttribute--custom field name--
i have custom field on user model it's name National-Number so to get the name (fieldName) on creat account form (it's id == 58) would be like this
_58_ExpandoAttribute--National-Number--
http://www.liferaysavvy.com/2014/01/objective-perform-form-validation-in.html
to get ( build ) custom field name : _portletId_ExpandoAttribute--custom field name--
i have custom field on user model it's name National-Number so to get the name (fieldName) on creat account form (it's id == 58) would be like this
_58_ExpandoAttribute--National-Number--