Re: questions about CheckGroupSelector's behavior?

2012-01-13 Thread rolandpeng
yes, Sven.

it's the same issue of wicket-4279

https://issues.apache.org/jira/browse/WICKET-4279

I'll download wicket 1.5.4 after release, thank you!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/questions-about-CheckGroupSelector-s-behavior-tp4291374p4291630.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



questions about CheckGroupSelector's behavior?

2012-01-12 Thread rolandpeng
CheckGroupSelector is very useful to select all/none, but I found there is
one condition that the behavior of CheckGroupSelector becomes strange. I'm
not sure whether it's a bug or not.

When the CheckGroup contains more than two check items, it's fine for any
function.
But when it contains only one check item, CheckGroupSelector becomes checked
status on initial and the one check item is unchecked. I mean,if the
CheckGroupSelector is checked, all of the related check items should be all
checked as well.(only one check item or more)
No matter how many times I press the CheckGroupSelector, it seems
malfunctioned to affect the check item, unless I put two or more check items
on the list.

I have tried org.apache.wicket.examples.compref.CheckGroupPage(in wicket
example) and modify the ComponentReferenceApplication.getPersons() to only
one person. It's the same behavior as what I mentioned above.

The version of my wicket is 1.5.3.

Does anyone has comments for this situation?Thanks.

Roland.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/questions-about-CheckGroupSelector-s-behavior-tp4291374p4291374.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: IndicatingAjaxSubmitLink missing?

2011-02-03 Thread rolandpeng

It's really simple.Thanks for your hint!

public abstract class IndicatingAjaxSubmitLink extends AjaxSubmitLink
implements
IAjaxIndicatorAware {

private static final long serialVersionUID = 1L;
private final AjaxIndicatorAppender indicatorAppender = new
AjaxIndicatorAppender();

public IndicatingAjaxSubmitLink(String id) {
super(id, null);
add(indicatorAppender);
}

public IndicatingAjaxSubmitLink(String id, Form form) {
super(id, form);
add(indicatorAppender);
}

/**
 * @see
org.apache.wicket.ajax.IAjaxIndicatorAware#getAjaxIndicatorMarkupId()
 */
public String getAjaxIndicatorMarkupId() {
return indicatorAppender.getMarkupId();
}
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IndicatingAjaxSubmitLink-missing-tp3257456p3259444.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to do setResponsePage after alert message pressed ok?

2011-02-02 Thread rolandpeng

reply by myself. 
I use target.appendJavascript to solve my problem.

@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
onConfirm(target, form);
target.appendJavascript("alert('" + responseMessage_ + "');");
if (redirectPage() != null) {
target.appendJavascript("window.location.href='"
+ 
RequestCycle.get().urlFor(redirectPage()) + "';");
}
}

//redirectPage() is my customized method.

Roland.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-do-setResponsePage-after-alert-message-pressed-ok-tp3225482p3257458.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



IndicatingAjaxSubmitLink missing?

2011-02-02 Thread rolandpeng

Will any later version of wicket add IndicatingAjaxSubmitLink?
It seems this class was missed. Or any other Class similar to this
IndicatingAjaxSubmitButton, but only for link?
Thank you.

Roland.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/IndicatingAjaxSubmitLink-missing-tp3257456p3257456.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to do setResponsePage after alert message pressed ok?

2011-02-02 Thread rolandpeng

Excuse me,I have one more question.

After I press ajax onsubmit, decorateOnSuccessScript is always executed if
no exception occurred.

how do I stop and not to run decorateOnSuccessScript if the validator finds
some components validate failed?
(The onsubmit action will not be executed while validate error found,so
"insert successfully" alertion should not poped up.)

//how to skip this function while the validator found error?
@Override 
public CharSequence decorateOnSuccessScript(CharSequence script) { 
return script + "alert('insert successfully');" 
+ "window.location.href='" 
+ RequestCycle.get().urlFor(getBackPage())+ "';"; 
} 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-do-setResponsePage-after-alert-message-pressed-ok-tp3225482p3256856.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to do setResponsePage after alert message pressed ok?

2011-01-30 Thread rolandpeng

This is what I have done and that works fine.Thank you for your hint!

new AjaxCallDecorator() {
   @Override
   public CharSequence decorateScript(CharSequence script) {
return "if(!confirm('確定返回嗎?')){return false;};"
+ script;
}

@Override
public CharSequence decorateOnSuccessScript(CharSequence script) {
return script + "alert('返回成功!');"
+ "window.location.href='"
+ RequestCycle.get().urlFor(getBackPage())+ "';";
}
};

//getBackPage() is customized method by myself.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-do-setResponsePage-after-alert-message-pressed-ok-tp3225482p3248008.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Use Byte for CheckBox instead of Boolean

2011-01-26 Thread rolandpeng

Hi, this is YesNoCheckBox referred from previous posts. You can modify to fit
your need.

Roland.

--
public class YesNoCheckBox extends CheckBox {

public YesNoCheckBox(String id) {
super(id);
}

@Override
protected IModel initModel() {
return new CheckBoxYesNoModel(super.initModel());
}

private class CheckBoxYesNoModel implements IModel {
final IModel model;

public CheckBoxYesNoModel(IModel model) {
this.model = model;
}

public void detach() {
model.detach();
}

public Object getObject() {
return convertToComponent(model.getObject());
}

public void setObject(Object object) {
model.setObject(convertFromComponent(object));
}

protected Object convertToComponent(Object o) {
if (o.toString().equalsIgnoreCase("y"))
return true;
else
return false;
}

protected Object convertFromComponent(Object o) {
if (((Boolean) o) == true)
return "y";
else
return "n";
}
}
}
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Use-Byte-for-CheckBox-instead-of-Boolean-tp3236065p3238209.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to do setResponsePage after alert message pressed ok?

2011-01-20 Thread rolandpeng

Hi,
   After doing insert or update,I'd like to show some alert message,such as
"insert succeed. or update succeed.",and then do setResponsePage() to data
listing page.
   But I wonder how to do it under wicket. Would anyone give me some hint?
Thank you!

use case: insert or update-->alert message-->auto redirect to data listing
page.

Roland.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-do-setResponsePage-after-alert-message-pressed-ok-tp3225482p3225482.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: how to validate a ListView?

2010-12-15 Thread rolandpeng

That's really what I want!Thank you very much.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-ListView-tp3088381p3090257.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: how to validate a ListView?

2010-12-15 Thread rolandpeng

thanks for your reply.I'd like to try your second suggestion.

But after looking into AbstractFormValidator and other related examples, I
find that in my case I don't have any FormComponet to pass to
error(FormComponent fc) after validate. 

Is there any way or examples to validate without FormComponet?


-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-ListView-tp3088381p3090249.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



how to validate a ListView?

2010-12-14 Thread rolandpeng

Hi,
I've a Listview and the content of list is selected by a modal window.
The content of list should be validate to be required.
I've tried to create a custom validator , but I have no idea how to bind the
validator to the Listview.
Is it possible to validate the Listview as required before on submit?

Any adivce would be appreciated.Thank you.

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-ListView-tp3088381p3088381.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: how to validate a Label?

2010-12-13 Thread rolandpeng

oh, thank you for the hint.
I find a HiddenField in the form package. I'll try this component later.
Thank you again!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-Label-tp3086348p3086380.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: how to validate a Label?

2010-12-13 Thread rolandpeng

I've tried a Label + TextField/setVisible(false)/setRequired(true) as well. 
But as the TextField is hidden,the required validation also disable ,either.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-Label-tp3086348p3086378.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



how to validate a Label?

2010-12-13 Thread rolandpeng

Hi,
   I need to validate a readonly Label with required which displays some
selection from a modalwindow. But a Label is not a formcomponent , so I
cannot use setRequired() to fulfill my requirement. 
   If I use a TextField/setEnable(false)/setRequired(true) for instead, the
validator also become disable.

   Do anyone give me some advice? Thank you!

Roland.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/how-to-validate-a-Label-tp3086348p3086348.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to setResponsePage with a classname string parameter?

2010-08-03 Thread rolandpeng

oh,I've figured it out...I should cast it with generic class. thank you :)

try {
  setResponsePage((Class)Class.forName(pageClass));
} catch (ClassNotFoundException e) {
  e.printStackTrace();
}   


rolandpeng wrote:
> 
> I've also tried casting like this.
> setResponsePage((Page)Class.forName(pageClass));
> 
> but compiles error as well,the message below,
> The method setResponsePage(Class) in the type Component is not
> applicable for the arguments (Page)
> 
> 
> James Carman wrote:
>> 
>> Cast it?
>> 
>> On Aug 3, 2010 10:19 PM, "rolandpeng"  wrote:
>> 
> 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-setResponsePage-with-a-classname-string-parameter-tp2312847p2312878.html
Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How to setResponsePage with a classname string parameter?

2010-08-03 Thread rolandpeng

I've also tried casting like this.
setResponsePage((Page)Class.forName(pageClass));

but compiles error as well,the message below,
The method setResponsePage(Class) in the type Component is not applicable
for the arguments (Page)


James Carman wrote:
> 
> Cast it?
> 
> On Aug 3, 2010 10:19 PM, "rolandpeng"  wrote:
> 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-setResponsePage-with-a-classname-string-parameter-tp2312847p2312876.html
Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



How to setResponsePage with a classname string parameter?

2010-08-03 Thread rolandpeng

Hi,I want to redirect to a dynamic webpage,but I can only get the destination
as a fullpath classname string .The sample code like below,

String pageClass=task.getFormResourceName();

WebPage page=null;
if(pageClass.equals("com.sandbox.Page1")){
page=new Page1();
}else if(pageClass.equals("com.sandbox.practices.Page2")){
page=new Page2();
}else if(pageClass.equals("com.sandbox.practices.Page3")){
page=new Page3();
}
setResponsePage(page);

Is there any better way to replace this "if...else if" way? I have tried
Class.forname(pageClass),but compiles error and shows Bound mismatch,like
below,

Bound mismatch: The generic method setResponsePage(Class) of type
Component is not applicable for the arguments (Class). The
inferred type capture#3-of ? is not a valid substitute for the bounded
parameter .

