Hi,
I started a new project where I wish to display some data in a dojo grid. This grid is linked to a
JsonRestStore that will interact with a REST controller.
I asked myself:
should I put the action that displays the grid (HTML+JS) in the same controller as the one which
will return the data (JSON)? My first thought was to put the "grid" action in a separate controller,
considering it should be seen as a consumer (or a front-end) of the REST one.
Then, I thought about the form action (the action displaying the form, not the one processing the
data). The form action triggers a PUT or POST request toward the REST controller. If the data are
valid, no problem. But what should we do in case of errors? If the postAction() is separated from
the formAction(), we should do some redirect to the referrer. And if we merge the two actions (or
controllers), the resulting controller would not be a "pure" REST anymore.
What would be your advice in such a situation?
--
Guillaume ORIOL
Software engineer
Technema