[
https://issues.apache.org/jira/browse/MYFACES-3833?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13850168#comment-13850168
]
Ricard Moré commented on MYFACES-3833:
--------------------------------------
Hi,
Before to create the issue I tried adding the jsf:id attribute as you said:
<div jsf:id="div1" style="width: 50px; height: 100px; background-color: blue;">
<f:ajax event="click" render="@this"
listener="#{bean.metodoParam('ajax')}"/>
</div>
<div jsf:id="div2" style="width: 50px; height: 100px; background-color: red;">
<f:ajax event="click" render="@this"
listener="#{bean.metodoParam2('ajax2')}"/>
</div>
But I only get an error message, and the div elements are not even added to the
DOM tree:
Warning: The page /lab/html.jsp declares namespace null and uses the tag
http://xmlns.jcp.org/jsf , but no TagLibrary associated to namespace
Ok, I'll ask to the users list in order to be sure that this is really a bug.
Maybe I'm doing something wrong, but it don't looks like sincerily, because the
jsf:id attribute works for an input tag I added to the same page:
> Two different ajax listener for two different divs
> --------------------------------------------------
>
> Key: MYFACES-3833
> URL: https://issues.apache.org/jira/browse/MYFACES-3833
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-344
> Affects Versions: 2.2.0-beta
> Environment: Tomcat 7, JDK 7
> Reporter: Ricard Moré
> Assignee: Leonardo Uribe
>
> Hi,
> I just started to evaluate beta version of MyFaces 2.2.
> In JSF 2.2 you are supposed to be able to add ajax calls directly to any HTML
> element. I tried with 2 different divs calling two different methods using
> ajax:
> <div id="clickCounter" style="width: 50px; height: 100px; background-color:
> blue;">
> <f:ajax event="click" render="@this"
> listener="#{bean.metodoParam('ajax')}"/>
> </div>
> <div id="clickCounter2" style="width: 50px; height: 100px; background-color:
> red;">
> <f:ajax event="click" render="@this"
> listener="#{bean.metodoParam2('ajax2')}"/>
> </div>
> But clicking both divs the methodParam (the first one) is called. Seems to be
> dued cause of the onclick event is added directly to the form instead of each
> div.
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)