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

TextField tag renders with wrong NAME value (OGNL not evaluated?)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.1.1
    • None
    • None
    • BEA Weblogic 10, jdk 1.5.0_06

    Description

      [code]
      <s:iterator value="languages" var="lang">
      <s:set var="language" value="lang"/>
      <tr>
      <td>
      <s:text name="editGroup.data.label">
      <%-- lang.value --%>
      <s:param><s:property value="value"/></s:param>
      </s:text>
      </td>
      <td>
      <s:textfield name="group.translations[translatedLang.langId].value"/>
      </td>
      </tr>
      </s:iterator>
      [/code]

      The problem is in:

      <s:textfield name="group.translations[translatedLang.langId].value"/>

      (I also tried <s:textfield name="group.translationslang.translatedLang.langId.value"/> ..)

      It renders to HTML as this (partially):

      <input type="text" name="group.translations[translatedLang.langId].value" value="Aanbevelingen van de raad" id="groupForm_group_translations_translatedLang_langId__value"/>

      while it should be:

      <input type="text" name="group.translations[4].value" value="Aanbevelingen van de raad" id="groupForm_group_translations_4_value"/>

      as lang is the language in the loop, lang.translatedLang is the language translated (just for clarity, languages is a collection of language translations in the user's language, translatedLang is the language being translated and it has an ID that's used as a key in the 'translations' Map ..)

      The bug is that it sets the value correctly, but that the NAME and ID are not evaluated as OGNL ...

      Even "<s:textfield key="group.translationslang.translatedLang.langId.value"/>" did not work.

      Attachments

        Activity

          People

            beaumkr kris beaumont
            beaumkr kris beaumont
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: