You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "David Brainard (JIRA)" <de...@myfaces.apache.org> on 2007/11/01 22:07:50 UTC

[jira] Issue Comment Edited: (TOMAHAWK-1110) Action / ActionListener on t:headerLink

    [ https://issues.apache.org/jira/browse/TOMAHAWK-1110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539468 ] 

sdbrain edited comment on TOMAHAWK-1110 at 11/1/07 2:07 PM:
-------------------------------------------------------------------

I had a look into the prob.I think  it is due to the following reason:
Whenever we add a t:headerLink  to the header facet, the id for the link is modified by the following code in the encodeChildren() of the HtmlCollapsiblePanelRenderer class as follows
if (linkToReset != null) {
                resetId = linkToReset.getId();
                linkToReset.setId(collapsiblePanel.getId() + LINK_ID);
            }

so while decoding any call to the component.getClientId(facesContext); will result in recalculation of the id(according to the specs) so the clientId obtained by this call will never be equal to the id which is obtained from the form using this code
String reqValue = (String) facesContext.getExternalContext().getRequestParameterMap().get(
                HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo));

since the clientId and reqValue are not equal, never an action or an actionlistener registered with the link gets called.

soln:
By writing a renderer for HeaderLink where we override the decode method and change the way the clientId is calculated.

Pls correct me if i am wrong. ;)
I'll try to add a patch for this soon.




      was (Author: sdbrain):
    I had a look into the prob.I think  it is due to the following reason:
Whenever we add a t:headerLink  to the header facet, the id for the link is modified by the following code in the encodeChildren() of the HtmlCollapsiblePanelRenderer class as follows
if (linkToReset != null) {
                resetId = linkToReset.getId();
                linkToReset.setId(collapsiblePanel.getId() + LINK_ID);
            }

so while decoding any call to the component.getClientId(facesContext); will result in recalculation of the id(according to the specs) so the clientId obtained by this call will never be equal to the id which is obtained from the form using this code
String reqValue = (String) facesContext.getExternalContext().getRequestParameterMap().get(
                HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo));

since the clientId and reqValue are not equal, never an action or an actionlistener registered with the link gets called.

soln:
By writing a renderer for HeaderLink where we override the decode method and change the way the clientId is calculated.

I'll try to add a patch for this soon.



  
> Action / ActionListener on t:headerLink
> ---------------------------------------
>
>                 Key: TOMAHAWK-1110
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1110
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.6
>         Environment: Java 5 + Tomcat 6
>            Reporter: Jesper Pedersen
>
> The action and actionListener attributes of t:headerLink are never evaluated.
> F.ex.
>   <t:collapsiblePanel id="p1"
>                       value="#{b.collapsed}" 
>                       title="p1">
>     <f:facet name="header">
>       <t:headerLink value="H1"
>                      action="#{b.goMenu}">
>         <f:actionListener type="org.apache.test.menu.HeaderLinkActionListener" />
>       </t:headerLink>
>     </f:facet>
>     <h:panelGrid columns="1">
>       <h:panelGroup>
>         <h:outputText escape="false" value="Test"/>
>       </h:panelGroup>
>     </h:panelGrid>
>   </t:collapsiblePanel>
> Log statements in b.goMenu and processAction() are never displayed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.