Title: RE: [Tapestry-developer] request for help with rewind

I would like to at least have the option to have the
IDirectListener called before rendering, whether this
is implemented directly or virtually (through a rewind).
For us, it is a reasonably common pattern for a page to contain
a ForEach with embedded Direct components that change
the state of the underlying object that the containing
Page represents. What happens now is that the Page
gets rerendered, with the old data, then the data
gets updated. So you don't see the effect of the
update. It just seems unnatural to have the IDirectListener
run _after_ rendering.

Another thing that I would like is the ability to
create Map contexts for a Direct component.
Ideally you should be able to specify a complete
Map of names and values, and the IDirectListener
interface would have a Map argument instead of
a String[] argument.

the .jwc would look something like this:

  <component id="editPerson" type="Direct">
    <binding name="listener" property-path="listeners.editPerson"/>
    <map-binding name="context">
        <binding name="fname" property-path="components.persons.value.firstName"/>
        <binding name="lname" property-path="components.persons.value.lastName"/>
    </map-binding>
  </component>

the IDirectListener interface would look like/be extended with this:
void directTriggered(IDirect component, Map context, IRequestCycle cycle)

and in your implementing method
public void editPerson(Map context, IRequestCycle cycle) {
    //context will look like this: {"fname" -> "chuck", "lname" -> "windsor"}
}

The Map binding would be useful when dealing with list of objects
with compound foreign keys (among other things).

-----Original Message-----
From: Tom Davies [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:46 AM
Cc: Tapestry Developer (E-mail)
Subject: Re: [Tapestry-developer] request for help with rewind


Phil Surette wrote:
 > Sorry, I said IActionListener, but it's Directs I have
 > problems with. With a Direct the page renders itself
 > before the IDirectListener gets called. Then you have to
 > do the dance that you told me about if you stay on
 > the same page.

I tend not to use Direct components, so I'm not too sure about the
differences, but I think that the page is rendered after the direct
listener is called, and that again the default is to stay on the same page.

The difference is that the state of the page is as it was before
rendering, so you don't have access to state changes performed during
rendering (like processing a form submit I suppose).

What do you want to happen with direct listeners, and what does happen?
I should figure this out, as Direct components can be more efficient
(but remember that premature optimisation is the root of all evil :-)

Tom




_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to