Servoy 3.0 Beta 2

Hi Jan and Johann and all others

I have a very strange behaviour in Servoy 3 Beta 2: The following newRecord statement

// Create new waypoint record (to be filled with data from import, i. e. a record from table import_positions)
forms._waypoints.controller.newRecord();

gives this error: ASA Error -195: Column ‘name’ in table ‘waypoints’ cannot be NULL

As the error happens at the statement newRecord, of course there is still nothing in each attribute, these are filled in later in the method as seen below.

After a complete new installing of Servoy Beta 2 the error message just mentions another colum (name), on the original installing it gave the same error on another column!

Best regards, Robert

PS: This is my whole code, which used to work in previous versions:

/*
Title Insert all waypoint records from table import_positions into table waypoints
Authors Robert Huber
Version 0.1, 23.1.2006

Tables import_positions, waypoints
Files -
Debugging application.output();

Description
*/

// set dialog defaults
globals.countryCode = “-”; // - Select Country -
globals.stateId = 0; // - Select State -
globals.sourceId = 0; // - Select Source -

if ( controller.getMaxRecordIndex() > 0 )
{
var noOfRecords = controller.getMaxRecordIndex(); // returns the number of records for this foundset

// Ask for country and state of waypoints
application.showFormInDialog(forms.DialogAddToWaypoints,-1,-1,-1,-1,‘Add to Wayppoints’,false,false,false);

if ( dialogButtonPressed == ‘add’ )
{
databaseManager.startTransaction(); // transaction rollback point
for ( var i = 1 ; i <= noOfRecords ; i++ )
{
controller.setSelectedIndex(i);
if ( importrow.substring(0, 1) == ‘*’ )
{
; // do nothing
}
else
{
// Create new waypoint record (to be filled with data from import, i. e. a record from table import_positions)
forms._waypoints.controller.newRecord();
// Split importrow into individual attributes
var attributesArray = importrow.split(‘,’);
// Set columns in table waypoints
var waypointAttributes = attributesArray[4]; // assign waypoint attributes, e. g. AT
var waypointAttributesCheckBoxFormat;

if ( waypointAttributes.length > 1 )
{
waypointAttributesCheckBoxFormat = waypointAttributes.charAt(0) + ‘\n’;
for ( var j = 1 ; j < waypointAttributes.length - 1 ; j++ )
{
waypointAttributesCheckBoxFormat += waypointAttributes.charAt(j) + ‘\n’; // add new line after each character to get checkbox format
}
waypointAttributesCheckBoxFormat += waypointAttributes.charAt(j); // no new line needed after last character

}
else
{
waypointAttributesCheckBoxFormat = waypointAttributes.charAt(0); // store attribute without a new line (at the end)
}

// Set attributes in table waypoints
forms._waypoints.attributes = waypointAttributesCheckBoxFormat;
forms._waypoints.elevation = attributesArray[3];
forms._waypoints.latitude = attributesArray[1];
forms._waypoints.longitude = attributesArray[2];
forms._waypoints.name = attributesArray[5];
forms._waypoints.remark = attributesArray[6];
forms._waypoints.state_id = globals.stateId;
forms._waypoints.source_id = globals.sourceId;
controller.saveData();
}
}
controller.saveData();

var success = databaseManager.commitTransaction();
if ( success )
{
plugins.dialogs.showInfoDialog(‘Add to Waypoints’,‘Waypoints successfully to waypoints added!’,‘OK’);
}
else
{
plugins.dialogs.showErrorDialog(‘Add to Waypoints’,‘No waypoints added! (Commit failed)’,‘OK’);
databaseManager.refreshRecordFromDatabase(foundset,-1);
}
}
else
{
// cancel pressed, do nothing
}
}
else
{
plugins.dialogs.showWarningDialog(‘Waypoints’, ‘No waypoints transfered!’);
}

