0

Annotation type not applicable to this kind of declaration

asked 2015-10-06 23:40:40 +0800

jawak gravatar image jawak
3 1

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"); }

}

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-07 07:00:21 +0800

chillworld gravatar image chillworld flag of Belgium
5367 4 9
https://github.com/chillw...

updated 2015-10-07 07:00:33 +0800

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.

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-10-06 23:40:40 +0800

Seen: 23 times

Last updated: Oct 07 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More