Getting the modal hints for the column in class


We will update the maxlength for the column in portlet-modal-hints.xml. Just like as below

<field name="comments" type="String">
<hint name="max-length">500</hint>
</field>

If we want to get these max length in the class,  we can use the below code.

ModelHintsUtil.getMaxLength(model, field)

model : Class name
field : columnName

ex:
ModelHintsUtil.getMaxLength(KBUser.class.getName(), "comments");

Comments

Popular posts from this blog

Theme display in javascript

How to know which liferay version we are using

Viewing the SQL Query in liferay : debugging the SQL Query in Hibernate