Jump to content

Date Picker Example


This topic is 5759 days old. Please don't post here. Open a new topic instead.

Recommended Posts

The Shadow said:

You can see it with FM7, but there are a few custom functions it uses you won't be able to look it.

Your post is confusing. This sounds like the file is for an earlier version of FM than FM7, but the file has the FM7 extension.

Lee

Link to comment
Share on other sites

  • 4 weeks later...

The original attachment didn't have that, only the one on my website has the underline for today:

http://www.spf-15.com/fmExamples/datePickWindow.fp7.sit

The red date is the "selection" date that will be put back into the selection field (in the exampleTbl table) when you click the "Close" button on the date picker.

Blue dates are "holidays"; the "datePicker Options" layout controls what colors should be used for these two indicators, and what days are holidays.

Link to comment
Share on other sites

  • Newbies

I am new to the forum (and this is the first thread that I have looked at..).. and it's really neat! But can you explain a little how this can be incorporated into an existing database?

Link to comment
Share on other sites

Ellis, thanks for your compliment.

As for how this can be incorporated, really only by recreating the structure inside your file. That sucks, so I made some improvements to break it apart, you can get a new copy at:

http://www.spf-15.com/fmExamples/

and download the "multi-file" version of the date picker.

Now, there is a "datePickUser.fp7" file, (with no custom functions in it), that shows how to call the date picker from the other (modified) "datePickWindow.fp7" file. Unfortunately, I could not figure out a way to copy back the date at the right moment without calling a script in the starting file, so you would need to duplicate several scripts for each file that you wanted to use it in (to send you back to the correct file).

In general, it seems to me it works much better if you can copy its structure into your existing file, but you'll need Dev7 to be able to copy the custom functions.

If anyone has any ideas for how to make this cleaner, I'm all ears. ;^)

Link to comment
Share on other sites

  • Newbies

hi

i note your great example has custom functions in it, i only have fmpro - and while using your file as an external reference the custom functions do not work

how can i integrate this into a solution or do i have to go and buy fmdev?

cheers

Link to comment
Share on other sites

  • 2 months later...

Shadow, you have really created one GREAT Date Picker. I downloaded both and I have to thank you sir....ya done good. I see where I will utilize several, in order to have it populate the corresponding field.

Thank you. You-Rock.gif

Link to comment
Share on other sites

  • 1 month later...

I've rebuilt this fantastic tool into my database but...

For some reason my days aren't counting properly (the 5 lines are all 1 to 7)...the scripts and specified parameters are correct BUT the only difference is that the "gLastDay" field for some reason refused to be a global field!! it says that as it is a calculation that references a global field, related feild, unstored field etc...please help! appreciate your time!

Link to comment
Share on other sites

This is a bug in 7.0v2. You need to make the field global when it doesn't have a calculation in it, once it decides to make it "unstored", you cannot manually switch it to global.

Just delete the content of the gLastDay calculation, make it global, and put the calculation back in.

Link to comment
Share on other sites

This is wonderful. My first attempt doesn't work. I don't know if I have something wrong in my script or what. The date appears in a portal of activities (activitydate). I originally put the date icon on the layout but also tried it inside the portal itself.

When I click the button, it brings up the date window nicely. But when I choose a date then close, it just displays [esc] and pulses. Can it not be used in a portal? I changed the Start and End and Edit to the portal activity date field and re-checked it.

I decided to ask because if it can't be used in portals it may not help me. Just about everything that has dates is in a portal. confused.gif Thank you for helping. :-) Oh, i used the one with two files so the window is a separate file but the DateUser scripts I imported into mine. I checked them. Are they wrong? They look right honestly.

Link to comment
Share on other sites

I figured it out all by myself! You have a script called Date Pick Close in datePickWindow. It says it doesn't need modification but I think it does. Because it references another script - date pick close from DatePickUser - which was the old example file. when I read your comment tht it didn't need changed, I didn't read any further. blush.gif

I'll let you know if that doesn't fix it but I'm pretty sure it will. smile.gif So sorry for being new. crazy.gif

Link to comment
Share on other sites

  • 2 weeks later...

Shadow ... thanks for this. Old with Oracle ... new wih FMPro . .. love what I see so far.

I was able to open and play around with date picker .. question for you .. (sorry, I am new at this) .. but how would I copy this solution into an existing solution? Or do I call it using file references?

Link to comment
Share on other sites

Hi David,

If your main layout is maximized, it will drop into windows mode (and assume a smaller stance). It needs to start out in window state first. Windowing and maximized will not work together. If you plan on using windows, give up maximized.

So, set your main layout to Move/Resize. Something like:

Height: Get ( WindowDesktopHeight ) - 4

Weidth: Get ( WindowDesktopWidth )- 4

Distance from top: 0

Distance from left: 0

Then, performing Date Picker will keep main layout the same 'full' size while the Date Picker window appears on top much smaller. I have one script called Full Window and apply this script to all 'full window' layouts, ie, this script is ran upon startup for the current layout. Layout switching alone leaves all 'full' layouts in this 'full window'd state.' In this way, they stay in place when a second window is called on top.

Link to comment
Share on other sites

  • 1 month later...
  • Newbies

This is a great solution, but watch out if you have other self-joins in the table that uses the picker... you can get some serious looping going ;-)

Love to see a way to make this work across several solutions off a server... rather than within a single file...

Cheers

Link to comment
Share on other sites

  • 3 months later...
  • Newbies

Shadow, I'm new to FM...having a lot of MS Access background. Is there not a way in FM to simply copy a complete table and paste it in another database; same with the scripts?! I've looked and don't see that capability--maybe I'm not sure what to look for. Guess what I'm asking is do I have to recreate the complete Date Picker in each database I want to use it? I would rather not have it "outside" the main file.

I just bought Developer thinking that capability would be there. Haven't found it yet. I've worked in Access a lot and found it so much better to be able to work in a "dummy" database creating tables, queries, etc.--then simply copy them and paste them in the working database when they were working properly. Users could continue to work in the active database and I wouldn't have to worry about doing something that disabled the working copy.

Thanks!

Link to comment
Share on other sites

  • Newbies

Shadow, I'm new to FM...having a lot of MS Access background. Is there not a way in FM to simply copy a complete table and paste it in another database; same with the scripts?! I've looked and don't see that capability--maybe I'm not sure what to look for. Guess what I'm asking is do I have to recreate the complete date picker in each database I want to use it? I would rather not have it "outside" the main file.

I just bought Developer thinking that capability would be there. Haven't found it yet. I've worked in Access a lot and found it so much better to be able to work in a "dummy" database creating tables, queries, etc.--then simply copy them and paste them in the working database when they were working properly. Users could continue to work in the active database and I wouldn't have to worry about doing something that disabled the working copy.

Thanks!

Link to comment
Share on other sites

Scripts can be imported between files, but some field references may be lost if relationship names are not identical.

Tables cannot be imported natively, but a third-party product (FM Robot?) can do it.

Link to comment
Share on other sites

  • 2 months later...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.