Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-261

fieldErrors dont display multiple errors in view tags

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • WW 2.0-beta2
    • WW 2.0-beta2
    • Plugin - Tags
    • None

    Description

      this is the fixed version of controlheader.vm that displays multiple errors per field (for fieldErrors), before the errors would simply list as [ErrorOne,ErrorTwo] and would resolve with getText() messages

      #if( $stack.findValue("fieldErrors") )
      #set( $errors = $stack.findValue("fieldErrors.get('$tag.Name')") )
      #if( $errors )
      <tr>
      <td colspan="2" class="error"><span class="errorMessage">
      #foreach( $error in $errors )
      #set( $message = $stack.findValue("getText('${error}')") )
      #if( $message && $message != "" )
      $message<br>
      #else
      $error<br>
      #end
      #end
      </span></td>
      </tr>
      #end
      #end

      #set( $labelValue = $stack.findValue("getText('$tag.Label')") )
      #if( !$labelValue )
      #set( $labelValue = $tag.Label )
      #end
      <tr>
      <td align="right" valign="top"#if($error) class="error"#end><label
      class="label">$!

      {labelValue}

      :</label></td>
      <td#if($errors) class="error"#end>

      Attachments

        Issue Links

          Activity

            People

              jcarreira Jason Carreira
              lagcisco Francisco Hernandez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: