Table view elements.allnames

Questions, tips and tricks and techniques for scripting in Servoy

Table view elements.allnames

Postby Peter de Groot » Wed Jan 11, 2017 4:26 pm

Hi,

using servoy 7.4.8 smartclient,

I want to get all the elements that are present on table view form, all elements needed are named
tableview1.png
tableview1.png (5.45 KiB) Viewed 825 times

tableview.png
tableview.png (6.5 KiB) Viewed 825 times


when I run this
Code: Select all
$elem = elements.allnames

I see all the elements except the labelfor elements (lbl_ prefixed),
result.png
result.png (5.04 KiB) Viewed 825 times


Is this expected behaviour?

Regards,

Peter
Servoy 7.3.x || 7.4.x

NEM ENERGY BV
Peter de Groot
 
Posts: 207
Joined: Thu Jan 10, 2008 8:38 pm
Location: Not sure...

Re: Table view elements.allnames

Postby mboegem » Wed Jan 11, 2017 8:42 pm

Hi Peter,

as far as I know that has been the behaviour from the very start (when it was first implemented in v3.5)
The labels have always been a replacement for the default table headers (which you obviously can not control either)

You should be able to grab them through solutionModel though.

Can you explain in a bit more detail what you are trying to achieve here?
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1384
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Table view elements.allnames

Postby Peter de Groot » Thu Jan 12, 2017 8:39 am

Hi Marc,

was just wondering why they don't show when using
Code: Select all
$elem = elements.allnames


because when I do
Code: Select all
var $form   = solutionModel.getForm(event.getFormName());
var $elems  = $form.getComponents();

every element on the passed form is listed..

Regards,

Peter
Servoy 7.3.x || 7.4.x

NEM ENERGY BV
Peter de Groot
 
Posts: 207
Joined: Thu Jan 10, 2008 8:38 pm
Location: Not sure...

Re: Table view elements.allnames

Postby ROCLASI » Thu Jan 12, 2017 11:25 am

Hi Peter,

The first approach gives you all the elements at runtime. As Marc already mentioned the table headers were never accessible as such so they don't show up.
The second approach actually looks at the blueprint of the form (not the runtime instance of it) and sure enough it shows the labels you defined at design time.
So the difference is that one reflects the actually form instance and the other the form blueprint.

Hope this helps.
Robert Ivens
ROCLASI Software Solutions / JBS Group, Partner
SAN Developer / Servoy Valued Professional / Servoy Certified Developer
Twitter: @roclasi / @servoyforge
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5209
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Table view elements.allnames

Postby mboegem » Thu Jan 12, 2017 1:21 pm

ROCLASI wrote:The first approach gives you all the elements at runtime. As Marc already mentioned the table headers were never accessible as such so they don't show up.
The second approach actually looks at the blueprint of the form (not the runtime instance of it) and sure enough it shows the labels you defined at design time.
So the difference is that one reflects the actually form instance and the other the form blueprint.

Check :wink:
_____________________
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance SAN Developer

Image
User avatar
mboegem
 
Posts: 1384
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

Re: Table view elements.allnames

Postby Peter de Groot » Thu Jan 12, 2017 1:36 pm

Thanks for the explanation Image

Regards,
Peter
Servoy 7.3.x || 7.4.x

NEM ENERGY BV
Peter de Groot
 
Posts: 207
Joined: Thu Jan 10, 2008 8:38 pm
Location: Not sure...


Return to Methods

Who is online

Users browsing this forum: No registered users and 4 guests

cron