NetTalk Central

Author Topic: On / Off Calendar  (Read 5204 times)

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
On / Off Calendar
« on: July 12, 2014, 03:23:46 AM »
I want to make an on / off type of calendar.
The user presses a button on a calendar day and the program will make a database insertion or deletion. I can get this done, but how do I get an refresh calendar after pressing ?

Jari

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: On / Off Calendar
« Reply #1 on: July 14, 2014, 12:51:21 AM »
I'm sorry Jari, I don't understand.
Are you using the built-in calendar controls? ie NetWebYear? or something else?

cheers
Bruce

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: On / Off Calendar
« Reply #2 on: July 14, 2014, 04:16:49 AM »
Yes and my "Form" procedure just insert record if it not found and deleting record if it is found.


jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: On / Off Calendar
« Reply #3 on: July 14, 2014, 08:12:38 AM »
Here is example app made from Hotdates

The idea is that the user clicks on the days when he will participate in a conference

Regards Jari

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: On / Off Calendar
« Reply #4 on: July 18, 2014, 06:12:33 AM »
Hi Jari,

I've got the example, but I'm not understanding what to do next. What am I looking for? What should I try and do etc?

Cheers
Bruce

jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: On / Off Calendar
« Reply #5 on: July 19, 2014, 02:34:06 AM »
Hi Bruce

I need something like this : http://www.topdreamweaverextensions.com/reservation-calendar / Example of a calendar with a reservation form, on a public site


I want the user to click on those days when he wants to transport.

Jari

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: On / Off Calendar
« Reply #6 on: July 20, 2014, 11:10:20 PM »
Hi Jari,

Cool. So does your example attempt to do this at all? I'm trying to understand what you want me to do...
Have you attempted this at all? Have you made any progress? Are there specific things you're stuck on?

Clearly - I'm confused.

cheers
Bruce


jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: On / Off Calendar
« Reply #7 on: July 21, 2014, 01:58:33 AM »
My example just add one record per day when clikking wanted day.
That code is in UpdateConferences procedure:

   if p_Stage=0
      do openfiles
        CON:StartDate=  p_web.GetValue('_Date_')
        set(CON:DateKey,CON:DateKey)
        next(Conference)
       
    if error() or CON:StartDate<>p_web.GetValue('_Date_')
             
            CON:StartDate=  p_web.GetValue('_Date_')
            CON:Description='OK'
            CON:DurationDays=1
            add(Conference)
           
        ELSE
            delete(Conference)
            if error()
                stop(error())
            .
        .
 
     do closefiles   
  .

That works but only problem is that I don't get the calendar refreshed after returning from Form-procedure.


Jari

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: On / Off Calendar
« Reply #8 on: July 23, 2014, 04:25:16 AM »
Hi Jari,

I've played around with it a bit, and I think it's probably do-able - but I also think you're on completely the wrong track. Embedding that sort of code in a form - and especially in that position - is not "correct" and in the long run will probably break (and break other things.) You're thinking of the form in a very "windows" way, and the form doesn't work like that.

I think it's probably best to go back to the root problem you are wanting to solve - which is the user selecting a date. There's a "Date" Form field type for that - and that field has lots (and lots) of options - many of which you are probably not aware of. so the first thing I'd probably recommend is that you construct your form using a date field - and then perhaps we can discuss how you'd like the date field to behave vs how it behaves on your form.

So, in short, I'm not sure I'd use the NetWebYear as the starting point here. That's primarily for displaying data - the Date Form field type is primarily for capturing a date from the user.

(I understand it's not going to work like you have in mind, but let's start there and discuss it from there.)

cheers
Bruce


jari@softmade.fi

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • Email
Re: On / Off Calendar
« Reply #9 on: July 23, 2014, 10:14:34 AM »
Thanks Bruce
I tried to use the form, because I really do not understand when the calendar is refreshing.
In this simple way I got so close to the target.

I agree that my mind is still the type of windows :)

Maybe I will try to solve this in some other way.

Jari