Any suggestion is welcome,thank you.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-setResponsePage-with-a-classname-string-parameter-tp2312847p2312847.html
Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Render a Wicket page to a string for HTML email

2010-03-16 Thread rolandpeng

append some more information.
After tracing the sessionId in live sessions. I found several id listed
below:

sessionId1=3F329131CF155AEAA4FB383AD854E510 (normal format,created by login)
sessionId2=7cc3d77e_12766bcf8eb__7fff (strange,created by call render api)
sessionId3=7cc3d77e_12766bcf8eb__7ffd (strange,created by call reder api)

I use wicket 1.4.6 for developing.


rolandpeng wrote:
> 
> Thank you. I have tested your implementation class,but it still the
> same(live sessions increasing) while I call
> requestLogger.getLiveSessions(). Does anyone have other advice? Thank you
> so much in advance.
> 

-- 
View this message in context: 
http://old.nabble.com/Render-a-Wicket-page-to-a-string-for-HTML-email-tp20325702p27916505.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Render a Wicket page to a string for HTML email

2010-03-16 Thread rolandpeng

Thank you. I have tested your implementation class,but it still the same(live
sessions increasing) while I call requestLogger.getLiveSessions(). Does
anyone have other advice? Thank you so much in advance.


Xavier López-2 wrote:
> 
> Oops, forgot to mention that code has a pair of bugs in it. Here is the
> implementation i came up with :
> 
> public class RenderHTMLUtils {
> 
> public static String renderPage(Page page) {
> 
> //get the servlet context
> WebApplication application = (WebApplication)
> WebApplication.get();
> 
> ServletContext context = application.getServletContext();
> 
> //fake a request/response cycle
> MockHttpSession servletSession = new MockHttpSession(context);
> servletSession.setTemporary(true);
> 
> MockHttpServletRequest servletRequest = new
> MockHttpServletRequest(
> application, servletSession, context);
> MockHttpServletResponse servletResponse = new
> MockHttpServletResponse(
> servletRequest);
> 
> //initialize request and response
> servletRequest.initialize();
> servletResponse.initialize();
> 
> WebRequest webRequest = new ServletWebRequest(servletRequest);
> 
> BufferedWebResponse webResponse = new
> BufferedWebResponse(servletResponse);
> webResponse.setAjax(true);
> 
> WebRequestCycle requestCycle = new WebRequestCycle(
> application, webRequest, webResponse);
> 
> //requestCycle.setRequestTarget(new
> BookmarkablePageRequestTarget(pageClass, pageParameters));
> requestCycle.setRequestTarget(new PageRequestTarget(page));
> 
> try {
> requestCycle.getProcessor().respond(requestCycle);
> 
> if (requestCycle.wasHandled() == false) {
> requestCycle.setRequestTarget(new
> WebErrorCodeResponseTarget(
> HttpServletResponse.SC_NOT_FOUND));
> }
> requestCycle.detach();
> 
> } finally {
> requestCycle.getResponse().close();
> }
> 
> return webResponse.toString();
> }
> 
> }
> 
> Cheers,
> Xavier
> 

-- 
View this message in context: 
http://old.nabble.com/Render-a-Wicket-page-to-a-string-for-HTML-email-tp20325702p27916314.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Render a Wicket page to a string for HTML email

2010-03-16 Thread rolandpeng

That works , thank you!
But I have another question:
when I use requestLogger.getLiveSessions() to get the live sessions,the
number of sessions always increased after I call the render api.
Is it possible to render page of html source in the same session(not create
a new one)?
Thank you!


Scott Swank wrote:
> 
> Here is a largely equivalent class that I created.  It simply extends
> BaseWicketTester.
> 
> public class PageRenderer extends BaseWicketTester {
>   private final Locale locale;
> 
>   public PageRenderer(Locale locale) {
>   this.locale = locale;
>   }
> 
>   public PageRenderer() {
>   this.locale = null;
>   }
> 
>   private String renderStartPage() {
>   if (this.locale != null) {
>   getWicketSession().setLocale(locale);
>   }
> 
>   return getServletResponse().getDocument();
>   }
> 
>   public synchronized String render(Class pageClass) {
>   startPage(pageClass);
>   return renderStartPage();
>   }
> 
>   public synchronized String render(Class pageClass,
> PageParameters parameters) {
>   startPage(pageClass, parameters);
>   return renderStartPage();
>   }
> 
>   public synchronized String render(WebPage page) {
>   startPage(page);
>   return renderStartPage();
>   }
> 
> }
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Render-a-Wicket-page-to-a-string-for-HTML-email-tp20325702p27914411.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dropdownchoice missing (only when the page with Tinymce component) while scrolling the vertical scroll bar

2009-07-19 Thread rolandpeng

After checking the strange behavior with Sander,we find that in deployment
mode to run the quickstart will be okay.
This strange problem only took place in development mode.
Thanks Sander helping me to figure out this problem.
-- 
View this message in context: 
http://www.nabble.com/Dropdownchoice-missing-%28only-when-the-page-with-Tinymce-component%29-while-scrolling-the-vertical-scroll-bar-tp24455751p24563216.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dropdownchoice missing (only when the page with Tinymce component) while scrolling the vertical scroll bar

