You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Paul Spencer <pa...@apache.org> on 2006/09/14 17:21:40 UTC
Components using an Alias bean are rendered when it's parent tabbedpane
is not! This is causing a javax.faces.FacesException? (REPOST)
(MyFaces + Tomahawk both 1.1.4-SNAPSHOT and 1.1.5-SNAPSHOT)
I have defined an aliasBean in a tabbed pane. If that tab is not the
current tab, the components that use the aliased bean are rendered even
though they are not displayed on the page. This becomes a problem when
the rendering fails.
**
* The example below is simplified version of what I am trying to do.
**
The pages initially displays the tab "Summary Report" and none of the
radio button are selected. When I select the tab "Finance Report" and
select any of the radio buttons, I see the following:
1) The valueChangeAction is called.
2) The exception "javax.faces.FacesException: Value is no String"
is displayed. In addition the error references the following
components:
{Component-Path :
[Class: javax.faces.component.UIViewRoot,ViewId: /query.jsp]
[Class:
org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPane,Id: _idJsp1]
[Class: org.apache.myfaces.custom.tabbedpane.HtmlPanelTab,Id: _idJsp2]
[Class: javax.faces.component.html.HtmlForm,Id: SummaryForm]
[Class: org.apache.myfaces.custom.aliasbean.AliasBean,Id: test_ab]
[Class: javax.faces.component.UINamingContainer,Id: test]
[Class: javax.faces.component.html.HtmlSelectOneRadio,Id: test_s1r]
}
** JSP code
<t:panelTabbedPane>
<t:panelTab label="Summary Report">
<h:form id="SummaryForm">
<t:aliasBean id="test_ab" alias="#{manager1}"
value="#{SummaryManager}">
<f:subview id="test">
<h:selectOneRadio id="test_s1r"
value="#{manager1.periodType}">
<f:selectItem itemLabel="Month To Date" itemValue="mtd" />
<f:selectItem itemLabel="Current Day" itemValue="now" />
</h:selectOneRadio>
</f:subview>
</t:aliasBean>
</h:form>
</t:panelTab>
<t:panelTab label="Finance Report">
<h:form>
<t:aliasBean alias="#{manager}"
value="#{financeManager}">
<f:subview id="test">
<h:selectOneRadio value="#{manager.periodType}"
valueChangeListener="#{manager.changePeriodType}"
onclick="submit();">
<f:selectItem itemLabel="Month To Date" itemValue="mtd" />
<f:selectItem itemLabel="Current Day" itemValue="now" />
</h:selectOneRadio>
</f:subview>
</t:aliasBean>
</h:form>
</t:panelTab>
</t:panelTabbedPane>
Note: If the #{SummaryManager.periodType} is not null, every thing work
as expected :(
1) Is this a bug?
2) Suggested workarounds?
Paul Spencer
Re: Components using an Alias bean are rendered when it's parent
tabbedpane is not! This is causing a javax.faces.FacesException? (REPOST)
Posted by Wdiaz <wd...@unipamplona.edu.co>.
In which line you have teh error?
SummaryManager, financeManager they are Beans declared in the file xml?
Paul Spencer escribió:
> (MyFaces + Tomahawk both 1.1.4-SNAPSHOT and 1.1.5-SNAPSHOT)
> I have defined an aliasBean in a tabbed pane. If that tab is not the
> current tab, the components that use the aliased bean are rendered even
> though they are not displayed on the page. This becomes a problem when
> the rendering fails.
>
> **
> * The example below is simplified version of what I am trying to do.
> **
> The pages initially displays the tab "Summary Report" and none of the
> radio button are selected. When I select the tab "Finance Report" and
> select any of the radio buttons, I see the following:
>
> 1) The valueChangeAction is called.
> 2) The exception "javax.faces.FacesException: Value is no String"
> is displayed. In addition the error references the following
> components:
> {Component-Path :
> [Class: javax.faces.component.UIViewRoot,ViewId: /query.jsp]
> [Class:
> org.apache.myfaces.custom.tabbedpane.HtmlPanelTabbedPane,Id: _idJsp1]
> [Class: org.apache.myfaces.custom.tabbedpane.HtmlPanelTab,Id:
> _idJsp2]
> [Class: javax.faces.component.html.HtmlForm,Id: SummaryForm]
> [Class: org.apache.myfaces.custom.aliasbean.AliasBean,Id: test_ab]
> [Class: javax.faces.component.UINamingContainer,Id: test]
> [Class: javax.faces.component.html.HtmlSelectOneRadio,Id: test_s1r]
> }
>
>
>
> ** JSP code
>
> <t:panelTabbedPane>
> <t:panelTab label="Summary Report">
> <h:form id="SummaryForm">
> <t:aliasBean id="test_ab" alias="#{manager1}"
> value="#{SummaryManager}">
> <f:subview id="test">
> <h:selectOneRadio id="test_s1r"
> value="#{manager1.periodType}">
> <f:selectItem itemLabel="Month To Date" itemValue="mtd" />
> <f:selectItem itemLabel="Current Day" itemValue="now" />
> </h:selectOneRadio>
> </f:subview>
> </t:aliasBean>
> </h:form>
> </t:panelTab>
> <t:panelTab label="Finance Report">
> <h:form>
> <t:aliasBean alias="#{manager}"
> value="#{financeManager}">
> <f:subview id="test">
> <h:selectOneRadio value="#{manager.periodType}"
> valueChangeListener="#{manager.changePeriodType}"
> onclick="submit();">
> <f:selectItem itemLabel="Month To Date" itemValue="mtd" />
> <f:selectItem itemLabel="Current Day" itemValue="now" />
> </h:selectOneRadio>
> </f:subview>
> </t:aliasBean>
> </h:form>
> </t:panelTab>
> </t:panelTabbedPane>
>
>
> Note: If the #{SummaryManager.periodType} is not null, every thing work
> as expected :(
>
>
> 1) Is this a bug?
>
> 2) Suggested workarounds?
>
> Paul Spencer
>
>
--
Cordialmente
William Diaz Pabón
Coordinador Técnico de Desarrollo
Vicerrectoría de Gestión y Desarrollo Tecnológico
Universidad de Pamplona