cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vffdd
Super User
Super User

Edit to view from gallery choice

I have a form which gets it's items from a selection in gallery.  All works well except for one thing I can't figure out !

 

If I select an item from the gallery and it appears in the form and decide to edit it and don't cancel the edit, or update it.. if I then pick another item from the gallery then the form is still in edit mode.. I would like to cancel the edit mode if a user chooses something else from the gallery.

 

I've tried the following and still shows edit !  (on select in gallery)    (VarDetails is just a variable that controls the visibility of the form)

 

 

FormMode.View;
Concurrent(
Select(Parent),Set(VarDetails,true))

 

 

I've also tried this

 

 

Concurrent(
Select(Parent),Set(VarDetails,true));FormPODetail.DisplayMode.View

 

 

and this !    all with no errors and item displays but still in edit mode

 

 

Concurrent(
Select(Parent),Set(VarDetails,true),FormPODetail.DisplayMode.View)

 

 

or do I do it on the form side? but can't figure out how to do it there and the default view is "view"

 

TIA

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @vffdd ,

You simply need to disable everything else on the screen other than the cancel and save buttons when in edit mode.

I have another tactic on one of my apps (image below is a test record) is to put semi-transparent rectangles (RGBA 128,128,128,0.5) over anything I do not want touched and hide/show them depending on the form mode. The only controls available to the user are edit save and edit cancel, both of which then hide the screens when chosen.HideFields.png

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

10 REPLIES 10
WarrenBelz
Super User
Super User

Hi @vffdd ,

I am assuming the gallery and the form are on the same screen?

You really need to lock down any further selections while a form is in edit mode. I do something similar on an app and disable the gallery selection button until the form is back in View mode.

If(
  YourFormName.Mode=FormMode.View,
  DisplayMode.Edit,
  DisplayMode.Disabled
)

This is also the only control on the gallery that can select another record - maybe this will work for you.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

eka24
Super User
Super User

Generally to change the mode of the form to view, insert a button and put onselect:

ViewForm(FormName)

 

However can you explain further "If I select an item from the gallery and it appears in the form and decide to edit it and don't cancel the edit, or update it."

 

Not very clear

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

ok yeah that explanation probably wasn't very clear.  Let me try again.

 

I have a gallery and a form on the one page.  When you select the item in the gallery it displays on the form.  My issue is if I select and item and then put the form in [Edit mode] , but don't cancel out of Edit Mode, if I select another item from the gallery then the form is still in Edit Mode....

@vffdd ,

Please have a look at my suggestion, which is very effective. Tag me if you want to continue the discussion.

Thanks @WarrenBelz  I totally missed your response !  that might be a good workaround all right.. I'll give it a go and let you now how it works 🙂

So thankts @WarrenBelz  that works well am happy to mark as a solution.. but as an add on do you know how I can sort the following issue.  If I don't cancel out edit mode on the form, I can't select another item.. that's fine but if I go out of the screen and come back in the form is still in edit mode? I'd like a clean slate every time someone lands on the screen.  I would have thought that was simple enough !! but I can't seem to figure it 🙂  I think I need to do something proactive in the on visible property but not sure what..

Hi @vffdd ,

You simply need to disable everything else on the screen other than the cancel and save buttons when in edit mode.

I have another tactic on one of my apps (image below is a test record) is to put semi-transparent rectangles (RGBA 128,128,128,0.5) over anything I do not want touched and hide/show them depending on the form mode. The only controls available to the user are edit save and edit cancel, both of which then hide the screens when chosen.HideFields.png

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @vffdd ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @vffdd 

I am following up this post to see if it can be closed as you got the result you were looking for. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue as this will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,714)