davidjcoombs
Posts: 0
Joined: Wed Jun 24, 2020 2:57 am

Error when trying to run master-detail page

When I build a master-detail page (per instructions in the youtube lesson at https://www.youtube.com/watch?v=Kehn1... and in docs at https://docs.appery.io/docs/appbuilde...), an error is returned when I run a test. The error is due to this snippet of code, which is the listener saving the selected item to local storage.

element.on("click", function () {
Apperyio.storage.selectedFood.set(value);
});

I haven't been able to find any guidance on master-detail pages with listeners that have worked for me, including appery.io docs, youtube videos, etc.

The error message is:

ERROR in src/app/main/main.ts:65:29 - error TS2552: Cannot find name 'element'. Did you mean 'Element'?

65 element.on("click", function() {

Code: Select all


   ../../../../noderepo/ionic4/node_modules/typescript/lib/lib.dom.d.ts:4998:13 
     4998 declare var Element: { 
                      ~~~~~~~ 
     'Element' is declared here. 
 src/app/main/main.ts:66:33 - error TS2304: Cannot find name 'Apperyio'. 

 66                                 Apperyio.storage.selectedProduct.set(value); 
                                    ~~~~~~~~
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Re: Error when trying to run master-detail page

Hello,

These examples are used for JQM apps, but don't work for Ionic 4. What exactly do you want to do here? Pass data between pages?

robertgibbel
Posts: 1
Joined: Mon Nov 09, 2020 3:44 am

Re: Error when trying to run master-detail page

It doesn't work for Ionic 4.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Re: Error when trying to run master-detail page

Hello Robert,

You are right, it doesn't work, see my answer above.

You can use a simple snippet to save the selected value to the Storage variable using the code (see this link how to do it https://docs.appery.io/docs/snippets#set-variable).
On the detail page, you can use the opposite method "getVariable" to read that value.

How do you create a clickable list, using a mapping from the server response to real UI components?

Williamskido
Posts: 3
Joined: Thu Dec 17, 2020 3:42 am
Location: Italy
Contact: Website Skype

-

Thank you for your replay,
I did that without sucsess, Im still have the below error

Notice: Array to string conversion in C:optprocessmakergulliverthirdpartycreoleSQLException.php on line 66

nicoleallen
Posts: 1
Joined: Tue Jun 22, 2021 8:11 am

Re: Error when trying to run master-detail page

Hi,
I think it is not working for Ionic 4 the error remains constant...

aricjoshua
Posts: 2
Joined: Fri Sep 03, 2021 3:24 am

Re: Error when trying to run master-detail page

I also think it doesn't work for Ionic 4, if you want to know if that's the case you should test it
cookie clicker

Return to “Issues”