Hi,
Documentation says : The DOUBLECLICK attribute defines the action for row choice on TABLE/TREE/SCROLLGRID rows.
But if the array is empty and you "DOUBLECLICK" the action is also fired ...
Tested with version fglrun 4.01.03 rev-3effeb69 and GBC 4.01.22
Regards
Hello,
Please provide a complete example or contact the support if you do not want to share your code in this public forum.
Where is the DOUBLECLICK attribute defined? In the .per or in the dialog?
What is the name of the action used by your DOUBLECLICK attribute?
The purpose of DOUBLECLICK in a TABLE is to select a row by going to a new current row and send the action.
See events in FGLGUIDEBUG=1 output, when there are rows in the table.
Should we blame the doc writer (me) or the way this feature has been designed when no rows are in the list?
I suggest that you define the action with ROWBOUND attribute:
ON ACTION myaction ATTRIBUTES(ROWBOUND)
Seb
I concur with Seb.
If you set DEFAULTVIEW=YES and experiment with and without ROWBOUND it may be a little clearer what is happening. By looking in the action panel you can see when the action is active.
DISPLAY ARRAY arr TO scr.* ATTRIBUTES(DOUBLECLICK=foo)
ON ACTION foo ATTRIBUTES(DEFAULTVIEW=YES)#, ROWBOUND)
MESSAGE "Doube click, row=", arr_curr()
END DISPLAY
You'll see that without ROWBOUND, the action is still active when there are no rows. With ROWBOUND, the action is not active when there are no rows.
I don't use explicity ROWBOUND nor DEFAULTVIEW ...
I've attached the source code, without line 320 and doubleclick on empty array error :
Fatal error -1326
An array variable has been referenced outside of its specified dimensions.
Program exited with code 1
764 LET FrmMrg.lnumart99 = FrmMrg.mrgval[curMrg].numart
regards
Benjamin,
We must discuss with the team if the current behavior is a bug or a feature.
In the meantime:
The variable curMrg certainly contains an invalid array index (0, NULL, <0)
Try to define the maj_marges action as ROWBOUND:
ON ACTION maj_marges ATTRIBUTES(ROWBOUND)
Seb
If you don't want to use the ROWBOUND attribute for the maj_marges action, you will have to check all over the place that there are rows in the table/array.
Seb
it's work with ROWBOUND in case of the doubleclick action is "maj_marges" ...
take a look at the second display array (sr_tlamrgcli) and you change doubleclick for action "ajout_marges" and with ROWBOUND on that action then the DOUBLECLICK doesn't fire if the table is empty ...
regards
I usually use the following code with every BEFORE ROW or ON ACTION statement inside of a DISPLAY/INPUT ARRAY to check whether a row has been selected:
BEFORE ROW
IF DIALOG.GetCurrentRow("ScreenArrayName") > 0
THEN do something
END IF
Kind regards
Roland