Hi Igor :)

yes, I've seen a similar thing in the FormInjector's code.

This line does (most of) the trick:
FormSupport formSupport = form.createRenderTimeFormSupport(form.getClientId(), actionSink, new IdAllocator());

But unfortunately the form's createRenderTimeFormSupport is in default scope, so I cannot call it unless I use a component with this zone-feature (or create a org.apache.tapestry5.corelib.components package in my project?). In my particular case I'm dependent on a radio-button, which does not have this zone parameter, yet. Maybe it would be sufficient if I could call the FormSupportImpl's constructor, wrapping the problematic functionality in some workaround-component:

FormSupport formSupport = new FormSupportImpl(resources, name, actionSink, clientBehaviorSupport,
                clientValidation, allocator, validationId);
// ... then push formSupport to the environment

This could be done by accessing the form's private members (as I obviously need the form component's resources, etc.) ... by reflection maybe? Or is there some Tapestry-Util or service doing that already? There was something in the TestBase class that I could use:

    Field field = findField(object.getClass(), fieldName);
    field.setAccessible(true);
    return field.get(object);

A better approach doesn't come to my mind now. Better idea, anyone?

What do you think about a JIRA requesting the implementation of the zone parameter for all AbstractFields? This would be a great addition to the framework IMHO.
I'd volunteer to open and possibly contribute some time for it ;)


Thanks,
Christian


Am 27.12.09 23:59, schrieb Igor Drobiazko:
Hi Christian,

you can also have a look at how TAP5-138 is fixed.

https://issues.apache.org/jira/browse/TAP5-138

On Sun, Dec 27, 2009 at 8:00 PM, Christian Riedel
<christian-rie...@gmx.net>wrote:

Hi list,

I am currently studying the sources of Tapestry to find out whether or not
I am able to push the formSupport into the environment before the body of a
Zone is rendered.

<t:form>

<!-- here be some control that triggers the zone update -->

<t:zone>
<t:textfield value="i.want.this.to.be.updated">
</t:zone>

</t:form>


I know why it's not working and I've seen the code of FormInjector that
does a pretty good job publishing the FormSupport.
Some other threads in the list about that topic were leading to no
result... but does someone have at least a workaround or maybe an idea for a
possible workaround? :)

Besides that, is there already an issue in JIRA for "Extending a Form with
a Zone"? The documentation at least is mentioning it...

Cheers
Christian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to