Dealing with multiple this.Parameter and Routing

I’m facing an issue when trying to pass parameters through pages.

I’m sending an Object like this through my Router:

// IndexPage.js

var data = {
  birthday: nascDay.value + "/" + nascMonth.value + "/" + nascYear.value,
  startDate: startDate,
  endDate: startDate
}

router.push("success", data);

However, when trying to fetch this data from the other view, it simply doesn’t show up:

// SuccessPage.js

var data = {};

data.birthday = this.Parameter.map(function(param) {
    return param.birthday;
});

data.startDate = this.Parameter.map(function(param) {
    return param.startDate;
});

data.endDate = this.Parameter.map(function(param) {
    return param.endDate;
});

// Items bellow should appear on my .ux view, but don't seem to work.
module.exports = {
    birthday: data.birthday,
    startDate: data.startDate,
    endDate: data.endDate
};

Now when I try to use birthday, startDate or endDate variables to my .ux page, they simply don’t show up.

Fun fact is that in the Desktop Preview they show properly. But the same project running on my Android phone renders blank variables in the UX page.

Am I doing something wrong?

Hi Claudio,

I don’t immediately see anything wrong with the code you posted. There might be something else going on in the parts of your app you haven’t shown.

I suggest you create a full (but preferably very tiny) example that reproduces the issue on the target device, and post it here along with the device information.

Thanks for the reply.

The project itself is already super small (only 3 pages), so I believe it would be easier to share it entirely.

You can clone the project from here:

https://kazzkiq@bitbucket.org/kazzkiq/fuse-app-sample.git

Alternatively you can download the project .ZIP here:

After setting a date and clicking “Consultar FGTS!” the data should show up in the next Page. It works on desktop preview, but on Android the data simply doesn’t show up.


If it helps, here is my Android phone information:

  • Model: Redmi Note 4
  • Company: Xiaomi
  • Android Version: 6.0 MRA58K (MiUI Global 8.1)
  • CPU: Deca-core Max 2,11GHz
  • RAM: 3 GB

Thanks for the information, I’ll give it a go on a Nexus 5 a bit later today and report on my findings.

Found the problem. It’s this:

	<JavaScript File="../Modules/Router.js" />
	<JavaScript File="Index.js" />

Each view (UX component) can have one and only one viewmodel (UX-bound JS file). Basically you screwed up what router knows about itself by including that ../Modules/Router.js file in UX, right above the viewmodel JS files.

I removed the Router.js include from all UX files and it works just fine.

As for your next question, stand-alone JS modules are included in viewmodels, just like you require your Utils. If necessary, you can pass router to a stand-alone module via a function.

@Uldis it worked perfectly!

Just wanted to congratulate you guys for the outstanding tool you built. Fuse is great!

Once I feel comfortable and with enough experience, I will definitely propose Fuse as one of the options for app development in the company I work with.

Thanks!

Thanks for the kind words! Looking forward to seeing you around :slight_smile: