Hey all!
I'm sorry. Maybe this is actually super simple, but I haven't figured out where I am making my mistakes.
I've also checked the documentation and the part that works is done accordingly.
I am using the button loading widget, and right now I am facing two problems. It does start the loading animation, but:
1. Contrary to the "normal" save, it skips my mandatory fields (form validation) and creates or edits a room without all the fields being filled correctly. I even used the same action I had for my Save Button (which worked correctly) and adapted it, including the assignment of the local variable to True.
2. If I do end the creation or update of the information, it goes to my destination page, but if I go back (like "abort" the action), it continues with the loading animation.
Can someone help?
Thank you in advance!
loading works but it starts loading without considering the mandatory fields
Hey
Do you have this "is form default" as yes? Also, don't forget to turn off the boolean which is being used on the button loading.
If that doesn't help you, it would be good for you to share an oml and maybe someone will certainly help you!
Kind Regards,
Márcio
Hello @Márcio Carvalho
I have updated the "is form default" to yes, as I initially had it set to no. Additionally, I had attempted to assign the variable back to False after creating the room and deleted before, but I have now added it again as you suggested.
Despite making these two changes, I am still encountering the same problems mentioned earlier.
It needs to be on the branch false as well of the form1.valid because as you mentioned on your question despite you having an error on the form because of mandatory fields the loading wasn't stopping.
Please, if you still have problems, share the oml.
Hey! Thank you for your help.
I have already implemented all the necessary branches, including the form not being filled correctly and custom validation branches. I have also added an assign that sets my variable back to False. However, the issue still persists.
Do you think I need to add an exception handle in addition to setting my variable to false in each branch?
Could you please explain to me how to change the "is form default" to yes? I want to understand it for future reference instead of just copying the solution.
Thank you for your time!
Hi @Mafalda Oliveira ,
Please find my contribution for your questions as below:
1. Contrary to the "normal" save, it skips my mandatory fields (form validation) and creates or edits a room without all the fields being filled correctly. I even used the same action I had for my Save Button (which worked correctly) and adapted it, including the assignment of the local variable to True.-> Please make sure the button wrapped inside the ButtonLoading having its attribute "built-in validation" is set to "Yes":
2. If I do end the creation or update of the information, it goes to my destination page, but if I go back (like "abort" the action), it continues with the loading animation.-> Please remember to set the Boolean variable set at attribute "IsLoading" of the ButtonLoading back to False after the Save Action (and before navigation away to destination page). For example my case, the variable is "IsProcessing":
Also, an altenative way is that you have an assignment to set the "IsProcessing" to False at the Initialize event of the screen/block. This will make sure whenever we navigate to this screen/block, the initial state of the IsProcessing is False.
Hope this helped.
Perfect, thanks! Right now, I guess I am missing an exception but still haven't figured it out. I haven't used exceptions much.
When I fill in the form with missing fields, it blocks it and I can't create it without filling in the form correctly.
I didn't know this also had a built-in feature inside the button. So the "built-in to yes" makes it validate the form? Can you also explain it so that I understand instead of just copying it?
try with this OML
"I didn't know this also had a built-in feature inside the button. So the "built-in to yes" makes it validate the form? Can you also explain it so that I understand instead of just copying it? "
That Oml does not solve the problem I still have with the loading animation continuing after the form validation does not go thought. I have my assign variable to False when form validation is false
yes it will validate the form. if you set built in validation yes. then isloading wont work till your form is not validate. after form valid if condition you can set the isLoading = True and in the last just set Isloading as False.
Isn't it usually set to "yes"? Was it because maybe it wasn't the button I had associated with the form, so it was not automatically set to "yes"?
The form starts loading. However, the form is not valid and the animation continues. Even if I fill in all the required fields, the loading animation continues and I can't use the button. So, it only works if I fill in the form correctly. The form validation is now being checked, but the button still stays with the loading animation. The assignment of the variable to False is done if the form is invalid.
@Nghia Hoang I'm not sure if you saw it, but I did reply to your answer/suggestion. However, it seems to have gotten a bit lost among the other comments. #
HI @Mafalda Oliveira ,Please make sure these steps are handled properly:-1.) Set the default value of the boolean variable to false which is mapped to the loader.2.) Reverify your logic that in every flow it gets assigned back to false once you complete your action, 3.) Assign false in your exception handler so that if any exception triggers loader gets stopped automatically. Please let me know if you have more queries.Regards,
Hello! Thank you for your assistance!
I have limited experience with exceptions, so I am currently working on understanding that aspect.
All other steps, solutions provided, etc. have been implemented successfully. The only issue remaining is that when the form is invalid, the action is interrupted and the loading animation stops (assign is False in all branches).
What is the issue with this? I think this is expected if the form is invalid, the loader should stop to edit the form and submit it again.What is your expected behavior in this scenario?
it does not stop the loading animation .
Did you assign it back to false if the form is not valid?Also, reverify the loader variable is it the same?Please try to debug the flow it will give you more clarity.If still not able to figure it out please share the OMLRegards,
-Yes. According to the pictures I sent, this was not the problem . I had it done almost from the beginning.
Thank you
Hi Mafalda Oliveira,i looked at your problem. you are using isloading variable right. before validation you need to set the value of is loading as true. and if any error you want to show then set the isloading as false. and after successfully saving the form you need to set isloading as false as well. for help i am adding oml. you can take help from it.
Thanks
Prince
@Prince Aadil Khan Panwar
Maybe I could ask you if you could delete the comments made on someone else's suggestion/post. This would make it easier to follow each person's suggestions.
Additionally, I have noticed 2 or 3 repeated comments with the same files sent, which makes it confusing and cluttered. Would you kindly delete those and reply to your comment instead? If that's OK by you, I would appreciate it ! :)
Thank you in advance for your time!
It's a combination of solutions from @Márcio Carvalho and @Nghia Hoang
Thank you guys!