[richfaces-issues] [JBoss JIRA] (RF-12971) a4j:commandButton does not evaluate value expressions in “oncomplete” attribute.

Holger L (JIRA) jira-events at lists.jboss.org
Wed May 8 21:16:54 EDT 2013


    [ https://issues.jboss.org/browse/RF-12971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773098#comment-12773098 ] 

Holger L edited comment on RF-12971 at 5/8/13 9:16 PM:
-------------------------------------------------------

This causes a javascript error: "Cannot call method 'show' of undefined"

The following seems to work with the workaround:
{code} 
<ui:param name="editModalName" value="editMarginModal${tableId}" />
<a4j:commandButton id="issueButton"
    onclick="alert('tableId is: editMarginModal${tableId}');"
    oncomplete="#{rich:component(editModalName)}.show()"
    action="#{richBean.helloWorld(margin)}"
    image="img/iconEdit.png" 
    render="editMarginModal${tableId}">
</a4j:commandButton>
{code} 
Is there a proper way using RichFaces.$ without having to define the ui:param?
                
      was (Author: holger.lierse):
    This causes a javascript error: "Cannot call method 'show' of undefined"

The following seems to work with the workaround:

<ui:param name="editModalName" value="editMarginModal${tableId}" />
<a4j:commandButton id="issueButton"
    onclick="alert('tableId is: editMarginModal${tableId}');"
    oncomplete="#{rich:component(editModalName)}.show()"
    action="#{richBean.helloWorld(margin)}"
    image="img/iconEdit.png" 
    render="editMarginModal${tableId}">
</a4j:commandButton>

Is there a proper way using RichFaces.$ without having to define the ui:param?

                  
> a4j:commandButton does not evaluate value expressions in “oncomplete” attribute.
> --------------------------------------------------------------------------------
>
>                 Key: RF-12971
>                 URL: https://issues.jboss.org/browse/RF-12971
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-a4j-core
>    Affects Versions: 4.3.1
>            Reporter: Ilia Vassilev
>            Assignee: Brian Leathem
>         Attachments: richfaces_sample_app.zip
>
>
> The following code works in RF 3, but not in RF 4. The "tableId" does not evaluate to a value in "oncomplete" attribute.
> {code}
> <a4j:commandButton id="issueButton"
> 				onclick="alert('tableId is: editMarginModal${tableId}');"
> 				oncomplete="#{rich:component('editMarginModal${tableId}')}.show()"
> 				action="#{richBean.helloWorld(margin)}"
> 				image="img/iconEdit.png" 
> 				render="editMarginModal${tableId}">
> 			</a4j:commandButton>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the richfaces-issues mailing list