ECLIPSE : HOW TO CALL JAVA FILE FROM ZUL FILE

See this image of Eclipse i have called EventController.java file from Events.zul file.

EventController.java———————–
package classes;
import java.util.List;
import org.zkoss.zul.*;
import org.zkoss.zk.ui.util.GenericForwardComposer;
import org.zkoss.zul.Listbox;

public class EventController extends GenericForwardComposer {
   
    /*
     *
     *
     */
   
    private static final long serialVersionUID = 1L;
    EventDAO eventDAO = new EventDAO();
    Event current = new Event();
    Listbox box;
    private Textbox name;
    private Intbox priority;

    public Event getCurrent() {
        return current;
    }

    public void setCurrent(Event current) {
        this.current = current;
    }

    public List getAllEvent() {
        return eventDAO.findAll();
    }

    public void onClick$add() {
        // insert into database       
        //System.out.println(“CURRENT NAME : ” + current.getName());
        //System.out.println(“CURRENT NAME : ” + current.getPriority());
        //Event newEvent = new Event(name.getText(), priority.getValue());
        eventDAO.insert(current);
    }

    public void onClick$update() {
        if (box.getSelectedItem() != null) {
            // update database
            eventDAO.update((Event) box.getSelectedItem().getValue());
        }
    }

    public void onClick$delete() {
        if (box.getSelectedItem() != null) {
            eventDAO.delete((Event) box.getSelectedItem().getValue());
        }
    }
   
}

Advertisements

About rajkirpal

i am a software engineer. and i have decent knowledge about java technologies like ANDROID, Servlet, Jsp, Struts, Hibernet, Spring, J2ME, Java Script, Ajax, JQuery, CSS. Further i am Preparing Easy understandable materials/documents upon the same java technologies and developing project in core java , advanced java and j2me , ANDROID as per the requirements Also designing the web sites and logos Thank You.
This entry was posted in J2EE. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s