Hello and thanks for all of the helpful responses!

The Magnolia project I was working on was put on the back-burner. But I 
recently remembered that I had left this task unfinished. So I checked back on 
the forum and found out I had even more posts!

So as suggested I have made a class that extends RenderingModelImpl. Upon 
testing it I got a "class does not have a constructor" error. So I created a 
default constructor and was going to test it but the server I need to upload to 
was acting funny and I was unable to upload or test. I'll let you know.

In the meantime I'd like to ask a couple more questions:

1. I'd like to use this class in two different way: when the user clicks on the 
link for Reservations, I want to call the MyRenderingModelImpl.loadSelectData() 
method, which will work much like a Spring MVC referenceData() method - load 
data to populate some selects on the form.

Then when the user clicks on the form submit button I want to call the 
MyRenderingModelImpl.makeReservation() method, which takes the form data, does 
some look-ups in the database and puts the result in the request.

Both of these methods would use custom tables, located in the same database as 
Magnolia data. So in my class I have methods to get a JDBC connection, etc. 

So my question is this: in the examples you talk about calling these methods 
from the .ftl page using the "model" variable. But how would I do what I 
describe above, namely, calling the loadSelectData() and makeReservation() 
methods when the user clicks a link/submit button?

To me what I need here is a some sort of Controller class. But since I need to 
use a class that extends the RenderingModelImpl class, which is a Model class, 
I'm a litle confused. I just want to make sure I am going about this the right 
way.

2. When you tell Magnolia that that "modelClass" for a template is your custom 
class that implements the RenderingModelImpl, does that mean that my class is 
now responsible for the "flow" of data? Do I need to do anything with the 
execute() or getContent() methods to make sure the correct .ftl page is shown, 
etc?

Thanks for the assistance!

-- 
Context is everything: 
http://forum.magnolia-cms.com/forum/thread.html?threadId=3f254fa9-4506-4830-8eee-44a5f18da5c4


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to