DisplayTag
  1. DisplayTag
  2. DISPL-597

Error with the javascript function created, when using the form atribute

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When we are use form atributte, we now use PostHref class to generete de href, and it creates a call for a javascript function, and it passes all the paramters including displaytag paramaters and the form parameters; when the "<a>" tag is been created the generated href is passed as <a href="(here is the javascript call" ...etc. this may cause a bug if the form has a lot of atributtes, a javascript call shouldn't be called from the href="" atribute of the link it should we called from an event such as onclick="".

      Instead of:

       private String getHrefString()
          {
              if (this.href == null)
              {
                  return TagConstants.EMPTY_STRING;
              }
              return " href=\"" + this.href.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
          }

      it should we something like:

      private String getHrefString()
          {
              if (this.href == null)
              {
                  return TagConstants.EMPTY_STRING;
              }

              if (isWithForm) {
                  return " href=\"#\" onclick=\"" + this.href.toString() + "\"";
              }

              return " href=\"" + this.href.toString() + "\""; //$NON-NLS-1$ //$NON-NLS-2$
          }

        Activity

        There are no comments yet on this issue.

          People

          • Reporter:
            Alvaro Villarroel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: