-
I have a custom JCB component where I am uploading files (based on the JCB video tutorial process) and doing some custom checking of files. $this->setMessage($this->getError(), 'error'); I'd like to have my custom notice displayed via that line (rather than the enqueueMessage function); however, I am not able to find how to 'set' a custom error. If that's not possible, is there a way to have that line disabled? (even though it's not part of my component code? Any ideas would be welcome. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Found a better solution. In the php before_save custom code area for this admin view, in the if section that checks for the valid file uploads, I have added the following code:
Now, when the error condition is met, the user is automatically re-directed back to the form and the custom enqueueMessage is displayed, and nothing else. I'm still working on how to have any entered data maintained on the form using session variables and something like this:
However, I've not used session variables like this before so still not quite got that working. Hope this helps anyone who wants to deal with data validation on a form in this sort of way. |
Beta Was this translation helpful? Give feedback.
Found a better solution.
In the php before_save custom code area for this admin view, in the if section that checks for the valid file uploads, I have added the following code:
Now, when the error condition is met, the user is automatically re-directed back to the form and the custom enqueueMessage is displayed, and nothing else.
I'm still working on how to have any entered data maintained on the form using session variables and something lik…