XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.7.2
    • 4.0
    • None
    • None
    • Tapestry 4.1.3, OGNL 2.7.2 snapshot, Java 1.5
    • Important

    Description

      migrating form 4.0.2 to 4.1.3.

      The following works fine under 4.0.2:

      <select jwcid="@Select"

      multiple="literal:false"

      size="10"

      onchange="ognl:'searchSubmit(\''@com.db.rdq.web.tapestry.html.component.Search@INSTRUMENT_GROUP'\',0);'">

      <div jwcid="@For"

      source="ognl:tab.searchItems"

      value="ognl:currentSearchItem"

      index="ognl:currentSearchItemIndex">

      <option jwcid="@Option"

      selected="ognl:tab.searchItems[currentSearchItemIndex].selected"

      label="ognl:tab.searchItems[currentSearchItemIndex].displayName">

      </option>

      </div>

      </select>

      Under 4.1.3 the page renders but then when the users selects an option and submits the form we get the following error:

      2007-10-24 13:41:15,206, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException

      2007-10-24 13:41:15,206, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression '<parsed OGNL expression>' of $Search_375@dc4a91e5[Home/$Search] to false: source is null for getProperty(null, "currentSearchItemIndex")

      2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32,

      2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44,

      binding|ExpressionBinding[Home/$Search tab.searchItems[currentSearchItemIndex].selected]

      location|context:/WEB-INF/Search.html, line 82

      2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException

      2007-10-24 13:41:15,221, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression '<parsed OGNL expression>' of $Search_375@dc4a91e5[Home/$Search] to false: source is null for getProperty(null, "currentSearchItemIndex")

      2007-10-24 13:41:15,237, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32,

      2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44,

      component|$Search_375@dc4a91e5[Home/$Search]

      location|context:/WEB-INF/Home.html, line 51

      2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.OgnlException

      2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, source is null for getProperty(null, "currentSearchItemIndex")

      2007-10-24 13:41:15,253, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32,

      ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1993)

      ...

      It looks like the index variable is going out of scope or something equally strange.

      If we update the template to:

      <select jwcid="@Select"

      multiple="literal:false"

      size="10"

      onchange="ognl:'searchSubmit(\''@com.db.rdq.web.tapestry.html.component.Search@INSTRUMENT_GROUP'\',0);'">

      <div jwcid="@For"

      source="ognl:tab.searchItems"

      value="ognl:currentSearchItem"

      index="ognl:currentSearchItemIndex">

      <option jwcid="@Option"

      selected="ognl:currentSearchItem.selected"

      label="ognl:tab.searchItems[currentSearchItemIndex].displayName">

      </option>

      </div>

      </select>

      The page renders and submits correctly.

      In 4.0.2 we had avoided this syntax as it did not reliably save the value back into the correct element, has this syntax changed in 4.1.3?

      Unfortunately even with the above work around we hit a similar problem again later in the form

      <select jwcid="@Select"

      multiple="literal:false"

      size="10"

      onchange="ognl:'searchSubmit(\''@com.db.rdq.web.tapestry.html.component.Search@FILTER'\', 'currentFilterGroupIndex');'">

      <div jwcid="@For"

      source="ognl:currentFilterGroup"

      value="ognl:currentFilter"

      index="ognl:currentFilterIndex">

      <option jwcid="@Option"

      selected="ognl:tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex]"

      label="ognl:currentFilter">

      </option>

      </div>

      </select>

      The above renders OK but then the form submits we get:

      2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.tapestry.BindingException

      2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression '<parsed OGNL expression>' of $Search_659@dc4a91e5[Home/$Search] to false: source is null for getProperty(null, "currentFilterGroupIndex")

      2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32,

      2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44,

      binding|ExpressionBinding[Home/$Search tab.searchCriteriaSelections[currentFilterGroupIndex][currentFilterIndex]]

      location|context:/WEB-INF/Search.html, line 106

      2007-10-24 13:49:21,134, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, org.apache.hivemind.ApplicationRuntimeException

      2007-10-24 13:49:21,149, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, Unable to update OGNL expression '<parsed OGNL expression>' of $Search_659@dc4a91e5[Home/$Search] to false: source is null for getProperty(null, "currentFilterGroupIndex")

      2007-10-24 13:49:21,149, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32,

      2007-10-24 13:49:21,149, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 44,

      component|$Search_659@dc4a91e5[Home/$Search]

      location|context:/WEB-INF/Home.html, line 51

      2007-10-24 13:49:21,149, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 22, ognl.OgnlException

      2007-10-24 13:49:21,149, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 23, source is null for getProperty(null, "currentFilterGroupIndex")

      2007-10-24 13:49:21,149, ERROR, [com.db.rdq.web.tapestry.html.RDQException], line 32,

      ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1993)

      ...

      Search.jwc

      <!DOCTYPE component-specification PUBLIC

      "-//Apache Software Foundation//Tapestry Specification 4.0//EN"

      "http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">

      <component-specification allow-body="no"

      allow-informal-parameters="no"

      class="com.db.rdq.web.tapestry.html.component.Search">

      <parameter name="tab" required="true"/>

      <property name="currentSearchItem"/>

      <property name="currentSearchItemIndex"/>

      <property name="currentFilterGroup"/>

      <property name="currentFilterGroupIndex"/>

      <property name="currentFilter"/>

      <property name="currentFilterIndex"/>

      <property name="currentMarketDataRow"/>

      <property name="currentMarketDataRowIndex"/>

      <property name="currentAttribute"/>

      <property name="currentAttributeIndex"/>

      </component-specification>

      Search.java (fragment)

      public abstract SearchTab getTab();

      SearchTab.java (fragments)

      /**

      • Flags stating which search criteria are selected

      */

      private List<List<Boolean>> searchCriteriaSelections =

      new ArrayList<List<Boolean>>(1000);

      public List<List<Boolean>> getSearchCriteriaSelections()

      { return this.searchCriteriaSelections; }

      public void setSearchCriteriaSelections(List<List<Boolean>> selections)

      { this.searchCriteriaSelections = selections; }

      /**

      • Filters that can be applied to this tabs searches

      */

      private List<SearchCriteria> searchCriteria =

      new ArrayList<SearchCriteria>();

      public List<SearchCriteria> getSearchCriteria()

      { return this.searchCriteria; }

      public void setSearchCriteria(List<SearchCriteria> searchCriteria)

      { this.searchCriteria = searchCriteria; }

      /**

      • 2D list of options available for each criteria

      */

      private List<List<String>> searchCriteriaOptions =

      new ArrayList<List<String>>();

      public List<List<String>> getSearchCriteriaOptions()

      { return this.searchCriteriaOptions; }

      public void setSearchCriteriaOptions(

      List<List<String>> searchCriteriaOptions)

      { this.searchCriteriaOptions = searchCriteriaOptions; }

      Attachments

        Activity

          People

            jkuhnert Jesse Kuhnert
            couldo Dom Couldwell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: