Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    setFieldErrors misunderstanding

    Hi Isomorphic team,

    I have a form with an uploadItem. This form is embedded into an upper principal form through a CanvasItem. If the file given to the uploadItem does fit some specific characteristics, I want the form to display an error near the CanvasItem (and block any principal form submit). To do that, I use setFieldErrors() on my embedded form when the file is not correct and clearError() when it is correct. The red tag is displayed or not as expected. But the uploadItem text part is cleared. Can you tell me why? And there is a way to avoid this?

    #2
    Setting errors causes the form to redraw, at which point the framework cannot re-create an UploadItem with the same file. This effect and the best ways to avoid it are covered prominently in the docs for UploadItem.

    Comment


      #3
      Hi Isomorphic,

      I've read the UploadItem docs carefully and I did not found anything related to the management of errors on it. Can you give me a sample or point me at the specific doc?

      Comment


        #4
        ?

        It's not exactly hidden - it says:

        [quote]If a form containing an UploadItem is redrawn (which may happen if other form items are shown or hidden, the form is resized, or other items show validation errors) then the value in the upload item is lost (because an HTML upload field may not be created with a value).[/url]

        Right in the middle of the class docs for UploadItem.

        Comment


          #5
          Thanks, I've already read it but... it gives no resolution...
          Last edited by MelieZxy; 11 Apr 2016, 22:44.

          Comment


            #6
            Actually, the solution is literally the very next sentence after the one we quoted.

            We don't know what's going on here, but you need to read the docs more carefully than this. We can't be literally quoting you the docs one sentence at a time on the forums - that's not what Support is for.

            Comment

            Working...
            X