Replies: 5 comments 2 replies
-
Thanks for then info about how this can be done. I'm quoting you below: "Happy to hear you got that issue sorted... please do not cross issue boundaries... since other looking for answers will not find it. Next time please post a question in the https://github.com/vdm-io/Joomla-Component-Builder/discussions area as it is the new JCB forum... Okay so the JTable is a class that we extend for the edit views which has a check method which we do not target from the JCB GUI at this time. So you will need to use some custom code..." |
Beta Was this translation helpful? Give feedback.
-
I don't do it a lot but if it was easier to do I might do that check more often in JTable since I think that's where that validation should live most of the time. |
Beta Was this translation helpful? Give feedback.
-
Sorry, Just seeing the discussion link. |
Beta Was this translation helpful? Give feedback.
-
Validation is done in the controller via the model, but with the JForm class returned by the getForm Method so that is why we have access to this area via JCB GUI. So I don't see why I would want to move my validation to the table, as this is after the fact... where the from validation is triggered before, the table. The table is closer to the database... so the way it validates the data now in the MVC we rely on the field validation. So when you setup your fields you can add custom validation to any field. Then with the permissions JCB has per field, if you say a user group does not have access to submit a field... then this is validated in the getForm Method automatically by JCB. Should you have a pro membership plugin, this validation goes even down into the Model with export and import of data. So with the combination of field validation and user access control I would say we have a very secure system without the need to touch the table. Let me know if you have any questions, or if I need to do some recording on this explanation. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I hear what you're saying. I've heard about it jbackend but never used it. Since J4 will have a built in API I'm looking forward to JCB working with it and will probably use it in the long run. I ended up using the Custom Code to edit the JTable Check() function and it worked out fine thanks for reminding me about that option. |
Beta Was this translation helpful? Give feedback.
-
One thing I can't seem to time in the Wiki/docs or the videos is how to add my own code in the JTables Check() function since I'm doing an API and need to do the validation check at the database/table level. Is that possible with JCB?
Beta Was this translation helpful? Give feedback.
All reactions