60
Views
5
Comments
loop through widgets in an action
Question
LS

Is it possible to loop through the widgets of an edit record, (or e.g. the input widgets in a container) within an action with the for each element? If so, is it also possible then to determine the kind of widget?

for each widget in editrecord1 do begin
 if widgettype = input then
 ...

Regards, Harry
2016-04-21 20-09-55
J.
 
MVP
afaik, you might be able to do it in javascript, but my question is more, why do you want to do that?
UserImage.jpg
Harry de Boer
Hi Joost,

This might come in handy eg for setting al background colors of input widgets, or when designing generic inputerror  logioc, or... I know that can be done in javascript, just wondered if it could be done in an action. New to the platform I may ask questions form an 'old school' programmers view who wonders what the 'limits' of actions are, sorry for that :)

Regards, Harry 
2016-04-21 20-09-55
J.
 
MVP
No problem, but OutSystems really is awesome in so many ways, so there are certain stuff you don't need to do yourself :)

in the other thread it's already mentioned, but look at this tutorial:  https://www.outsystems.com/how-to/validate-web-form-input/
2017-10-02 14-22-21
Paulo Tavares
Staff
Hi Harry,

If I may add, if you want to change the appearance of certain widgets in the Edit Record widget, you might as well use the widget's styles, or change the existing ones, namely for the error messages.

Regards,

Paulo Tavares
2011-06-15 10-51-52
Cipriano Teibão
Hello Harry,

As far as i know, its not possible to loop through the fields of an Edit Record using the for each element. The for each element can only iterate Recor Lists and the elements of an Edit Record are not in a Record List.

Regards
Cipriano
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.