NetTalk Central

Author Topic: Calendar not working in my app  (Read 7370 times)

rayrip

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Calendar not working in my app
« on: August 13, 2008, 02:29:55 PM »
I have one field that has a date. I tried web21 which are invoices and the invoice update works... I can't see what it is doing that I am not. I changed the field to a date field. I can change the date manually, but if I press the calendar button I get an error that says:

The Page at local http host says:
Error calling the Calendar: Parameter specified is not valid target control.

I have the calendarlookup.htm in my web folder. I see calendar2.js and 6 and their associated gz files.

Not sure where to go from here.

Help, hints, tips?

Thanks,

Ray
VMT

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Calendar not working in my app
« Reply #1 on: August 14, 2008, 01:52:37 PM »
Which field did you change to a date field? Is it a date field, or a Long, or something else?

Otherwise, if you look at the HTML source when the page is rendered, does the Javascript function look properly formed and matched what's in the calendarx.js file? Also, which release are you on?
Mike Grigsby
Credify Systems
Central Oregon, USA

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Calendar not working in my app
« Reply #2 on: August 15, 2008, 11:18:43 PM »
Hi Ray,

perhaps post an example - it's hard to say for sure.
I know you're working in a mix of static & dynamic pages so maybe that has something to do with it as well?

Cheers
Bruce

rayrip

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Calendar not working in my app
« Reply #3 on: August 18, 2008, 11:04:10 AM »
Well, I tried turning off calling the htm file and just called the procedure, and the calendar still didn't work.

I think I'm using the latest version of the software. The field is originally a long for a date. I just changed the selection for the field in the Netwebform which did make it automatically put a button near the field and it tries to call the calendar. I don't know what properly formatted JS looks like.

Usually I have it running on our server.. the problem is when you first try and reserve a movie.. .it creates a form and puts a date in automatically. That is the only place I let them change the date... and that is where the problem is.

The instructions are at the top of the screen for logging in.. the link is:

http://63.224.205.143/browsemovies_h.htm

