QCalendar error in 2.0

Login or register to post comments
11 replies [Last post]
LaCeja's picture
Offline
Joined: 11/04/2009

I have started development, using QCubed 2.0 and found a problem with QCalendar. In the following code, I get the error: "strlen() expects parameter 1 to be string" at line 170 of QControlBase.class.php.

      $this->dtxComtCalendar = new QDateTimeTextBox($this);
      $this->calComtExpDate = new QCalendar($this, $this->dtxComtCalendar);

The call stack looks like this:

#0 (): QcodoHandleError()
#1 C:\wamp\www\htw2\includes\qcubed\_core\base_controls\QControlBase.class.php(170): strlen()
#2 C:\wamp\www\htw2\includes\qcubed\_core\base_controls\QTextBoxBase.class.php(64): QControlBase->__construct()
#3 C:\wamp\www\htw2\wla\customers_edit.php(413): QTextBoxBase->__construct()
#4 C:\wamp\www\htw2\includes\qcubed\_core\base_controls\QFormBase.class.php(294): CustomersEditForm->Form_Create()
#5 C:\wamp\www\htw2\wla\customers_edit.php(714): QFormBase::Run()

The problem is in creating the new QCalendar control.

Running the Examples Date and DateTime-based QControls fails completely.

This code works without exception in 1.1.1.

Offline
Joined: 03/31/2008

Looks like the new control may include its own QTextBox instead of needing one supplied. I wonder if there's a way to keep this backwards compatible.
If not, we need to update the example (and any codegen templates that utilize it) to use the new syntax.

LaCeja's picture
Offline
Joined: 11/04/2009

VexedPanda, after some testing, I see you are correct. It's actually very much simpler now. It's no longer necessary to create a QDateTimeTextBox and then a QCalendar attached to it. Simply create the QCalendar as the control and you're done.

I'll look into adding the capability to add more options to it.

Thank you!

Offline
Joined: 01/09/2008

I created a ticket for this:
http://trac.qcu.be/projects/qcubed/ticket/539

However, the examples work properly on my system, are you sure you updated your examples as well?

LaCeja's picture
Offline
Joined: 11/04/2009

The new QCalendar seems to work without any problems. I think all that is needed is update of examples documentation for 2.0.

Offline
Joined: 01/09/2008

can you indicate where we should update? I noticed that examples are working fine here...?

LaCeja's picture
Offline
Joined: 11/04/2009

Kristof:

In 1.1.1 it's necessary to create a QDateTimeTextBox and then attach QCalendar to it. In 2.0, all I needed was the QCalendar.

In Examples, when I take the Date and Date Time-based QControls, I get the following error:

"Trying to get property of non-object"

at line 53 of datetime.php.

$this->btnCalendar->ActionParameter = $this->dtxCalendar->ControlId;

Basically, it seems like btnCalendar and btnCalendarPopup can be eliminated.

Thanks,

LaCeja

LaCeja's picture
Offline
Joined: 11/04/2009

Kristof, I've created several enhancements to the QCalendar control. Ive added the following options:

minDate, maxDate, defaultDate, firstDay, gotoCurrent, IsRTL, numberOfMonths, and autoSize.

There are quite a few other options available, which I have not given much attention. However, if anyone wants any of them added, I'll be happy to do so.

Please have a look at ticket# 539 for the details. The new QCalendar is attached to that ticket.

Thanks,

LaCeja

Offline
Joined: 12/20/2009

I'm sorry to beat what might be a dead horse on this, but would you be able to clarify the backwards-compatibility issues on this? Creating a QDateTimeTextBox/QCalendar combination does not seem to work at all in 2.0, but, as LaCeja indicates, you only need the calendar piece. I'm assuming that when I port my 1.1 application to 2.0, I will run into problems on this? I don't have calendars lying all over the place, but still it's something I'd like to keep in the back of my mind.

Thanks guys!

Offline
Joined: 03/31/2008

I believe the QDateTimeTextBox QCalendar stuff was fixed in either 2.0.1 or in SVN (which will be released as 2.0.2). As for backwards compatibility, I believe the existing controls should be backwards compatible (and if they are not, we should fix that). There are also new jQuery-based controls that do have different syntax, but you can choose which to use.

CharlesMainegra (not verified)

Thank you very much for posting this article. Its a very useful article. We will be acquire lot landing page design of things from this site.So i want some information about this post.

CharlesMainegra (not verified)

The post is written Denver Events in very a good manner hughesnet and it entails many useful information for me. I am happy to find your distinguished business logo Design way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post.