Search in sources :

Example 1 with InternalFormSupport

use of org.apache.tapestry5.corelib.internal.InternalFormSupport in project tapestry-5 by apache.

the class AjaxFormUpdateControllerImpl method createInternalFormSupport.

private InternalFormSupport createInternalFormSupport(String formClientId, String formComponentId, ComponentActionSink actionSink) {
    // Kind of ugly, but the only way to ensure we don't have name collisions on the
    // client side is to force a unique id into each name (as well as each id, but that's
    // JavaScriptSupport's job). It would be nice if we could agree on the uid, but
    // not essential.
    String uid = Long.toHexString(System.nanoTime());
    IdAllocator idAllocator = new IdAllocator("_" + uid);
    Component formComponent = componentSource.getComponent(formComponentId);
    CaptureResultCallback<InternalFormSupport> callback = CaptureResultCallback.create();
    // This is a bit of a back-door to access a non-public method!
    formComponent.getComponentResources().triggerEvent("internalCreateRenderTimeFormSupport", new Object[] { formClientId, actionSink, idAllocator }, callback);
    return callback.getResult();
}
Also used : IdAllocator(org.apache.tapestry5.ioc.util.IdAllocator) InternalFormSupport(org.apache.tapestry5.corelib.internal.InternalFormSupport) Component(org.apache.tapestry5.runtime.Component)

Aggregations

InternalFormSupport (org.apache.tapestry5.corelib.internal.InternalFormSupport)1 IdAllocator (org.apache.tapestry5.ioc.util.IdAllocator)1 Component (org.apache.tapestry5.runtime.Component)1