Page 1 of 1

Table view elements.allnames

PostPosted: Wed Jan 11, 2017 4:26 pm
by Peter de Groot
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 5672 times

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


Is this expected behaviour?

Regards,

Peter

Re: Table view elements.allnames

PostPosted: Wed Jan 11, 2017 8:42 pm
by mboegem
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?

Re: Table view elements.allnames

PostPosted: Thu Jan 12, 2017 8:39 am
by Peter de Groot
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

Re: Table view elements.allnames

PostPosted: Thu Jan 12, 2017 11:25 am
by ROCLASI
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.

Re: Table view elements.allnames

PostPosted: Thu Jan 12, 2017 1:21 pm
by mboegem
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:

Re: Table view elements.allnames

PostPosted: Thu Jan 12, 2017 1:36 pm
by Peter de Groot
Thanks for the explanation Image

Regards,
Peter