validation - Allowing only digits in aui:form, with Liferay portlet-model-hints.xml -
my portlet-model-hints.xml
below stipulates quantity
required, works fine.
want stipulate quantity
must made of digits:
<model-hints> <model name="com.example.model.myentity"> [...] <field name="order" type="long"> <validator name="required" /> <validator name="digits" /> <----- not work </field> [...] </model> </model-hints>
problem: adding <validator name="digits" />
makes text field disappear.
is there problem in syntax? should validation in jsp instead? way here jsp form add/edit entity:
<aui:form action="<%= editmyentityurl %>" method="post" name="fm"> <aui:fieldset> [...] <aui:input name="quantity" /> [...] </aui:fieldset> [....] </aui:form>
[workaround, still looking better solution]
not elegant @ all, moving digits validation jsp works:
<aui:form action="<%= editmyentityurl %>" method="post" name="fm"> <aui:fieldset> [...] <aui:input name="quantity"> <aui:validator name="digits"/> </aui:input> [...] </aui:fieldset> [....] </aui:form>
it must done in jsp forms use entity.
Comments
Post a Comment