[fusion-trac] #235: Task Pane's home button sometimes directs to a task instead of the home page

Fusion trac_fusion at osgeo.org
Tue Mar 31 13:20:16 EDT 2009


#235: Task Pane's home button sometimes directs to a task instead of the home
page
-------------------------+--------------------------------------------------
   Reporter:  dorshemer  |       Owner:  madair          
       Type:  defect     |      Status:  new             
   Priority:  P2         |   Milestone:  Future          
  Component:  Widgets    |     Version:  1.1.1           
   Severity:  Minor      |    Keywords:  "Task Pane" Home
External_id:             |       State:  New             
    Browser:  All        |          Os:  All             
-------------------------+--------------------------------------------------
 1. Select a task on the Task List menu
  2. Click the Task Pane Home button
  3. Select a task again
  4. Click the Home button

 After the fourth step, the task pane will reload with the last task it
 had, instead of the task pane's home page.

 This occurs because of the following code (widgets/TaskPane.js):

 {{{
 goHome: function() {
         this.nCurrentTask = 0;
         this.iframe.src = this.aExecutedTasks[this.nCurrentTask];
         this.updateButtons();
     },

 setContent: function(url) {
         ....

         this.aExecutedTasks.push(url);
         ++this.nCurrentTask;
         this.iframe.src = url;
         this.iframe.taskPaneId = this.widgetTag.name;
         this.updateButtons();
     },
 }}}

 Selecting a task calls setContent which pushes the task URL to the
 aExecutedTasks array, but clicking the home button resets the array
 without pushing it. The next call to setContent will place the task URL at
 index 0, and every call to goHome after that will invoke that URL.

 To fix it, I suggest calling setContent from goHome:
 {{{
 goHome: function() {
         this.nCurrentTask = 0;
         var url = this.aExecutedTasks[this.nCurrentTask];
         this.aExecutedTasks = [];
         this.setContent(url);
     },
 }}}

 or perhaps something more elegant.

-- 
Ticket URL: <http://trac.osgeo.org/fusion/ticket/235>
Fusion <http://trac.osgeo.org/fusion>
Fusion is a web-mapping application development framework for MapServer and MapGuide OS.


More information about the fusion-trac mailing list