I have a form in “table view” with some columns. Some related directly to the form table, some related to other tables.
Two fields that are related with a different table when I click on the column header don’t sort. Some other fields related with other tables instead haven’t this problem…
Any idea why I cannot sort these two fileds?
One is calculated and maybe these fileds are unsortable but the other is a simple number…
Unstored calculated fields are not sortable.
If your column is not based on an unstored calculation: Are you sure there is an onsortCmd method attached (either the default or a custom method)?
Paul
Yes the OnSortCmd on the form is set to default infact all the other column are sortable.
Maybe because it’s related to the same table of the calcalulated field?
solved just deleting and reinserting the field. I made a screenshot of the properties before and after and are the same. Simply a mystery.
Is there a method to set the table view as unordenable (columns drag and drop)?
Gh I inserted a wrong column. The problem persist. I can’t order this related column.
The problem seem to be at table level. Every field of this table I try to insert in “table view” is unsortable.
Any other column from another related table works fine?
How does the relation look?
Any errors in the log?
Yes all other columns related works fine except one calculated unstored field of the same table.
The relation is a simply 1to1 with an inner join with “allow creation of related record” active.
Where I can found the log of the “servoy developer”?
except one calculated unstored field of the same table
One of the first things I mentioned is the following:
Unstored calculated fields are not sortable
Offcourse this also goes for related unstored calculated fields.
Paul
Yes two column cannot be sorted and is related to the same table:
one is a calculated unstored filed and is natural cannot be sorted
one is a simply number that SHOULD BE sorteable
Sorry, forgot that you allready provided that detail…
Mmm, it sounds strange.
The log of developer can be found in the /Servoy directory.
You can also check the performance log on the admin pages to see which query is fired at the database exactly (clear the log, try to sort and refresh the performance log page).
If no errors occur and you do not see any wrong with the queries fired, please try creating a sample solution and create a case in our support system, attaching the sample solution to it.
Paul
I made a sample solution.
From the log simply no query is fired. Seem like the click on the column header has no effects.
I attached it in this post cause I’m not so sure it’s a bug. Sound too strange.
test_nc_commessa.zip (5.87 KB)
I tested on 3.5.5 with the solution you created, but all columns are perfectly sortable…
Which version are you on?
Paul
The same (3.5.5) with jdk_1.6.0.5 and mysql 5.0.45 with jdbc 5.1.6. I exported to the production server that have the same configuration and there’s the same result.
![Sad :(]()
I tried your sample solution with Servoy 3.5.5 running on jdk_1.6.0_05-b13 - and it just worked. Only difference being that I ran it on the Sybase database that comes with Servoy. This seems, therefore, like a MySQL problem.
Apparently, MySQL won’t sort on this column. Maybe the column is not sortable as far as MySQL is concerned. Please try with Sybase.
Please, try to post the table structure that you can get in MySQL using the command:
show create table <table_name>
MAIN TABLE
CREATE TABLE non_conformita
.non_conformita
(
nc_id
int(10) unsigned NOT NULL,
numero
char(7) NOT NULL,
id_stato
int(10) unsigned NOT NULL default ‘1’,
id_tipo
int(10) unsigned NOT NULL default ‘1’,
data_rilievo
datetime NOT NULL,
id_commessa
int(10) unsigned NOT NULL,
id_sistema
int(10) unsigned NOT NULL,
rilevatore
varchar(30) NOT NULL,
id_fase_rilevazione
int(10) unsigned NOT NULL,
id_prod_serv
int(10) unsigned NOT NULL,
id_specifica
int(10) unsigned NOT NULL,
tipologia
varchar(45) default NULL,
fornitore
varchar(45) default NULL,
descrizione
text NOT NULL,
id_fase_attribuzione
int(10) unsigned default NULL,
costo
int(10) unsigned NOT NULL default ‘0’,
rimborso
int(10) unsigned NOT NULL default ‘0’,
azioni_correttive
text,
data_azioni_correttive
datetime default NULL,
verifica_efficacia
text,
data_verifica_efficacia
datetime default NULL,
verificatore
varchar(30) default NULL,
data_chiusura
datetime default NULL,
data_ins
datetime default NULL,
data_upd
datetime default NULL,
PRIMARY KEY USING BTREE (nc_id
,numero
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
RELATED TABLE (with unsortable column numero, nome)
CREATE TABLE commesse
.commesse
(
commessa_id
int(10) unsigned NOT NULL,
numero
int(10) unsigned NOT NULL default ‘0’,
nome
varchar(30) NOT NULL,
committente
varchar(50) NOT NULL,
id_stato
int(10) unsigned NOT NULL,
id_referente
int(10) unsigned NOT NULL,
id_agente
int(10) unsigned default NULL,
azienda
varchar(15) NOT NULL default ‘Pregeco’,
zona_sismica
int(10) unsigned NOT NULL,
anno
int(10) unsigned NOT NULL,
PRIMARY KEY USING BTREE (commessa_id
),
UNIQUE KEY Index_nome
(nome
),
UNIQUE KEY Index_numero
(numero
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
PRIMARY KEY USING BTREE (nc_id
,numero
)
Can you check your dataprovider window to see if PK are set correctly for this table? Maybe that could cause the issue, post a screenshot of the dataprovider window for that table.
I remove all the index and the double primary key and check the dataprovider windows that is OK but the problem persist.
Sorry, then I’m clueless.
Create a case in the Support System and wait for the Dev team to have a look at this issue.