Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - using xtreme calendar control in IE
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

using xtreme calendar control in IE

 Post Reply Post Reply
Author
Message
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Topic: using xtreme calendar control in IE
    Posted: 02 September 2005 at 6:20am

Hi,

I want to use the control in internet explorer. So i wrote the following piece of code in the load event.

  Sub Window_OnLoad()
   Dim loNewEvent
   With Document.forms(0).ccJobs
    If .DataProvider.Create() Then
     Set loNewEvent = .DataProvider.CreateEvent()
     loNewEvent.StartTime = Now()
     loNewEvent.EndTime = DateAdd("n",60,loNewEvent.StartTime)
     .DataProvider.AddEvent loNewEvent
     .DataProvider.AddEvent loNewEvent.CloneEvent()
     .Populate
    End If
   End With
  End Sub

Note that ccJobs is the name given in the object tag. The html is as follows:

<body>
 <form name="frmTest">
  <OBJECT id="ccJobs" style="WIDTH: 797px; HEIGHT: 512px" classid="clsid:B4252697-58EA-4784-B25E-95223304C93C">< /OBJECT>
 </form>
</body>

When i run this code everything works fine and iam able to see 2 events. I want to prevent the events from being edited, so i added the event BeforeEditOperation to the code, so that using the CancelOperation parameter, i can prevent the event from being edited. I just added the following piece of code.

  Sub ccJobs_BeforeEditOperation(byval OpParams , CancelOperation)
   
  End Sub

After adding the above procedure, if i try to run , i get an error at "If .DataProvider.Create() Then" line saying object does not support this property or method. The following is the complete source in the sample html page

<html>
<head>
 <title>Untitled</title>
 <script language="VBScript">
  Sub Window_OnLoad()
   Dim loNewEvent
   With Document.forms(0).ccJobs
    If .DataProvider.Create() Then
     Set loNewEvent = .DataProvider.CreateEvent()
     loNewEvent.StartTime = Now()
     loNewEvent.EndTime = DateAdd("n",60,loNewEvent.StartTime)
     .DataProvider.AddEvent loNewEvent
     .DataProvider.AddEvent loNewEvent.CloneEvent()
     .Populate
    End If
   End With
  End Sub
  
  Sub ccJobs_BeforeEditOperation(byval OpParams , CancelOperation)
   
  End Sub  
  
  Sub ccJobs_OptionsChanged(ByVal ViewType )
  
  End Sub
 </script>
</head>
<body>
 <form name="frmTest">
  <OBJECT id="ccJobs" style="WIDTH: 797px; HEIGHT: 512px" classid="clsid:B4252697-58EA-4784-B25E-95223304C93C">< /OBJECT>
 </form>
</body>
</html>

When i remove the events from the code, it does not give any error and whenever i add any event code i get an error. Can anyone help me in finding the reason for the error and how to correct it?

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 02 September 2005 at 9:06am
Hi,

You are using incorrect ID: 1CC36260-AD0A-47AC-95EB-B54A218A7B9C

It is not a class id.

The correct class ID is: B4252697-58EA-4784-B25E-95223304C93C

--
WBR,
Serge
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 04 September 2005 at 10:44pm

Iam using the correct id, u can look at the code that i have pasted above, it is

<body>
 <form name="frmTest">
  <OBJECT id="ccJobs" style="WIDTH: 797px; HEIGHT: 512px" classid="clsid:B4252697-58EA-4784-B25E-95223304C93C">< /OBJECT>
 </form>
</body>

this is not 1CC36260-AD0A-47AC-95EB-B54A218A7B9C as you have mentioned in the answer. Moreover used visual interdev to add the component to the toolbox and when i dragged and dropped it into the designer, it generated the code with the correct class id. If it was incorrect class id then the control itself should not appear when i run the code.

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2005 at 7:06am
Hi,

Sorry, you're correct. May be the problem is in the following?


Sub ccJobs_BeforeEditOperation(byval OpParams , ByRef CancelOperation)     

           '...     
     
End Sub


--
WBR,
Serge
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 08 September 2005 at 10:37pm

Hi,

The default way of passing parameters in vbscript is ByRef and hence is optional. I have tried all of these and still it does not work. Since the events does not work, it cannot be said that it works in IE. If it is possible please post some code which handles events and works in IE.



Edited by Nataraj
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2005 at 3:01am
Hi,

What do you mean by 'events does not work' ?
Do you receive ccJobs_BeforeEditOperation event ?
The first what I did - placed alert message in the handler and it works.


Sub ccJobs_BeforeEditOperation(byval OpParams, CancelOperation)

Window.alert CStr(CancelOperation)

End Sub


Also, could you please specify what is your environment?
Windows version:
IE version:

--
WBR,
Serge
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 11 September 2005 at 11:22pm

What i meant by 'events does not work' is that the moment i put the empty event declarations in the code and run, i get an error.  If i remove the event declaractions then it works. I have mentioned this in the first post, you can paste that code into notepad, save it as .htm and then try to run it, it gives error. After this remove the event declarations and try to run, you will see 2 events getting created.

I use Windows Xp Professional SP2 and IE 6.0 with SP2

I tried it in IE 5.0 and the events fire, but even if CancelOperation is set to true, it does not work, i.e. even after setting the property to true, i can resize, edit text, move, copy, create new events etc...

