Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-relevant event handler should not run #134

Closed
ebruchez opened this issue Apr 11, 2012 · 8 comments
Closed

Non-relevant event handler should not run #134

ebruchez opened this issue Apr 11, 2012 · 8 comments

Comments

@ebruchez
Copy link
Collaborator

To reproduce, run http://db.tt/5CDa9n9, click on the button: the message "Go
event" is shown, while it shouldn't.

Moved from:

http://forge.ow2.org/tracker/index.php?func=detail&aid=316007&group_id=168&atid=350207

@ghost ghost assigned ebruchez Apr 11, 2012
@avernet
Copy link
Collaborator

avernet commented Nov 28, 2013

The above link to the test case isn't valid anymore, but here is its source:

<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:fr="http://orbeon.org/oxf/xml/form-runner">
    <xhtml:head>
        <xhtml:title>Dispatch to non-relevant control</xhtml:title>
        <xforms:model>
            <xforms:instance>
                <instance>
                </instance>
            </xforms:instance>
            <xforms:bind ref="." relevant="false()"/>
        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        <xforms:trigger appearance="minimal">
            <xforms:label>Dispatch event</xforms:label>
            <xforms:dispatch ev:event="DOMActivate" name="my-event" target="my-input"/>
        </xforms:trigger>
        <xforms:input ref="." id="my-input">
            <xforms:label/>
            <xforms:message ev:event="my-event">Go event</xforms:message>
        </xforms:input>
    </xhtml:body>
</xhtml:html>

@ebruchez
Copy link
Collaborator Author

To clarify, this issue is about an a declarative event handler (as per XML Events) within a non-relevant control. I think it makes sense to consider such an event handler as "non-relevant".

On the other hand a "relevant" event handler for that event would work.

I checked that the example above still works the same way with 2016.2.

@ebruchez ebruchez changed the title Listener on an non-relevant control should not be called Non-relevant event handler should not run Aug 22, 2016
@ebruchez
Copy link
Collaborator Author

Isue #828 also mentions "we need to implement what XForms 1.1 says, that is: handlers attached to non-relevant controls don't run".

This is a bit less clear. Is it the same, or different, whether:

  • the XML markup for the handler is within a non-relevant control
  • or the XML markup is relevant but observes a non-relevant control (with observer)

So that's still an open question.

@ebruchez
Copy link
Collaborator Author

ebruchez commented Apr 20, 2018

This would make sense for issue #3566: the handler is non-relevant, but runs anyway, and causes problems. Are we confident that we could make this change without breaking anything? Maybe:

  • check all uses of xforms-disabled (XBL, etc.)
  • update internal uses of xxforms-dialog-close
    • dialog-publish.xml
    • dialog-select.xbl
    • dialog-select1.xbl
    • home.xhtml
    • spell-checker.xbl
    • submission-dialog.xhtml
    • validation-dialog.xhtml
  • possibly, attribute/option to opt in/out of the new behavior at first
  • doc
  • tests

@ebruchez
Copy link
Collaborator Author

fr:wizard and fr:error-summary use xforms-disabled, possibly nothing else right now.

@ebruchez
Copy link
Collaborator Author

There are other cases which don't imply xforms-disabled. For example, xxforms-dialog-close within dialogs: the dialog closed, and therefore handlers are non-relevant, and so the handler won't run.

@ebruchez
Copy link
Collaborator Author

ebruchez commented Apr 23, 2018

Current thinking: we change the default behavior, but add an option to re-enable the default behavior on a per-handler basis with an xxf:if-non-relevant="true" attribute.

@ebruchez
Copy link
Collaborator Author

Documented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants