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 5659 times

tableview.png
tableview.png (6.5 KiB) Viewed 5659 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 5659 times


Is this expected behaviour?

Regards,

Peter
User avatar
Peter de Groot
 
Posts: 215
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 Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1742
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

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
User avatar
Peter de Groot
 
Posts: 215
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
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
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 Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1742
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Table view elements.allnames

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

Thanks for the explanation Image

Regards,
Peter
User avatar
Peter de Groot
 
Posts: 215
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 8 guests

cron