简体   繁体   中英

OnActionFromStart(Tapestry)

I'm using this following java and tml code

java

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

In 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>

my problem is when i click on the image it get overlayed but onActionFromStart is not triggered how to solve this problem

Action handlers need to have default or public modifiers for Tapestry to be able to find them:

void onActionFromStart(int id) {
    ...
}

Also take a look at the Component Events section of the docs.

Make sure you reload the server and refresh the page.

Action handlers should not be private.

Try:

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

Or, using tapestry's anotations

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM