Ticket #4853 (closed defect: fixed)

Opened 9 months ago

Last modified 5 months ago

[patch][cla]dojox.layout.FloatingPane with remote content is not resizable

Reported by: guest Owned by: dante
Priority: normal Milestone: 1.1
Component: Dojox Version: 1.0
Severity: normal Keywords: dojox.layout.FloatingPane remote href resizable widget
Cc:

Description

a dojox.layout.FloatingPane? with remote content (i.e. with an attribute href) will not be resizable.

In order to reproduce it : take the test page dojox/layout/tests/test_FloatingPane.html and add an attribute resizeable="true" to the remote pane : <div dojoType="dojox.layout.FloatingPane?" resizeable="true"

title="remote pane" href="../../../dijit/tests/layout/doc0.html" style="width:250px; height:250px; background:#fff;"

></div>

the floating pane is not resizable.

I think it is only because you add resize handle : <div id="dojox_layout_ResizeHandle_0" class="dojoxResizeHandle dojoxResizeNW" dojoattachpoint="resizeHandle" widgetid="dojox_layout_ResizeHandle_0">

before getting the content from the server, so it is erased ?

Attachments

FloatingPane_ResizeHandle.patch (4.1 kB) - added by guest 5 months ago.
Patch to fix the bug

Change History

Changed 9 months ago by dante

  • status changed from new to assigned
  • owner changed from ttrenka to dante

Changed 6 months ago by dante

  • milestone changed from 1.1 to 1.2

Changed 5 months ago by guest

The root of the problem is that when ContainerPane? wants to set its contents internally, _setContent(cont) calls first the method destroyDescendants (which is inherited from _Widget). As advertised, destroyDescendants destroys all descendents including the ResizeHandler?.

There is no easy way to fix this one. The cleaner solution would be to implement a ReseizableContaintPane?, that extends ContaintPane? and overrides all the life-cycle and public functions that end up calling _setContent(cont) so they call an alternative method. Another solution would be to override _setContent(cont), but it is never a good idea to override private functions since ContentPane? could change its implementation. Another problem with having a ReseizableContaintPane?, is that not all FloatingPanes? are going to be resizables. So it would not be clean to have all FloatingPanes? extend ReseizableContaintPane?.

The patch that I submit is a little bit of a hack, but I think it is a good compromise solution and it's much better that FloatingPane? not working at all with setHref. What I did is adding a member to FloatingPane?:

this._destroyResizeHandle

and override

destroyDescendants()

so it doesn't destroy the RresizeHandle? unless this._destroyResizeHandle is true.

When the FloatingPane? is resizable, I set this._destroyRresizeHandle to false, and reset it to true in the destroy() and destroyRecursive() methods so it gets destroyed when the FloatingPane? is destroyed.

I also changed test_FloatingPane.html to have a FloatingPane? that tests this fix and created a file doc0.html that will be used as a parameter to setHref. doc0.html has a button to calls setHref on itself to prove that the FloatingPane? doesn't loose the ResizeHandle?.

My email for any questions issues: angel dot municio at nexaweb dot com

Changed 5 months ago by guest

Patch to fix the bug

Changed 5 months ago by guest

For legal purposes, the patch above (FloatingPane?_ResizeHandle.patch) was submitted by myself, Angel Municio and I have already signed an CLA.

Changed 5 months ago by peller

  • summary changed from dojox.layout.FloatingPane with remote content is not resizable to [patch][cla]dojox.layout.FloatingPane with remote content is not resizable

Changed 5 months ago by dante

  • milestone changed from 1.2 to 1.1

Changed 5 months ago by dante

  • status changed from assigned to closed
  • resolution set to fixed

(In [12380]) fixes #5833 and fixes #4853 - patch / cla from nexaweb - workaround for floatingpane resizable content. was thinking a template change might be easier, and easier to style in the longrun, but this works for now it seems. thanks for the patch.

Changed 5 months ago by guest

  • status changed from closed to reopened
  • resolution deleted

dante

Sorry to be a pain, but you forgot to commit the file doc0.html. You need to either commit it or revert the line 132 in test_FloatingPane.html from:

title="Remote Pane" href="doc0.html" resizable="true"

to

title="remote pane" href="../../../dijit/tests/layout/doc0.html" resizable="true"

As it is, test_FloatingPane.html is giving an error in the remote pane.

Thanks.

Changed 5 months ago by dante

  • status changed from reopened to closed
  • resolution set to fixed

re-fixed in [12398] ... ref'd wrong ticket in commit.

Note: See TracTickets for help on using tickets.