How to add tooltips to dropdown choices

2017-09-26 Thread Lorne Malvo

Is there a simple way to insert a "title" HTML attribute into each option of
a DropDownChoice, in order to display a different tool tip with each choice?

I tried doing it simply by adding HTML in a ChoiceRenderer, but could not
get Wicket to not escape the HTML (can't call setEscapeModelStrings(false))
on a DropDownChoice. 

I also tried this...
https://stackoverflow.com/questions/12234738/wicket-dropdownchoice-titles-tooltips-for-options
... but it didn't work for me. First, that method was always calling
toString() on my model object to display the option, which is not what I
wanted, and I couldn't see a way to make that subclass non-generic.
Secondly, even if I had had the aforementioned problem, the tooltip didn't
even show up. 

Anyway to do this simply?

Thanks in advance!


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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



Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo

In this case yes, I do have to execute some logic server side anyway...

Thanks again.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-way-to-show-a-Are-you-sure-you-want-to-navigate-away-page-tp4674323p4674339.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: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
Ernesto thanks for the help.

I made it work by using an AjaxEventBehavior and adding it directly to the
page, like so:


AjaxEventBehavior event = new AjaxEventBehavior("beforeunload") {
@Override
protected void onEvent(final AjaxRequestTarget target) {
// do stuff here
target.appendJavaScript("alert('are you sure want to navigate
away?');");
}
}
add(event);

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-way-to-show-a-Are-you-sure-you-want-to-navigate-away-page-tp4674323p4674333.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: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
Hi Ernesto,

thanks - but that didn't quite work. Wicket Ajax Debug tells me "window" is
not in the DOM.

Any other ideas?

Thanks!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-way-to-show-a-Are-you-sure-you-want-to-navigate-away-page-tp4674323p4674331.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: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
Thanks Ernesto.

I tried using OnEventHeaderItem but can't quite get it to work. 
What would I use as a target?

Thanks!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-way-to-show-a-Are-you-sure-you-want-to-navigate-away-page-tp4674323p4674326.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



"Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
Does Wicket have any built in support for showing a "Are you sure you want to
navigate away from this page" message when the user navigates away from the
page?

What would be the simplest way to detect when a user is trying to navigate
away from a page, execute some Java code, and then show a "Are you sure you
want to navigate away..." message?

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-way-to-show-a-Are-you-sure-you-want-to-navigate-away-page-tp4674323.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 get rid off Feedback Messages?

2016-02-12 Thread Lorne Malvo
How would I use that to delete FeedbackMessages if clear() and markRendered()
don't work?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-get-rid-off-Feedback-Messages-tp4673577p4673580.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 get rid off Feedback Messages?

2016-02-12 Thread Lorne Malvo

I have a form with a large number of textfields I want to validate for
numerical input. However, if multiple fields fail validation, I want to
display only a single error message. 

I'm using an AjaxSubmitLink to submit my form.

To avoid displaying multiple error messages when multiple textfields fail
validation, I figure I could just delete all FeedbackMessages generated
during form validation, and then register my own FeedbackMessage.
However, it seems a thing of impossibility to delete (or mark as rendered)
existing FeedbackMessages.

I'm trying to do this in an AjaxSubmitLink's onError() method like this:

FeedbackCollector collector = new FeedbackCollector(form);
for (FeedbackMessage fm : collector.collect()) {
fm.markRendered();
}

But that doesn't do the trick. The feeback messages are found, but marking
them as rendered doesn't prevent them from being displayed. 
I also tried collector.collect().clear() but that also doesn't work. 

I also tried to do the same thing by overriding the form's onValidate()
method and deleting the messages right after validation, but that also
doesn't work.

How to get rid off these damn things?  :)

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-get-rid-off-Feedback-Messages-tp4673577.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 refer to a validator message for a textfield with a certain type

2016-02-12 Thread Lorne Malvo
Thank you!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-refer-to-a-validator-message-for-a-textfield-with-a-certain-type-tp4673555p4673578.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 refer to a validator message for a textfield with a certain type

2016-02-12 Thread Lorne Malvo
Thanks Martin!

So is a validator for, say a textfield with a certain type always referred
to as "IConverter" in properties files?

So, if I used the properties file next to my example class, say
com.MyExample.properties, would my path look like:

someComponent.someComponent.myTextField.IConverter=My Error Message

?

Or how would I would refer to the specific validator that validates integer
input?

Thanks again!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-refer-to-a-validator-message-for-a-textfield-with-a-certain-type-tp4673555p4673565.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 refer to a validator message for a textfield with a certain type

2016-02-11 Thread Lorne Malvo
Say I have a TextField like so:

TextField amountField = new TextField("someTextField",
someModel);
amountField.setType(Integer.class);

Where can I customize the error message when the user enters a value other
than an integer?

I generate the id for this text field on the fly, so I can't specify it in
the page class' .properties file (or can I? can I use wildcards in a
properties file?)
But it would be good enough in this particular case to simply change the
error message application-wide.
Howeveer, I can't find where the default message is generated.
Documentation refers to an application.properties file which I don't see to
have. 

