福网

ZK AJAX 学习笔记第四天 使用Button

ZK AJAX 学习笔记
——Run Java and JSP on ZK

1.打开zk_jsp_java工程,在WebContent下新建button文件夹,并在其下新建文件button_onclick.jsp,内容如下:

<%@page language="java" pageEncoding="UTF-8"%>
<html xmlns:x="http://www.zkoss.org/2005/zul">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Button onClick()</title>
</head>

<body>
<x:groupbox mold="3d" width="50%">
	<x:caption label="Button onClick()"></x:caption>
    <x:window id="rootWindow">
		<x:button label="Click me" use="edu.bigc.zk.button.ButtonOnClick" />
       <br />
       <br />
    </x:window>
</x:groupbox>
</body>
</html>

2.在src 新建ButtonOnClick.java文件,内容如下:

package edu.bigc.zk.button;

import org.zkoss.zul.Button;
import org.zkoss.zul.Label;
import org.zkoss.zul.Window;

public class ButtonOnClick extends Button {
	public void onClick() {
		Window rootWindow = (Window) this.getSpaceOwner().getFellow("rootWindow");
		Window window = new Window();
		window.setBorder("normal");
		window.setWidth("100%");
		window.setHeight("100px");
		window.setTitle("Button Window");

		Label label = new Label("Hello, I am a new Window!");
		window.appendChild(label);

		rootWindow.appendChild(window);
	}
}

1. 运行结果

点击button前

点击button后

8 thoughts on “ZK AJAX 学习笔记第四天 使用Button

  • Everything published was actually very logical.

    However, what about this? what if you added a little content?
    I ain’t saying your content isn’t good, however suppose you added
    a post title to maybe grab folk’s attention? I mean ZK AJAX 学习笔记第四天
    使用Button | 来福日记 is kinda boring. You ought to peek at Yahoo’s front page and
    watch how they write news titles to get viewers to click.
    You might add a related video or a related pic
    or two to grab readers excited about everything’ve written. In my opinion, it could make your posts
    a little livelier.

  • I rarely comment, but after browsing some of the responses on ZK
    AJAX 学习笔记第四天 使用Button | 来福日记.
    I do have a couple of questions for you if you do not mind.
    Is it only me or do some of these responses appear as if they are written by brain dead individuals?
    :-P And, if you are writing at additional online social sites, I would like to follow anything new
    you have to post. Could you list of every one of all your shared sites like
    your twitter feed, Facebook page or linkedin profile?

  • Thanks for finally talking about >ZK AJAX 学习笔记第四天 使用Button |
    来福日记 <Loved it!

  • I don’t drop a leave a response, but after browsing a few of the remarks on ZK
    AJAX 学习笔记第四天 使用Button | 来福日记. I actually do have 2 questions for you
    if it’s okay. Could it be only me or do a few of these comments appear as if they are coming
    from brain dead individuals? :-P And, if you are posting at
    additional social sites, I’d like to keep up with
    you. Could you post a list of the complete urls of all your social networking pages like
    your linkedin profile, Facebook page or twitter feed?

  • Shenna说道:

    I rarely create responses, but i did some searching and wound up here ZK AJAX 学习笔记第四天 使用Button | 来福日记.
    And I do have 2 questions for you if you don’t mind. Is it only me or does it look like some of these remarks look like they are coming from brain dead folks?
    :-P And, if you are writing at other online social sites,
    I’d like to keep up with everything fresh you have to post.
    Would you list of every one of all your public
    pages like your Facebook page, twitter feed, or
    linkedin profile?

  • newgoodsforyou说道:

    Thanks for finally writing about >ZK AJAX 学习笔记第四天 使用Button | 来福日记
    <Loved it!

  • Thanks for finally writing about > ZK AJAX 学习笔记第四天 使用Button | 来福日记 < Loved it!

  • I comment when I appreciate a post on a site or if I
    have something to contribute to the discussion. Usually it is triggered by the passion displayed in the article I looked
    at. And on this article ZK AJAX 学习笔记第四天 使用Button | 来福日记.
    I was moved enough to drop a comment ;) I do have a few questions for you if
    you don’t mind. Is it simply me or do a few of these comments appear like left
    by brain dead people? :-P And, if you are posting at additional online sites, I’d like to keep up with
    you. Would you make a list all of your public pages like your linkedin profile, Facebook page or twitter feed?

    Also visit my website :: ΑσφάλειαΑυτοκινήτουOnline.Com

Download Fim indonesia terbaru进行回复 取消回复

电子邮件地址不会被公开。

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>