FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
108 stars 18 forks source link

ChoiceChips issues SetState only on the first selection after that is doesn't triger any change in state. #642

Closed drorgrinberg closed 1 year ago

drorgrinberg commented 1 year ago

Has your issue been reported?

Current Behavior

I have form with table data that gets the data from backend API. in order to filter data, I added "Name" textFiled an action OnChange, that trigers "Refresh database Request". The data gets udated acording to the "name" field. this works fine since when I update the text, the table is filterd acordingliy (it genreats a new API request with the filter data, the backend is doing the filtering and sends the filterd data).

When doing the same on a ChoiceChips this is trigerd only the first time (and the table gets the new filtered data). all the flowing events are ignored and the GUI does not refresh.

Not clear to me if the problem is in the ChoiceChips (setSate) or the data table that does not rerenders.

Expected Behavior

I would expect that change in ChoiseChips will issue a new API request resoulting a rerender of the form and the tale data.

Steps To Reproduce

  1. create data grid that gets data for API set text field and add action the refresh the grid on change, send the filter field data with REST request to filter the data accordingly.
  2. set a multiselect choise chip with event to refresh the grid on selection of more then on field.

Bug Report Code

IT40hfHlxItOocsA7qX1bflFmmI5JnJ7aI0nlMF7aCsofePrOpkAf8/7UFtUcM++d2xXPk2jrGYX/MrpivOWUuwnNQqrfp98+Yd2cwvxcGCRV7qtOq63b3JfN8JQf1Cu1rerrhBTNbZacmMj6lOAeumREnLcJITuPDABA+aeXdeK2SrDX1iXc2URm05KZDPz

Context

I can not make web form for filtering data and display it on a the data grid table.

Additional info

image image image image

Environment

- FlutterFlow version: 3.1 -flutter 3.7.3
- Platform:Web
- Browser name and version: chrome Version 111.0.5563.65 (Official Build) (64-bit)
- Operating system and version affected: Windows 11
organicnz commented 1 year ago

Hi, @drorgrinberg. Thanks for adding this issue, mate πŸ™‚

Could you also provide a screenshot of the widget tree :)

drorgrinberg commented 1 year ago

Hi,

I made a few workarounds, I changed the component back to be an element on the page and added an action of "refresh data request" on the ChoiceChips event so now, it is calling the backend API . This workaround does not work if I have the ChiceChips is part of a component.

You can see the "Card" (that is working) and the "compAssetTypes" (that is not working) in the tree [image: image.png]

[image: image.png]

For the component, I added an action and state variable but it didn't help.

[image: image.png] [image: image.png]

[image: image.png]

Regards, Dror.

On Sun, 26 Mar 2023 at 17:54, Tarlan Isaev @.***> wrote:

Hi, @drorgrinberg https://github.com/drorgrinberg. Thanks for adding this issue, mate πŸ™‚

Could you pls also provide a screenshot of the widget tree :)

β€” Reply to this email directly, view it on GitHub https://github.com/FlutterFlow/flutterflow-issues/issues/642#issuecomment-1484120912, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5AB6M6QX4HN3EDTXA5OMV3W6BKBVANCNFSM6AAAAAAWBIY6G4 . You are receiving this because you were mentioned.Message ID: @.***>

organicnz commented 1 year ago

Hi, I made a few workarounds, I changed the component back to be an element on the page and added an action of "refresh data request" on the ChoiceChips event so now, it is calling the backend API . This workaround does not work if I have the ChiceChips is part of a component. You can see the "Card" (that is working) and the "compAssetTypes" (that is not working) in the tree [image: image.png] [image: image.png] For the component, I added an action and state variable but it didn't help. [image: image.png] [image: image.png] [image: image.png] Regards, Dror. … On Sun, 26 Mar 2023 at 17:54, Tarlan Isaev @.> wrote: Hi, @drorgrinberg https://github.com/drorgrinberg. Thanks for adding this issue, mate πŸ™‚ Could you pls also provide a screenshot of the widget tree :) β€” Reply to this email directly, view it on GitHub <#642 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5AB6M6QX4HN3EDTXA5OMV3W6BKBVANCNFSM6AAAAAAWBIY6G4 . You are receiving this because you were mentioned.Message ID: @.>

Sorry mate, screenshots are not attached for some reason. Could you please link them again by any chance?

shelpert commented 1 year ago

Hi @drorgrinberg,

I am not able to reproduce this issue. It seems that it may have something to do with components based on your second comment, but I am having trouble reproducing without your screenshots. If you could clearly explain when this does and doesn't work, I can further investigate. For this I will need screenshots, or better yet, a link to a simple project with one page where your case does work and another where it does not.

I am closing this issue for now, please feel free to reopen it if you can provide the necessary information!