-
here is the output in performance metric (the blank lines I inserted for myself to understand better)
the datasource of the first section ("azonositok") is "FELADAS". "FUVAR" is the name of datasource of "fuvarlevelek" and "fuvaradat".
Code:
[ 0ms] Clicked actionbar button 'Next Record'
[ 0ms] performAction Next Record for page feladas dirty=0
[ 1ms] refresh form section feladas.azonositok begin
[ 125ms] cursoradaptor::fetchRows(ISOKOD) started
[ 17ms] cursoradaptor::fetchRows(ISOKOD) completed rows=11 rowsfetched=11 reccount=11
[ 17ms] cursoradaptor::fetchRows() started
[ 0ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 32ms] refresh form section feladas.azonositok end
[ 0ms] parentdatachanged for grid section feladas.fuvarlevelek
[ 0ms] id=feladas.fuvarlevelek event=parentdatachanged(before) delegate=feladas_fuvarlevelek_parentdatachanged()
[ 21ms] cursoradaptor::fetchRows(FUVAR) started
[ 0ms] cursoradaptor::fetchRows(FUVAR) completed rows=2 rowsfetched=2 reccount=2
[ 0ms] refresh form section feladas.fuvaradat begin
[ 128ms] cursoradaptor::fetchRows(ISOKOD) started
[ 0ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 32ms] cursoradaptor::fetchRows() started
[ 3ms] cursoradaptor::fetchRows() completed rows=6 rowsfetched=6 reccount=6
[ 11ms] id=feladas.fuvaradat.field6 event=datachanged delegate=fuvarlevel_fuvaradat_field6_datachanged()
[ 124ms] cursoradaptor::fetchRows(ISOKOD) started
[ 3ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 80ms] cursoradaptor::fetchRows() started
[ 3ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 43ms] cursoradaptor::fetchRows() started
[ 4ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 43ms] cursoradaptor::fetchRows() started
[ 4ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 46ms] cursoradaptor::fetchRows() started
[ 3ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 48ms] cursoradaptor::fetchRows() started
[ 3ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 33ms] cursoradaptor::fetchRows(CIKK) started
[ 8ms] cursoradaptor::fetchRows(CIKK) completed rows=25 rowsfetched=25 reccount=438
[ 36ms] cursoradaptor::fetchRows() started
[ 3ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 30ms] refresh form section feladas.fuvaradat end
[ 0ms] evaluate rowcount('fuvar') filter=
[ 16ms] CursorAdaptorReccount [rowcount=2] filter=
[ 0ms] refresh form section feladas.fuvaradat begin
[ 137ms] cursoradaptor::fetchRows(ISOKOD) started
[ 0ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 34ms] cursoradaptor::fetchRows() started
[ 6ms] cursoradaptor::fetchRows() completed rows=6 rowsfetched=6 reccount=6
[ 10ms] id=feladas.fuvaradat.field6 event=datachanged delegate=fuvarlevel_fuvaradat_field6_datachanged()
[ 115ms] cursoradaptor::fetchRows(ISOKOD) started
[ 0ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 104ms] cursoradaptor::fetchRows() started
[ 1ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 55ms] cursoradaptor::fetchRows() started
[ 6ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 65ms] cursoradaptor::fetchRows() started
[ 10ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 53ms] cursoradaptor::fetchRows() started
[ 6ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 51ms] cursoradaptor::fetchRows() started
[ 7ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 59ms] cursoradaptor::fetchRows(CIKK) started
[ 17ms] cursoradaptor::fetchRows(CIKK) completed rows=25 rowsfetched=25 reccount=438
[ 70ms] cursoradaptor::fetchRows() started
[ 10ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 56ms] refresh form section feladas.fuvaradat end
[ 20ms] cursoradaptor::fetchRows(FUVAR) started
[ 15ms] cursoradaptor::fetchRows(FUVAR) completed rows=2 rowsfetched=2 reccount=2
[ 0ms] refresh form section feladas.fuvaradat begin
[ 139ms] cursoradaptor::fetchRows(ISOKOD) started
[ 8ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 30ms] cursoradaptor::fetchRows() started
[ 9ms] cursoradaptor::fetchRows() completed rows=6 rowsfetched=6 reccount=6
[ 16ms] id=feladas.fuvaradat.field6 event=datachanged delegate=fuvarlevel_fuvaradat_field6_datachanged()
[ 131ms] cursoradaptor::fetchRows(ISOKOD) started
[ 17ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 83ms] cursoradaptor::fetchRows() started
[ 8ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 55ms] cursoradaptor::fetchRows() started
[ 5ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 43ms] cursoradaptor::fetchRows() started
[ 16ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 43ms] cursoradaptor::fetchRows() started
[ 15ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 58ms] cursoradaptor::fetchRows() started
[ 9ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 39ms] cursoradaptor::fetchRows(CIKK) started
[ 12ms] cursoradaptor::fetchRows(CIKK) completed rows=25 rowsfetched=25 reccount=438
[ 41ms] cursoradaptor::fetchRows() started
[ 9ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 47ms] refresh form section feladas.fuvaradat end
[ 10ms] evaluate rowcount('fuvar') filter=
[ 10ms] CursorAdaptorReccount [rowcount=2] filter=
[ 9ms] id=feladas.fuvarlevelek event=parentdatachanged(after) delegate=feladas_fuvarlevelek_parentdatachanged()
[ 10ms] refresh grid section feladas.fuvarlevelek begin
[ 10ms] refresh grid section feladas.fuvarlevelek
[ 10ms] grid.setSkipFilter: filter=FELADAS="V500KL002S001"
[ 10ms] refresh grid FUVAR pagination=1 (start)
[ 10ms] grid.getRowCountValue(START)
[ 14ms] evaluate rowcount('fuvar') filter=FELADAS="V500KL002S001"
[ 10ms] Tablescan [rowcount=0] filter=FELADAS="V500KL002S001"
[ 11ms] grid.getRowCountValue(END)
[ 10ms] grid.getRowCountValue(START)
[ 11ms] evaluate rowcount('fuvar') filter=FELADAS="V500KL002S001"
[ 10ms] Tablescan [rowcount=0] filter=FELADAS="V500KL002S001"
[ 12ms] grid.getRowCountValue(END)
[ 12ms] grid.getRowCountValue(START)
[ 10ms] evaluate rowcount('fuvar') filter=FELADAS="V500KL002S001"
[ 14ms] Tablescan [rowcount=0] filter=FELADAS="V500KL002S001"
[ 12ms] grid.getRowCountValue(END)
[ 13ms] grid.getRowCountValue(START)
[ 12ms] evaluate rowcount('fuvar') filter=FELADAS="V500KL002S001"
[ 2ms] Tablescan [rowcount=0] filter=FELADAS="V500KL002S001"
[ 17ms] grid.getRowCountValue(END)
[ 10ms] refresh grid (end)
[ 8ms] grid.getRowCountValue(START)
[ 0ms] evaluate rowcount('fuvar') filter=FELADAS="V500KL002S001"
[ 17ms] Tablescan [rowcount=0] filter=FELADAS="V500KL002S001"
[ 15ms] grid.getRowCountValue(END)
[ 0ms] grid.getRowCountValue(START)
[ 16ms] evaluate rowcount('fuvar') filter=FELADAS="V500KL002S001"
[ 16ms] Tablescan [rowcount=0] filter=FELADAS="V500KL002S001"
[ 16ms] grid.getRowCountValue(END)
[ 0ms] parentdatachanged for form section feladas.fuvaradat
[ 16ms] refresh form section feladas.fuvaradat begin
[ 17ms] refresh form section feladas.fuvaradat begin
[ 152ms] cursoradaptor::fetchRows(ISOKOD) started
[ 0ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 35ms] cursoradaptor::fetchRows() started
[ 15ms] cursoradaptor::fetchRows() completed rows=6 rowsfetched=6 reccount=6
[ 46ms] id=feladas.fuvaradat.field6 event=datachanged delegate=fuvarlevel_fuvaradat_field6_datachanged()
[ 118ms] cursoradaptor::fetchRows(ISOKOD) started
[ 15ms] cursoradaptor::fetchRows(ISOKOD) completed rows=4 rowsfetched=4 reccount=4
[ 67ms] cursoradaptor::fetchRows() started
[ 16ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 58ms] cursoradaptor::fetchRows() started
[ 11ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 52ms] cursoradaptor::fetchRows() started
[ 12ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 64ms] cursoradaptor::fetchRows() started
[ 16ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 37ms] cursoradaptor::fetchRows() started
[ 16ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 37ms] cursoradaptor::fetchRows(CIKK) started
[ 15ms] cursoradaptor::fetchRows(CIKK) completed rows=25 rowsfetched=25 reccount=438
[ 36ms] cursoradaptor::fetchRows() started
[ 11ms] cursoradaptor::fetchRows() completed rows=1 rowsfetched=1 reccount=1
[ 39ms] refresh form section feladas.fuvaradat end
[ 11ms] refresh section feladas.fuvaradat end
[ 0ms] refresh section feladas.fuvarlevelek end
-
What are doing in the "parentdatachanged" delegate for feladas.fuvaradat
What is its parent section? you seem to have multiple refreshes going on for section feladas.fuvaradat as can be seen by the metrics.
Are you possibly refreshes manually in the parentdatachanged delegate and still have a section relationship set?
-
that's all
Code:
proc feladas_fuvarlevelek_parentdatachanged()
// insert your code here
private cFeladas, ca
cFeladas = feladas.feladas
ca = cursoradapter("fuvar")
if type("m.ca") = "O"
ca.requery("feladas like '"+m.cFeladas+"'")
endif
endproc
parent is "azonositok" (datasource: FELADAS), parentkey:FELADAS
child is "fuvarlevelek" (datasource: FUVAR), key: FELADAS
-
Can you reply to the posts to keep them organized This thread is all over and is hard to follow.
-
I see so you have a tabview section above the form section.
So you want to relate the form section when? when you click on grid rows or what?
-
It would make more sense to detach your tabs and get the relationships that you want working then attach them back into the tabview section.
-
no more tabview. the parent is a simple form section, the child is a grid section. The problem is with the vt. Everything works fine with automatic relation. However, in the case of Vt, the automatic relation is very slow (the loading of the app is 2 minutes approx.) I cannot solve the custom relation handling correctly. Maybe the ca.requery() is OK, but the grid refresh and navigation bar are not working properly.
-
4 Attachment(s)
I cannot reproduce any of this behavior.
I created an App with a form section at the top and a grid underneath.
The form section is MSSQL and the grid section is MySQL.
I clicked the + icon in the relationship builder and connected the form section to the grid section. I then unchecked "Automatically relate" in the section attributes for the top form section.
Attachment 2336
I then selected the lower grid section and added a "parentdatachanged" delegate.
Code:
////////////////////////////////////////////////////////////////
// Event delegate for 'parentdatachanged' event
proc page1_section2_parentdatachanged()
? "parentdatachanged()"
ca = cursoradaptor("vt_actors")
ca.requery("last_name='MAVIN'")
endproc
"vt_actors" is the alias for the MySQL grid section.
Everything works as expected.
You can test your code interactively if you have any questions about whether it works or not. See below.
Attachment 2337
You can reset the requery() like this.
Attachment 2338
When requerying the data remember to get the active "search filter" and the "filter" if you are using that, and postfix this to your query so that the search panel is honored too. You can access these in the section like this:
Code:
Lianja.get("page1.section2").searchfilter
Lianja.get("page1.section2").filter
When using manual relationships like this in order to speed up the loading of an App you should specify "nodata=1" in the VT properties. This prevents any data being retrieved until a "where" condition is specified e.g. in the requery( [expression] ) call. When using VTs this is important for performance otherwise all the data will be retrieved on startup of the App in desktop apps only. Web/Mobile apps are specifically optimized so don't experience this behavior.
Here is an example of the performance metrics in my test desktop App relating MSSQL with 20k records to MySQL.
Attachment 2339
Note that there is an example_virtualtables app in the distro that you can study. It relates two virtual tables together using SQL statements with no parent->child relationship expressions.
There are always various ways that things can be done in Lianja.
-
1 Attachment(s)
Hi Barry,
take a look at the bottom nav bar... '1 of 3'
Attachment 2341
-
What are you referring to. Oh i see let me investigate. This was not what you were discussing but I will look into it anyway.