Skip to Content
author's profile photo Former Member
Former Member

Enabling mandatory validation in HMC

How can I define that an input field is mandatory in HMC? I tried to add the parameter optional="false" to the items.xml:

    <attribute type="valueCode" qualifier="valueCode">
         <modifiers read="true" write="true" optional ="false"/>
         <persistence type="property" />
     </attribute>

But it doesn't work.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2016 at 04:57 PM

    Hi, Felix,

    One way is to create an annotation for this attribute.

    For example, in the hybris 6.0 core trail, an annotation NotEmptyCuppy created and used to make the field Name not empty. More details steps, please refer to

    https://help.hybris.com/6.0.0/hcd/94a4e5bf02a1463287fb3f2f00c6d5d3.html#loio71fa61d3d64545c899f095689de917d6

    Regards

    Haitao

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.