Hi,

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); 
    }

That should provide the right context to the right event handler.

Good luck,
Joost

On Dec 3, 2012, at 4:22 PM, dodjavola wrote:

> There is no form around loop.
> 
> Here is the 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>       
> </t:container>
> 
> 
> 
> 
> 
>       
> 
> 
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Get-selected-item-from-loop-tp5718460p5718464.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

Reply via email to