You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Helmut Swaczinna (JIRA)" <de...@myfaces.apache.org> on 2011/01/06 10:09:46 UTC

[jira] Created: (TOBAGO-962) CSS class tobago-sheet-row-selected has no effecr on tc:link

CSS class tobago-sheet-row-selected has no effecr on tc:link
------------------------------------------------------------

                 Key: TOBAGO-962
                 URL: https://issues.apache.org/jira/browse/TOBAGO-962
             Project: MyFaces Tobago
          Issue Type: Improvement
          Components: Themes
    Affects Versions: 1.0.33
         Environment: All
            Reporter: Helmut Swaczinna
            Priority: Minor


When changing the style of the selected row in a tc:sheet by changing the CSS class tobago-sheet-row-selected, this has no effect on a tc:link in the row.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOBAGO-962) CSS class tobago-sheet-row-selected has no effecr on tc:link

Posted by "Helmut Swaczinna (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOBAGO-962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12978234#action_12978234 ] 

Helmut Swaczinna commented on TOBAGO-962:
-----------------------------------------

I solvled this problem. Apply this changes to tobago-sheet.js:

Tobago.Sheet.prototype.updateSelectionView = function(sheetId) {
  var selected = Tobago.element(this.selectedId).value;
  var row = Tobago.element(this.firstRowId);
  var i = 0;

  while (row) {

    // you must not use Tobago.element() or document.getElementById() because the IE 6? doen't index the ids.
    // to the performace is quadratic aka. O(N*N) when N is the number of rows.

    var rowIndex = i + this.firstRowIndex * 1; // * 1 to keep integer operation
    var re = new RegExp("," + rowIndex + ",");
    var classes = row.className;
    var image = this.getSelectionElementForRow(row);

    if (selected.search(re) == -1) { // not selected: remove selection class

      Tobago.removeCssClass(row, "tobago-sheet-row-selected");
      this.setLinkSelected(i, false);

      if (image && image.src && !image.src.match(/Disabled/)) {
        image.src = this.uncheckedImage;
      }

    } else {  // selected: check selection class
      if (classes.search(/tobago-sheet-row-selected/) == -1) {
        Tobago.addCssClass(row, "tobago-sheet-row-selected");
        this.setLinkSelected(i, true);      
      }
      if (image && image.src && !image.src.match(/Disabled/)) {
        image.src = this.checkedImage;
      }
    }
    row = this.getSiblingRow(row, ++i);
  }
};

Tobago.Sheet.prototype.setLinkSelected = function(rowIndex, selected) {
    var j = 0;
    var idPrefix = this.id + "_data_row_" + rowIndex + "_column"; 
    var column = Tobago.element(idPrefix + j++);
    while (column) {
      var content = column.childNodes[0].childNodes[0];
      if (content != null && content.tagName == "A") {
        if (selected == true) {
          Tobago.addCssClass(content, "tobago-sheet-row-selected");
        } else {
          Tobago.removeCssClass(content, "tobago-sheet-row-selected");
        }
      }
      column = Tobago.element(idPrefix + j++);
    }
};


> CSS class tobago-sheet-row-selected has no effecr on tc:link
> ------------------------------------------------------------
>
>                 Key: TOBAGO-962
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-962
>             Project: MyFaces Tobago
>          Issue Type: Improvement
>          Components: Themes
>    Affects Versions: 1.0.33
>         Environment: All
>            Reporter: Helmut Swaczinna
>            Priority: Minor
>
> When changing the style of the selected row in a tc:sheet by changing the CSS class tobago-sheet-row-selected, this has no effect on a tc:link in the row.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TOBAGO-962) CSS class tobago-sheet-row-selected has no effecr on tc:link

Posted by "Helmut Swaczinna (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TOBAGO-962?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Helmut Swaczinna updated TOBAGO-962:
------------------------------------

    Status: Patch Available  (was: Open)

> CSS class tobago-sheet-row-selected has no effecr on tc:link
> ------------------------------------------------------------
>
>                 Key: TOBAGO-962
>                 URL: https://issues.apache.org/jira/browse/TOBAGO-962
>             Project: MyFaces Tobago
>          Issue Type: Improvement
>          Components: Themes
>    Affects Versions: 1.0.33
>         Environment: All
>            Reporter: Helmut Swaczinna
>            Priority: Minor
>
> When changing the style of the selected row in a tc:sheet by changing the CSS class tobago-sheet-row-selected, this has no effect on a tc:link in the row.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.