finding controls

Post any suggestions or enhancement requests about the Verj.io platform or this Forum

Moderators: Jon, Steve, Ian, Dave

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

finding controls

#1

Postby HarryDeBoer » Tue Jun 04, 2013 6:34 am

LS

I would like to see a way to finding controls on forms. We have a lot of code with calls to controls (controls.) but cannot find the controls easy on the form (they are on lots of tab controls). Exceeding the find functionality with 'find control' would come in handy.

Kind Regards, Harry
0 x
Kind regards,

Harry

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

finding controls (extended)

#2

Postby HarryDeBoer » Wed Jun 05, 2013 7:59 am

LS,

Also it would be nice to have a search function to search in multiple scripts. To know in which scripts a control is used.

Kind regards, Harry
0 x
Kind regards,

Harry

LKirby
Ebase User
Posts: 37
Joined: Wed Mar 13, 2013 11:33 am
Contact:

#3

Postby LKirby » Wed Jun 05, 2013 8:56 am

If you're using JavaScript (not FPL) for your scripts and you want to find multiple controls at once you can do this really easily. In the properties panel for a control (e.g. the properties for a panel or field), look for the 'Modifiers' property. For each of the controls that you want to do something to in a script, give them the same modifier. Then in your script you can use something similar to:

Code: Select all

for each (var ctrl in pages.PAGE_NAME.getControlsByModifier("modifierNameYouChose")){
	// so for each control found on the page selected with the modifier above, do something to it:
	ctrl.show();
	ctrl.setCssClass("class1");
}

For example, on a page i have several panels with the Modifier 'hideOnPageReturn' and in a before page script i have:

Code: Select all

for each (var ctrl in pages.PAGE_1.getControlsByModifier("hideOnPageReturn")){
	ctrl.hide();
}

Also, if you are writing your scripts in JavaScript; in a script type in controls. (with the fullstop) and press ctrl + space, it will then give you a list of all the controls on the form :)


Hope this helps,

Luke
0 x

HarryDeBoer
Ebase User
Posts: 118
Joined: Tue Oct 23, 2012 7:01 am
Location: The Netherlands

#4

Postby HarryDeBoer » Wed Jun 05, 2013 9:23 am

Hi Luke,

We use js and are aware of the techniques you describe, however that's not what I mean. If you have a lot of scripts I want to find in which script(s) and on what line(s) the control is mentioned. The first question was to find a control in a form (or outline) by its name.

Regards, Harry
0 x
Kind regards,

Harry


Who is online

Users browsing this forum: No registered users and 44 guests