[
https://issues.jboss.org/browse/RF-11950?page=com.atlassian.jira.plugin.s...
]
Brian Leathem updated RF-11950:
-------------------------------
Description:
The rich:findComponent does not retrieve the component - What we want to achieve is to
send .click() event on a command button. We got different errors depending the tests we
made such as syntax error.
The involved code:
------------------
{code}
<!-- -->
<!-- CANCEL -->
<!-- -->
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="#{rich:findComponent('#{activity.id}-closeCmd')}.click();;return
false;"
render="#{tab.id}-tabsClient"
immediate="true" />
{code}
The error we got:
----------------
{code}
syntax error - [Stopper sur une erreur] - jsf.js.jsf?ln=javax.faces (ligne 1)
.click();return false;
{code}
The corresponding view source:
------------------------------
{code}
<input type="submit" value="Cancel"
onclick="jsf.util.chain(this,event,".click();return false;",
"RichFaces.ajax(
\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;"
name="tabbedForm:TAB_CLIENT-1-rcd-cancelCreateCmd"
id="tabbedForm:TAB_CLIENT-1-rcd-cancelCreateCmd">
{code}
The generated javaScript under firebug:
--------------------------------------
{code}
function onclick(event) {
jsf.util.chain(this, event, ".click();return false;",
"RichFaces.ajax(\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;
}
{code}
If we hard code the Id instead of the calculated one we got following error:
{code}
uncaught exception: Syntax error, unrecognized expression: TAB_CLIENT-1-TAB_RCD-closeCmd
Line 0
{code}
The generated javaScript under firebug:
--------------------------------------
{code}
function anonymous(event) {
rich:
findComponent("TAB_CLIENT-1-TAB_RCD-closeCmd").click();
return false;
}
{code}
If we use directly jQuery:
{code}
<!-- -->
<!-- CANCEL -->
<!-- -->
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="$('##{activity.id}-closeCmd').click();return
false;"
render="desktopTabPanel"
immediate="true" />
{code}
{code}
missing ; before statement
http://localhost:12000/crm/javax.faces.resource/jsf.js.jsf?ln=javax.faces
Line 1
{code}
If we hardcode an existing static Id, we got the error as shown the screen capture:
{code}
function onclick(event) {
jsf.util.chain(this, event,
"org.richfaces.component.UICommandButton(a)39de2ca.click();",
"RichFaces.ajax(\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;
}
{code}
{code}
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="#{rich:findComponent('qsearchClient')}.click();"
render="#{tab.id}-tabsClient"
immediate="true" /> 
{code}
was:
The rich:findComponent does not retrieve the component - What we want to achieve is to
send .click() event on a command button. We got different errors depending the tests we
made such as syntax error.
The involved code:
------------------
<!-- -->
<!-- CANCEL -->
<!-- -->
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="#{rich:findComponent('#{activity.id}-closeCmd')}.click();;return
false;"
render="#{tab.id}-tabsClient"
immediate="true" />
The error we got:
----------------
syntax error - [Stopper sur une erreur] - jsf.js.jsf?ln=javax.faces (ligne 1)
.click();return false;
The corresponding view source:
------------------------------
<input type="submit" value="Cancel"
onclick="jsf.util.chain(this,event,".click();return
false;","RichFaces.ajax(\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");return false;"
name="tabbedForm:TAB_CLIENT-1-rcd-cancelCreateCmd"
id="tabbedForm:TAB_CLIENT-1-rcd-cancelCreateCmd">
The generated javaScript under firebug:
--------------------------------------
function onclick(event) {
jsf.util.chain(this, event, ".click();return false;",
"RichFaces.ajax(\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;
}
If we hard code the Id instead of the calculated one we got following error:
uncaught exception: Syntax error, unrecognized expression: TAB_CLIENT-1-TAB_RCD-closeCmd
Line 0
The generated javaScript under firebug:
--------------------------------------
function anonymous(event) {
rich:
findComponent("TAB_CLIENT-1-TAB_RCD-closeCmd").click();
return false;
}
If we use directly jQuery:
<!-- -->
<!-- CANCEL -->
<!-- -->
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="$('##{activity.id}-closeCmd').click();return
false;"
render="desktopTabPanel"
immediate="true" />
missing ; before statement
http://localhost:12000/crm/javax.faces.resource/jsf.js.jsf?ln=javax.faces
Line 1
If we hardcode an existing static Id, we got the error as shown the screen capture:
function onclick(event) {
jsf.util.chain(this, event,
"org.richfaces.component.UICommandButton(a)39de2ca.click();",
"RichFaces.ajax(\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;
}
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="#{rich:findComponent('qsearchClient')}.click();"
render="#{tab.id}-tabsClient"
immediate="true" /> 
Assignee: Pavol Pitonak
QE please confirm
rich:findComponent does not retrieve the component
---------------------------------------------------
Key: RF-11950
URL:
https://issues.jboss.org/browse/RF-11950
Project: RichFaces
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: base functionality
Affects Versions: 4.1.0.Final
Environment: Websphere 8 - RAD 8 - JSF Mojorra 2.1.4 - Spring 3.0.6 Final -
Firefox 10.0 - Windows 7 (6.1 sp1)
Reporter: Jean ANDRE
Assignee: Pavol Pitonak
Attachments: index.xhtml, listClient.xhtml, requestClientDocument.xhtml,
tabsClient.xhtml
The rich:findComponent does not retrieve the component - What we want to achieve is to
send .click() event on a command button. We got different errors depending the tests we
made such as syntax error.
The involved code:
------------------
{code}
<!-- -->
<!-- CANCEL -->
<!-- -->
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="#{rich:findComponent('#{activity.id}-closeCmd')}.click();;return
false;"
render="#{tab.id}-tabsClient"
immediate="true" />
{code}
The error we got:
----------------
{code}
syntax error - [Stopper sur une erreur] - jsf.js.jsf?ln=javax.faces (ligne 1)
.click();return false;
{code}
The corresponding view source:
------------------------------
{code}
<input type="submit" value="Cancel"
onclick="jsf.util.chain(this,event,".click();return false;",
"RichFaces.ajax(
\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;"
name="tabbedForm:TAB_CLIENT-1-rcd-cancelCreateCmd"
id="tabbedForm:TAB_CLIENT-1-rcd-cancelCreateCmd">
{code}
The generated javaScript under firebug:
--------------------------------------
{code}
function onclick(event) {
jsf.util.chain(this, event, ".click();return false;",
"RichFaces.ajax(\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;
}
{code}
If we hard code the Id instead of the calculated one we got following error:
{code}
uncaught exception: Syntax error, unrecognized expression: TAB_CLIENT-1-TAB_RCD-closeCmd
Line 0
{code}
The generated javaScript under firebug:
--------------------------------------
{code}
function anonymous(event) {
rich:
findComponent("TAB_CLIENT-1-TAB_RCD-closeCmd").click();
return false;
}
{code}
If we use directly jQuery:
{code}
<!-- -->
<!-- CANCEL -->
<!-- -->
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="$('##{activity.id}-closeCmd').click();return
false;"
render="desktopTabPanel"
immediate="true" />
{code}
{code}
missing ; before statement
http://localhost:12000/crm/javax.faces.resource/jsf.js.jsf?ln=javax.faces
Line 1
{code}
If we hardcode an existing static Id, we got the error as shown the screen capture:
{code}
function onclick(event) {
jsf.util.chain(this, event,
"org.richfaces.component.UICommandButton(a)39de2ca.click();",
"RichFaces.ajax(\"tabbedForm:TAB_CLIENT\\u002D1\\u002Drcd\\u002DcancelCreateCmd\",event,{\"incId\":\"1\"}
)");
return false;
}
{code}
{code}
<a4j:commandButton id="#{tab.id}-rcd-cancelCreateCmd"
value="#{msg['common.command.cancel']}"
onclick="#{rich:findComponent('qsearchClient')}.click();"
render="#{tab.id}-tabsClient"
immediate="true" /> 
{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