PDA

View Full Version : Tools: the currently selected object



HankFay
2012-05-28, 17:49
For some tools (builders), we need to know the Currently Selected Object.

a) how can I know the currently selected AppBuilder section (Apps, Data, etc.)?

b) how can I know, or get an object reference to, the currently selected object? E.g., on a Page, the currently selected control? On a report, the name of the report? Etc. I can get a reference to ActivePage, but there seems to be nothing futher down the line. CurrentControl would be great to have.

tia,

Hank

lianjasupport
2012-05-28, 20:26
Currently:

cResult = Lianja.database
cResult = Lianja.application
oResult = Lianja.editor
cResult = Lianja.activePage

As of beta9.

cResult = Lianja.activePage.activeSection
cResult = Lianja.activePage.activeSection.activeControl

Note that these return character strings so you must then use Lianja.getElementByID( result ) to get an object reference.

HankFay
2012-05-28, 21:51
That is beeyooteefull!

phabio
2012-05-29, 02:22
and there will be just a few examples for all? :-)

lianjasupport
2012-05-29, 02:33
Yes we will blog it. Beta9 has many improvements. We are listening. :)

lianjasupport
2012-05-29, 02:38
Also we have new videos coming organized into categories.

Beginner Tutorials

Intermediate Tutorials

Advanced Tutorials

and...

Community Submitted tutorials
(anyone can submit these in their own native language and we will make them available in the video channels)

We have been updating the videos which is why they are unavailable at the moment.

phabio
2012-05-29, 02:41
we look forward to ...

tabacaru
2012-06-01, 09:34
This is very good !

HankFay
2012-06-01, 12:59
and there will be just a few examples for all? :-)

Probably all you need is what was put into the revised Lianja Object Model blog entry: http://www.lianja.com/resources/blog/39-coding-tips/129-working-with-the-lianja-object-model

lcActiveControl = Lianja.ActivePage.ActiveSection.ActiveControl
loActiveControl = Lianja.getelementbyid(lcActiveControl)
? loControl.type
loControl.name = "myOwnVerySpecialName"

hth,

Hank