3
 Followers
53
 Likes

Switch widget on webscreen - Service Studio improvement.

On our radar

As NextStep 2012 says 'Simplicity'.


A switch widget on a webscreen will make the web screens more simple to understand!

Created on 25 May 2012
Comments (27)
See idea: 1015
Merged this idea with 'Switch control statement at the screen flow.' (created on 2012-01-20 16:34:18 by Hugo Almeida)
20 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
21 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
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
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
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
17 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
17 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
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
25 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 Fernandes
26 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
26 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
26 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
27 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
4 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
1 Dec 2017

The idea is to have a new or modification to the existing Switch widget such that the switch widget can be bound to static entity identifier variable. Once bound, the switch widget will automatically create all the condition statements based on the elements in the static entity type.

  • There would be support to turn on and off Conditions for individual static entity values.
    • The interface would be patterned after the Web Screen's Roles property section
      • Auto Generated Conditions
      • Checkbox based on/off condition enablement
  • Additional Conditions
    • An Otherwise condition would handle cases where the static entity value does not match any turned on conditions.
    • A NullIdentifier condition would handle cases when the static entity value is a NullIdentifier().
    • An Unknown condition would be generated to handle when the static entity value does not match a defined static entity value (defined identifiers and NullIndentier()).


Merged from 'Switch Widget - Static Entity Identifier binding and automatic Condition generation' (idea created on 2017-12-01 17:00:05 by erik berg), on 2018-04-12 12:42:45 by Vasco Pessanha
1 Dec 2017

The idea is to have a new or modification to the existing Switch widget such that the switch widget can be bound to static entity identifier variable. Once bound, the switch widget will automatically create all the condition statements based on the elements in the static entity type.

  • There would be support to turn on and off Conditions for individual static entity values.
    • The interface would be patterned after the Web Screen's Roles property section
      • Auto Generated Conditions
      • Checkbox based on/off condition enablement
  • Additional Conditions
    • An Otherwise condition would handle cases where the static entity value does not match any turned on conditions.
    • A NullIdentifier condition would handle cases when the static entity value is a NullIdentifier().
    • An Unknown condition would be generated to handle when the static entity value does not match a defined static entity value (defined identifiers and NullIndentier()).


Merged from 'Switch Widget - Static Entity Identifier binding and automatic Condition generation' (idea created on 2017-12-01 17:00:05 by erik berg), on 2018-04-12 12:42:46 by Vasco Pessanha
12 Apr (11 days ago)

As it happens in the logic side, sometimes we require something in the webblock/screen to be rendered conditionally, but there are times in which that condition is not only True or False

For those cases we typically chain If's within If's, but it would be nice to have the Case version available

The default (by dragging and dropping it in the canvas) would (as it happens on the logic counterpart) have the Condition 1 and the Otherwise parts available, and would grow as conditions are added.

A visual representation could look like this (pardon my paint skills)



Merged from 'Case (Switch) for the visual editor' (idea created on 2018-04-12 10:20:41 by Pedro Coelho), on 2018-04-13 09:04:01 by Vasco Pessanha
2 Jul 2015
Any progress on this idea?
Would be great to have.
12 Apr (11 days ago)
Merged this idea with 'Switch Widget - Static Entity Identifier binding and automatic Condition generation' (created on 2017-12-01 17:00:05 by erik berg)
12 Apr (11 days ago)

Changed the category to Frontend


13 Apr (10 days ago)
Merged this idea with '' (created on 1900-01-01 00:00:00 by )
13 Apr (10 days ago)
Merged this idea with 'Case (Switch) for the visual editor' (created on 2018-04-12 10:20:41 by Pedro Coelho)
views
369
Followers
3