-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Messagebox.INFORMATION -----return an icon same as Messagebox.EXCLAMATION in zk-bin-prof-3.5.2.jar.
---------some codes to try-----------------------------------------------------------------------------------------------
Messagebox.show("are you sure to quit ?","info",16|32,Messagebox.INFORMATION); //got an exclamation icon.wrong!
Messagebox.show("are you sure to quit ?","info",16|32,Messagebox.EXCLAMATION); //got an exclamation icon.right!
alert("are you sure to quit ?"); //got an information icon. right!
-------------------------------------------------------------------------------------------------------------------------
i tried it on the ZK Demo , it's ok..
i download the zk-demo-3.5.2.zip and zk-bin-prof-3.5.2.zip, it is OK ...
maybe you can check your jar files' version...
Thanks to pay attention to my report.
I've tested about it again.
It's ok in zscript.
but if you use it in Classes that implements Composer or Extends GenericComposer or Extends GenericForwardComposer, it returns an wrong icon.
here's my code, which returns an Examation icon instead of Information icon.
--------in zul file------------------------------------------------
<button label="click" use="mypackage.Mybox" />
-------------------------------------------------------------------
--------in class Mybox---------------------------------------------
package mypackage;
import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.util.Composer;
import org.zkoss.zul.Button;
public class Mybox extends Button implements Composer{
public void onClick(){
try {
Messagebox.show("are you sure to quit?","title",16|32,Messagebox.INFORMATION);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
@Override
public void doAfterCompose(Component arg0) throws Exception {
// TODO Auto-generated method stub
}
}
-------------------------------------------------------------------
in this class,String org.zkoss.zhtml.Messagebox.INFORMATION = "z-msgbox z-msgbox-exclamation".
It seems there's sth wrong with Class Composer.
Composer is NOT a subclass of Component currently.
and the key attribute to declare a composer is "apply" not "use".
You should correct your code like this:
--------in zul file------------------------------------------------ <button label="click" apply="mypackage.MyComposer" /> --------in class Mybox--------------------------------------------- package mypackage; import org.zkoss.zhtml.Messagebox; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.util.Composer; import org.zkoss.zul.Button; public class MyComposer extends GenericForwardComposer{ public void onClick(){ try { Messagebox.show("are you sure to quit?","title",16|32,Messagebox.INFORMATION); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
hi,iantsai !
of course i've tryed codes like yours.It also returns an examation ico instead of information icon when request Messagebox.INFORMATION.
I posted above codes just to point out the bug comes from Composer not only its child class GenericForwardComposer.
thanks.
i've finnally got the reason.
It's a small bug in Class org.zkoss.zhtml.Messagebox, the satic final string: "org.zkoss.zhtml.Messagebox.INFORMATION" returns a wrong value.
if i use org.zkoss.zul.Messagebox, it will work right.
Asked: 2009-01-17 08:48:36 +0800
Seen: 366 times
Last updated: Apr 29 '09