(another way of doing this i thought of was to clear all error messages, and
then setting a new error message using the errror() method. however, the
clearing of error messages via FeedbackMessages.clear() does not seem to
work)

How do find the default message and edit it?

Thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-refer-to-a-validator-message-for-a-textfield-with-a-certain-type-tp4673555.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: Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior

2014-07-30 Thread Lorne Malvo

Hmmm I tried to figure out how to do that but I don't get it. 
I know to override updateAjaxAttributes() but I'm not sure how of the
meaning/function of the childSelector filter string. "The selector string
that filters the descendants" doesn't make too much sense, and I can't find
any other documentation. childSelector is not explained in the apache
wicket, either.
Would you mind elaborating?

Thank you!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxEventBehavior-tp4666782p4666806.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



Getting intermittent ListenerInvocationNotAllowedException with AjaxEventBehavior

2014-07-29 Thread Lorne Malvo

I'm getting an intermittent ListenerInvocationNotAllowedException when using
an AjaxEventBehaviors.
(stacktrace below)

This is my code:



WebMarkupContainer con = new WebMarkupContainer( "container" ) {
  @Override
  protected void onConfigure() {
super.onConfigure();
setVisible( someFlag);
  }
};
con.setOutputMarkupId( true );
con.setOutputMarkupPlaceholderTag( true );

con.add( new AjaxEventBehavior( "onmouseover" ) {
  @Override
  protected void onEvent(AjaxRequestTarget target) {
someFlag = true;
target.add( someLargerContainerComponent );
  }
} );

-

In the same panel, I have a second container with a second AjaxEventBehavior
attached. The code is the same as above, except that the behavior uses the
"onmouseout" event and the someFlag logic is reversed. The idea is that a
visible  is swapped out for another  on mouseover, and then the
swap is reversed on mouseout.
This works fine - except sometimes it doesn't. I would say the exception
occurs in about 1 out of 40 mouseovers/mouseouts. I can't discern a pattern. 
I've tested this in FF and Chrome on Windows and the problem occurs in both
browsers.


I did read
https://issues.apache.org/jira/browse/WICKET-5603
which seems to suggest that this problem has been fixed - but I guess it
hasn't. I'm using Wicket 6.16.0.
(the workaround suggested in the jira comments doesn't apply to me since my
behaviors are not attached to form components)

Any suggestions on how to catch this exception or for another workaround?

Thanks!

 

29 Jul 2014 15:44:21,930 WARN  RequestCycleExtra 342:

29 Jul 2014 15:44:21,932 WARN  RequestCycleExtra 343: Handling the following
exception
org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException:
Behavior rejected interface invocation. Component: [WebMarkupContainer
[Component id = myComponentId]] Behavior:
com.myDomain.web.myPanel$2@293d7910 Listener: [RequestListenerInterface
name=IBehaviorListener, method=public abstract void
org.apache.wicket.behavior.IBehaviorListener.onRequest()]
at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:237)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:250)
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:236)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:862)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
at
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
29 Jul 2014 15:44:21,933 WARN  RequestCycleExtra 344:


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Getting-intermittent-ListenerInvocationNotAllowedException-with-AjaxE

Re: Problem adding CSS resources in Wicket 6

2014-07-27 Thread Lorne Malvo

Thank you, Sven, very helpful!
However, unfortunately, the read and your suggestion didn't solve my
problem.
I'm upgrading a site from Wicket 4 to Wicket 6, and I thought that the
version numbers in the links to the CSS resources where the reason for
browsers not finding my CSS resources.
But it seems that was not the problem after all - the problem seems to be
that the URLs in the links to my CSS resources in the HTML headers are
pointing to different locations that they were before.
For example:

In Wicket 4, the link to a css stylesheet was rendered like this:



In Wicket 6, the link to the same resource (haven't changed anything about
the actual resource), the same link is rendered like this.



In Wicket 4, the stylesheet is found by browsers. In Wicket 6, it's not.

Would you know what the problem is here?

Thank you so much! It helps a lot.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-adding-CSS-resources-in-Wicket-6-tp4666749p4666759.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



Problem adding CSS resources in Wicket 6

2014-07-25 Thread Lorne Malvo
I have a problem adding CSS resources to Wicket pages in Wicket 6.

In my page class, I override renderHead() like this:

@Override
  public void renderHead(IHeaderResponse response) {
response.render( CssHeaderItem.forReference( new CssResourceReference(
MyFantasticPage.class, "MyFantasticPage.css" ) ) );
  }

However, in the resulting HTML code, the link to the CSS file is rendered by
Wicket like this:



The link is correct except for this portion: "-ver-1406325551266"

How can I prevent Wicket from adding this extra noise? This is happening in
my entire application for every single page. I've tried a few variations on
my renderHead() implementation, but no luck.

Thank you very much!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Problem-adding-CSS-resources-in-Wicket-6-tp4666749.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