There should be either a calendar or a notepad icon in the movie browse (let me know if there isn't please) .. the calendar is for reserves.

Thanks. If you have any other idea's I'd like to try them.




Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Calendar not working in my app
« Reply #4 on: August 18, 2008, 12:41:12 PM »
From the Page Source, I see you don't have the date.js javascript file you need in order to use the calendar control. Your call is formed properly, but there's no javascript function for it to work on.

You should see:
<script src="/scripts/date.js" type="text/javascript" ></script>

...but it is not generated on the page. That indicates you don't have the date.js javascript file included in your application. Verify this by going to your first or main proc. Go to Extension: NetTalk or NetSimple (3) | Settings | Scripts tab. You should have in your list a 'date.js' script, Browser All. Let me know what this does for you.
Mike Grigsby
Credify Systems
Central Oregon, USA

rayrip

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Calendar not working in my app
« Reply #5 on: August 18, 2008, 04:23:02 PM »
Mike,

Well, I tried adding that to the scripts list to no avail... it showed up in the source just like you had it.

I couldn't find a date.js anywhere. Also, the invoices app that I am using to compare to (web21) doesn't have the include either.. but somehow it works. I think it is calling the calendarlookup.html somehow... and that uses either calendar2.js or calendar6.js... but I have no idea yet.

I looked in the invoice app and there are no extra includes in the scripts that I can find. I copy the web folder with every new update as instructed.. but that does no good.

Thanks though.. it gave me hope for a minute because it makes sense. However, I cannot find a date.js anywhere in the clarion6 folder(s). I even tried copying and renaming the calendar2.js to date.js (yes, I'm grasping at straws now :)

Thanks,

Ray

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Calendar not working in my app
« Reply #6 on: August 18, 2008, 05:08:22 PM »
Hey, I'm so sorry, I sent you on a wild goose chase. the date.js is an alternative date function I use in my app. So forgive me and let me try again:

- calendar2.js is in the web\scripts directory?
- all.js is in the web\scripts directory?
- calendarlookup.htm is in the web directory?
  that file should have a function called sd for select date. Make sure everything looks okay, or copy that file from one of the examples back into your app directory (always backup your existing app files<g>).

- Your main proc Settings | Scripts tab has the scripts directory field as 'scripts'?
- Are you on a recent release?
- You might want to reinstall a clean release.
- Can you rename your web folder to something else, then copy an original web directory from one of the NetTalk examples? The run the app again and see what happens.
- Possibly copy in one of the NetTalk procs that uses the date function and see if it works?
- Compile one of the example apps in the directory where you app is and see if it can use your web\scripts okay?
- Or copy your app and dct into one of the example apps that works (like 21), compile and run and see if it will use its scripts without a problem.
- Delete the procedure and set it up again?

I'm running out of ideas.



Mike Grigsby
Credify Systems
Central Oregon, USA

rayrip

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Calendar not working in my app
« Reply #7 on: August 19, 2008, 04:12:14 PM »
Ha.. I'm running out of idea's myself... but I like the idea of copying my app into the web21 folder and see if it runs..... but usually I just copy the entire web folder from the libsrc when I get an update and paste it into my working app folder... it overwrites everything that isn't mine.

I hunted for a couple of hours today to figure out why my icons wouldn't show up on my server machine... found out explorer doesn't display icons (.ico)... I didn't know that.. I use firefox and it was displaying my .ico files no problem.... so I just changed them to .png files and everything is fine.

Bruce also told me my header tags were in the wrong place... that fixed a bunch of problems... I'm sure this calendar thing is a little thing too. Anyway, the program is almost version 1.

I sure appreciate your feedback.. it's been a great help.

Ray
VMT
 

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Calendar not working in my app
« Reply #8 on: August 20, 2008, 12:44:05 AM »
Hi Ray,

Your calendar problem is being caused by the Date field being in the Unique key for the form.

As you know, fields in the unique key cannot be changed on the form (although they can be displayed on the form).

In your case, make a local field to get the date from the user, and then assign that date to the field just before the record is saved (ie ValidateRecord routine).

Cheers
Bruce

rayrip

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Calendar not working in my app
« Reply #9 on: August 20, 2008, 03:17:22 PM »
Well, putting a (memory) date field on the screen did let the popup calendar work. And the date came into the date field for display. However, after using the calendar or even typing something new into the date field I cannot seem to capture the displayed date, only the original date that I initialized to the date field (today() + 1).

I have put code all over the place to try and get the date field after it has been changed, but no luck.

I need to find out how to get the date field that is displayed.

thanks,

Ray
VMT

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Calendar not working in my app
« Reply #10 on: August 21, 2008, 12:32:20 AM »
p_web.GetValue('loc:date')

Cheers
Bruce

rayrip

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Email
Re: Calendar not working in my app
« Reply #11 on: August 21, 2008, 10:30:18 AM »
 :-\

Still can't get it right.

I put the code in:

Validate:insert start embed

  RES:RESERV_DATE=p_web.GetValue('loc:RESERV_DATE')
  !stop('REserve Date: ' & format(RES:RESERV_DATE,@d2))

 This gets the initialized value that was FIRST in the loc:reserv_date variable (I initialize it to today() + 1).

This code happens AFTER I have used the calendar to change the loc:reserv_date when I click on SAVE, as I witnessed by putting a stop or even without a stop, the reservation date is the original initialized date from loc:reserv_date.

For instance, I initialize loc:reserv_date to 8/22/2008.

in routines before generate form:
   loc:RESERV_DATE=today()+1
   p_web.SetSessionValue('loc:RESERV_DATE',loc:RESERV_DATE)



The form displays 8/22/2008. I use the calendar and change the loc:reserv_date to 8/23/2008. It displays 8/23/2008.

However, when I use the code above in my validate insert I get 8/22/2008.

One other piece of code that I had to put in there was an if statement that got rid of the code in the RestoreMem embed... the code there would always under every circumstance zero out the loc:reserv_date.

I did put the loc:reserv_date in the StoreMem embed and that does store it ok... the restore just doesn't work right.

I have put the code to get the loc:reserv_date in just about every embed.. and there is no where that it ever picks up the date that the calendar put into the field on the screen... or even if I just type in the date into the memory field... it is not memorized anywhere where I can find it.

It's like it's on the screen.. but doesn't get into the variable.

Is there any sample code anywhere that has an insert form with a date memory variable that is captured on the save and put into a field variable?

Thanks,

Ray
VMT