2011-12-22 82 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){ 
    ... 
    }