Topic
  • 2 replies
  • Latest Post - ‏2012-06-27T08:37:17Z by SystemAdmin
SystemAdmin
SystemAdmin
648 Posts

Pinned topic Showing validation errors in PIM UI

‏2012-06-26T13:03:25Z |
Hi,

Is there any particular JAVA API available to show the attribute level validation error on the particular field itself. I have got a pre-developed validation framework which does the validation and send down the response object which has got the error message.
Any clue how to show that error message on the attribute field? The item shouldn't be saved as well.

Thanks,
Abhijeet
Updated on 2012-06-27T08:37:17Z at 2012-06-27T08:37:17Z by SystemAdmin
  • babinag
    babinag
    91 Posts

    Re: Showing validation errors in PIM UI

    ‏2012-06-27T05:24:53Z  
    Hi Abhijeet.M.

    Attribute level validation is a prepostprocessing validation.
    Java API for item snippet:
    
    @Override 
    
    public 
    
    void prePostProcessing(ItemPrePostProcessingFunctionArguments inArgs) 
    { AttributeInstance attrInstance = getYourInstanceToValidate(inArgs); inArgs.addValidationError(attrInstance, Type.VALIDATION_RULE, 
    "Bad, bad validation error"); 
    }
    

    If validation error occurs, item will not be saved.
  • SystemAdmin
    SystemAdmin
    648 Posts

    Re: Showing validation errors in PIM UI

    ‏2012-06-27T08:37:17Z  
    • babinag
    • ‏2012-06-27T05:24:53Z
    Hi Abhijeet.M.

    Attribute level validation is a prepostprocessing validation.
    Java API for item snippet:
    <pre class="jive-pre"> @Override public void prePostProcessing(ItemPrePostProcessingFunctionArguments inArgs) { AttributeInstance attrInstance = getYourInstanceToValidate(inArgs); inArgs.addValidationError(attrInstance, Type.VALIDATION_RULE, "Bad, bad validation error"); } </pre>
    If validation error occurs, item will not be saved.
    Thanks for the reply. It worked! )

    ~Abhijeet