2009-07-16 Thread rolandpeng

oh,sorry it's my typo.
I've already corrected the post. no defense,pals. ^^


insom wrote:
> 
> When you called us wicket poles, I had just assumed that you were
> referring
> to the stumps that hold up the bails on a cricket wicket. However, I'm
> glad
> to see that we're also pals and not just poles ;)
> 
> On Thu, Jul 16, 2009 at 6:42 PM, rolandpeng  wrote:
> 
>>
>> hi wicket poles,
>>
>> Does anyone know who still works around the maintenance of the
>> wicket-tinymce in wicketstuff?
>> I'd like to pass my problem to the group.
>>
>> thank you.
>>
>> Roland.
>>
>>
>> rolandpeng wrote:
>> >
>> > thanks for your teach,igor.
>> >
>> > I've find the way to build the quickstart with tinymce included.
>> > The quickstart project is attached,and can be run with 'mvn jetty:run'
>> .
>> > the url: http://localhost:8080/quickstart
>> >
>> > my quickstart brief:
>> > there are two webpages,one with ajaxlink and the other with
>> non-ajaxlink.
>> > You can find that when scrolling the vertical bar in the page with
>> > ajaxlink.The dropdownchoice is dispeared(or blured).But non-ajaxlink
>> page
>> > won't.
>> >
>> > I don't know how to issue this problem in the right way,so I just post
>> > this quickstart here.
>> > I would be very obliged if Igor or someone can help to resolve this
>> > problem.thank you.
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Dropdownchoice-missing-%28only-when-the-page-with-Tinymce-component%29-while-scrolling-the-vertical-scroll-bar-tp24455751p24527355.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Dropdownchoice-missing-%28only-when-the-page-with-Tinymce-component%29-while-scrolling-the-vertical-scroll-bar-tp24455751p24527864.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dropdownchoice missing (only when the page with Tinymce component) while scrolling the vertical scroll bar

2009-07-16 Thread rolandpeng

hi wicket poles,

Does anyone know who still works around the maintenance of the
wicket-tinymce in wicketstuff?
I'd like to pass my problem to the group.

thank you.

Roland.


rolandpeng wrote:
> 
> thanks for your teach,igor.
> 
> I've find the way to build the quickstart with tinymce included.
> The quickstart project is attached,and can be run with 'mvn jetty:run' .
> the url: http://localhost:8080/quickstart
> 
> my quickstart brief:
> there are two webpages,one with ajaxlink and the other with non-ajaxlink.
> You can find that when scrolling the vertical bar in the page with
> ajaxlink.The dropdownchoice is dispeared(or blured).But non-ajaxlink page
> won't.
> 
> I don't know how to issue this problem in the right way,so I just post
> this quickstart here.
> I would be very obliged if Igor or someone can help to resolve this
> problem.thank you.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Dropdownchoice-missing-%28only-when-the-page-with-Tinymce-component%29-while-scrolling-the-vertical-scroll-bar-tp24455751p24527355.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



RE: DropDownChoice missing in IE6 when has AJAX

2009-07-15 Thread rolandpeng

I also get the same problem,do anyone have the resolution about this?

I've made a quickstart to simulate this problem as the attachment.

I will be very obliged if someone can help to find the resolution.Thanks.

Roland.


Alex.Borba wrote:
> 
> Thank you for the suggestion, most of you are saying that apparently this 
> issueis related to something else but wicket, but is curious how the 
> problem is easily "fixed" just deleting the Wicket Modal Window which is 
> related to a button. 
> 
> I'm working on the quickstart now, while some friends are trying to find 
> anything unusual in JS, CSS or other stuff.
> 
http://www.nabble.com/file/p24508564/quickstart.rar quickstart.rar 
-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-missing-in-IE6-when-has-AJAX-tp21484545p24508564.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dropdownchoice missing (only when the page with Tinymce component) while scrolling the vertical scroll bar

2009-07-14 Thread rolandpeng

thanks for your teach,igor.

I've find the way to build the quickstart with tinymce included.
The quickstart project is attached,and can be run with 'mvn jetty:run' .
the url: http://localhost:8080/quickstart

my quickstart brief:
there are two webpages,one with ajaxlink and the other with non-ajaxlink.
You can find that when scrolling the vertical bar in the page with
ajaxlink.The dropdownchoice is dispeared(or blured).But non-ajaxlink page
won't.

I don't know how to issue this problem in the right way,so I just post this
quickstart here.
I would be very obliged if Igor or someone can help to resolve this
problem.thank you.





igor.vaynberg wrote:
> 
> you have to add wicketstuff maven2 repo to the pom, and if that does
> not contain the snapshot you have to check out all the sources of
> tinymce and mvn install so the artifacts go into your local repo.
> 
> -igor
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 
http://www.nabble.com/file/p24492531/quickstart.rar quickstart.rar 
-- 
View this message in context: 
http://www.nabble.com/Dropdownchoice-missing-%28only-when-the-page-with-Tinymce-component%29-while-scrolling-the-vertical-scroll-bar-tp24455751p24492531.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Dropdownchoice missing (only when the page with Tinymce component) while scrolling the vertical scroll bar

