Closed Bug 825170 Opened 11 years ago Closed 11 years ago

OK button does not close "Invite attendees" dialog when an attendee is deleted from the list

Categories

(Calendar :: Dialogs, defect)

Lightning 1.9
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 815568

People

(Reporter: msmat, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20100101 Firefox/17.0 SeaMonkey/2.14.1
Build ID: 20121129191119

Steps to reproduce:

1. Create an event and add 5 attendees.
2. Update the event and go in the attendees dialog.
3. Delete 3rd attendee.
4. Click OK button => nothing happens, the dialog does not close itself.


Actual results:

Invite attendees dialog cannot be closed by clicking OK button.

The bug is caused by wrong ID resetting in the method "deleteRow" in the file "calendar-event-dialog-attendees.xml". This method is supposed to reset ID of all rows followed the one that was deleted. But this is done only for 2 columns:
attendeeCol#1 and attendeeCol#2
There is also attendeeCol#3 which is not updated and this causes the described behavior.


Expected results:

List of attendees should have been updated and dialog closed.

After changing the "deleteRow" method as below, the OK button works well.

    <method name="deleteRow">
        <parameter name="aRow"/>
        <body><![CDATA[
          // reset id's in order to not break the sequence
          var maxAttendees = this.mMaxAttendees;
          this.removeRow(aRow);
          
          for (var row = aRow + 1; row <= maxAttendees; row++) {
              var col = 1;
              do {
                  var elem = document.getAnonymousElementByAttribute(this, "id", "attendeeCol" + col + "#" + row);
                  if (elem) {
                      elem.setAttribute("id", "attendeeCol" + col + "#" + (row - 1));
                  }
                  col++;
              } while (elem);
          }
        ]]></body>
      </method>

Original methods looks following (with some additional comments why it is wrong):

<method name="deleteRow">
        <parameter name="aRow"/>
        <body><![CDATA[
          // reset id's in order to not break the sequence
          var maxAttendees = this.mMaxAttendees;
          this.removeRow(aRow);
          // numberOfCols returns 2 but we have to update 3 elements.
          // The 3rd element is a subelement of the 2nd column
          // and so it is not included in the numberOfCols 
          var numberOfCols = this.numColumns;
          for (var row = aRow + 1; row <= maxAttendees; row++) {
              for (var col = 1; col <= numberOfCols; col++) {
                  var colID = "attendeeCol" + col + "#" + row;
                  var elem = document.getAnonymousElementByAttribute(this, "id", colID);
                  if (elem) {
                      elem.setAttribute("id", "attendeeCol" + col + "#" + (row - 1));
                  }
              }
          }
        ]]></body>
      </method>
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.