Getting error by using Button Group in Mobile app

Hello,

I'm using button group in my mobile app form and set its property Mandatory true, its working fine on create new item but when I'm updating any item, getting client side error "Required field" and value is already selected.

 Thanks,

Kamlesh

Kamlesh Rajput wrote:

Hello,

I'm using button group in my mobile app form and set its property Mandatory true, its working fine on create new item but when I'm updating any item, getting client side error "Required field" and value is already selected.

 Thanks,

Kamlesh

Hi Can you share the respective OML or action.

Thanks

assif_tiger wrote:

Kamlesh Rajput wrote:

Hello,

I'm using button group in my mobile app form and set its property Mandatory true, its working fine on create new item but when I'm updating any item, getting client side error "Required field" and value is already selected.

 Thanks,

Kamlesh

Hi Can you share the respective OML or action.

Thanks



Thanks Kamal,

I went through the OML, not able to work on it completely as of some dependencies.

If you are using the same screen for Update, based on whether the inputParam is set or not, the you have to take an associated variable for each input you are using.

And then set the Variable in onReady Action of Screen based on InputParam Id from your Aggregate.

Thus when you create a new Item, the variable will be empty & while you go for an update, the variable will be  initalize by the value which you stored. [ In you case it is Constant you defined]

Thanks



Hi!

I'm facing the same problem... It seems a bug of Outsystems ...




Solution

Hi, 

We can handle this bug by applying mandatory true/false on the conditional basis:

Thanks,

Kamlesh

Solution

Hi all,

I have the same issue during the Mobile Developer course exercises. And while your suggestion works @Kamlesh Rajput, that's only a workaround, not a permanent solution. :/ I hope this will work again in the future.


Best regards,

Michael

Hi all,

I had the same issue during the Mobile Developer course exercise. And even I tested the @Kamlesh Rajput solution, and it really works, Could PLEASE anybody explain to me WHY does it work? Because I read that line [If(ToDoId = NullIdentifier(), True, False)] and i really don't understand what it does that fix the problem.


And as @Michael Segbers explains, I think that's only a workaround, not a permanent solution too :-/


Thank You!


Juan Calderón



Kamlesh Rajput wrote:

Hi, 

We can handle this bug by applying mandatory true/false on the conditional basis:

Thanks,

Kamlesh



Hello Juan, I'm not sure if you still need help with your question about the workaround suggested by Kamlesh, but I thought I would reply just in case you do, and in case someone else might be wondering as well.

What happens is that the Mandatory property of the ButtonGroup (named PriorityGroup in this example), drives the behavior of the system when it runs built-in validations : if Mandatory = Yes, then the validation fails if no value was provided.

So Kamlesh solution is to set the value of the Mandatory property conditionally, based on the value of ToDoId which is an Input Parameter of the Screen where the PriorityGroup widget is placed :

  • If ToDoId = NullIdentifier() then the Screen was invoked to create a new ToDo record, so the Expression sets the Mandatory property to True to ensure the user cannot save a new ToDo record without providing a Priority
  • If ToDoId <> NullIdentifier() then the Screen was invoked to view/edit an existing ToDo record, so the Expression sets the Mandatory property to False to disable the built-in validation because of the bug that we have to circumvent.

As you mentioned, this is only a workaround and this bug will get fixed eventually, but since there are acceptable workarounds, the bug priority might be lower, so it might take a little while to get a fix out.

Hope this helps.

Juan Carlos Calderón Colina wrote:

Hi all,

I had the same issue during the Mobile Developer course exercise. And even I tested the @Kamlesh Rajput solution, and it really works, Could PLEASE anybody explain to me WHY does it work? Because I read that line [If(ToDoId = NullIdentifier(), True, False)] and i really don't understand what it does that fix the problem.


And as @Michael Segbers explains, I think that's only a workaround, not a permanent solution too :-/


Thank You!

Juan Calderón


Kamlesh Rajput wrote:

Hi, 

We can handle this bug by applying mandatory true/false on the conditional basis:

Thanks,

Kamlesh