Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8930981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:00:39+00:00 2026-06-15T09:00:39+00:00

I’m currently working on some project, using Apache Tapestry 5.3.6. I have issue using

  • 0

I’m currently working on some project, using Apache Tapestry 5.3.6. I have issue using t:loop component. Is there any way I can get selected item after loop finishes, and page is rendered?
What I need to achieve is: Let’s say I have loop like this:

<t:loop t:source="itemList" t:value="item">
    <t:actionlink id="something" context="item.ID"></t:actionlink>
</t:loop>

This will work fine. But if I move this actionlink into my own component, and pass this ID through my parameter, if I click, I always get the last item from list, and not the one which is clicked.

<t:loop t:source="itemList" t:value="item">
    <t:mycomponent myparameter="item.ID"></t:mycomponent>
</t:loop>

I tried putting formState=”iteration”, and puting ValueEncoder, but nothing helps.
Please, can anyone help me, and show me how to solve this issue, and get the selected item from the list.
Thanks in advance

Edit: Here is code of my component

public class Ocenjivanje 
{   
    @Parameter(required=true) 
    @Property 
    private int materijalID; 

    private Materijal materijal; 

    @Inject 
    private Session session; 

    @SessionState 
    private User user; 

    @CommitAfter 
    public Object unesiOcenu(int ocena) 
    { 
            Materijal m = (Materijal)session.createCriteria(Materijal.class).add(Restrictions.eq("materijalID", this.materijalID)).list().get(0); 
            Date d = new Date(); 
            Ocena o = new Ocena(); 
            o.setMaterijal(m); 
            o.setKorisnikID(this.user.getID()); 
            o.setDatumOcene(d); 
            o.setOcena(ocena); 
            session.save(o); 
            return this; 
    } 

    public void onActionFromJedan() 
    { 
            unesiOcenu(1); 
    } 

    public void onActionFromDva() 
    { 
            unesiOcenu(2); 
    } 

    public void onActionFromTri() 
    { 
            unesiOcenu(3); 
    } 

    public void onActionFromCetiri() 
    { 
            unesiOcenu(4); 
    } 

    public void onActionFromPet() 
    { 
            unesiOcenu(5); 
    }   
} 

<t:container 
      xmlns="http://www.w3.org/1999/xhtml"
  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"
  xmlns:p="tapestry:parameter">

  Oceni sadržaj:                 
            <t:actionlink t:id="jedan">1</t:actionlink>
            <t:actionlink t:id="dva">2</t:actionlink>
            <t:actionlink t:id="tri">3</t:actionlink>
            <t:actionlink t:id="cetiri">4</t:actionlink>
            <t:actionlink t:id="pet">5</t:actionlink>        

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:00:40+00:00Added an answer on June 15, 2026 at 9:00 am

    I’m not quite sure what you are trying to achieve but in any case you do not use the context you pass in in your actionlinks and use hardcoded int’s in stead. Change your action links to <t:actionlink t:id="tri" context="materijalID">3</t:actionlink> and change your event handlers to

    public void onActionFromJedan(int context) 
        { 
                unesiOcenu(context); 
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
I have thousands of HTML files to process using Groovy/Java and I need to
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.