2009-07-14 Thread rolandpeng

thanks igor,

I have added dependency below into pom.xml

  org.wicketstuff
  tinymce
  1.4-SNAPSHOT


but after execute 'maven package',I got error below:
--
Project ID: null:tinymce:jar:null

Reason: Cannot find parent: org.wicketstuff:tinymce-parent for project:
null:tin
ymce:jar:null for project null:tinymce:jar:null
--
I have referred to the pom.xml in
wicket-stuff\trunk\wicketstuff-core\tinymce-parent\tinymce-examples
as the attachment.
Could you please give me more hints to add the correct dependency?thanks.

By the way,I found the key problem issued in my original post.
That's any ajaxbehavior component(ajaxlink for example) will lead
DropdownChoice compoent missing while scrolling vertical bar.
After I moved all the ajaxbehavior component (or replace to non-ajaxbehavior
component,submitlink,for example) in the webpage,then the DropdownChoice
works fine.

I will make a quickstart to simulate this strange situation,but at first I
need to know how to include tinymce.jar into my pom.xml . thanks again.

roland.


igor.vaynberg wrote:
> 
> add it as a dependency in the pom file.
> 
> -igor
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 
http://www.nabble.com/file/p24490974/pom.xml pom.xml 
-- 
View this message in context: 
http://www.nabble.com/Dropdownchoice-missing-%28only-when-the-page-with-Tinymce-component%29-while-scrolling-the-vertical-scroll-bar-tp24455751p24490974.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Going back to a previous URL?

2009-07-08 Thread rolandpeng

hi cu uwe,

I've tried your mentioned method below to setResponsePage for keeping state
in BookmarkablePage.
But it doesn't work.

here is my implemented codes:
--
PageParameters oParam=new PageParameters();
oParam.add("product_oid",String.valueOf(oProduct.getOid()));
DetailProduct targetPage=new DetailProduct();
targetPage.setBackPage(this.getPage());
targetPage.setMetaData(HybridUrlCodingStrategy.PAGE_PARAMETERS_META_DATA_KEY,
oParam);
setResponsePage(targetPage);
--
I assumed DetailProduct(PageParameters params) will be called internally.
But the process still called DetailProduct() instead of 
DetailProduct(PageParameters params).
So some exception happened.

Could you please give me more information about that and any suggestions?

Roland.

