[richfaces-issues] [JBoss JIRA] Updated: (RF-11112) PartialViewContext#getRenderIds() implementation returns empty set

Brian Leathem (JIRA) jira-events at lists.jboss.org
Wed Jul 20 02:38:23 EDT 2011


     [ https://issues.jboss.org/browse/RF-11112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-11112:
-------------------------------

      Fix Version/s: 4.1.0.Final
    Forum Reference: http://community.jboss.org/message/31413#31413  (was: http://community.jboss.org/message/31413#31413)


> PartialViewContext#getRenderIds() implementation returns empty set
> ------------------------------------------------------------------
>
>                 Key: RF-11112
>                 URL: https://issues.jboss.org/browse/RF-11112
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-a4j-core
>    Affects Versions: 4.0.0.Final
>         Environment: Win7 x64, Eclipse Helios SR2, JBoss AS 6.0.0 Final, RF 4.0.0 Final.
>            Reporter: Bauke Scholtz
>             Fix For: 4.1.0.Final
>
>
> During invoke action phase we would like to retrieve a list of partial render IDs for some specific preprocessing (resetting submitted values for the case they're embedded in another form). Those IDs are normally available by {{PartialViewContext#getRenderIds()}}.
> {code}
> PartialViewContext partialViewContext = FacesContext.getCurrentInstance().getPartialViewContext();
> Collection<String> renderIds = partialViewContext.getRenderIds();
> {code}
> This works fine in combination with standard JSF components, such as {{<h:commandLink><f:ajax render="foo"/></h:commandLink>}} However, when a RichFaces/A4J command component is been used, such as {{<a4j:commandLink render="foo" />}}, an empty collection is been returned instead. Debugging learns that the {{ExtendedPartialViewContextImpl}} implementation stores them in {{componentRenderIds}} instead of {{renderIds}} and never returns it on {{getRenderIds()}} method. The {{ExtendedPartialViewContextImpl}} also doesn't seem to use {{renderIds}} in a sensible manner anywhere else.
> I believe that {{componentRenderIds}} really has to be {{renderIds}} instead.
> As far now, we workarounded this by accessing the {{componentRenderIds}} field using reflection.
> {code}
> Collection<String> renderIds = partialViewContext.getRenderIds();
> if (renderIds.isEmpty() && partialViewContext instanceof ExtendedPartialViewContextImpl) {
>     try {
>         Field componentRenderIds = ExtendedPartialViewContextImpl.class.getDeclaredField("componentRenderIds");
>         componentRenderIds.setAccessible(true);
>         renderIds = (Collection<String>) componentRenderIds.get(partialViewContext);
>     } catch (Exception e) {
>         // Handle.
>     }
> }
> {code}
> However, this introduced a nasty dependency in our code.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list