FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
130 stars 26 forks source link

Callback parameter not available in a custom alter dialog even if it is still the same component #2501

Open SebyOnGitHub opened 8 months ago

SebyOnGitHub commented 8 months ago

Has your issue been reported?

Current Behavior

The callback of a component is not visible if you try to use it within a callback from a custom alter dialogue.

Expected Behavior

Inside of the Main Component, the callbackParameterMail should be availlable.

Steps to Reproduce

  1. Create a new custom component and name it Info
  2. Within the Info component, define a component parameter called callbackParameterInfo of type Action

image

  1. Create another new custom component and name it Main
  2. Within the Main component, define a component parameter called callbackParameterMain of type Action

image

  1. Place a button (in Main comp) and define an action: Custom Alert Dialog
  2. Select the Info component as the Custom Alert Dialog component
  3. Pass the Parameter callbackParameterInfo to the custom dialog

image

  1. Go inside the action editor of callbackParameterInfo
  2. Now inside the callbackAction, the callbackParameterMain is missing, which should not have happened as we are still inside if the Main component

image

Reproducible from Blank

Bug Report Code (Required)

IT4olfLl8Yx1m8ta1YSJcMdVryQ7H0h/bZINjMpOGDsdF4iuPOxzac6kUxBoTtOhS1Y+KEWJpD8E+fDeuN71A/YEPRetbqZb/7lcZDnzTn+/aoSlO8ySY3B6RMJYf1yd0Z67rSNCHO9YLn9h7GC2AezKdB3UQb36Zwh9f6PHaOI=

Context

We are using this main component, inside a page that has list from a backend (each list item is the main component). After the user has selected something inside the info component, we want to update the backend, so giving this info to the page is impossible for now. This is just one example of many that would give more possible options.

Visual documentation

All the visual documentation was created within the Steps to Reproduce.

Additional Info

No additional Infos.

Environment

- FlutterFlow version: v4.1.31
- Platform: Web, Windows
- Browser name and version: Chrome 121.0.6167.140
- Operating system and version affected: Windows 10
hariprasadms commented 8 months ago

Hi @SebyOnGitHub - The configurations you're setting seem a bit confusing. Additionally, it's unclear why you're attempting to access the callback executor when a callback parameter is already defined. Moreover, when a component with a callback parameter is associated, it should be used to call an action that can execute instead of assigning another callback executor. I would suggest that it's an error due to missing configurations rather than a bug.

SebyOnGitHub commented 8 months ago

Hi @hariprasadms If it is not clear why the configuration is done this way, I have made a more detailed example. It is still the same basic app as before, but the main widget is inside a list on the page. And the info widget is more like a dropdown to change the text from that list. I hope an example like this will make something like this clearer. The first example might be too simple. Please take a look inside the app and let me know if there are still things unclear, the bug still exists, that's why the buttons to change the text/colour still don't work (the needed action is disabled). So please take a look inside the app, which is referenced from the bug report link, and let me know.

SebyOnGitHub commented 8 months ago

In addition, please note that this is done to have a reusable component that can also be used on other pages that could have totally different lists or, in a real case, a backend like Supabase. This is just a basic example. And as an example, having a widget inside a widget, and calling a callback inside a callback works. Only in a custom dialogue does it not work. So this is not a new feature, it already exists but has probably been forgotten in custom dialogs.

SebyOnGitHub commented 8 months ago

Hi @hariprasadms I have found some additional information for you. If you place the callback node inside of the component and then just copy that node into to the custom alert callback, it will work. It is just the interface that does not show, that you can create this callback. Here are some screenshots, to show what I mean:

Here is the Main component, which is starting the custom alert dialog: image

Now lets place a callback inside of this Main Component: image

Now lets copy this node into the custom alert callback: image

Here is a screenshot with this node is copied inside into the custom alert callback: image

Here's the previous example, from the bug report, which still doesn't not allow this node to be added. But as of found out, the node can still be copied into this. I tested it, and the copied node works. It is just the FlutterFlow editor that does not allow this node to be added. Only by copying it… image

hariprasadms commented 8 months ago

Thanks for the additional details. I have flagged the issue for technical review to decide the status of it. We will update you shortly. Thanks

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

SebyOnGitHub commented 8 months ago

@hariprasadms If you have any further questions or need more details, please feel free to comment.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

Franco98404 commented 5 months ago

If you place the callback node inside of the component and then just copy that node into to the custom alert callback, it will work. It is just the interface that does not show, that you can create this callback.

I found the same workaround and it was helpful for me but I found another problem related: It is not possible to use a callback parameter in a component action block

https://www.loom.com/share/9a881f8564c44c73af6d8b50552939cc

Is necessary to create a new GitHub issue for this new problem related? @rzambroni @leighajarett @ignalauret @hariprasadms

PD: A few months ago I reported a similar problem, which was not displayed by the UI but by copying and then pasting it was possible, just like what is happening with this bug, maybe it helps you solve the problem faster: https://github.com/FlutterFlow/flutterflow-issues/issues/2165

leighajarett commented 5 months ago

Thanks for filing! So sorry you are dealing with this issue. I appreciate all the information - it's in our backlog, will fix as soon as we are able to!

wolfhoundgelert commented 1 month ago

And this hasn't been fixed yet - it's still not possible to pass an action to a custom dialog.