I have seen one strange behavior with this. I went directly to the beta release as a new install so I wasn’t upgrading. I have a method that puts all the elements of a form in a global variable using the allnames property. I had only 83 named elements on that form and when I look in the method editor tree for the elements of that form I also only see those 83 elements. However the ‘forms.formname.elements.allnames’ of that form returns 84 elements. The ‘rogue’ element is called ‘dialog4’. I have nothing by that name on any of my forms nor in my methods nor does it show up in the ‘elements tree’ in the method editor. This definitely wasn’t there and didn’t happen using 2.2.4. I wasn’t planning on upgrading yet actually but I thought I would take the plunge when it became impossible for me to import my solutions on this computer (see http://forum.servoy.com/viewtopic.php?p … ght=#30505)

Unfortunately that didn’t solve that problem but it did bring this to light :)
Should this be filed as a bug? Or for beta releases should we post them on these ‘announcements’ as before? Servoy Developer
Version 3.0b2-build 363
Java version 1.5.0_06-b05 (Windows 2000)

John

Hi John

There is definitly a strange behaviour in my solution as well, as the succes a newRecord command (in a method) can’t be depending on what forms is in front, can it?

BTW, I am still unable to get bean properties after the initial placement on a form. Do you also have this phenom on your Mac with Developer Beta 2?

Best regards, Robert

john.allen:
I have seen one strange behavior with this. I went directly to the beta release as a new install so I wasn’t upgrading. I have a method that puts all the elements of a form in a global variable using the allnames property. I had only 83 named elements on that form and when I look in the method editor tree for the elements of that form I also only see those 83 elements. However the ‘forms.formname.elements.allnames’ of that form returns 84 elements. The ‘rogue’ element is called ‘dialog4’. I have nothing by that name on any of my forms nor in my methods nor does it show up in the ‘elements tree’ in the method editor. This definitely wasn’t there and didn’t happen using 2.2.4. I wasn’t planning on upgrading yet actually but I thought I would take the plunge when it became impossible for me to import my solutions on this computer (see http://forum.servoy.com/viewtopic.php?p … ght=#30505)

Unfortunately that didn’t solve that problem but it did bring this to light :)
Should this be filed as a bug? Or for beta releases should we post them on these ‘announcements’ as before? Servoy Developer
Version 3.0b2-build 363
Java version 1.5.0_06-b05 (Windows 2000)

John

Robert,
can you make a case where i can see a newRecord immediantly saving the the record even if you don’t call saveData() or change to another form anywhere?

NewRecord shouldn’t save
You can go around that completely now by using databasemanager.autosave = false;

Hi Johann

See attached the situation of the error occuring at the newRecord statement. I found it also occurs with the controller.setSelectedIndex( i ); or controller.setSelectedIndex( ++i ); statement, which is even more strange.

Best regards, Robert

PS: I am feeling stupid, but I can’t find the button to upload an image any more, only when I open a new thread in this list.

jcompagner:
Robert,
can you make a case where i can see a newRecord immediantly saving the the record even if you don’t call saveData() or change to another form anywhere?

NewRecord shouldn’t save
You can go around that completely now by using databasemanager.autosave = false;

if you do setSelectedIndex() then it can that it saves.
Becaus then you go to another record and the current record is then saved.

Please add a case in the support system for this with a sample solution.

johan

That was just what I did :-) I put it in my case id 290 under other files. It’s a zip file with two screen shots. I sent you my trial solution (under this case id) already so you can try it yourself.

Best regards, Robert

jcompagner:
if you do setSelectedIndex() then it can that it saves.
Becaus then you go to another record and the current record is then saved.

Please add a case in the support system for this with a sample solution.

johan

I reported earlier that a solution that was ‘upgraded’ to 3.0.2beta got an ‘extra’ named item in a form. This named item (‘dialog4’) was not named on that form nor any other form in that solution nor did that element show up in the method tree for that form. Now I have also discovered that a couple of items that were named, somehow ‘lost’ their names. These were named label/buttons that when clicked performed a sort of the column that they were above. That method had been working for several weeks. After the upgrade, however, that sort did not work and when I investigated I found that the ‘names’ were now simply blank.

can you make a case with that or a sample solution so that i can look at it?

What happes if you really reset the names in that solution?

3.0.3 Build 364 on WinXP - in method editor tree, I can’t see foundset under any of my forms. Also UseSeparateFoundset property is gone from the properties panel - any idea why?

If I type foundset in my method and hit ctrl-space I do get the foundset class of methods - i’ts just not in the tree.

yes, there is function, to have a simple mode and advanced mode and a webclient- mode in your editor! (out of head)

Look in your menu, to set the mode

Enable the advanced filter in view menu
for filter spec. see: http://forum.servoy.com/viewtopic.php?t=5138