Also there is no option to specify the font and forecolor for each event. No option to print the control. No option to specify custom background color for the event.

When MeetingFlag of the event is set to true instead of icon "E" appears.

When PrivateFlag of the event is set to true instead of icon "B" appears.

 



Edited by Nataraj
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2005 at 9:21am

Hi,

Is there a way of making the events readonly without using the BeforeEditOperation and IsEditDisabled events? i.e. is there any property setting which the event becomes readonly i.e. user should not be able to stretch / shrink the event.

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2005 at 10:55am
Hi Nataraj,

To resolve this problem in the recent 9.80 release we've added one more property to OpParams object. Now you can cancel operations in the following way:

OpParams.DisableCancelOperation = True

Let me know whether this would work for you.

--
HTH,
Serge
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 29 September 2005 at 11:01pm

Hi,

I tried to find DisableCancelOperation by opening the object browser and was not able to find it, i also searched the help file but could not find it. To Which object does that property belong to? I also could not find that property in the CalendarOptions object. I have downloaded the latest version i.e. 9.8.0.0. OpParams is the parameter that can be seen in BeforeEditOperation event and it does not contain that property, moreover the type is ByVal which means that the value cannot be changed. Even if it is ByRef then IE does not support it and hence user can stretch / shrink the events even though the CancelOperation is set to true in BeforeEditOperation event.

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2005 at 7:00am
Nataraj,

This member is hidden. It's special case for IE.
VB and C# clients should use CancelOperation event parameter.

Just enable "Show Hidden members" in the object browser.
It is member of CalendarEditOperationParameters object.

Just use
OpParams.DisableCancelOperation = True

as it was mentioned early.

Of course OpParams is ByVal, it is a pointer to object.
ByRef for object suppose that you have to (or may to) create your own one and return it. In our case you need only access to object properties.

--
WBR,
Serge
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2005 at 5:39am

Hi,

Is there a way to programatically scroll the control vertically? Also is there a way to set a particular date as the first date of the calendar control in month view? For example if i use showday method and pass 10/23/2005 as the parameter and use Options.FirstDayOfTheWeek property to set the first day of week as sunday (10/16/2005), i see 10/16/2005 as the first date. Is it possible to show 10/23/2005 as the first day of the calendar control or any specific date as the first visible day of the calendar control?



Edited by Nataraj
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2005 at 6:48am
Hi,

The ShowDay() work depends on options state:
    Options.FirstDayOfTheWeek property
    Options.MonthViewCompressWeekendDays

Set these options firstly and apply them, than call ShowDay:

EXAMPLE:

    CalendarControl.Options.FirstDayOfTh eWeek = 1
    CalendarControl.Options.MonthViewCom pressWeekendDays = False
    
    ' ***
    ' to apply options before calculating first visible date in ShowDay call
    ' otherwise old options will be used in calculation
    ' ***
    CalendarControl.Populate

    CalendarControl.MonthView.ShowDay #10/23/2005#


if Options.MonthViewCompressWeekendDays = True
ShowDay #10/23/2005# will set (10/17/2005) as first visible date.


--
HTH,
Serge
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 30 October 2005 at 11:36pm

Hi,

I tried the same as you have replied, but this is the result i got for the following dates

Date                 First Visible Date

10/23/2005   -  10/23/2005

10/24/2005   -  10/24/2005

10/25/2005   -  10/19/2005

10/26/2005   -  10/22/2005

10/27/2005   -  10/22/2005

10/28/2005   -  10/22/2005

10/29/2005   -  10/29/2005

Am i missing something? This is the code that iam using

With CalendarControl1

     .Options.EnableInPlaceCreateEv ent = False
     .Options.EnableInPlaceEditEven tSubject_AfterEventResize = False
     .Options.EnableInPlaceEditEven tSubject_ByF2 = False
     .Options.EnableInPlaceEditEven tSubject_ByMouseClick = False
     .Options.EnableInPlaceEditEven tSubject_ByTab = False
     .Options.MonthViewShowEndDate = True
     .Options.WeekViewShowEndDate = True
     .Options.MonthViewCompressWeek endDays = False
     ldtCurr = #10/25/2005#
     .Options.FirstDayOfTheWeek = 2 ^ (WeekDay(ldtCurr) - 1)

       ---------------------------

       .ViewType = 3

       .Populate

       .ActiveView.ShowDay ldtCurr, True

End With

I have tried all possible ways, but am not able to set the first visible date to a particular date. It works in some cases and does not work in some cases, please help.



Edited by Nataraj
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 01 November 2005 at 8:05am
Hi,

Looks like you've found a bug in our help.

FirstDayOfTheWeek - is not an enum (flag), but a simple index:

1 = Sunday,      
2 = Monday,      
3 = Tuesday,     
4 = Wednesday,    
5 = Thursday,    
6 = Friday,     
7 = Saturday

So, just use the following:
.Options.FirstDayOfTheWeek = Weekday(ldtCurr)


--
WBR,
Serge
Back to Top
Nataraj View Drop Down
Newbie
Newbie


Joined: 02 September 2005
Location: India
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Nataraj Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2005 at 11:07pm

Hi,

Is there a way to color a particular cell with custom background color?

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 04 November 2005 at 2:33am
Hi,

No, you can't set color a particular cell, there is a possibility only to customize colors for work and non-work cells for day view.


--
WBR,
Serge
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.