MyFaces Core
  1. MyFaces Core
  2. MYFACES-3115

jsf.js event handler source id might be missing

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.5
    • Fix Version/s: 2.0.6
    • Component/s: None
    • Labels:
      None

      Description

      Martin Koci reported about a missing context.source.id in the event handling. I rather suspect this not being a bug since we had some name fallback in 2.0.4 which was removed to due to being not entirely correct this needs to be investigated.

        Issue Links

          Activity

          Werner Punz created issue -
          Hide
          Werner Punz added a comment -

          ok the example from Martin Koci was not reproducable, I have requested the sourcecode causing this problem.
          I assume that a missing id on Martins side is the cause. Up until 2.0.5 there was some fixup code which tried to determine the id nevertheless, which was not entirely correct so this was dropped. The JSF ri assumes that an id must be set anyway.

          Show
          Werner Punz added a comment - ok the example from Martin Koci was not reproducable, I have requested the sourcecode causing this problem. I assume that a missing id on Martins side is the cause. Up until 2.0.5 there was some fixup code which tried to determine the id nevertheless, which was not entirely correct so this was dropped. The JSF ri assumes that an id must be set anyway.
          Hide
          Martin Kočí added a comment -

          Here are code snippets:

          sample.xhtml:

          <f:view
          xmlns="http://www.w3.org/1999/xhtml"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html">
          <h:head>
          <h:outputScript name="jsf.js" library="javax.faces" />
          <h:outputScript name="project.js" />
          </h:head>
          <h:body>
          <h:form id="form1">
          <h:commandButton value="Partial">
          <f:ajax execute="@this" render="@this" />
          </h:commandButton>
          </h:form>
          </h:body>
          </f:view>

          project.js:

          jsf.ajax.addOnEvent( function (data)

          { var test = data.source.id; }

          );

          with 2.0.6-snapshot:
          Error: data.source is undefined
          Source: http://localhost:8080/project/faces/javax.faces.resource/project.js
          Line: 2

          Works fine with 2.0.4

          Show
          Martin Kočí added a comment - Here are code snippets: sample.xhtml: <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <h:outputScript name="jsf.js" library="javax.faces" /> <h:outputScript name="project.js" /> </h:head> <h:body> <h:form id="form1"> <h:commandButton value="Partial"> <f:ajax execute="@this" render="@this" /> </h:commandButton> </h:form> </h:body> </f:view> project.js: jsf.ajax.addOnEvent( function (data) { var test = data.source.id; } ); with 2.0.6-snapshot: Error: data.source is undefined Source: http://localhost:8080/project/faces/javax.faces.resource/project.js Line: 2 Works fine with 2.0.4
          Hide
          Werner Punz added a comment -

          Ok I can reconfirm the issue, interesting issue indeed because the ids are properly set.

          Show
          Werner Punz added a comment - Ok I can reconfirm the issue, interesting issue indeed because the ids are properly set.
          Hide
          Werner Punz added a comment -

          Ok I think i found it, it was an problematic event call, the context was bypassed due to a refactoring done between 2.0.4 and 2.0.5

          Show
          Werner Punz added a comment - Ok I think i found it, it was an problematic event call, the context was bypassed due to a refactoring done between 2.0.4 and 2.0.5
          Werner Punz made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.0.6-SNAPSHOT [ 12316347 ]
          Resolution Fixed [ 1 ]
          Rene O made changes -
          Link This issue relates to MYFACES-3080 [ MYFACES-3080 ]
          Leonardo Uribe made changes -
          Fix Version/s 2.0.6 [ 12316397 ]
          Fix Version/s 2.0.6-SNAPSHOT [ 12316347 ]
          Leonardo Uribe made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Werner Punz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development