View Full Version : Make component follow another.

14 May 2010, 4:58 AM

The idea is to create a plug-in that will add my component to the page and make it follow another component anywhere it moves. Like a Badge on iPhone buttons.

I tried using Element's anchorTo() method as well BoxComponent's move() event but they don't work EVERY time. Here's my problem:

Let's say I have 3 components in a Panel (with default layout). Component #2 has my plug-in attached hence a Badge is created and aligned next to Comp#2. If I resize my window, anchorTo() does it's work and realigns the Badge next to Comp#2. BUT, if I resize Comp#1, and browser itself moves Components #2 and #3 to fill in the gap (in case of shrinking Comp#1) or prevent overlapping (in case of expanding Comp#1) nothing happens and my Badge stays behind, floating somewhere in the air.

I attached a screenshot of the problem. Red square being the Badge that doesn't move when I collapse the top FieldSet.

IMPORTANT NOTE: I don't want to be dependent on a layout manager or specific component I add my plug-in to. I need a general solution.

Thank you,