Switch widget on webscreen - Service Studio improvement.

By Luis Paulo Soares on 25 May 2012
As NextStep 2012 says 'Simplicity'.

A switch widget on a webscreen will make the web screens more simple to understand!
See idea: 1015
Hugo Almeida20 Jan 2012
Add a new widget for switch control statement at the screen flow.

Instead of nested if widgets, why not a switch widget to be used on the screen?


Merged from 'Switch control statement at the screen flow.' (idea created on 2012-01-20 16:34:18 by Hugo Almeida), on 2014-01-24 12:37:19 by Gonçalo Borrêga
Miguel Melo21 Jan 2012
Though adding a new widget to the platform is always a complex affair (it needs to go through deep evaluation by R&D) I think this is actually a very cool idea.

Merged from 'Switch control statement at the screen flow.' (idea created on 2012-01-20 16:34:18 by Hugo Almeida), on 2014-01-24 12:37:19 by Gonçalo Borrêga
Hans Baard2 Jul 2015
Any progress on this idea?
Would be great to have.
Jason Herrington25 Mar 2015
There may be some cases where I want to look at a value (say module type) and then depending on the value (say integer) I may want to display several different things.  Right now I think the only way to do that is via several if's.  It would be nice to have a switch statement where you put in a value to look at, and then have multiple output possibilities based on the value coming in along with a default output if the input doesn't match any of the cases.

Merged from 'Switch Statement' (idea created on 2015-03-25 21:47:05 by Jason Herrington), on 2017-07-11 08:34:32 by Carlos Alfaro
João Fernandes26 Mar 2015
Can you clarify if you're talking about the server-side logic or the UI?
Because you can do a switch on your logic. Check here the docs.


Merged from 'Switch Statement' (idea created on 2015-03-25 21:47:05 by Jason Herrington), on 2017-07-11 08:34:33 by Carlos Alfaro
Justin James26 Mar 2015
It would be nice if there was a matching Switch widget for the Screens/Blocks on the UI.

J.Ja


Merged from 'Switch Statement' (idea created on 2015-03-25 21:47:05 by Jason Herrington), on 2017-07-11 08:34:33 by Carlos Alfaro
Paulo Sebastião26 Jun 2017

Just as we have the IF statement we can use when building the frontends, it would be great to have a switch statement so we could, for example, show/hide several elements according to a boolean expression. The workaround is enclosed ifs, which makes the interface difficult to view and manage,



Merged from 'Have a switch "action" in the frontend editor' (idea created on 2017-06-26 10:32:31 by Paulo Sebastião), on 2017-07-11 08:35:01 by Carlos Alfaro
Justin James27 Jun 2017

A switch would be functionally and visually just about no different from Ifs right after each other. Also, don't nest Ifs if you don't like it, just put them right after each other with a blank "false".

J.Ja



Merged from 'Have a switch "action" in the frontend editor' (idea created on 2017-06-26 10:32:31 by Paulo Sebastião), on 2017-07-11 08:35:01 by Carlos Alfaro

@Justin, true, but the situation gets tricky when you have about 10 Ifs with a lot of visual elements. This starts getting extremely difficult to manage (visually). With the switch, we would be able to show only one or all of the branches. This would make it easier to jump to a specific branch straight away.



Merged from 'Have a switch "action" in the frontend editor' (idea created on 2017-06-26 10:32:31 by Paulo Sebastião), on 2017-07-11 08:35:01 by Carlos Alfaro
Justin James4 Jul 2017

Paulo -

Ah, yeah, that makes sense! I rarely use the "show true" or "show false" on the If so I forget that this is a feature. :)

J.Ja



Merged from 'Have a switch "action" in the frontend editor' (idea created on 2017-06-26 10:32:31 by Paulo Sebastião), on 2017-07-11 08:35:01 by Carlos Alfaro
As the IF function, there should be a function SWITCH CASE like a function, otherwise I need to use several nested IF one of my tasks.

Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha
Kilian Hekhuis17 Dec 2012
I'm not sure what would accomplish this. If-functions are typically used in one-liners, and in practice, you'll hardly need to nest more than one or two. For more complex logic, you use the switch tool thingy (what are they called anyway?). I'm guessing you're thinking a bit too much 3GL-style programming instead of the OutSystems Way™.

Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha
Rebecca Hall17 Dec 2012
You can create a function where you pass in your values and then use the built in switch statement to determine the return value.

Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha
J.17 Dec 2012
I agree with Kilian and Rebecca.

If you "need" a switch-statement inside an expression, I really should reconsider the code.


Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha
Some other related ideas for this one:

Screen:
1015
1139

Expression editor:
1189

In mine opion, I would like to have both (-:

Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha
Good morning Evert van der Zalm!
 
Really, if I had the two options mentioned, it would be great and would help a lot.


Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha
You be really nice!

Im getting tired of using chainned IF's statements inside a expression to consider all cases.

Merged from 'Switch case inside expression wizard' (idea created on 2012-07-18 15:13:19 by Luis Paulo Soares), on 2014-01-24 12:35:58 by Gonçalo Borrêga

Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha
J.20 Jul 2012
Imho, if an expression contains more than 1-2 inline if's I should be thinking of a better solution.


on the other hand, if the inline-if could have the else-branche as optional it would improve the readability!


Merged from 'Switch case inside expression wizard' (idea created on 2012-07-18 15:13:19 by Luis Paulo Soares), on 2014-01-24 12:35:58 by Gonçalo Borrêga

Merged from 'SWITCH CASE' (idea created on 2012-12-14 11:44:44 by Claudio Felipe Sampaio), on 2018-01-25 11:20:03 by Vasco Pessanha