Page 2 of 3

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Thu Apr 28, 2011 12:55 pm
by ROCLASI
victor.rojo wrote:I think that Postgres expect a date instead of a string.

That is correct. PostgreSQL doesn't implicitly cast strings to a date (anymore).

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Thu Apr 28, 2011 1:36 pm
by jasantana
victor.rojo wrote:
jasantana wrote:Hi,

When I launch the solution I get this error: Cannot rander the Calendar. Please Restart the application!


Hi, did you import the solution in a Postgres db?

I also had this error. The problem is in
Code: Select all
   var apptDataset = databaseManager.getDataSetByQuery(datasource,
      sqlQuery, [globals.mfcal_g_getUserIDx(),
      utils.dateFormat(monthViewStartDate, 'yyyy-MM-dd HH:mm:ss'),
      utils.dateFormat(monthViewlastTime, 'yyyy-MM-dd HH:mm:ss')], 10000);


I think that Postgres expect a date instead of a string.
I searched all the databaseManager.getDataSetByQuery and replaced the utils.dateFormat(<date>, 'yyyy-MM-dd HH:mm:ss') with <date> and it worked.



Thanks Victor that did the trick. I got it working now

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Thu Apr 28, 2011 4:19 pm
by pradiptab
For this module we have used MySQL.

victor.rojo wrote:I think that Postgres expect a date instead of a string.
I searched all the databaseManager.getDataSetByQuery and replaced the utils.dateFormat(<date>, 'yyyy-MM-dd HH:mm:ss') with <date> and it worked.


Yes you are right for PG you need to use only date without any formatting.
Thanks Victor Rojo for sharing this information.

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Thu Apr 28, 2011 9:19 pm
by michele
Someone has tested to use this module in an application based on the servoy navigation framework ?
I receive an error ("Cannot rander the Calendar. Please Restart the application!" when the main form is opened and i can't see the months panel on the left....

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Thu Apr 28, 2011 9:53 pm
by jasantana
michele wrote:Someone has tested to use this module in an application based on the servoy navigation framework ?
I receive an error ("Cannot rander the Calendar. Please Restart the application!" when the main form is opened and i can't see the months panel on the left....


I think the solution for your problem is some posts ago. It might be the SQL to retrieve the data and the dates format

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Fri Apr 29, 2011 9:31 pm
by michele
jasantana wrote:
michele wrote:Someone has tested to use this module in an application based on the servoy navigation framework ?
I receive an error ("Cannot rander the Calendar. Please Restart the application!" when the main form is opened and i can't see the months panel on the left....


I think the solution for your problem is some posts ago. It might be the SQL to retrieve the data and the dates format


I think this is not the same problem. I have corrected the rows with the problem explained some posts ago. In fact if i run the module in standalone mode it is all ok. The problem is only when i attempt ro run the module into my application that works with the servoy navigation framework.....i don't know which is the problem...i am not an expert in Servoy....i use it since the beginning of this year and i come from Visual Foxpro not from Java....i have seen that the error message appears every time an error is found in the "try" structure....the message is in the "catch" part.... and the result is that the months in the left side of the form are not present after the error....

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Fri Apr 29, 2011 9:53 pm
by michele
I have commented the try/catch structure and i have found that the program find this error

"TypeError: Cannot call method "getFullYear" of null "

on this statement

var navEndDate = new Date(navCalStartDate.getFullYear(),
navCalStartDate.getMonth() + 3,
navCalStartDate.getDate());

what can i try ?

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Fri Apr 29, 2011 11:54 pm
by ROCLASI
So the variable navCalStartDate holds null. Where does is get set ?

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Sat Apr 30, 2011 10:23 am
by CHAUMARET
Thank you !

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Sat Apr 30, 2011 3:27 pm
by michele
The previous error was generated by another try/catch structure taht goes in error....commented also this try/catch and the first error seems to be this:

Exception Object: org.mozilla.javascript.EvaluatorException: Can't find method com.servoy.j2db.scripting.solutionmodel.JSForm.js_newLabel(string,number,number,null,number). (K:\servoy_workspace\mfModuleAppointments\forms\mfcal_main.js#187)
MSG: Can't find method com.servoy.j2db.scripting.solutionmodel.JSForm.js_newLabel(string,number,number,null,number). (K:\servoy_workspace\mfModuleAppointments\forms\mfcal_main.js#187)
Can't find method com.servoy.j2db.scripting.solutionmodel.JSForm.js_newLabel(string,number,number,null,number). (K:\servoy_workspace\mfModuleAppointments\forms\mfcal_main.js#187)

with(frmObj.newLabel('', colCnt * cellWidth , 0, cellWidth, (cellNormalHeight * 21) + (headerCellHeight * 3)))

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Mon May 02, 2011 10:35 am
by jcompagner
how is there a 'null' in this:

string,number,number,null,number

that should also be a number.

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Mon May 02, 2011 2:40 pm
by michele
The problem is that when i use this module in my application and i run it, the form when is loaded is lined to the requested table, but doesn't see the record stored in it....so the null values returned...and all the problems in the creation of the form....if i set the values, normally read from the table, manually all seems to run without problem...but if i attempt to read data from the parameters tables no records are displayed..i don't know why....

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Tue May 03, 2011 10:35 am
by michele
My application works with another server name that is different from the original (schedule). All ther tables are in my server and i have checked that all entries in files in workspace haven't references to old server name (schedule) and have only references to my server's name (approdo).
The problem is still present. When i open the form the record in the tbl_preference table is not read.....and if i enter the settings form i can't see the data stored in the table. I can save new appointments and search all old appointments....In the settings form i can't see the appointment's type table, but if i insert a new appointment i can see the valuelist of the appointment's type....

I don't know what verify anymore....

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Wed May 04, 2011 4:45 pm
by michele
The problem has been resolved. The appointments module can runs in standalone mode or as module in another application. When starts in standalone there is a method in onShow that execute some statements and between these there is a loadallrecords() of the main form. If the module is inserted in another application the onShow is not executed.....if i put the loadallrecords() before calling the main form it is all ok.

The only problem is still present is that when i call the main form from another application and i attempt to call the full method present in onshow of the module it runs correct only the first time, while the next it shows an error message.....

xception Object: java.lang.RuntimeException: Couldn't start the scheduler! Unable to store Job with name: 'showAlert' and group: '13DDEB9A-2C32-469E-970B-0F0F5E9149A6', because one already exists with this identification.

Re: Appointments Module in Servoy - mfModuleAppointments

PostPosted: Wed May 04, 2011 5:54 pm
by jasantana
@pradiptab

Good afternoon from Gran Canaria. First I want to thank you for this contribution, it is a very good one.

I have been trying to make it work as a module in one solution and I do not know how to get something. What I need is to share my solution navigator and to do that I created a new form in my solution that extends mfcal_main and set the navigator to my own, but it does not work as expected and do not know why. Have you tried to get that?

Thanks in advance