Here is a way to reproduce it. Attached is a diff that simply adds the search
trails:SearchForm component to the list page.
To see the problem, log in and go to the 'List Team Years' menu link. In the
Year Start field enter a number. You will see that the list is correctly
filtered after 'search', but the form is cleared.
If you now enter a value in the 'Year End' field and click search, both 'Year
Start' and 'Year End' are filled with the same value. The result of the search
is correct.
IFAIK, the implementation of the SearchForm does not store what the user
entered. it just uses the data to create a criterion and then stores it in the
component 'value' field. Once the second form field (ie: 'Year End') is
processed (in a rewind), trails picks the same block object and sets the value
to the value entered in that field. Then, (when not rewinding but rendering),
trails draws the 'Year Start' field, using the same block that now contains the
value of the 'Year End' field.
Note: this is against trails svn trunk (1.2-SNAPSHOT).
Hope this helps ...
regards.
Alejandro Scandroli wrote:
> Hi Pablo
>
> I'm sorry but I'm not following. Did you mean that your search form
> it's always being cleared; it's never being cleared, or it's
> "randomly" being cleared.
> Can you show me your code?
>
> Saludos.
> Alejandro.
>
> On Mon, Jun 30, 2008 at 4:06 PM, Pablo Gra~na <
pablo.grana@...> wrote:
>> Hi there.
>>
>> I want the search form at the top of the list of entities. Is there an easy
>> way? I put the search component in the DefaultList.html, but it works
>> partially: when the form is recreated, the status of the search page fields
>> are correctly restored, neither cleaned: some values are overwriten with the
>> values in other forms.
>>
>> I know close to nothing about tapestry, but I imagine that the problem is in
>> the way the value for the input tag is handled: instead of storing the value
>> in the page, the search component is used to create a new criterion and
>> reused for the next input tag.
>>
>> I am now hacking a bit (with trails 1.1.1, unfortunately), but I will
>> probably spend some time to get this working for other projects using a
>> 1.2-SNAPSHOT. Any hints?
>>
>> thanks a lot.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>
http://xircles.codehaus.org/manage_email>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>
http://xircles.codehaus.org/manage_email>
>
--
Pablo Gra\~na
Chief Architect
Globant
Arg Office: +54 (11) 4109 1743
UK Office: +44 (20) 7043 8269 int 8043
US Office: +1 (212) 400 7686 int 8043
Index: src/main/webapp/WEB-INF/DefaultList.html
===================================================================
--- src/main/webapp/WEB-INF/DefaultList.html (revision 944)
+++ src/main/webapp/WEB-INF/DefaultList.html (working copy)
@@ -12,6 +12,9 @@
</ul>
</span>
+ <form jwcid="@trails:SearchForm">
+ </form>
+
<h1><span jwcid="@Insert" value="message:org.trails.i18n.list">
List</span> <span jwcid="@Insert" value="ognl:classDescriptor.pluralDisplayName"/>
</h1>
@@ -23,4 +26,4 @@
column="ognl:column"
/>
-</span>
\ No newline at end of file
+</span>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email