-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have created a ZUL page in Netbeans with a button and in the controller class @LISTEN is throwing the error message as "Annotation type not applicable to this kind of declartion". Appreciate your help. Below is the class snippet.
package com.controller;
import java.sql.SQLException; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.OperationException; import org.zkoss.zk.ui.select.SelectorComposer; import org.zkoss.zk.ui.select.*; import org.zkoss.zk.ui.select.annotation.Wire; import org.zkoss.zk.ui.select.annotation.Listen; import org.zkoss.zk.ui.util.Clients; import org.zkoss.zul.Label; import org.zkoss.zul.ListModel; import org.zkoss.zul.Radio; import org.zkoss.zul.Radiogroup; import org.zkoss.zul.Selectbox; import org.zkoss.zul.Textbox; import org.zkoss.zul.Window;
public class EditPage extends SelectorComposer<window> {
@Wire Textbox txtbusigroup;
@Wire Textbox txtmanufacturer;
@Listen("onclick=button#btnSaveProduct") Public void SaveData() { // Messagebox.show("OK"); }
}
You have some errors written.
@Listen("onclick=button#btnSaveProduct")
Public void SaveData() {
is completely wrong.
First of all Public
should be public
.
Second, events has always 3th character as capital, so onclick
should be onClick
.
Last one is an improvement of the css selector. If you work with id you can just use #btnSaveProduct
.
So it should be this :
@Listen("onClick=#btnSaveProduct")
public void SaveData() {
Greetz chill.
Asked: 2015-10-06 23:40:40 +0800
Seen: 23 times
Last updated: Oct 07 '15