Hello,
This time, a question related to processor logic and form.
I introduce you the context :
I have a custom detail form, opened in
scheduler.showLightbox = function(id){}
However, I do not use scheduler.startLightbox() in it or scheduler.endLightbox() in my custom save function because :
- I have no #custom_form html container on the page : in fact, I call with AJAX a detail form which needs to be generated server-side (more server logic, form specific to type of event, …)
- I use another lightbox system, which (like component one) loads the form in current document (no iFrame so).
When I click on “SAVE”, “CANCEL”, or “DELETE” button on my custom form, I call custom JS function. In my custom “SAVE” method, I populate the ev object then call the :
_edit_stop_event(ev, true);
// then I close my custom detail form (and its lightbox)
This methods calls my custom server side logic to create or update the event, returning the waited XML <action type="" <id…>>
The issue I meet : I can not use all validators on client side, so you understand : my server side logic check some data not tested client side and need in some case to return a : “The event can not be updated, please check your inputs”, but how could I do that ? the _edit_stop_event() return no value, so I can not know if I need to close my detail form or if I need to display error messages to the user without closing my detail form so that he can update its input before trying to save again.
Maybe in my save function I just need to call the _edit_stop_event(), and use another event listener to know if retrieve XML action/type is an “error” or not, so that I can eitgher close the form or display errors in it ?
If it is easier to implement, I could come back to native system, by calling my custom form with Ajax in a first time to put in HTML document then using scheduler.<show|end>Lightbox() to opening it in existing component lightbox. But even with native system I’m not sure that there is a way to do server side validators and permits to keep detail opened to allows user to keep on its edition…
(I hope this message is enough comprehensible…)