-
FEATURED COMPONENTS
First time here? Check out the FAQ!
1 | initial version | |
HI Dennis ,
I think the questions I posted have some solutions.
By this link, the question "Page is already covered by another Data Binder. Cannot be covered by this Data Binder again. Page:z390" has the solution. Now by specifying "arg0" in AnnotateDataBinderInit in the modal window page. Just specify arg0 to self window object.
personForm.zul:
<window xmlns="<a href=" http:="" www.zkoss.org="" 2005="" zul"="">http://www.zkoss.org/2005/zul" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd" xmlns:a="http://www.zkoss.org/2005/zk/annotation" use="PersonFormWnd" border="normal" mode="highlighted" width="400px" closable="true" title="test"** id="personFormWnd"**>
personView.zul:
For my question2, passing objects to the create component, I use the auto-wire feature and update the value of the firstname/lastname textbox in the setSelected() method. It seems work now. But it seems missing the feature of data binder. And It is not work if uses binder.loadComponent(firstname) or binder.loadAll(). Do I miss this ?
import org.zkoss.zk.ui.Components; import org.zkoss.zk.ui.ext.AfterCompose; import org.zkoss.zkplus.databind.AnnotateDataBinder; import org.zkoss.zul.Textbox; import org.zkoss.zul.Window;
public class PersonFormWnd extends Window implements AfterCompose { private Person selected; ** private Textbox firstname; private Textbox lastname;
public void afterCompose() { // wire variables Components.wireVariables(this, this); // NO need to register onXxx event listeners // auto forward Components.addForwards(this, this); }
public void setSelected(Person person) {
this.selected = person;
* firstname.setValue(selected.getFirstName());
lastname.setValue(selected.getLastName());*
}
public Person getSelected() { return this.selected; } }
Thanks to all.
/Sand