Nested Dynamic Panels with Fit to Content

Seems I’ve had a bit of a brain melt - I thought this worked before??

I’ve got a situation kind of like nested accordions - I’ve got a dynamic panel set to Fit to Content which pushes widgets down and then inside that panel, I’ve got another dynamic panel also set to Fit to Content which pushes stuff down in that.

Basically when I open up a hidden panel within the nested panel, then the “content size” for fit to content doesn’t update and push the widgets down on the level above? I was pretty sure it used to??

Please check the Demo:
Untitled Document

To recreate what I’m experiencing:
Scenario 1:
• Click the 1 button and watch panel expand and push 2 down
• Next Click the A button and watch the nested panel expand and not push 2 down??

Scenario 2:
• Reload page
• Click 1
• Click A
• Click 1 again 2 is not pulled??

Scenario 3:
• Reload page
• Click 1
• Click A
• Click A again
• Click 1 and all is good 2 is pulled

I read somewhere that OnResize is supposed to be called but I didn’t see that happening.

What’s the scoop here - maybe it’s a long day and I’m missing how I used to easily get this to work automatically - but I was pretty sure it worked by itself - unless this is a fit to content issue?

Any help on getting this to work properly?

thanks!

1 Like

Hi!

Push/pulling objects that are inside a dynamic panel will move only the objects inside of the panel. It’s always been that way as far as I know.

The workaround is tedious, as you need to manually move the accordions below based on the height of the object you are hiding/showing.

Attached below is a sample that does that. A couple of notes:

[ul]
[li]I’m testing selected of a checkbox rather than testing for the visibility of the shown/hidden widget because there are timing issues with the visibility property when hiding/showing with a timed transition.[/li][li]You’ll notice that accordion 2 has an OnMove script that moves accordion 3 when accordion 2 moves. You would add a similar script to accordion 3 if there were an accordion 4[/li][/ul]

Live sample

File: push pull groups.rp (137 KB)

[Edit] Note that, yes, this could be done much more simply with OnResize handler if you weren’t using transitions. For instance, on accordion 1 you could say:

OnResize
[INDENT]Move accordion 2 to [[This.bottom]][/INDENT]

However, OnResize of a panel doesn’t fire until the transition that caused the size change has completed, which as you can imagine would make for a odd experience.

2 Likes

Thanks for replying josephxbrick - I wonder if I am wearing out my Axure support welcome with all my posts recently - so thanks for contributing and going to the trouble of making a demo and .RP file - I appreciate that!

Getting back to the point of my query - the way nested dynamic panels are handled kind of sucks and should really be fixed by Axure; I see no reason why it can’t report the right sizes to the parent panel? - I mean I don’t want a push/pull to move things outside of the scope of a panel - that is by design - I get it, however Fit to Content should report the updated content height when you change panel States?

I really was trying not to have to manually manage heights and have to resize panels - this gets really tedious especially if you have more than 2 levels.

Thanks so much for taking the time to look at my query and I’ll have a closer look at your .rp file and see how you did it and if this solution would be cumbersome if there are many of these in a prototype.

:slight_smile:

Hi!

Yes: the problem is a trivial one to solve if you need no animation. The animation makes it tricky, but I think the result is worth the tedium of entering code (most of which is just a copy/paste plus changing what the local variable targets).

One way for Axure to make this easier would be to have a dynamic panel property that says, basically, “Allow push pull to act on objects outside this panel.”

Hi all,

Thanks for the notes and feedback on this! I’ve gone ahead and logged the request for an option to have push/pull animations of a panel state to affect widgets outside of the container DP.

Popweb, not a problem at at all–the forum is largely peer-driven and our support team can certainly hop in with additional comments and help as needed. If you have any questions that might be more urgent in nature, please also feel free to email us at support@axure.com, where we handle support tickets a little differently and oftentimes faster. Here’s Kip with some more information:

https://www.axure.com/c/forum/lounge/15974-unanswered-threads.html#post52202

Thanks again!

1 Like