You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Michail Jekimov (JIRA)" <de...@myfaces.apache.org> on 2007/01/15 16:48:27 UTC
[jira] Created: (TOMAHAWK-858) Property selectedIndex of the
panelTabbedPane component does not accept value bindings
Property selectedIndex of the panelTabbedPane component does not accept value bindings
--------------------------------------------------------------------------------------
Key: TOMAHAWK-858
URL: https://issues.apache.org/jira/browse/TOMAHAWK-858
Project: MyFaces Tomahawk
Issue Type: Bug
Components: Tabbed Pane
Affects Versions: 1.1.5-SNAPSHOT
Environment: WinXP, JDK 1.5, JBoss 4.0.4 GA, Facelets
Reporter: Michail Jekimov
The following works fine:
<t:panelTabbedPane styleClass="panelTabbedPane"
activeTabStyleClass="activeTab" inactiveTabStyleClass="inactiveTab"
tabContentStyleClass="tabContent"
selectedIndex="3"
disabledTabStyleClass="inactiveTab" serverSideTabSwitch="false">
<t:panelTab id="tab1" label="Tab 1">
<ui:include src="/Tab1.xhtml" />
</t:panelTab>
<t:panelTab id="tab2" label="Tab 2">
<ui:include src="/Tab2.xhtml" />
</t:panelTab>
<t:panelTab id="tab3" label="Tab 3">
<ui:include src="/Tab3.xhtml" />
</t:panelTab>
</t:panelTabbedPane>
I.e. the tab tab3 is visible when the tabbed pane is rendered. But if I set selectedIndex="#{myBean.selectedTabIndex}" then tab1 is always visible first, regardless of the value of myBean.selectedTabIndex
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (TOMAHAWK-858) Property selectedIndex of the
panelTabbedPane component does not accept value bindings
Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TOMAHAWK-858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581605#action_12581605 ]
Andrew Robinson commented on TOMAHAWK-858:
------------------------------------------
I started a discussion on this bug in the dev user list as I do not feel the fix is appropriate for the problem and this problem should be addressed for all tomahawk and trinidad components that may set local component values from other components or renderers.
> Property selectedIndex of the panelTabbedPane component does not accept value bindings
> --------------------------------------------------------------------------------------
>
> Key: TOMAHAWK-858
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-858
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Tabbed Pane
> Affects Versions: 1.1.5-SNAPSHOT
> Environment: WinXP, JDK 1.5, JBoss 4.0.4 GA, Facelets
> Reporter: Michail Jekimov
> Attachments: HtmlPanelTabbedPane.class, HtmlPanelTabbedPane.java
>
>
> The following works fine:
> <t:panelTabbedPane styleClass="panelTabbedPane"
> activeTabStyleClass="activeTab" inactiveTabStyleClass="inactiveTab"
> tabContentStyleClass="tabContent"
> selectedIndex="3"
> disabledTabStyleClass="inactiveTab" serverSideTabSwitch="false">
> <t:panelTab id="tab1" label="Tab 1">
> <ui:include src="/Tab1.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab2" label="Tab 2">
> <ui:include src="/Tab2.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab3" label="Tab 3">
> <ui:include src="/Tab3.xhtml" />
> </t:panelTab>
> </t:panelTabbedPane>
> I.e. the tab tab3 is visible when the tabbed pane is rendered. But if I set selectedIndex="#{myBean.selectedTabIndex}" then tab1 is always visible first, regardless of the value of myBean.selectedTabIndex
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TOMAHAWK-858) Property selectedIndex of the
panelTabbedPane component does not accept value bindings
Posted by "Michael Lipp (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TOMAHAWK-858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581378#action_12581378 ]
Michael Lipp commented on TOMAHAWK-858:
---------------------------------------
Close. IMHO the fixed method should read:
public void setSelectedIndex(int selectedIndex) {
ValueBinding vb = getValueBinding("selectedIndex");
if (vb == null) {
_selectedIndex = new Integer(selectedIndex);
return;
}
vb.setValue(getFacesContext(), new Integer(selectedIndex));
}
> Property selectedIndex of the panelTabbedPane component does not accept value bindings
> --------------------------------------------------------------------------------------
>
> Key: TOMAHAWK-858
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-858
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Tabbed Pane
> Affects Versions: 1.1.5-SNAPSHOT
> Environment: WinXP, JDK 1.5, JBoss 4.0.4 GA, Facelets
> Reporter: Michail Jekimov
> Attachments: HtmlPanelTabbedPane.class, HtmlPanelTabbedPane.java
>
>
> The following works fine:
> <t:panelTabbedPane styleClass="panelTabbedPane"
> activeTabStyleClass="activeTab" inactiveTabStyleClass="inactiveTab"
> tabContentStyleClass="tabContent"
> selectedIndex="3"
> disabledTabStyleClass="inactiveTab" serverSideTabSwitch="false">
> <t:panelTab id="tab1" label="Tab 1">
> <ui:include src="/Tab1.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab2" label="Tab 2">
> <ui:include src="/Tab2.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab3" label="Tab 3">
> <ui:include src="/Tab3.xhtml" />
> </t:panelTab>
> </t:panelTabbedPane>
> I.e. the tab tab3 is visible when the tabbed pane is rendered. But if I set selectedIndex="#{myBean.selectedTabIndex}" then tab1 is always visible first, regardless of the value of myBean.selectedTabIndex
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (TOMAHAWK-858) Property selectedIndex of the
panelTabbedPane component does not accept value bindings
Posted by "Alex Alvarez (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TOMAHAWK-858?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Alvarez updated TOMAHAWK-858:
----------------------------------
Status: Patch Available (was: Open)
> Property selectedIndex of the panelTabbedPane component does not accept value bindings
> --------------------------------------------------------------------------------------
>
> Key: TOMAHAWK-858
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-858
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Tabbed Pane
> Affects Versions: 1.1.5-SNAPSHOT
> Environment: WinXP, JDK 1.5, JBoss 4.0.4 GA, Facelets
> Reporter: Michail Jekimov
> Attachments: HtmlPanelTabbedPane.java
>
>
> The following works fine:
> <t:panelTabbedPane styleClass="panelTabbedPane"
> activeTabStyleClass="activeTab" inactiveTabStyleClass="inactiveTab"
> tabContentStyleClass="tabContent"
> selectedIndex="3"
> disabledTabStyleClass="inactiveTab" serverSideTabSwitch="false">
> <t:panelTab id="tab1" label="Tab 1">
> <ui:include src="/Tab1.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab2" label="Tab 2">
> <ui:include src="/Tab2.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab3" label="Tab 3">
> <ui:include src="/Tab3.xhtml" />
> </t:panelTab>
> </t:panelTabbedPane>
> I.e. the tab tab3 is visible when the tabbed pane is rendered. But if I set selectedIndex="#{myBean.selectedTabIndex}" then tab1 is always visible first, regardless of the value of myBean.selectedTabIndex
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TOMAHAWK-858) Property selectedIndex of the
panelTabbedPane component does not accept value bindings
Posted by "Michael Lipp (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TOMAHAWK-858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581382#action_12581382 ]
Michael Lipp commented on TOMAHAWK-858:
---------------------------------------
I forgot: Problem and patch both still apply to 1.1.6!
> Property selectedIndex of the panelTabbedPane component does not accept value bindings
> --------------------------------------------------------------------------------------
>
> Key: TOMAHAWK-858
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-858
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Tabbed Pane
> Affects Versions: 1.1.5-SNAPSHOT
> Environment: WinXP, JDK 1.5, JBoss 4.0.4 GA, Facelets
> Reporter: Michail Jekimov
> Attachments: HtmlPanelTabbedPane.class, HtmlPanelTabbedPane.java
>
>
> The following works fine:
> <t:panelTabbedPane styleClass="panelTabbedPane"
> activeTabStyleClass="activeTab" inactiveTabStyleClass="inactiveTab"
> tabContentStyleClass="tabContent"
> selectedIndex="3"
> disabledTabStyleClass="inactiveTab" serverSideTabSwitch="false">
> <t:panelTab id="tab1" label="Tab 1">
> <ui:include src="/Tab1.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab2" label="Tab 2">
> <ui:include src="/Tab2.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab3" label="Tab 3">
> <ui:include src="/Tab3.xhtml" />
> </t:panelTab>
> </t:panelTabbedPane>
> I.e. the tab tab3 is visible when the tabbed pane is rendered. But if I set selectedIndex="#{myBean.selectedTabIndex}" then tab1 is always visible first, regardless of the value of myBean.selectedTabIndex
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (TOMAHAWK-858) Property selectedIndex of the
panelTabbedPane component does not accept value bindings
Posted by "Michael Lipp (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/TOMAHAWK-858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12581381#action_12581381 ]
Michael Lipp commented on TOMAHAWK-858:
---------------------------------------
Thought about it again. Actually, the setXXX methods always set the local value, thus overriding any value binding. Therefore the *real* patch is to modify broadcast:
public void broadcast(FacesEvent event) throws AbortProcessingException {
if (event instanceof TabChangeEvent)
{
TabChangeEvent tabChangeEvent = (TabChangeEvent)event;
if (tabChangeEvent.getComponent() == this)
{
ValueBinding vb = getValueBinding("selectedIndex");
if (vb == null) {
setSelectedIndex(tabChangeEvent.getNewTabIndex());
} else {
vb.setValue(getFacesContext(),
new Integer(tabChangeEvent.getNewTabIndex()));
}
getFacesContext().renderResponse();
}
}
...
> Property selectedIndex of the panelTabbedPane component does not accept value bindings
> --------------------------------------------------------------------------------------
>
> Key: TOMAHAWK-858
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-858
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Tabbed Pane
> Affects Versions: 1.1.5-SNAPSHOT
> Environment: WinXP, JDK 1.5, JBoss 4.0.4 GA, Facelets
> Reporter: Michail Jekimov
> Attachments: HtmlPanelTabbedPane.class, HtmlPanelTabbedPane.java
>
>
> The following works fine:
> <t:panelTabbedPane styleClass="panelTabbedPane"
> activeTabStyleClass="activeTab" inactiveTabStyleClass="inactiveTab"
> tabContentStyleClass="tabContent"
> selectedIndex="3"
> disabledTabStyleClass="inactiveTab" serverSideTabSwitch="false">
> <t:panelTab id="tab1" label="Tab 1">
> <ui:include src="/Tab1.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab2" label="Tab 2">
> <ui:include src="/Tab2.xhtml" />
> </t:panelTab>
> <t:panelTab id="tab3" label="Tab 3">
> <ui:include src="/Tab3.xhtml" />
> </t:panelTab>
> </t:panelTabbedPane>
> I.e. the tab tab3 is visible when the tabbed pane is rendered. But if I set selectedIndex="#{myBean.selectedTabIndex}" then tab1 is always visible first, regardless of the value of myBean.selectedTabIndex
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.