Print Page | Close Window

datepicker blockscount problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=7174
Printed Date: 23 November 2024 at 6:33am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: datepicker blockscount problem
Posted By: tristoon
Subject: datepicker blockscount problem
Date Posted: 18 May 2007 at 5:14am
Hi,
I'm trying to count the blocks selected with progress langage.
 
The action is done with the "OCX.selectionChanged" and I have a problem, when I select more than 1 day on the datePicker, the blocksCount is always equals to "1".
 
this is my code:
 
 
DEF VAR DTdateDebut AS DATE NO-UNDO.
DEF VAR DTdateFin AS DATE NO-UNDO.
DEF VAR DTcpt AS INT NO-UNDO.

        chDAtePick:DatePicker:Selection():AllowNoncontinuousSelection = TRUE. /*autorise la séléction multiple*/
        DTcpt = chDAtePick:DatePicker:Selection():BlocksCount. /*nb de jours séléctionnés*/
    
        MESSAGE DTcpt
            VIEW-AS ALERT-BOX INFO BUTTONS OK.

        CASE DTcpt:
            WHEN 1 THEN
            DO:
            DTdateDebut = chdatepick:datepicker:SELECTION(0):datebegin. /*séléction d'un block*/
            chctrlframe:calendarcontrol:dayview:showday(STRING(DTDateDebut),TRUE).
            RUN init-initDemarrage.
            chCtrlFrame:CalendarControl:ViewType = 0. /*vue sur 1 jours*/
            END.

         WHEN 2 OR WHEN 3 OR WHEN 4 OR WHEN 5 OR WHEN 6 THEN
            DO:
            DTDateDebut = chDAtePick:DatePicker:Selection():Blocks(0):DateBegin. /*récupère le premier jour*/
            DTDateFin = chDAtePick:DatePicker:Selection():Blocks(DTcpt - 1):DateEnd. /*récupère le dernier jour séléctionné*/
           
            chctrlframe:calendarcontrol:dayview:showdays(STRING(DTdateDebut),STRING(DTDateFin)).
            RUN init-initDemarrage.
            chCtrlFrame:CalendarControl:ViewType = 1. /*vue sur 5 jour*/
            END.

        WHEN 7 THEN
           DO:
           DTDateDebut = chDAtePick:DatePicker:Selection():Blocks(0):DateBegin. /*récupère le premier jour*/
           DTDateFin = chDAtePick:DatePicker:Selection():Blocks(DTcpt - 1):DateEnd. /*récupère le dernier jour séléctionné*/

           chctrlframe:calendarcontrol:dayview:showdays(STRING(DTdateDebut),STRING(DTDateFin)).
           RUN init-initDemarrage.
           chCtrlFrame:CalendarControl:ViewType = 2. /*vue sur 7 jour*/
           END.

        OTHERWISE
                DO:
                DTDateDebut = chDAtePick:DatePicker:Selection():Blocks(0):DateBegin. /*récupère le premier jour*/
                DTDateFin = chDAtePick:DatePicker:Selection():Blocks(DTcpt - 1):DateEnd. /*récupère le dernier jour séléctionné*/
               
                chctrlframe:calendarcontrol:dayview:showdays(STRING(DTdateDebut),STRING(DTDateFin)).
                RUN init-initDemarrage.
                chCtrlFrame:CalendarControl:ViewType = 3. /*vue sur 1 mois*/
               END.

        END CASE.

 
Can you help me? I don't know where is my problem.
Thanks.
 
Tristan



Replies:
Posted By: tristoon
Date Posted: 18 May 2007 at 11:43am
I resolved my problem lonely ! :)
In fact, I tryied to do something so complicated!
just a "attachtoCalendar" masters it fine!
thanks



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net