I have a tree view to which I'm adding various RPs. I'm catching the #treeItems.ItemGotFocus event to determine which is the active item.
One of my RPs has a text box element and when I click into the textbox the above event fires.
But another contains a DateTime Picker and if I click on the white area of the date box or I use the event fires but if instead I click on the first part of the date (as in 22 in 22/12/2017) then the itemGotFocus does not fire. If I click on the down arrow to the month view the itemGotFocus again does not fire.
Since anyone change. How can I capture these events in the RP and propagate them back to the tree as itemGotFocus events.
Cheers
Tree View Issue
-
GregSippel
- Posts: 25
- Joined: Thu May 19, 2016 11:34 am
Re: Tree View Issue
Soa,
The answer is very close to a question asked by jyoung, see here viewtopic.php?f=3&t=1695&sid=3402ea900c ... 9284dc0f17
In your Tree Item Design, signal an event when the DateTime Picker get focus like this
Then in the component that uses the tree view, you need the capture the event. To do this first we need a global variable to hold the reference item we wish to here events from
Now we have this, we can capture the reference item like this
and finally, we can hear the events via this
Hope this helps.
Cheers
Greg
The answer is very close to a question asked by jyoung, see here viewtopic.php?f=3&t=1695&sid=3402ea900c ... 9284dc0f17
In your Tree Item Design, signal an event when the DateTime Picker get focus like this
Code: Select all
Define_Evt Name(DateTimeGotFocus)
Evtroutine Handling(#DateTime1.GotFocus)
#SYS_WEB.Console.Log( ('Item Design Evtroutine Handling(#DateTime1.GotFocus)') )
Signal Event(DateTimeGotFocus)
EndroutineThen in the component that uses the tree view, you need the capture the event. To do this first we need a global variable to hold the reference item we wish to here events from
Code: Select all
Define_Com Class(#gbsTestTreeEventsDesign) Name(#CurrentDesign) Reference(*DYNAMIC)
Code: Select all
Evtroutine Handling(#Tree1.ItemMouseHover) Item(#Item)
#CurrentDesign <= (#Item.Design *As #gbsTestTreeEventsDesign)
EndroutineCode: Select all
Evtroutine Handling(#CurrentDesign.DateTimeGotFocus) Com_Sender(#Sender)
#SYS_WEB.console.log( ('#Tree1.ItemGotFocus by sender ' + #Sender.name + ' and Item ' + #Tree1.CurrentItem.Entry.AsString) )
EndroutineCheers
Greg