ResetInputAjaxActionListener: RichFaces 4.5 ExtendedPartialViewContext does not return renderIds in INVOKE_APPLICATION phase #168

Closed
torgre opened this Issue Sep 24, 2015 · 2 comments

Projects

None yet

2 participants

@torgre
torgre commented Sep 24, 2015

The fix for #63 introduced support for RichFaces 4.5.

The old reflection hack gets the renderIds through the call to the field componentRenderIds. Although the new ExtendedPartialViewContext now extends from PartialViewContextWrapper, the method getRenderIds()only returns the correct ids when in RENDER_RESPONSE phase:

@Override
    public Collection<String> getRenderIds() {
        assertNotReleased();
        if (detectContextMode() == ContextMode.EXTENDED) {
            PhaseId currenPhaseId = facesContext.getCurrentPhaseId();
            if (renderIds == null) {
                renderIds = new LinkedHashSet<String>();
            }
            if (currenPhaseId == PhaseId.RENDER_RESPONSE) {
                visitActivatorAtRender();
            }
            return renderIds;
        } else {
            return wrappedViewContext.getRenderIds();
        }
    }

The visitActivatorAtRendermethod is responsible for collecting the render ids. If for example the ResetInputAjaxActionListeneris used, the getRenderIds() is called in INVOKE_APPLICATION phase, thus returning an empty list.

If I change the Hacks class to detect also RichFaces 4.5 ExtendedPartialViewContext and use the same reflection hack as for versions prior to 4.5, I get the correct render ids again.

@BalusC BalusC closed this in b4ea985 Sep 24, 2015
@BalusC
Member
BalusC commented Sep 24, 2015

Thank you for reporting. The fix is available in today's latest snapshot. Can you give it a try?

@torgre
torgre commented Sep 25, 2015

I can confirm it is fixed, I tested using latest Snapshot omnifaces-2.2-20150924.202210-25 with RichFaces 4.5.9.Final. Thanks!

@BalusC BalusC added the bug label Oct 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment