Return-Path: Delivered-To: apmail-tiles-users-archive@locus.apache.org Received: (qmail 50401 invoked from network); 13 Feb 2008 20:28:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2008 20:28:52 -0000 Received: (qmail 34670 invoked by uid 500); 13 Feb 2008 20:28:46 -0000 Delivered-To: apmail-tiles-users-archive@tiles.apache.org Received: (qmail 34646 invoked by uid 500); 13 Feb 2008 20:28:46 -0000 Mailing-List: contact users-help@tiles.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tiles.apache.org Delivered-To: mailing list users@tiles.apache.org Received: (qmail 34637 invoked by uid 99); 13 Feb 2008 20:28:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2008 12:28:46 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [66.195.143.16] (HELO celerasystems.com) (66.195.143.16) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Feb 2008 20:28:02 +0000 X-Ninja-PIM: Scanned by Ninja X-Ninja-AttachmentFiltering: (no action) Content-class: urn:content-classes:message Subject: RE: Question re: attribute evaluation MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Wed, 13 Feb 2008 14:28:20 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <91BFD6F4E78D484182C3C055E2240EF025CBA3@titan.celerasystems.com> In-Reply-To: Thread-Topic: Question re: attribute evaluation Thread-Index: Achuexr1HmgZ1LunTA6JVJtOERyELwAAG2Sg References: <91BFD6F4E78D484182C3C055E2240EF025CB9F@titan.celerasystems.com> From: "Tim Kannenberg" To: X-Virus-Checked: Checked by ClamAV on apache.org Thanks, Antonio. Unfortunately, I think I chose an example which doesn't do a very good job of illustrating what I'm actually trying to accomplish, so let me try to explain more fully. I'm working on a Struts 2 web application which has several very similar pages, each of which contains some form fields used to capture search criteria, along with a table displaying a set of search results which match the specified criteria. Each page allows you to search for a different type of thing (cars, airplanes, boats, etc.), so the set of search criteria fields differs from one page to the next, as does the set of columns required to display the results. However, the basic layout is consistent from one page to the next, as is some of the markup for the results table (for example, odd-numbered elements are assigned a different class so they can easily be displayed with a different background color). I'd like to factor all of this common stuff (including the Struts tags and the tags) the out into my template, so that the individual pages which use that template only have to specify the appropriate set of form fields and the corresponding set of result row columns. In effect, I'm trying to do something analogous to having an abstract search page (the template) from which other pages (my individual search pages) can inherit, overriding only the pieces which control the rendering of the form fields and the result row columns. I tried to do this by having the individual pages specify the JSP text needed to render the form fields and the row content using , but it seems like that's not going to work, since the tag body is evaluated *before* the attribute is substituted into the template, not after. From reading about list attributes, I don't think that mechanism is going to do what I need, either. Is there a different approach I can use to achieve the desired results using Tiles? | -----Original Message----- | From: Antonio Petrelli [mailto:antonio.petrelli@gmail.com] | Sent: Wednesday, February 13, 2008 2:00 PM | To: users@tiles.apache.org | Subject: Re: Question re: attribute evaluation |=20 | I think I misunderstood your question, sorry. | I will try to answer better this time. |=20 | 2008/2/13, Tim Kannenberg : | > Because ${current} is undefined when the body content is evaluated, this | produces a table with 5 rows, each of which contains a single cell with | nothing in it. Is this an unavoidable consequence of the way Tiles works, | or is there a way to make Tiles treat the content of the putAttribute tag | as a literal string to be inserted into the template and then evaluated | along with the rest of the template page? |=20 | It is unavoidable, since the JSP page put inside the | tag body is evaluated *before* putting it as an | attribute value. | But in your particular case, why don't you use a list attribute? | http://tiles.apache.org/tutorial/advanced/list-attributes.html |=20 | Ciao | Antonio