I have a web page that contains an RP, then a TREE, and the tree uses #Prim_Tree.iTreeDesign.
If the web page is resized, how do I get the event down to the RP for my list entries? I have the event in the list entry RP but I don't see that firing.
Thanks
Using Designs PRIM_TREE
-
dannyoorburg
- Posts: 177
- Joined: Mon Jan 04, 2016 9:50 am
- Location: Australia
Re: Using Designs PRIM_TREE
Hi,
The Tree Design is a Panel, and as such it has a SizeChanged event.
That event is NOT about the Browser changing size, if that's what's causing the confusion, but about the Panel itself changing size (probably triggered by layout managers resizing the Tree that it lives in).
If you want to know about the Web Page changing size, you'll need a reference to it, you could for instance add the following into your Tree Design:
It's generally sufficient to know the PANEL is changing size though. Unless you want to trigger different UI for phone/tablet/desktop. But in that case I would have a look at the Web Page Templates on the New Web Page view. They fire events of a global application object on certain size thresholds..
Regards,
Danny
The Tree Design is a Panel, and as such it has a SizeChanged event.
That event is NOT about the Browser changing size, if that's what's causing the confusion, but about the Panel itself changing size (probably triggered by layout managers resizing the Tree that it lives in).
If you want to know about the Web Page changing size, you'll need a reference to it, you could for instance add the following into your Tree Design:
Code: Select all
Define_Com Class(#PRIM_WEB) Name(#WebPage) Reference(*DYNAMIC)
Evtroutine Handling(#COM_OWNER.CreateInstance)
#WebPage <= #SYS_WEB.WebPage
Endroutine
Evtroutine Handling(#WebPage.SizeChanged)
#Caption1 := ("The Browser's view port size is &1 by &2").Substitute( #WebPage.Height.AsString #WebPage.Width.AsString )
Endroutine
Evtroutine Handling(#COM_OWNER.SizeChanged)
#Caption2 := ("This Design Panel's size is &1 by &2").Substitute( #COM_OWNER.Height.AsString #COM_OWNER.Width.AsString )
EndroutineRegards,
Danny
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Using Designs PRIM_TREE
Hi Art
VL also has a Designs feature (http://docs.lansa.com/14/en/lansa012/co ... 2_0060.htm)
These can be used to set up your application to handle multiple sizes. Most important here is that the DesignChanged event will fire on every reusable part instance at runtime.
This thread might help http://vlforum.lansa.com.au/viewtopic.php?t=14
Regards
VL also has a Designs feature (http://docs.lansa.com/14/en/lansa012/co ... 2_0060.htm)
These can be used to set up your application to handle multiple sizes. Most important here is that the DesignChanged event will fire on every reusable part instance at runtime.
This thread might help http://vlforum.lansa.com.au/viewtopic.php?t=14
Regards
Re: Using Designs PRIM_TREE
Thanks Stewart. Currently I'm not able to see debug breakpoints on designchanged in my Tree item RP. I'm still making sure that it's not something else causing the problem.
Art Tostaine
- Stewart Marshall
- Posts: 417
- Joined: Thu Nov 05, 2015 5:25 pm
Re: Using Designs PRIM_TREE
Did you get it to work Art?
I was tinkering today (for peace of mind) and spent 15 minutes being very confused by the event not firing on the items at start up. Eventually I realised that thanks to async processing, they weren't added until after long initialization had finished.
Always easy when you know.
I was tinkering today (for peace of mind) and spent 15 minutes being very confused by the event not firing on the items at start up. Eventually I realised that thanks to async processing, they weren't added until after long initialization had finished.
Always easy when you know.
Re: Using Designs PRIM_TREE
Yes I did. I also discovered if I set a minimum width on the only row at (say) 500, my design change won't fire if It's set to < 500. Which is good if you know 
Art Tostaine