Title: Change INPUT ARRAY attribute Post by: David Z. on May 14, 2012, 11:13:28 pm FGL = 2.32.03
If I have something like: input array progarrayname without defaults from screenarrayname attribute (insert row = false) ...... ...... end input How can I set "insert row = true" within the input array statement? I need to toggle "insert row" on and off while the user is in the insert array statement. Thanks David Title: Re: Change INPUT ARRAY attribute Post by: Reuben B. on May 14, 2012, 11:56:42 pm Use the setActionActive method of the DIALOG class https://4js.com/online_documentation/fjs-fgl-manual-html/User/ClassDialog.html#setActionActive
remembering that INPUT ARRAY has these built-in actions https://4js.com/online_documentation/fjs-fgl-manual-html/User/InputArray.html#DEFAULT_ACTIONS Experiment with something like ... Code
Title: Re: Change INPUT ARRAY attribute Post by: David Z. on May 15, 2012, 03:33:38 pm Reuben,
I thought about setActionActive() but dialog.setActionActive("insert", TRUE) gives a runtime error -8089 Action "insert" not found in dialog. I get the same error for "insert row". I did find a solution. If I start the INPUT ARRAY this way: Code
I will get error -8089. But this works: Code
In other words, INSERT ROW must be TRUE in the INPUT ARRAY ATTRIBUTE for setActionActive() to see it elsewhere in the INPUT ARRAY. Is this expected behavior or a bug in Genero? David Title: Re: Change INPUT ARRAY attribute Post by: Reuben B. on May 15, 2012, 10:31:01 pm Hi David,
The developers will have to confirm if that is deliberate but I suspect it is. The ATTRIBUTES clause determines if the action is added to the dialog to begin with. Using the setActionActive method we are only changing the value of the active attribute of the action. I would actually tend to use this pattern as the same technique can be applied to all actions in the dialog. Code
Reuben PS Do you know Control-RightClick when GDC is started in debug mode (-D) to view the DOM tree? If you look at that, you will see the action nodes belonging to the dialog and their attribute values. Title: Re: Change INPUT ARRAY attribute Post by: Rene S. on May 16, 2012, 08:32:56 am Hello,
yes Reuben's explanation is correct: the attribute INSERT ROW = FALSE prohibits the creation of the built-in insert action. If the action has not been created, a runtime error is legal and expected when accessing this not existing action with the method DIALOG.setActionActive(). Rene Title: Re: Change INPUT ARRAY attribute Post by: David Z. on May 16, 2012, 03:25:51 pm Reuben,
My program does use variables like you are using (input_allowed). My TRUE and FALSE were for demonstration purposes. Rene says it is expected behavior. That is fine. Its not hard to program around it. It didn't occur to me that INSERT had to be TRUE in the INPUT ARRAY ATTRIBUTE clause for setActionActive() to see it. Is this in the documentation? I didn't see it. David |