There is agreement about this poor use of terms. (But now we have it please
don't change it!) I think Howard explained that the original idea was that
of iteration through the fields of a form which from the point of view of it
being an activity on the server, I suppose is analogous to winding in a
string or a fishing line with many sinkers on it. Each sinker (field, node)
must be inspected in turn as it is rewound. So, on rewinding, each node is
inspected and values are read off (have they changed? against a hidden
field/against a (any) page, session or db?, are they valid (according to ...
there is a sophisticated built in framework for validation that can be
easily extended) and so forth. Then we want to know if that process has
finished then we can write out new values dependant on valid or other
pre-cons and all of the above.

example 1.
public abstract class CalendarField extends AbstractFormComponent{
...
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
...

if (form.isRewinding()) {
if (!disabled) { //< -- set by the client due to page logic and read in from
the request
updateDataFromRequest(name, displayName, form, delegate, cycle);
}
return;
}
// If the page is rewinding, but the form isn't,
// then no point in doing anything else.
/**
The page has been submited but not the contained form component, so no data
change in the form
**/

if (cycle.isRewinding()) {
return;
}
...

example 2.
public abstract class AutoCompleteComponent extends BaseComponent implements
ErroredComponent {
...
protected void renderComponent(IMarkupWriter iMarkupWriter,
IRequestCycle iRequestCycle) {
super.renderComponent(iMarkupWriter, iRequestCycle);
// if the component is running during the rewind phase, then
// there is no need to render the Javascript
/**
In other words you don't (can't) do rendering durring rewind.
**/
if (!iRequestCycle.isRewinding()) {

IScriptSource iScriptSource = iRequestCycle.getEngine()
.getScriptSource();
IResourceLocation specLocation = getSpecification().getLocation()
.getResourceLocation();
IResourceLocation scriptLocation = specLocation
.getRelativeLocation("autocomplete.script");

Body body = Body.get(iRequestCycle);
IScript script = iScriptSource.getScript(scriptLocation);

Map symbols = new HashMap();

symbols.put("component", this);

script.execute(iRequestCycle, body, symbols);
}

}

hth
Adam

On 21/11/05, Martijn Hinten <[EMAIL PROTECTED]> wrote:
>
> "Rewinding" means that Tapestry is processing the request, prior to
> rendering the response. IMHO the choice of the word "rewinding" is a
> bit hard to get used to at first.
>
> ---- Original Message ----
> From: [EMAIL PROTECTED]
> To: [email protected]
> Subject: RE: what's isRewinding and isRewound mean?
> Date: Mon, 21 Nov 2005 07:50:15 +0000 (UTC)
>
> >sorry for asking a so simple question, but i really don't know it,
> >anyone can
> >tell me what's they mine?
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >g
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to