cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnthonyPhan
Kudo Kingpin
Kudo Kingpin

Bug: Gallery with textbox control shows the wrong default value

 

Hi,

 

I have noticed that the default value of a textbox nested within a gallery control will have the following behaviour which may be a bug. I have put together the following example to demonstrate the bug.

 

Step 1. Insert button1, which will populate a collection by setting the OnSelect formula to

             >>   OnSelect = Collect(Collection1, {Column1Name: “test”})

 

Step 2. Insert a gallery control and set “Collection1” as the data source.

            >>    Items = Collection1

 

Step 3. Insert a textbox into the gallery control. Set the default property of the textbox to the Colum1Name

            >>    Default = Column1Name

 

Now each time when you click “Button1” you will see a new row added to the gallery with the “test” string displayed.. as expected.

Bug_Report1

 

Step 4. Type a new string into the text box on the first row of the gallery. Now press button 1. Each time you press “button 1” now the default value of the textbox is no longer the Colum1Name value as expected.

 

Bug_Report2

 

Has anyone else experienced this issue or able to offer a work around?

1 ACCEPTED SOLUTION

Accepted Solutions

On testing I am having the same issue, a workaround was to reset the gallery at the same time as adding the new item to the collection. I have attached a demo app with this workaround.

 

The issue with the workaround is that you loose the data you modified at the top, you could have an onChange event on the text box save back to the collection to prevent the data loss.

View solution in original post

6 REPLIES 6
PeteMc
Resolver I
Resolver I

If you go to view the collection from the file menn has it been updated or is it still the original value?

hi @PeteMc

 

The underying collection data is still the same. Infact if add an additional label displaying the value it will show correctly

image.png

On testing I am having the same issue, a workaround was to reset the gallery at the same time as adding the new item to the collection. I have attached a demo app with this workaround.

 

The issue with the workaround is that you loose the data you modified at the top, you could have an onChange event on the text box save back to the collection to prevent the data loss.

View solution in original post

v-xida-msft
Community Support
Community Support

Hi @AnthonyPhan,

 

I have made a test and the issue is confirmed on my side.

 

I would post this issue to my product team, if the issue is solved, I would reply here.

 

In addition, as an alternative solution, I agree with @PeteMc's thought almost. You could consider take a try to reset your Gallery control before adding a new row into your Gallery.

 

I have made a test on my side, please take a try with the following workaround:2.JPG

 

 

Set the OnSelect property of the Button control to following formula:

UpdateContext({GalleryItems:Blank()});
Collect(Collection1,{Column1Name:"test"});
UpdateContext({GalleryItems:Collection1})

Set the Items property of the Gallery control to following:

GalleryItems

 

 

In addition, if you want to save the modification within your Gallery control, please take a try with the following workaround:3.JPG

 

Set the OnSelect property of the Button control to following formula:

UpdateContext({GalleryItems:Blank()});
Collect(Collection1,{Column1Name:"test"});
UpdateContext({GalleryItems:Collection1})

Set the Items property of the Gallery control to following:

GalleryItems

Set the OnChange property of the Text input control within the Gallery control to following formula:

Clear(Collection1);
ForAll(Gallery1.AllItems,Collect(Collection1,{Column1Name:TextInput1.Text}))

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I apreciate everyones suggestions. All have been very usefull. 

The work around I have used is to save the contents of the gallery to Collection1 everytime button 1 is pressed, Making sure the save happens before creating a new row in collection 1. 

 

 

Any Response from the production team? It would be good to get a long term fix for this rather than work arounds.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (46,908)