modified (and saved) dataclass function, adding a parameter
(note tab does not have the “unsaved” dot, and note that there are two parameters in the new parameter list)
in the form, here is the event before i refresh to load the new parameter list:
refresh the event to capture the new parameter:
event panel thinks there are three parameters, not two:
Did you, by any chance, before adding the params to you function, click on the “add parameter” button?
i did not. all i hit was the refresh button.
i recreated the recipe so i could take screenshots of it.
The third parameter appears to have been added using the “Add parameter” button before hitting the refresh button, as only manually added parameters have a delete option. Code-defined parameters need to be deleted from the code and then refresh the function prototype.
For more clarity, when working with function bindings, consider two scenarios:
Initially, upon binding a function, Qodly Studio automatically interprets its prototype and parameters.
Modifying the function prototype in the code by removing all parameters and clicking the refresh button, updates the prototype accordingly, showing no parameters.
Manual Parameter Addition:
Starting with a parameter-less function, manually adding a parameter using the “Add parameter” button, and then updating the code to integrate one parameter results in the manually added parameter assuming the role of the parameter in the function code.
However, refreshing the function prototype prioritizes code-defined parameters. The one added in the code is automatically included, while preserving the manually added one below it. (This is why, in your case, there are three parameters instead of two.)
see comment above yours.
i did not add a parameter. all i hit was the refresh button. i tried it twice, so i could repeat the recipe and take screenshots.
In the second screenshot you shared, the event showed the existing parameter affecting the datasource
locationsCollection even before the refresh.
The manual addition is highlighted by the delete icon. Removing Code-defined parameters directly from the webform editor is not possible.
To fix this, delete the parameter using the delete button next to it. If you bind the same function a second time, it will lack that parameter, containing only the Code-defined parameters
since it’s been a couple of weeks, and i barely remember this issue, are you saying that the screenshot at the bottom of the first post was taken out of sequence, and that i had futzed up the function bind, along the way? i’m just trying to understand what you’re saying.
i thought i took all of these right in a row, when i was repeating the recipe. the timestamps on them seem to say that they were taken in order, but i don’t know how those timestamps were generated, and since it has been a couple of weeks, i don’t remember what else might have happened.
My explanation relies on the sequential order of the screenshots, which are accurate. They suggest the following scenario:
- Bound a parameter-less function to an event.
- Manually added a parameter using the
- Updated the code to integrate two Code-defined parameters,
- Refreshed the function prototype to include those Code-defined parameters.
- Consequently, the function prototype prioritized the two Code-defined parameters, followed by the manually added one, resulting in three parameters instead of two in your case.
Regardless of how much you refresh the function prototype, you’ll need to manually delete the added parameter, just like how it was added.
so, you think that what is missing is a photo of step 2 in your scenario, right?
Indeed, that’s the missing element in the scenario you outlined. It may have eluded your attention, or perhaps it was a bug or an error that has since been rectified; I’m not entirely certain.