Opened 9 years ago

Closed 4 years ago

#11674 closed defect (patchwelcome)

PortletSettings don't work with Portlet and dynamic content

Reported by: MarkusWolff Owned by: Shane O'Sullivan
Priority: high Milestone: 1.13
Component: DojoX Widgets Version: 1.5
Keywords: Portlet, PortletSettings Cc: Shane O'Sullivan
Blocked By: Blocking:

Description

Portlets (as in dojox.widget.Portlet, see #8867) can contain dynamically loaded content, as inherited by TitlePane:

var portlet = new dojox.widget.Portlet({
        id: 'p1',
        dndType: 'Portlet',
        title: 'Portlet title',
        href: '/some/content/url',
        preload: true
    });

This works well. However, it seems to be impossible to use this dynamically loaded content with a settings pane simultaneously:

var portletSettings = new dojox.widget.PortletSettings({
    content: '<h1>Hello World</h1>'
});
portlet.addChild(portletSettings);

The portlet still renders fine, fetches the external content and even displays the settings icon in the title bar. When clicking on the settings icon, however, nothing happens. Upon further inspection, it seems the loaded content has overwritten all other child nodes within the Portlet, including the PortletSettings node.

Everything works just fine with static content.

Environment:

  • Browser: Firefox 3.6.8 w/ FireBug 1.5.4
  • OS: MacOS X 10.6.4

Change History (4)

comment:1 Changed 9 years ago by MarkusWolff

The problem is in the _setContent() method inherited by ContentPane. First thing it does is call this.destroyDescendants(), which also destroys the PortletSettings node. So, having the settings node be a child element of Portlet seems to be a conceptual problem.

As a quick fix, I have copied over the _setContent() method from ContentPane to Portlet and removed the call to destroyDescendants(). This seems to do the trick, at least at first glance. I'm pretty sure it won't work for everyone, though, and there will be side-effects, for example if the remote content is to updated repeatedly (new content would always be appended instead of overwriting old content).

My proposal for a solution is to introduce a new attribute, let's call it settingsNode, in which you can provide the ID of a PortletSettings widget that can be anywhere else in the document (like with Dialogs or Tooltips). On clicking the settings icon, this node will be dynamically attached to the portlet and used for displaying the settings widget.

comment:2 Changed 9 years ago by dante

Milestone: tbd1.7
Owner: changed from dante to Shane O'Sullivan

comment:3 Changed 7 years ago by Colin Snover

Milestone: 1.82.0

1.8 has been tagged; moving all outstanding tickets to next major release milestone.

comment:4 Changed 4 years ago by dylan

Milestone: 2.01.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 5+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.