Tapestry
  1. Tapestry
  2. TAPESTRY-1820

RenderBlock fails to operate with persistent properties off of PropertySelection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 4.1.3
    • Fix Version/s: 4.1.5
    • Component/s: Framework
    • Labels:
      None
    • Environment:

      Description

      While developing a Gallery widget in trails... I have found that properties with PropertySelection are operating flakey.

      I have 3 renderblocks
      <form jwcid="galleryForm@Form" listener="listener:onFormSubmit">
      <div jwcid="headerSelect@RenderBlock" block="ognl:components.autoPagingContent" />
      <div jwcid="content@RenderBlock" block="ognl:components.collectionContent" />
      <div jwcid="footerSelect@RenderBlock" block="ognl:components.autoPagingContent" />
      </form>

      The RenderBlock issue is confused....

      Additionally, prefixed "do" listeners fail to invoke.

      Additionally @persist fails to work when defined in the JAVA instead of JWC.

      The main issue for renderBlock is The select components in the footerSelect are clobbering the values in headerSelect internally. yet, All the id's are unique. Is this because the actual array is forced to be declared static?

      Here is my model (sources attached)

      Gallery.html
      <span jwcid="autoPagingContent@Block">
      <table width="100%" border=1>
      <tr>
      <td width="25%" align="left" NOWRAP>
      <span jwcid="@Insert" value="Table Size"/>
      <select jwcid="tableSizeSelect" listener="listener:doTableSizeSelect"
      parameters="ognl:tableSize" onchange="tapestry.form.refresh(this.form)"/>
      <span jwcid="@Insert" value="Paging Span"/>
      <select jwcid="pagingSpanSelect" listener="listener:doPagingSpanSelect"
      parameters="ognl:pagingSpan" onchange="tapestry.form.refresh(this.form)"/>
      </td>
      ... snip
      </span>

      <form jwcid="galleryForm@Form" listener="listener:onFormSubmit">
      <div jwcid="headerSelect@RenderBlock" block="ognl:components.autoPagingContent" />
      <div jwcid="content@RenderBlock" block="ognl:components.collectionContent" />
      <div jwcid="footerSelect@RenderBlock" block="ognl:components.autoPagingContent" />
      </form>

      Gallery.jwc
      <component-specification class="org.trails.demo.components.Gallery"
      allow-body="yes"
      allow-informal-parameters="yes">
      <parameter name="autoPagingContentParm"/>
      <parameter name="collectionContentParm"/>

      <property name="tableSize" persist="session"/>
      <property name="pagingSpan" persist="session"/>

      <property name="theTableSizeValue" persist="session"/>
      <property name="thePagingSpanValue" persist="session"/>

      <component id="tableSizeSelect" type="PropertySelection">
      <binding name="value" value="theTableSizeValue"/>
      <binding name="model" value="tableSizeModel"/>
      </component>

      <component id="pagingSpanSelect" type="PropertySelection">
      <binding name="value" value="thePagingSpanValue"/>
      <binding name="model" value="pagingSpanModel"/>
      </component>
      </component-specification>

      1. screensnapshot.doc
        160 kB
        Kenneth William
      2. Gallery.jwc
        1.0 kB
        Kenneth William
      3. Gallery.java
        5 kB
        Kenneth William
      4. Gallery.html
        3 kB
        Kenneth William

        Activity

        Hide
        Kenneth William added a comment -

        Here is usage...

        Home.html

        <span jwcid="border@Border">

        <h1>
        <div id="page.title">
        <span jwcid="@Insert" value="Listings"/>
        </div>
        </h1>

        <div jwcid="galleryWidget@custom:Gallery"
        collectionType="ognl:@org.trails.demo.Listing@class"
        component="galleryWidget"
        collectionContentParm="collectionContent"
        autoPagingContentParm="autoPagingContent"
        >

        <span jwcid="@RenderBody">content goes here</span>
        </div>

        </span>

        Show
        Kenneth William added a comment - Here is usage... Home.html <span jwcid="border@Border"> <h1> <div id="page.title"> <span jwcid="@Insert" value="Listings"/> </div> </h1> <div jwcid="galleryWidget@custom:Gallery" collectionType="ognl:@org.trails.demo.Listing@class" component="galleryWidget" collectionContentParm="collectionContent" autoPagingContentParm="autoPagingContent" > <span jwcid="@RenderBody">content goes here</span> </div> </span>
        Hide
        Kenneth William added a comment -

        Looking at the code...

        block="ognl:components.autoPagingContent"

        this is defined twice below...

        If the block is being used as a hash key internally that might explain why the last definition is clobbering the first? Just guessing.

        I am poised ready to debug this. Can someone point me to the proper modules?

        This problem seems to be a combination of RenderBlock and Persist property lapses...

        <form jwcid="galleryForm@Form" listener="listener:onFormSubmit">
        <div jwcid="headerSelect@RenderBlock"
        block="ognl:components.autoPagingContent" />
        <div jwcid="content@RenderBlock"
        block="ognl:components.collectionContent" />
        <div jwcid="footerSelect@RenderBlock"
        block="ognl:components.autoPagingContent" />
        </form>

        Hoping for a workaround.

        Show
        Kenneth William added a comment - Looking at the code... block="ognl:components.autoPagingContent" this is defined twice below... If the block is being used as a hash key internally that might explain why the last definition is clobbering the first? Just guessing. I am poised ready to debug this. Can someone point me to the proper modules? This problem seems to be a combination of RenderBlock and Persist property lapses... <form jwcid="galleryForm@Form" listener="listener:onFormSubmit"> <div jwcid="headerSelect@RenderBlock" block="ognl:components.autoPagingContent" /> <div jwcid="content@RenderBlock" block="ognl:components.collectionContent" /> <div jwcid="footerSelect@RenderBlock" block="ognl:components.autoPagingContent" /> </form> Hoping for a workaround.
        Hide
        Kenneth William added a comment -

        Given the attached sources...

        I am in the debugger....

        ListenerMapImpl.JAVA
        public IActionListener getImplicitListener(IComponent component)
        {
        IActionListener listener;
        String generatedName = "do" + TapestryUtils.capitalize(component.getId());
        try

        { listener = getListener(generatedName); }

        A breakpoint at "String generatedName = "do" + "

        never gets hit.

        Just providing field feedback.

        Show
        Kenneth William added a comment - Given the attached sources... I am in the debugger.... ListenerMapImpl.JAVA public IActionListener getImplicitListener(IComponent component) { IActionListener listener; String generatedName = "do" + TapestryUtils.capitalize(component.getId()); try { listener = getListener(generatedName); } A breakpoint at "String generatedName = "do" + " never gets hit. Just providing field feedback.
        Hide
        Kenneth William added a comment -

        Ok, I am in the debugger stepping thru.

        Apologies for being unfamiliar with the code base. I am coming up to speed here.

        I am seeing Form components do not have the same listener support as other ones (ie. DirectLink)... so that explains why the "do" does not work for ProeprtySelection and this could be a mis-use. I see no listener support for PropertySelection or Selection for that matter... kinda wondering why.

        So my attempt to remedy my property issue may well better be served by operating the Form listener at least for now.

        That brings me back to the original issue of the RenderBlock which remains a mystery.

        Still looking striving for a workaround.

        Show
        Kenneth William added a comment - Ok, I am in the debugger stepping thru. Apologies for being unfamiliar with the code base. I am coming up to speed here. I am seeing Form components do not have the same listener support as other ones (ie. DirectLink)... so that explains why the "do" does not work for ProeprtySelection and this could be a mis-use. I see no listener support for PropertySelection or Selection for that matter... kinda wondering why. So my attempt to remedy my property issue may well better be served by operating the Form listener at least for now. That brings me back to the original issue of the RenderBlock which remains a mystery. Still looking striving for a workaround.
        Hide
        Kenneth William added a comment -

        BTW: the "do" prefix does not work on forms.

        Show
        Kenneth William added a comment - BTW: the "do" prefix does not work on forms.

          People

          • Assignee:
            Unassigned
            Reporter:
            Kenneth William
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development