[richfaces-issues] [JBoss JIRA] (RF-11112) PartialViewContext#getRenderIds() implementation returns empty set
Brian Leathem (Updated) (JIRA)
jira-events at lists.jboss.org
Wed Oct 5 14:34:16 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.CR1
(was: 4.1.0.Tracking)
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.CR1
>
>
> 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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the richfaces-issues
mailing list