For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 21 replies, 3 voices, and was last updated 14 years ago by
Kale.
-
AuthorPosts
-
Celeste PatinMemberHi Wayne & Octavio (and all members):
I’ve created my app with 7 screens. One one screen I have calculated the average of two years sales and placed the result in a text field on the same screen.
Now I want to also put that result on the third screen to perform other calculations.
I’ve look at your example “Custom Actions Demo” and my issue is like the last push button (Custom Function) where you send the date to the third screen.
In my case, I would be sending the calculated result that is in a text field to a field on another screen.
Can you tell me how to do this, PLEASE? Are there similar examples that you have posted to do this?
Thank you in advance for your help.
Celeste
July 5, 2012 at 7:30 pm #327941
support-octavioMemberHi CelesteP,
You should use a similar snippet that I suggested here:
http://www.genuitec.com/support-genuitec/viewtopic.php?p=8533#p8533Your function can be something like this:
function TotalScreen() { var total = $('#m1-mainPage-textfield1').val(); $('#m1-secondPage-textfield1').val(total); // ... //show the second screen phoneui.gotoPage('m1-secondPage',null); }July 7, 2012 at 11:38 pm #327986
Celeste PatinMemberOctavio or Wayne:
I’ve uploaded my compressed file. It is just 2 screens. The 1st is the WKLY screen which calculates a daily average. After the computation, I want to send this daily average to the RESULTS screen and put it in the field “results6Field”.
Octavio: When I tried to add the code you suggested, it does not work. Also, with putting that code in the custom file it doesn’t calculate the totals any longer on the WKLY screen.
What am I doing wrong? Can you please review and let me know? I have a few fields that I want to transfer to RESULTS or another screen like this.
Thank you for your help.
Celeste
Attachments:
You must be logged in to view attached files.July 8, 2012 at 4:11 am #327987
KaleMemberHi,
didn´t check your programm, just saw that your function updateTotalScreen() is missing a “{“.
Kale
July 8, 2012 at 1:58 pm #327989
Celeste PatinMemberHi Kale:
Thank you for pointing my error out. When I put in the {, the totals did come back. I still can’t get it to send the total to the next page.
Thanks again,
Celeste
July 8, 2012 at 3:18 pm #327990
KaleMemberHi,
I changed the code a bit. A change of a textfield value is obviousliy not recognized when the change is not done by hand. So after the last value input you have to tap somwhere outside of the textfield and the transition starts and shows the value on the results page.
Hope it helps.
Kale
Attachments:
You must be logged in to view attached files.July 8, 2012 at 9:26 pm #327991
Celeste PatinMemberHi Kale:
Thanks for debugging but I still can’t see the field on the next page. I’ve input your code (did you just change the area below) and I ran it in the emulator and input the values and clicked outside the text area and the daily value still does not appear (for me) on the RESULTS screen. I don’t understand what I’m doing wrong. Can you help? I really appreciate it.
Thanks,
Celeste
function updateTotalScreen() {
var total = $(‘#m1-WKLYSales-totalAvgDailyText’).val();
$(‘#m1-RESULTS-results6Field’).val(total);
//…
//show the second screen
phoneui.gotoPage(‘m1-RESULTS’);
}July 9, 2012 at 1:13 pm #328007
support-octavioMemberHi CelesteP,
Pleas try adding a Link widget and set its click action to a GoToScreen action that references a screen that you need to include when code is generated, in your case your result page. This is a wayne’s tip, you can read more about it in this thread: http://www.genuitec.com/support-genuitec/viewtopic.php?p=4543#p4543
Let me know if this is helpful for you.
July 9, 2012 at 9:28 pm #328022
Celeste PatinMemberHello:
It still does not work. What else can I try? I have several totals that I need to send to other pages. Does anyone have any ideas?
Thanks,
Celeste
July 10, 2012 at 2:02 am #328025
KaleMember@CelesteP wrote:
Hi Kale:
Thanks for debugging but I still can’t see the field on the next page. I’ve input your code (did you just change the area below) and I ran it in the emulator and input the values and clicked outside the text area and the daily value still does not appear (for me) on the RESULTS screen. I don’t understand what I’m doing wrong. Can you help? I really appreciate it.
Thanks,
Celeste
function updateTotalScreen() {
var total = $(‘#m1-WKLYSales-totalAvgDailyText’).val();
$(‘#m1-RESULTS-results6Field’).val(total);
//…
//show the second screen
phoneui.gotoPage(‘m1-RESULTS’);
}What happens when you try it only with the two pages you submitted here and replace the WKLYSales_custom.js with the file I have provided? Maybe it doesn´t work when you use it in your whole project. Can you submit your whole project here? Would be helpful.
Kale
July 10, 2012 at 12:39 pm #328052
Celeste PatinMemberHi Kale:
I replaced the custom file with the one that you have and that worked for the 2 screens that I provided to you. THAT WORKED!
The calculation worked and it went to the results screen and put the daily average there.
When I incorporated the change to my real APP (all of the screens) I can’t get it to work. The calculation works but it doesn’t go to the other screen and put the daily average on that screen.
I will upload my whole project shortly.
Thank you for your help.
Celeste
July 10, 2012 at 2:38 pm #328064
Celeste PatinMemberHi Kale:
I JUST TRIED TO ATTACH THE ZIPPED FILE AND IT IS 1466 KB AND I GOT THE MSG “FILE IS TOO BIG, MAX ALLOWED SIZE IS 500KB”. WHAT DO I DO NOW?I have attached my APP–all screens for now. What I found is that when I run the emulator from let’s say the CAS Screen, none of the calculations work. But, if I run the emulator from the WKLYSales screen or MTHLY or ANN the calculations work. Is there maybe a problem with the first screen? They were working all together until I started trying to send the avg daily to the RESULTS screen.
So here is the order that the screens should work”
1 – CASScreen, 2 – TOOL, 3 – WKLYSales, 4 – MTHLYSales, 5 – YRLYSales, 6 – DISCEXP, 7 – RESULTS, and 8 CAS CONTACTS.From the CASScreen the user can select the TOOL and fill in the data and select whether the have weekly, monthly or yearly sales and then go to those screens. Going to the weekly screen you can fill in weekly data and get a daily average. Then you should go to the DISCEXP screen to calculate expenses. Then fields (i.e. the daily average) should be transferred automatically to the RESULTS. I would like this page to eventually be emailed. I think I know how to do that I just want to make the fields start calculating and working together again. Then the last page is just a contacts help screen. I had put in telephone numbers and took them out for this example.
Note: All screens at the bottom have a “Back” button which seems to work fine to go to the previous screen. The middle button takes you to the 1st screen.
Also, only the daily average is coded right now to go to the RESULTS screen. MTHLY and YRLY don’t have the coding yet. When I/you/whoever fixes the screens not working together I will finish the coding for those to send the data to the RESULTS screen.
Thank you for your help. Sorry to bother so much but I am an Accountant trying to do this project for my work. I really appreciate the help you or anyone can give.
Thanks,
Celeste
July 10, 2012 at 11:12 pm #328073
Celeste PatinMemberWayne, Kale or Octavio:
Here are all 8 of my screens. I made a copy of each file and put an X in the front of each name. When you extract them, please take off the X and all the code written thus far should be available and I stated in my last email.
Again, when they are all together, the calculations do not work. When sent to the emulator individually they work. The WKLYScreen has code to send the daily avg to the RESULTS screen. This does not work when they are all emulated together.
Please help as I do not know what I am doing wrong.
Thank you,
Celeste
Attachments:
You must be logged in to view attached files.July 11, 2012 at 4:18 am #328083
KaleMemberHi,
the problem is a missing reference from your input screen to the RESULTS screen as octavio already mentioned. I could solve the problem by inserting a link widget somwhere in WKLYSales with no text and width=0 and a gotoScreen action to RESULTS Page.
BTW: avoid alert popups, just use them in case of errors or false user inputs 😉
Kale
July 11, 2012 at 8:45 am #328089
Celeste PatinMemberHi:
So a link widget does not need to be “pressed”, it will just automatically go to the screen that I set it to?
Sorry Octavio if I didn’t understand you when you told me this.
I will also take out the pop-ups. The boss wanted those in there but they will come out.
I will try this a little later and let you know what happens. Thanks again for all the support to you, Octavio and Wayne.
Will chat later. Thanks,
Celeste
-
AuthorPosts
