cancel
Showing results for 
Search instead for 
Did you mean: 

Single SAVE button for a gallery

Hello,

I have implemented a single SAVE button for multiple entries in a gallery.I have not used any check boxes nor Collection concepts. It's much simple and easy.Any item inside a gallery will repeat itself with respect to the no. of rows present in the database,so imagine if there are 100 items and if the user has to click on the save button after each entry 100 times,that's not a good idea.Here's what I did.

1. Insert a gallery and add the required columns(sample attached).

2. Add a save icon and write the patch commands to save the inserted values to the database.

3. Add a Timer, now here's the trick,set the following: 

AutoStart - false

AutoPause - true

Duration - 1000

OnTimerStart - false

OnTimerEnd - Select(SaveIcon);UpdateContext({TimerGo:false}) 

Repeat - false

Reset - false

Start - TimerGo

"TimerGo" is a variable which is set to True on the "OnSelect" of the Save button which is created outside the Gallery.

4. On the "OnSelect" on the Save button write - UpdateContext({TimerGo:true})

Now what happens when you click the save button(outside the gallery), It will start the timer as it is set to "True" and when the timer reaches 1 sec it will in turn trigger the save button which is inside the gallery and the Variable "TimerGo" is again set to false.So basically we are making the Save button which is outside the gallery to click the save button inside the gallery with the help of the timer.

Hide the Save icon and the timer in the gallery. That's it, now we have only one save button for the gallery.

 

Thanks

Anitha P.

 

 
Status: New
Comments
TxH
Level: Powered On

Hi @AnithaTEK ,
Alternatively, you could use the additional parameters of the select() statement:
SelectControl, Row or column, Child Control ).

In your case the Save Button outside of the Gallery could have the following formula:
Select(Gallery1, Gallery1.Selected, Save Button) which would trigger OnSelect() of the Save Button inside of the Gallery - without using the timer control.

Regards,

TxH

Level: Powered On

Hi TxH,

 

Thanks for the input, I did try that earlier but for some reason it does not save the data as expected, It only saves for some of the input values, was not able to know the reason and that's how i came up with the timer idea.