0

Bug Report: about Messagebox icon

asked 2009-01-17 08:48:36 +0800

evpole gravatar image evpole
481 2

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!
-------------------------------------------------------------------------------------------------------------------------

delete flag offensive retag edit

11 Replies

Sort by » oldest newest

answered 2009-01-19 01:29:20 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

i tried it on the ZK Demo , it's ok..

link publish delete flag offensive edit

answered 2009-01-20 02:06:25 +0800

evpole gravatar image evpole
481 2

yes,it works correctly in zk demo online.but really appears in zk-bin-prof-3.5.2 and zk-studio 0.9.0/0.9.2.

link publish delete flag offensive edit

answered 2009-01-20 08:29:23 +0800

RyanWu gravatar image RyanWu
533 2
about.me/flyworld

updated 2009-01-20 08:33:39 +0800

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...

link publish delete flag offensive edit

answered 2009-01-21 01:49:42 +0800

evpole gravatar image evpole
481 2

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.

link publish delete flag offensive edit

answered 2009-01-22 03:27:25 +0800

iantsai gravatar image iantsai
2755 1

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(); 
} 
} 


} 

link publish delete flag offensive edit

answered 2009-01-24 02:23:59 +0800

evpole gravatar image evpole
481 2

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.

link publish delete flag offensive edit

answered 2009-02-02 04:16:35 +0800

iantsai gravatar image iantsai
2755 1

I see, and sorry for late responding. I have a vacation last week.

I'll try your case in my env.

link publish delete flag offensive edit

answered 2009-03-03 06:44:45 +0800

evpole gravatar image evpole
481 2

not at all,i'm late,too.
^_^
Thanks very much!

link publish delete flag offensive edit

answered 2009-04-23 09:32:55 +0800

evpole gravatar image evpole
481 2

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.

link publish delete flag offensive edit

answered 2009-04-24 06:56:29 +0800

iantsai gravatar image iantsai
2755 1

Thanks for your research!

I already post a BUG for this issue:
https://sourceforge.net/tracker/?func=detail&aid=2780038&group_id=152762&atid=785191

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-01-17 08:48:36 +0800

Seen: 366 times

Last updated: Apr 29 '09

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More