Anda di halaman 1dari 1

APLIKASI CRUD ZK FRAMEWORK

Bima Palma Nugraha, PT

Menggunakan Modal Window


index.zul
<?page title="CRUD Application"?>
<window title="CRUD with Modal Window" border="normal" width="400px"
apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('com.bimapalma.vm.MainWindow')">
<div>
<button label="New PO" onClick="@command('openNew')" />
</div>
<listbox>
<listhead>
<listheader label="PO Title" sort="auto" />
<listheader label="PO Number" sort="auto" />
</listhead>
<listitem>
<listcell label="" />
<listcell label="" />
</listitem>
</listbox>
</window>

com.bimapalma.vm.MainWindow.java
package com.bimapalma.vm;
import org.zkoss.bind.annotation.Command;
import org.zkoss.zk.ui.Executions;
public class MainWindow {
@Command
public void openNew() {
Executions.createComponents("newwindow.zul", null, null);
}
}

newwindow.zul
<?page title="New Window" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="New Window" border="normal" mode="modal" width="400px"
height="300px" position="center" closable="true"
action="show: slideDown; hide: slideUp">
Halooooooo!
</window>
</zk>

Anda mungkin juga menyukai