Uwe Schäfer wrote:
> 
> classacts schrieb:
> 
>> Let's say I'm on bookmarkable Page1.class with PageParameters
>> {"id=1,0=foo,1=bar"} and I click on a BookmarkablePage link to ConfigPage
>> PageParameters {"id=1"} and do some stuff like submit forms on that page,
>> etc... How can I place a Back button or link to the Page1.class with its
>> PageParameters intact?  The mechanism should also would even if the
>> originating page isn't Page1.class but any arbitrary class.
> 
> *IF* i get this correctly, we do that by using HybridURLEncoding and 
> passing pageInstances around.
> linking to bookmarkable urls with additional state can be done with smth 
> like:
> 
> Page targetPage = new BookmarkablePageClass(...
> // the add state to it, like
> targetPage.setPageToNavigateBackTo(getWebPage());
> // and add params for the URL
> targetPage.setMetaData(HybridUrlCodingStrategy.PAGE_PARAMETERS_META_DATA_KEY, 
> new PageParameters(...));
> setResponsePage(targetPage);
> 
> cu uwe
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Going-back-to-a-previous-URL--tp19254601p24387309.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Could TinyMCE Upload pictures or files

2009-06-04 Thread rolandpeng

I meet this requirement,too.
anyone have solutions?
or any comments will be welcome. thanks.


Nino.Martinez wrote:
> 
> Add a upload field to the page.. And reference that from tinymce?
> 
> Mead wrote:
>> Hello All,
>>Could TinyMCE upload pictures or files?
>> I run the example of TinyMCE(from wicket stuff), and find the demo there
>> could not upload any files or images, but only insert the URL of picture 
>>
>> Best regards, 
>>   
>> Mead
>> xb...@126.com
>> 2008-01-28
>>
> 

-- 
View this message in context: 
http://www.nabble.com/Could-TinyMCE-Upload-pictures-or-files-tp15132568p23881231.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Possible to retrieve previous page from PageMap

2009-03-12 Thread rolandpeng

great! after delare a ineer class below:
class PageIdVersion {
public int id;
public int version;
public PageIdVersion last;
}
then the track function works.


John Patterson wrote:
> 
> 
>   // must declare hash map because meta data must be serializable
>   private MetaDataKey> lastPageIdVersionKey
> = new MetaDataKey>() {};
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Possible-to-retrieve-previous-page-from-PageMap-tp20861106p22488568.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Possible to retrieve previous page from PageMap

2009-03-12 Thread rolandpeng

thanks john,
but how to define variable lastPageIdVersionKey?
It seems you missed the statement in the original post. thanks.

Roland.


John Patterson wrote:
> 
>   HashMap lastPageMap =
> getSession().getMetaData(lastPageIdVersionKey);   
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Possible-to-retrieve-previous-page-from-PageMap-tp20861106p22479144.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: tinymce question: how to switch default language?

2009-03-07 Thread rolandpeng

Got it.I missed the part of constructor.
The way to set my lanuage works.
--
TinyMCESettings settings=new
TinyMCESettings(TinyMCESettings.Theme.advanced,Language.tw);
--

thank you!


pointbreak+wicketstuff wrote:
> 
> The default language is based on the locale of the session. Which is
> normally what you want (because it is influenced by the browser
> preferences, and the same as what wicket is using). You can override it
> by passing a language as second argument in the TinyMCESettings
> constructor.
> 

-- 
View this message in context: 
http://www.nabble.com/tinymce-question%3A-how-to-switch-default-language--tp22388584p22394058.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



tinymce question: how to switch default language?

2009-03-07 Thread rolandpeng

There are many languages supported by tinymce.
The default lanuage of my tinymce is "zh".
--
TinyMCESettings settings = new TinyMCESettings(
TinyMCESettings.Theme.advanced);
Language language = settings.getLanguage();
System.out.println(language.name());
==>
result: zh
--
I can't find setLanguage() method in TinyMCESettings class.
How to switch the language from "zh" into "en",or any others? 

Thanks.

Roland.
-- 
View this message in context: 
http://www.nabble.com/tinymce-question%3A-how-to-switch-default-language--tp22388584p22388584.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: WYSIWYG component

2009-03-06 Thread rolandpeng

I use wicket 1.4-rc2 and meet the same problem.

you can download jazzy.jar here to solve the exception.
http://sourceforge.net/projects/jazzy/

then all the program works.

-- 
View this message in context: 
http://www.nabble.com/WYSIWYG-component-tp22214000p22369491.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: A Bug in SqlDateConverter?

2009-02-22 Thread rolandpeng

igor, I'm not sure if the datepickers removed will make the error go away.

Since all of my programs have been refactorred from java.sql.Date to
java.util.Date,I can't try your assumption in my application now.

Anyway,now I adopt java.util.Date instead of java.sql.Date,and everything
goes well.
Thanks.

roland.
--

does the error go away if you do not add the datepickers?

-igor


-- 
View this message in context: 
http://www.nabble.com/A-Bug-in-SqlDateConverter--tp22145097p22156014.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: A Bug in SqlDateConverter?

2009-02-22 Thread rolandpeng

Here you are. 
html and java files are both uploaded as attachments for your reference.
Data type of the date field in my entity is also java.sql.Date.

By the way,instead of above method,
Now I have a try to change all the date type of Date from java.sql.Date into
java.util.Date.
Then everything is fine.

--

If input is null and the field is not required converters do not run.
Show us your code.

-Igor

http://www.nabble.com/file/p22155201/Bulletin.java Bulletin.java 
http://www.nabble.com/file/p22155201/ModifyBulletin.java ModifyBulletin.java 
http://www.nabble.com/file/p22155201/ModifyBulletin.html ModifyBulletin.html 
-- 
View this message in context: 
http://www.nabble.com/A-Bug-in-SqlDateConverter--tp22145097p22155201.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: A Bug in SqlDateConverter?

2009-02-22 Thread rolandpeng

Thanks for your quick response.

Now I have updated my lib into wicket1.4-rc2.

Rerun the date input functoin and I have another exception.(the date field
is not empty)

--
Caused by: java.lang.ClassCastException: java.util.Date
at
org.apache.wicket.util.convert.converters.SqlDateConverter.convertToObject(SqlDateConverter.java:43)
at
org.apache.wicket.util.convert.converters.SqlDateConverter.convertToObject(SqlDateConverter.java:28)
at
org.apache.wicket.markup.html.form.FormComponent.convertInput(FormComponent.java:1297)
--

Is this also another bug of SqlDateConverter?
Or I need to modify any code of my program?
Thank you.
-- 
View this message in context: 
http://www.nabble.com/A-Bug-in-SqlDateConverter--tp22145097p22145456.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



A Bug in SqlDateConverter?

2009-02-22 Thread rolandpeng

Now I use wicket 1.3.5.

There is a date field in my webpage.and it is not required.
The date class type is java.sql.date

But I alway have a NullPointerException while the input of this optional
field is empty.
the exceptions below:
Caused by: java.lang.NullPointerException
at
org.apache.wicket.util.convert.converters.SqlDateConverter.convertToObject(SqlDateConverter.java:35)
at
org.apache.wicket.markup.html.form.FormComponent.convertInput(FormComponent.java:1211)
...

How do I fix this problem?
Now I must set a date into my date filed  to pass the program.But this field
is not required.
Thanks.
-- 
View this message in context: 
http://www.nabble.com/A-Bug-in-SqlDateConverter--tp22145097p22145097.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: set the feedback message to js function

2008-10-31 Thread rolandpeng

Excuse me. I don't get it clearly.
What does 'hack up a small js' do and please discribe more about
"scriptaculous toaster", or any url for reference?
Thank you very much.

roland.


Nino.Martinez wrote:
> 
> I would hack up a small js component for this case, and "poke" it with 
> the message, sort of maybe what I've done with the scriptaculous toaster.
> 
> rolandpeng wrote:
>> thank you,igor
>>
>> here is my try and that work. 
>> But how could I display message only in alert dialog instead of both
>> feedback panel and alert dialog?
>> thanks.
>>
>> roland.
>> --
>> HeaderContributor alert = new HeaderContributor(
>>   new IHeaderContributor() {
>> public void renderHead(IHeaderResponse response) {
>>   FeedbackMessages messages = Session.get().getFeedbackMessages();
>>  for (Iterator iter = messages.iterator(); iter.hasNext();) {
>>  FeedbackMessage message = (FeedbackMessage) iter.next();
>>  response.renderOnLoadJavascript("alert(\""+ message.getMessage() +
>> "\");"); 
>>  }
>> }
>> });  
>>   
>> User oUser = new User();
>> cFeedback = new FeedbackPanel("feedback");
>> cFeedback.setOutputMarkupId(true);
>> cFeedback.add(alert);
>>
>> --
>>
>> igor.vaynberg wrote:
>>   
>>> renderhead(IHeaderResponse r) {
>>>   for (FeedbackMessage m:messages) {
>>> r.renderonloadjavascript("alert('"+m.toString()+"');");
>>>   }
>>> }
>>>
>>> -igor
>>>
>>>
>>> On Dec 31, 2007 11:25 PM, JohnSmith333 <[EMAIL PROTECTED]>
>>> wrote:
>>> 
>>>> Thanks for your kindly reply and help.
>>>> I have read the FeedbackPanel  source code and know the use of
>>>> HeaderContributor.
>>>> But I still don't know how to do . Could you or anyone help me more?
>>>> Thanks!
>>>>
>>>> HeaderContributor.forJavaScript("/js/default.js");
>>>>
>>>>
>>>>
>>>>
>>>> igor.vaynberg wrote:
>>>>   
>>>>> see how feedbackpanel is implemented, you can write a header
>>>>> contributor to spit feedback messages to a js function
>>>>>
>>>>> -igor
>>>>>
>>>>>
>>>>> On Dec 31, 2007 7:51 AM, JohnSmith333 <[EMAIL PROTECTED]>
>>>>> 
>>>> wrote:
>>>>   
>>>>>> Could anyone tell me how to set the feedback message to js function
>>>>>>   
>>>> like
>>>>   
>>>>>> alert("some txt must set")?
>>>>>> thanks!
>>>>>> --
>>>>>> View this message in context:
>>>>>>
>>>>>>   
>>>> http://www.nabble.com/set-the-feedback-message-to-js-function-tp14558865p14558865.html
>>>>   
>>>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>>>
>>>>>>
>>>>>> -
>>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>>
>>>>>>
>>>>>>   
>>>>> -
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>> 
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/set-the-feedback-message-to-js-function-tp14558865p14565041.html
>>>>
>>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>> -
>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>
>>>>
>>>>   
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>> 
>>
>>   
> 
> -- 
> -Wicket for love
> 
> Nino Martinez Wael
> Java Specialist @ Jayway DK
> http://www.jayway.dk
> +45 2936 7684
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/set-the-feedback-message-to-js-function-tp14558865p20276176.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: set the feedback message to js function

2008-10-30 Thread rolandpeng

thank you,igor

here is my try and that work. 
But how could I display message only in alert dialog instead of both
feedback panel and alert dialog?
thanks.

roland.
--
HeaderContributor alert = new HeaderContributor(
  new IHeaderContributor() {
public void renderHead(IHeaderResponse response) {
  FeedbackMessages messages = Session.get().getFeedbackMessages();
 for (Iterator iter = messages.iterator(); iter.hasNext();) {
FeedbackMessage message = (FeedbackMessage) iter.next();
response.renderOnLoadJavascript("alert(\""+ message.getMessage() + 
"\");"); 
 }
}
}); 
 
User oUser = new User();
cFeedback = new FeedbackPanel("feedback");
cFeedback.setOutputMarkupId(true);
cFeedback.add(alert);

--

igor.vaynberg wrote:
> 
> renderhead(IHeaderResponse r) {
>   for (FeedbackMessage m:messages) {
> r.renderonloadjavascript("alert('"+m.toString()+"');");
>   }
> }
> 
> -igor
> 
> 
> On Dec 31, 2007 11:25 PM, JohnSmith333 <[EMAIL PROTECTED]> wrote:
>>
>> Thanks for your kindly reply and help.
>> I have read the FeedbackPanel  source code and know the use of
>> HeaderContributor.
>> But I still don't know how to do . Could you or anyone help me more?
>> Thanks!
>>
>> HeaderContributor.forJavaScript("/js/default.js");
>>
>>
>>
>>
>> igor.vaynberg wrote:
>> >
>> > see how feedbackpanel is implemented, you can write a header
>> > contributor to spit feedback messages to a js function
>> >
>> > -igor
>> >
>> >
>> > On Dec 31, 2007 7:51 AM, JohnSmith333 <[EMAIL PROTECTED]>
>> wrote:
>> >>
>> >> Could anyone tell me how to set the feedback message to js function
>> like
>> >> alert("some txt must set")?
>> >> thanks!
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/set-the-feedback-message-to-js-function-tp14558865p14558865.html
>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/set-the-feedback-message-to-js-function-tp14558865p14565041.html
>>
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/set-the-feedback-message-to-js-function-tp14558865p20260428.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



a way to show jfreechart tooltip on the image

2008-10-09 Thread rolandpeng

This is my sample code to to show jfreechart tooltip on the image.
The key is to override onComponentTagBody() and use replaceComponentTagBody().

Just post my tried to share.
There should be better way to tune the performance.

--source code  here--
public class JFreeChartImage extends NonCachingImage {

private String imageMapId;
private int width;
private int height;
private JFreeChart chart;
private ChartRenderingInfo info = new ChartRenderingInfo(
new StandardEntityCollection());

public JFreeChartImage(String id, String imageMapId,
int width, int height) {
// super(id, new Model(defaultImage));
super(id);
this.imageMapId = imageMapId;
this.width = width;
this.height = height;
}

@Override
protected Resource getImageResource() {
Resource imageResource = null;
final JFreeChart chart = getChart();
imageResource = new DynamicImageResource() {
@Override
protected byte[] getImageData() {
ByteArrayOutputStream stream = new 
ByteArrayOutputStream();
try {
if (chart != null) {
info.clear();

ChartUtilities.writeChartAsPNG(stream, chart, width,
height, info);
}
} catch (IOException e) {
System.out.println("IOException: " + 
e.getMessage());
}
return stream.toByteArray();
}
};  return imageResource;
}

@Override
protected void onComponentTagBody(MarkupStream markupStream,
ComponentTag openTag) {
JFreeChart chart = getChart();
if (chart == null)
return;
ByteArrayOutputStream stream = new ByteArrayOutputStream();
try {
if (chart != null) {
info.clear();
ChartUtilities.writeChartAsPNG(stream, chart, 
width, height,
info);
}
} catch (IOException e) {
System.out.println("IOException: " + e.getMessage());
}
System.out.println(ChartUtilities.getImageMap(imageMapId, 
info));
replaceComponentTagBody(markupStream, openTag, ChartUtilities
.getImageMap(imageMapId, info));
}

public JFreeChart getChart() {
return chart;
}

public void setChart(JFreeChart chart) {
this.chart = chart;
}

}


Public email at Nabble.com


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



a way to show jfreechart tooltip on the image

2008-10-08 Thread rolandpeng

This is my sample code to to show jfreechart tooltip on the image. 
The key is to override onComponentTagBody() and use
replaceComponentTagBody(). 
the parameter imageMapId used in ChartUtilities.getImageMap(imageMapId,
info); should also 
markded in html file ,for example :imageMapId="tooltip",then  

remember that the   tag must leave open tag,not close tag( ,
else replaceComponentTagBody() will not work.

Just post my tried code to share. 
There should be better way to tune the performance. 

--source code  here-- 
public class JFreeChartImage extends NonCachingImage { 

private String imageMapId; 
private int width; 
private int height; 
private JFreeChart chart; 
private ChartRenderingInfo info = new ChartRenderingInfo( 
new StandardEntityCollection()); 

public JFreeChartImage(String id, String imageMapId, 
int width, int height) { 
// super(id, new Model(defaultImage)); 
super(id); 
this.imageMapId = imageMapId; 
this.width = width; 
this.height = height; 
} 

@Override 
protected Resource getImageResource() { 
Resource imageResource = null; 
final JFreeChart chart = getChart(); 
imageResource = new DynamicImageResource() { 
@Override 
protected byte[] getImageData() { 
ByteArrayOutputStream stream = new
ByteArrayOutputStream(); 
try { 
if (chart != null) { 
info.clear(); 
   
ChartUtilities.writeChartAsPNG(stream, chart, width, 
height,
info); 
} 
} catch (IOException e) { 
System.out.println("IOException: " +
e.getMessage()); 
} 
return stream.toByteArray(); 
} 
}; return imageResource; 
} 

@Override 
protected void onComponentTagBody(MarkupStream markupStream, 
ComponentTag openTag) { 
JFreeChart chart = getChart(); 
if (chart == null) 
return; 
ByteArrayOutputStream stream = new ByteArrayOutputStream(); 
try { 
if (chart != null) { 
info.clear(); 
ChartUtilities.writeChartAsPNG(stream,
chart, width, height, 
info); 
} 
} catch (IOException e) { 
System.out.println("IOException: " +
e.getMessage()); 
} 
System.out.println(ChartUtilities.getImageMap(imageMapId,
info)); 
replaceComponentTagBody(markupStream, openTag,
ChartUtilities 
.getImageMap(imageMapId, info)); 
} 

public JFreeChart getChart() { 
return chart; 
} 

public void setChart(JFreeChart chart) { 
this.chart = chart; 
} 

} 
-- 
View this message in context: 
http://www.nabble.com/a-way-to-show-jfreechart-tooltip-on-the-image-tp19873571p19873571.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]