On Wednesday 02 July 2008 06:07:48 Diez B. Roggisch wrote:
> On Tuesday 01 July 2008 15:35:35 mettwoch wrote:
> > Hi,
> >
> > I've a question about merging multiple results from multiple
> > controllers and templates together. The problem raises when I have a 1
> > to many relationship to represent. Let's say an invoice (with Nr,
> > date, customer, ...) and below the invoice lines. I'ld like to have
> > separate controllers for the invoice detail with a "form"template
> > exposed and another controller with a "list"template exposed and get
> > the page put together from these pieces.
> >
> > How should I do it the right way?
>
> Separate controllers is not the way, at least not in TG. But you can use
> Widgets to separate the representation of various items of your pages, and
> in a controller gather data & widgets that you return then to be rendered
> in your template.

It would be easier to do as Diez says.

But you can do the way you want using AJAX.

When you update the master. you trigger some event to update the detail part.  
So, when you have the invoice list ready you start some JS that will check the 
selected entry and get the details for that specific invoice.  When the user 
selects another invoice, you trigger another event that will update the list 
and so on.

But using widgets is easier to get this done and to get the JS code inserted 
and run at the right time.

-- 
Jorge Godoy      <[EMAIL PROTECTED]>


Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to