I'm sorry about don't provide all the informations. I'll try to explain a
little more.

I'm trying to generate a <s:a>  tag for each item in a list, but I have to
send a param when click on this <s:a> link.
This is why I use <s:url> to do that. My code seems like that:

  <s:iterator value="type">
    <tr>
      <td>
        <s:url id="url%{id}" action="Variables">
           <s:param name="typeId" value="id"></s:param>
        </s:url>
        <s:a id="tipo${module}%{id}" 
          name="tipo${module}%{id}" 
          href="%{url}" <!-- Here is my problem. I need lots of url, but not
with the same id, because my param changes
                                        according to the type I'm itereting
-->
          cssClass="listItem" 
          notifyTopics="changeTypeListItem" 
          theme="ajax"  
          showLoadingText="false"><s:property value="dsc"/></s:a>
      </td>
    </tr>
  </s:iterator>

I was doing this with <c:forEach>, but some changes in my project made me
change from <c:forEach> to <s:iterator>. When using forEach I could just use
EL, but with iterator, I can't (I think I can't, but not sure).
How could I do that in this case?

Thanks in advance,

Felipe


Laurie Harper wrote:
> 
> Why do you need to make the url-id unique on each loop iteration? Have 
> you tried simply writing something like
> 
>    <c:forEach ...>
>      <s:url id="url" .../>
>      <s:a href="%{#id}" .../>
>      ...
> 
> You should, on the other hand, provide a unique value for the 'id' (and 
> possibly 'name) attribute on the s:a tag as those get passed through to 
> the rendered HTML.
> 
> If you're still having trouble, try describing what exactly you are 
> trying to achieve, and posting a more complete code sample of how you're 
> trying to achieve it.
> 
> L.
> 
> Felipe Rodrigues wrote:
>> I'm sorry, but I didn't got it.
>> When I pass in a parameter, I'll send it to the destiny. That is not what
>> I
>> want. I only want to identify the url according to the id. This code is
>> inside a foreach, that renders lots of urls.
>> 
>> How would be that in this case?
>> 
>> Thanks,
>> 
>> Felipe
>> 
>> 
>> Martin Gainty wrote:
>>> You'll need to pass in a parameter for id such as this
>>> <s:url value="UpdateHome.selectPlant">
>>>     <s:param name="id" value="%{id}" />
>>> </s:url>
>>>
>>> M--
>>> This email message and any files transmitted with it contain
>>> confidential
>>> information intended only for the person(s) to whom this email message
>>> is
>>> addressed.  If you have received this email message in error, please
>>> notify
>>> the sender immediately by telephone or email and destroy the original
>>> message without making a copy.  Thank you.
>>>
>>> ----- Original Message ----- 
>>> From: "Felipe Rodrigues" <[EMAIL PROTECTED]>
>>> To: <user@struts.apache.org>
>>> Sent: Tuesday, May 08, 2007 3:31 PM
>>> Subject: OGNL question
>>>
>>>
>>>> Hi,
>>>>
>>>> How could i do that
>>>>
>>>> <s:url id="setUsina${id}" action="UpdateHome!selectPlant">
>>>>      </s:url>
>>>>      <s:a id="any"
>>>>        name="any"
>>>>        href="%{setUsina${id}}"  theme="ajax">Link</s:a>
>>>>
>>>> changing EL by OGNL?
>>>> The especific part  href="%{setUsina${id}}" . I tried
>>>> href="%{setUsina(#id)}" but didn't work.
>>>>
>>>> Thanks,
>>>>
>>>>
>>>> Felipe
>>>>
>>>>
>>>> -- 
>>>> View this message in context: 
>>>> http://www.nabble.com/OGNL-question-tf3711762.html#a10382481
>>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/OGNL-question-tf3711762.html#a10393352
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to