javazkzk-grid

How can I get this value in Java Class?


I have a form built with zk. In this part :

<template name="model:group">            
            <group label="@load(each)" value="@load(each)" onClick="@command('viewGraph')"/>      
        </template>

I call method viewGraph() and i want that this value is sent to this method.
In JavaScript i should have made this:

onClick="function(parameter);"

In this case I don't know how to do.

Also, if i can't set an id on label because label is in a cycle so, it must have 1 different id.

What's the solution?


Solution

  • To access the group inside of viewGraph, write

     <group label="@load(each)" value="@load(each)" onClick="@command('viewGraph', self=self)"/>
    
    public void viewGraph(@BindingParam("self") Integer self){
    //your code here
    }
    

    See this for more info.