2011-12-22 116 views
0

我使用这下面的Java和TML代码OnActionFromStart(挂毯)

的Java

private void onActionFromStart(int id) 
    { 
     // here im getting url for the particular overlay when onclick 
    } 

在TML

<t:loop t:source="videos" t:value="pojo"> 

     <t:actionlink t:id="start" t:context="${pojo.id}" rel="#overlay1"> 
      // here image tag 
     </t:actionlink> 
    </t:loop> 

我的问题是,当我得到它覆盖在图像上单击但onActionFromStart不会触发如何解决这个问题

回答

5

动作处理程序需要有默认或公共修饰符对于挂毯能够找到他们:

void onActionFromStart(int id) { 
    ... 
} 

而且看一看的文档的Component Events部分。

+0

我变了,什么也没发生 – FreshBits 2011-12-23 06:49:20

1

确保您重新加载服务器并刷新页面。

动作处理程序不应该是私人的。

尝试:

public void onActionFromStart(int id) { ... }

或者,使用Tapestry的anotations

@OnEvent(value = EventConstants.ACTION, component = "start") 
    public void start(int id){ 
    ... 
    }