I noticed some unexpected behavior when using plugins.rawSQL.flushAllClientsCache().
It looks like the selectedindex of the foundset isn’t always set correctly after this operation when in the webclient with only one record in the foundset.
To illustrate this unexpected behavior i created a form based on the shippers table of the example database.
- I choose table view (locked) as view for this form and add a few labels (like shipperid, companyname) of the shippers table.
- I add one button to the form (this button will be displayed inside the table view next to each record)
- I create a form method for the onAction event of the button. In this method I do an application.output() of the companyname.
I start this form in the smartclient and I delete all records except for one (the unexpected behavior is most consistent with one record in the foundset). Each time when I click on the button, the companyname is printed in the console (like it should).
When I click on the button in the webclient though, the companyname is printed out in the console only one time. Each attempt afterwards will print in the console. After debugging, I found out that selectedindex is set to 0 instead of 1.
Is anyone able to recreate this unexpected behavior?
I’m using Servoy 5 in Windows XP (I also encountered the unexpected behavior in Ubuntu).
The content of the shippers.frm
dataSource:"db:/example_data/shippers",
items:[
{
dataProviderID:"companyname",
location:"150,70",
name:"companyname",
size:"140,20",
text:"Companyname",
typeid:4,
uuid:"26825CFD-D360-4415-9EF9-1D033BAE75A3"
},
{
height:120,
partType:5,
typeid:19,
uuid:"38A01F38-10A2-4331-B4D3-1633A51C7192"
},
{
location:"400,70",
mediaOptions:14,
onActionMethodID:"3B5853A9-B585-4EE6-8E35-59011B013809",
onDoubleClickMethodID:"-1",
onRightClickMethodID:"-1",
size:"80,20",
text:"button",
typeid:7,
uuid:"6B1BE14C-0A6F-442E-938C-FCFB77D7A849"
},
{
dataProviderID:"phone",
location:"240,70",
name:"phone",
size:"140,20",
text:"Phone",
typeid:4,
uuid:"7DA4EC8A-5CDF-4EBF-84F6-1B43E0D1E4F4"
},
{
dataProviderID:"shipperid",
editable:false,
location:"60,70",
name:"shipperid",
size:"140,20",
text:"Shipperid",
typeid:4,
uuid:"D9701134-E418-41AA-8AAA-172AC63A5E3F"
}
],
name:"shippers",
paperPrintScale:100,
showInMenu:true,
size:"640,120",
typeid:3,
uuid:"1F64CBB4-86EE-429A-8536-BCDDBD5C2823",
view:3
Content of the script file
/**
* Perform the element default action.
*
* @param {JSEvent} event the event that triggered the action
*
* @properties={typeid:24,uuid:"3B5853A9-B585-4EE6-8E35-59011B013809"}
*/
function onAction(event)
{
// TODO Auto-generated method stub
plugins.rawSQL.flushAllClientsCache(controller.getServerName(), 'shippers');
application.output(companyname);
}