myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tomas Havelka (JIRA)" <...@myfaces.apache.org>
Subject [jira] Created: (TRINIDAD-675) Component selectRangeChoiceBar not properly rendered
Date Mon, 03 Sep 2007 09:27:19 GMT
Component selectRangeChoiceBar not properly rendered
----------------------------------------------------

                 Key: TRINIDAD-675
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-675
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions: 1.0.2-core, 1.0.1-core
            Reporter: Tomas Havelka


When component selectRangeChoiceBar is rendered for the last page and model row count is not
known (-1), the link for the navigation to next page should be rendered as disabled (now it's
rendered as enabled even if no onclick event is attached).

Solution:
Modify _renderLink method of SelectRangeChoiceBarRenderer similarly to _renderArrow method.
For example like this.

    String text = getBlockString(arc, isNext, records);
    boolean isEnabled = ((records > 0) && (onclick != null));  // here is the place
to check whether link is to be rendered as disabled

    ResponseWriter writer = context.getResponseWriter();
    if (isEnabled)
    {
      writer.startElement("a", null);
      writer.writeURIAttribute("href", "#", null);
      writer.writeAttribute("onclick", onclick, null);

      // The navBar needs its initial focus to be on the Next button,
      // according to the BLAF. Render a special id on the Next button
      // if this navBar is to have the initial focus. (unless it needs
      // initial focus, the Next button does not have an id on it)
      if (isNext)
      {
        String linkID = _getIDForFocus(arc, id);
        writer.writeAttribute("id", linkID, null);
      }

      renderStyleClass(context, arc, SkinSelectors.NAV_BAR_ALINK_STYLE_CLASS);
    }
    else
    {
      writer.startElement("span", null);
      renderStyleClass(context, arc, SkinSelectors.NAV_BAR_ILINK_STYLE_CLASS);
    }

    writer.writeText(text, null);

    if (isEnabled)
    {
      writer.endElement("a");
    }
    else
    {
      writer.endElement("span");
    }


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


Mime
View raw message