FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Placeholder with an id attribute doesn't call creatingView handler · Issue #772 · NativeScript/NativeScript · GitHub

Placeholder with an id attribute doesn't call creatingView handler #772

Description

I have the following main-page.xml

<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
  <StackLayout>
    <Placeholder id="chartView" creatingView="creatingView"  />
  </StackLayout>
</Page>

and the following main-page.js

var vmModule = require("./main-view-model");
function pageLoaded(args) {
    var page = args.object;
    page.bindingContext = vmModule.mainViewModel;
}

function creatingView(args) {
    console.log("creatingView is called");

    var nativeView = new UILabel();
    nativeView.text = "Native";
    args.view = nativeView;
}

exports.creatingView = creatingView;
exports.pageLoaded = pageLoaded;

When the id attribute is before the creatingView the handler is never called. If I switch them like that
<Placeholder creatingView="creatingView" id="chartView" /> the handler is called.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL