Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 85500 invoked from network); 28 May 2010 18:03:40 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 May 2010 18:03:40 -0000 Received: (qmail 39810 invoked by uid 500); 28 May 2010 18:03:37 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 39774 invoked by uid 500); 28 May 2010 18:03:37 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 39765 invoked by uid 99); 28 May 2010 18:03:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 18:03:37 +0000 X-ASF-Spam-Status: No, hits=3.5 required=10.0 tests=AWL,EXTRA_MPART_TYPE,HTML_MESSAGE,MIME_BASE64_BLANKS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.97.132.74] (HELO postalmail-a2.g.dreamhost.com) (208.97.132.74) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 18:03:30 +0000 Received: from [192.168.10.154] (dsl-vlan475-66-18-239-235.nucleus.com [66.18.239.235]) by postalmail-a2.g.dreamhost.com (Postfix) with ESMTP id 83064111D91 for ; Fri, 28 May 2010 11:03:09 -0700 (PDT) Subject: Re: Struts url, a, and iterator tag behaviour From: Ken To: Struts Users Mailing List In-Reply-To: References: <1275007088.8536.53.camel@hpa527x-desktop> Content-Type: multipart/related; type="multipart/alternative"; boundary="=-7HP4SYMAn3KsC7l9gfqU" Date: Fri, 28 May 2010 11:58:44 -0600 Message-ID: <1275069524.23369.17.camel@hpa527x-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 --=-7HP4SYMAn3KsC7l9gfqU Content-Type: multipart/alternative; boundary="=-41TrtOOtV5oPkaorfAR5" --=-41TrtOOtV5oPkaorfAR5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit I still don't know what caused the issue. Using just the tag revealed that ${companyId} was null, producting tags. So I removed the id from the tag... and then embedded the the whole tag into the tag, and it works as expected... My issue is it isn't pretty. Okay just out of interest I added id="something" to and the html is back to ... So the id attribute causes the tag not to return a value and pushes the url onto the value stack as the name of the id attribute? The usage example here suggests this too: http://struts.apache.org/2.0.14/docs/a.html On Fri, 2010-05-28 at 08:34 -0400, Greg Lindholm wrote: > Use the "href" not the "value" attribute to specify the URL. > > Unless you are use the tag ajax support there is no reason to use the > tag just use the plain html tag > > like > > On Thu, May 27, 2010 at 8:38 PM, Ken wrote: > > I am trying to dynamically construct a url inside an iterator tag and > > use that result in an anchor. > > > > > > > namespace="/secure"> > > > > > > > > > > > > > > > > > value="cur.mco"/> > > > > > > > > This is producing the following html: > > (Showing two iterations only) > > > > > > > > 01 > > 24737 > > **** TEST ** FOCUS INDUSTRIAL **** > > **** TEST ** FOCUS INDUSTRIAL **** > > > > > > > > > > > > > > 01 > > 07777 > > ==================+** THE TEST COMPANY **+================================ > > CASH ** THE TEST COMPANY ** > > > > > > Any Ideas? > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org > For additional commands, e-mail: user-help@struts.apache.org > A E Rose Logo Ken McWilliams A E Rose Information Service Ltd. PO Box 3473 15A Alberta Avenue Spruce Grove AB T7X 3A7 Phone: 780 948-0012 Fax: 780 948-0052 E-Mail: ken.mcwilliams@aerose.com --=-41TrtOOtV5oPkaorfAR5 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 7bit I still don't know what caused the issue.  Using just the <a> tag revealed that  ${companyId} was null, producting <a href=""> tags.
So I removed the id from the <s:url> tag... and then embedded the the whole <s:url> tag into the <a> tag, and it works as expected...

<a href='<s:url action="companyDetails.action" namespace="/secure"><s:param name="group" value="log.id.mlgroup"/><s:param name="id" value="log.id.mlid"/></s:url>'>
   <s:property value="cur.mco"/>
</a>

My issue is it isn't pretty. Okay just out of interest I added  id="something" to <s:url> and the html is back to <a href=''>... So the id attribute causes the tag not to return a value and pushes the url onto the value stack as the name of the id attribute? 

The usage example here suggests this too: http://struts.apache.org/2.0.14/docs/a.html

On Fri, 2010-05-28 at 08:34 -0400, Greg Lindholm wrote:
Use the "href" not the "value" attribute to specify the URL.

Unless you are use the tag ajax support there is no reason to use the
<s:a> tag just use the plain html <a> tag

like <a href="${companyId}">

On Thu, May 27, 2010 at 8:38 PM, Ken <ken.mcwilliams@aerose.com> wrote:
> I am trying to dynamically construct a url inside an iterator tag and
> use that result in an anchor.
>
>        <s:iterator value="next">
>            <s:url  id="companyId" action="companyDetails.action"
> namespace="/secure">
>                <s:param name="group" value="log.id.mlgroup"/>
>                <s:param name="id" value="log.id.mlid"/>
>            </s:url>
>            <tr>
>                <td><s:property value="log.id.mlgroup"/></td>
>                <td><s:property value="log.id.mlid"/></td>
>                <td><s:property value="log.mlco"/></td>
>                <td><s:a value="%{companyId}"><s:property
> value="cur.mco"/></s:a></td>
>            </tr>
>        </s:iterator>
>
> This is producing the following html:
> (Showing two iterations only)
>
> <tr>
>
>                <td>01  </td>
>                <td>24737</td>
>                <td>****  TEST ** FOCUS INDUSTRIAL ****                                        </td>
>                <td><a>****  TEST ** FOCUS INDUSTRIAL ****     </a></td>
>            </tr>
>
>
>
>
>            <tr>
>                <td>01  </td>
>                <td>07777</td>
>                <td>==================+** THE TEST COMPANY  **+================================</td>
>                <td><a>CASH ** THE TEST COMPANY  **            </a></td>
>            </tr>
>
> Any Ideas?
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



A E Rose Logo






Ken McWilliams
A E Rose Information Service Ltd.
PO Box 3473


15A Alberta Avenue
Spruce Grove  AB
T7X 3A7
Phone:  780 948-0012
Fax:       780 948-0052
E-Mail:  ken.mcwilliams@aerose.com





--=-41TrtOOtV5oPkaorfAR5-- --=-7HP4SYMAn3KsC7l9gfqU--