Skip to content

Tap Event Does Not Fire When Using codeFile In Different Directory #1667

Closed

Description

Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?

Yes.

Tell us about the problem

tap event does not fire when the main XML's codeFile is in a different directory than the XML. Page element's loaded event seems to work fine.

For example, if the main module is views/launches/default and it loads the XML. The Page tag has a codeFile attribute pointing to controllers/launches/default.

The tap event exported from this codeFile never runs. If the codeFile is in the same directory as the XML it works without any problems.

Which platform(s) does your issue occur on?

Both.

Please provide the following version numbers that your issue occurs with:

  • CLI: 1.6.1

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

<!-- file: views/launches/default.xml -->
<Page codeFile="~/controllers/launches/default">
    <Button text="Tap" tap="tapp" />
</Page>
// file: views/launches/default.js

"use strict";

exports.tap = function(args) {
    console.log("tap event fires!"); // never fires...
};

Activity

  1. tsonevn commented on Feb 29, 2016

    @tsonevn
    Contributor

    I have verified this problem. I have made a simple project , where ActionItem works. Could you test this project. If there is still a problem, please sent us a new simple project which shows the problem.

    I am attaching link to the project repository:
    https://github.com/tsonevn/TestActionItem.git

  2. ghost closed this as completedon Feb 29, 2016
  3. ghost changed the title [-]Tap Event Does Not Fire for ActionItems[/-] [+]Tap Event Does Not Fire When Using codeFile In Different Directory[/+] on Feb 29, 2016
  4. ghost reopened this on Feb 29, 2016
  5. self-assigned this
    on Mar 1, 2016
  6. tsonevn commented on Mar 1, 2016

    @tsonevn
    Contributor

    Well, the codeFile and XML file should be in the same directory. In this way NativeScript is searching codeFile for every XML. I hope this information helps. Please let me know if I can assist you any further. Thank you in advance.

  7. assigned and unassigned on Mar 9, 2016
  8. added this to the 1.7.0 milestone on Mar 9, 2016
  9. lock commented on Aug 30, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  10. locked and limited conversation to collaborators on Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions