How to handle ListenerInvocationNotAllowedException on invisible field

2018-11-18 Thread Vishal Popat
Hi,

I am using Wicket 7...

Recently I have been getting lots of the following exception
WARN RequestCycleExtra:347 - Handling the following exception: 
org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: 
Behavior rejected interface invocation. Component: [TextField [Component id = 
name]] Behavior: bidding.web.pages.search.RefineSearchFields$1@1471c2d 
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:248)
at 
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
...

I have the following panel being called from SearchResults web page:
RefineSearchFields refineFields = new RefineSearchFields("refineSearch", 
getPageParameters());
refineFields.setVisible(doSearch());
add(refineFields);

Within the RefineSearchFields Panel, I have:
final TextField nameField = new TextField("name", new 
PropertyModel(this, "name"));
OnChangeAjaxBehavior nameFieldBehavior = new OnChangeAjaxBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
//do stuff
}
};
nameField.add(nameFieldBehavior);
form.add(nameField);

I have found out why I get this exception... this is due to doSearch() 
returning false so the RefineSearchFields panel is not visible.
However the behaviour is still added to the field that is invisible.
What I would like, is to not execute/setup RefineSearchFields if its not 
visible.
What is the Wicket way to do this?

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



Set Double to more than 3 digits in AjaxEditableLabel

2018-08-16 Thread Vishal Popat
Hi,

In Wicket 6.29.0, I did the following within a class that extended 
AjaxEditableLabel

@Override
public IConverter getConverter(Class clazz) {
DoubleConverter converter = 
(DoubleConverter)DoubleConverter.INSTANCE;
NumberFormat format = converter.getNumberFormat(getLocale());
format.setMaximumFractionDigits(12);
converter.setNumberFormat(getLocale(), format);
return converter;
}

In Wicket 7.10.0, converter.setNumberFormat no longer exists. I am not sure 
what I need to do to increase the fraction digit to 12 as it is currently set 
to 3.

Any help would be appreciated.

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



wicketstuff-gmap3 marker label

2018-08-10 Thread Vishal Popat
Hi,

I was wondering if there is a way that gmap3 can use marker labels found here: 
https://developers.google.com/maps/documentation/javascript/reference/marker#MarkerLabel
 

I have looked at GMarkerOptions but its not in there…

Regards
Vishal

rememberMe not working in 6.19

2015-04-28 Thread Vishal Popat
Hi,

I am currently using wicket 6.16 and wanting to upgrade to 6.19.
I am using a LoginPanel using the rememberMe feature something like this:

IAuthenticationStrategy strategy = 
getApplication().getSecuritySettings().getAuthenticationStrategy();

if (WiaSession.get().signIn(getUsername(), 
getPassword())) {
if (rememberMe == true) {
System.out.println(rememberMe is true, 
so saving username and password);
strategy.save(getUsername(), 
getPassword());
}
else {
strategy.remove();
}

…

When using 6.19 and restarting the server (I am not sure if it happens without 
restarting i.e. waiting a long time), I have to log in again.
This does not happen with 6.16, 6.17 and 6.18, so it is difference in 6.18 and 
6.19 i.e. I am already logged in.

Does anyone know why this could be? Of course it could be possible that I have 
custom code that no longer works with 6.19.

Any hints would be appreciated!

Regards
Vishal


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



Url loading context twice

2014-09-23 Thread Vishal Popat
Hi,

I have a really strange one...
I am using 
Apache 2.x
Jboss 7 (EAP 6.3) and also tried in Tomcat 7
Wicket 6.16.0

I used the HelloWorld application here 
https://wicket.apache.org/learn/examples/helloworld.html

It works fine on http://localhost:8080/myapp

I add Apache virtual host with the following settings:

VirtualHost *:80
ServerName myapp.com

ProxyRequests Off
ProxyPreserveHost On
ProxyPassReverseCookiePath / /
ProxyPass / http://localhost:8080/myapp/
ProxyPassReverse / http://localhost:8080/myapp/
/VirtualHost

It works fine at the url http://localhost:8080/myapp and myapp.com

When I add the following to the HelloWorld.java file:

add(new Link(myLink) {
@Override
public void onClick() {
}
});

and the following in the HelloWorld.html
a wicket:id=myLinklink/a

And load http://localhost:8080/myapp it works fine.

However, if I load myapp.com I get a 404 as the url is changed to
http://myapp.com/myapp/;jsessionid=4A80C86C4F4BF1FAE13721E22F64350E?0

The body of the 404 page says the following:
HTTP Status 404 - /myapp/myapp/;jsessionid=4A80C86C4F4BF1FAE13721E22F64350E
type Status report
message /myapp/myapp/;jsessionid=4A80C86C4F4BF1FAE13721E22F64350E
description The requested resource is not available.
Apache Tomcat/7.0.30

Does anyone have any idea why this is happening?

Regards
Vishal

Page reloads continuously- AjaxLazyLoadPanel ?

2014-07-18 Thread Vishal Popat
Hi,

I have upgraded from 6.7.0 to 6.16.0 and now one of my pages continuously 
reloads.

On this page I have AjaxLazyLoadPanel which does not call getLazyLoadComponent 
method when using 6.16. It does call the constructor and does call 
getLoadingComponent method.

If I remove 6.16 jars and revert back to 6.7 it works fine.

I have had a look at the release notes but cant find anything that I may need 
to do to upgrade.

Anyone have any thoughts?

Regards
Vishal


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



wicket-select2 - adding sub categories seen in select2

2014-07-07 Thread Vishal Popat
Hi,

Is it possible to add categories to the lists in wicket-select2 like seen in 
http://ivaynberg.github.io/select2/#basics (The Time Zone labels)?
Also is it possible to add functionality like the flag images as well?

Regards
Vishal

Model data lost when calling target.add before onSubmit

2014-06-25 Thread Vishal Popat
Hi,

I have two panels added to a form. The idea is to create a step 1, step 2 type 
functionality where after clicking next on panel 1, it hides and shows Panel 2.

I have a checkbox on Panel 1
add(new CheckBox(single, new 
PropertyModel(SelectionPanel.this, single)));

and I have the following link
add(new AjaxLink(next) {
@Override
public void onClick(AjaxRequestTarget target) {
panel1.add(new AttributeModifier(style, new 
ModelString(display:none)));
target.add(panel1);

JQueryEffectBehavior effectBehavior = new 
JQueryEffectBehavior(#panel2, slide, slideOptions, 400);

target.appendJavaScript(effectBehavior.toString());
target.add(panel2);
}
});

I submit the form using AjaxButton on panel2 where I log out the PropertyModel 
data. The data shows the defaults for single in panel1 but is fine for any data 
in Panel2

I have narrowed it down to when I call target.add(panel1) in the onClick.

Does this call clear any Model data that has not been submitted?

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



Ajax Form Submit via jquery plugin / javascript

2014-06-10 Thread Vishal Popat
Hi,

I am using a jquery steps plugin which has the ability to change options.
One of the options I have is:
onFinished: function (event, currentIndex) {
var form = document.forms[selectionForm];
form.submit();
},

The javascript above submits the associated form. However I would like to 
submit the form via ajax. Normally I would use an AjaxButton for ajax 
processing but in this case I need something else. I have tried

selectionForm.add(new AjaxFormSubmitBehavior(selectionForm, onsubmit) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
log.debug(*** ajax form submit);
}
}

but this does not seem to work as the debug does not get outputted.
Additionally, the onSubmit Form version is called. Is there a way to stop this?

Let me know if should be using something else instead.

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



replaceWith method in Panel not working with AjaxLazyLoadPanel

2014-02-06 Thread Vishal Popat
Hi,

I have the following panel layout:

SomeOtherPanel
AjaxLazyLoadPanel
Panel loading with AjaxLazyLoadPanel
PanelToReplace

I am trying to replace PanelToReplace using replaceWith within 
IndicatingAjaxFallbackLink onClick method but I get the message:
Component '[EmptyPanel [Component id = additionalInfo]]' with markupid: 
'additionalInfo3e' not rendered because it was already removed from page.

Using the same approach, I have replaced SomeOtherPanel which is not inside 
AjaxLazyLoadPanel and it works fine.

So it seems I cannot use replaceWith when the Panel is within AjaxLazyLoadPanel.
Is there an alternative way to do this?

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



replaceWith method in Panel not working with AjaxLazyLoadPanel

2014-02-06 Thread Vishal Popat
Hi,

I have the following panel layout:

SomeOtherPanel
AjaxLazyLoadPanel
Panel loading with AjaxLazyLoadPanel
PanelToReplace

I am trying to replace PanelToReplace using replaceWith within 
IndicatingAjaxFallbackLink onClick method but I get the message:
Component '[EmptyPanel [Component id = additionalInfo]]' with markupid: 
'additionalInfo3e' not rendered because it was already removed from page.

Using the same approach, I have replaced SomeOtherPanel which is not inside 
AjaxLazyLoadPanel and it works fine.

So it seems I cannot use replaceWith when the Panel is within AjaxLazyLoadPanel.
Is there an alternative way to do this?

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



AjaxLazyLoadPanel loading asynchronously

2014-01-29 Thread Vishal Popat
Hi,

I have a situation where I have to make multiple REST calls to different 
suppliers.
I currently am using AjaxLazyLoadPanel to make these calls but loading time is 
very slow and not scaleable if I wanted to add more suppliers.

Is there a way to make AjaxLazyLoadPanel asynchronously?
I have read some older posts on the forum but not sure if they are the best way 
in Wicket 6.
Or is there an alternative approach?

Many thanks
Vishal


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



Gmap3 NullPointerException

2013-08-07 Thread Vishal Popat
Hi all,

I have set up this to report errors
this.getRequestCycleListeners().add(new AbstractRequestCycleListener() {  
@Override  
public IRequestHandler onException(RequestCycle cycle, Exception e) 
{
return new RenderPageRequestHandler(new PageProvider(new 
InternalError(e)));
}
});

One of the types of errors I am continuously being reported is below. I cannot 
understand how to recreate this or why it is occurring.
Any help would be appreciated.

I am using Gmap3 6.7.0 with Wicket 6.7.0
The line seems to refers to 
final String overlayId = 
request.getRequestParameters().getParameterValue(overlay.overlayId).toString().replace(overlay,
 );

Regards
VIshal

Method onRequest of interface org.apache.wicket.behavior.IBehaviorListener 
targeted at org.wicketstuff.gmap.GMap$OverlayListener@15f6c99 on component [Map 
[Component id = map]] threw an exception

org.apache.wicket.WicketRuntimeException: Method onRequest of interface 
org.apache.wicket.behavior.IBehaviorListener targeted at 
org.wicketstuff.gmap.GMap$OverlayListener@15f6c99 on component [Map [Component 
id = map]] threw an exception
at 
org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:268)
at 
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:241)
at 
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:247)
at 
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)
at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:854)
at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at 
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:254)
at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:211)
at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:282)
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:274)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)
at 
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor219.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at 
org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:258)
... 26 more
Caused by: java.lang.NullPointerException
at org.wicketstuff.gmap.GMap$OverlayListener.respond(GMap.java:957)
at 
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:617)
... 30 more

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



Gmap3 Geocoding shows Status 610

2013-03-16 Thread Vishal Popat
Hi,

I am using GMap3 from here: 
https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/gmap3-parent/gmap3.
 My Geocoding has recently stopped working and is showing Status 610. Google 
searching shows that this is all related to GMap2 being deprecated etc (There 
maybe other reasons why I am getting a 610).

However, when looking here: 
https://github.com/wicketstuff/core/blob/master/jdk-1.6-parent/gmap3-parent/gmap3/src/main/java/org/wicketstuff/gmap/geocoder/Geocoder.java.
 The encoding url looks like it is from Gmap v2 (see here: 
https://developers.google.com/maps/documentation/geocoding/index), which would 
explain the 610.

Am I mistaken?

Regards
Vishal

CSS load order in 6.x

2012-12-19 Thread Vishal Popat
Hi,

I have been migrating my website from 1.4.x to 6.x (6.3 at the moment).
Previously, I had my own css for YUI calendar which was loading correctly i.e. 
overwriting the YUI calendar version.
However, in 6.x it is no longer working. Checking the css, its seems to be 
loading calendar.css after my app.css.

Does anyone know of any way to change the order of the CSS.

One way I found was here 
http://javathoughts.capesugarbird.com/2009/06/css-load-order-with-wicket-and-external.html
However, 6.x adds the -ver-timestamp to the end which means that it loads two 
versions of the same css.

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



Two YUI DatePickers - use first date as basis for second date

2012-05-10 Thread Vishal Popat
Hi,

I have two YUI DatePickers where the date selected from the first DatePicker is 
the starting date (+1) for the second DatePicker.
I would ideally like to disable the dates prior to the first date as well.
The scenario is like checkin and checkout dates for hotels.

I cannot work out how to hook into the YUI javascript after the page has 
already loaded- assuming that is the best way to solve the problem.

Any help would be appreciated.

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



Latest version of TinyMCE

2011-10-21 Thread Vishal Popat
Hi all,

I am trying to get the latest version of TinyMCE... I have tried getting this 
from Maven like so:

dependency
groupIdorg.wicketstuff/groupId
artifactIdtinymce/artifactId
version1.4.18/version
/dependency

When looking at the version of TinyMCE it says its version 3.3. This version is 
quite old- latest version on TinyMCE website is 3.4.6.
The reason I need the latest version is that I am having major problems with 
IE9. Some Googling shows that it may be fixed in later versions.

I have seen jbrookover / core from GitHub which seems to have version 3.4.1. I 
am not sure whether this should be used and how to get it has a jar.

Any help would be appreciated.

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



Configure http and https with apache and jboss

2011-06-29 Thread Vishal Popat
I am trying to configure my web app to use http and https. I am using the 
following code in my Application class:
protected IRequestCycleProcessor newRequestCycleProcessor() {
HttpsConfig config = new HttpsConfig(80, 443);
return new MyHttpsRequestCycleProcessor(config);
}
WebPages such as Login, MyAccount etc have the @RequireHttps annotation.

I receive a 404 error when clicking on any page which have the @RequireHttps
A bit of debugging shows that the link its trying to access is 
https://myserver.com/myapp/login. I am trying to have my web application not 
have a context root i.e. the myapp should not be there.

I have looked at various threads which have slightly different scenarios 
without success. I have tried various other setup configs with different 
results.
Any help would be appreciated.

My setup is below:
Ubuntu 11.04
Apache/2.2.17 (Unix)
JbossAS 6
Wicket 1.4.15

I am using Apache as the front web server which I want to handle http and https
I have the following within my httpd.conf:

NameVirtualHost *:80
VirtualHost *:80
ServerName myserver.com:80

ProxyPass / http://myserver.com:8080/myapp/
ProxyPassReverse / http://myserver.com:8080/myapp/
/VirtualHost

NameVirtualHost *:443
VirtualHost *:443
ServerName myserver.com:443

SSLEngine On
SSLCertificateKeyFile /etc/ssl/private/server.key
SSLCertificateFile /etc/ssl/certs/server.crt

ProxyPass / http://myserver.com:8080/myapp/
ProxyPassReverse / http://myserver.com:8080/myapp/
/VirtualHost 

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



Cannot get current page from AjaxPagingNavigator

2010-11-09 Thread Vishal Popat
Hi all,

For some reason I cannot get the current page number. This is the relevant
part of my code:

 

PageableListView dataList = new PageableListView(dataList, results, 10) {

protected void populateItem(ListItem item) {

..

}

}

 

AjaxPagingNavigator pagination = new
AjaxPagingNavigator(navigator, dataList);

add(pagination);

 

Label currentPage = new Label(currentPage,
pagination.getPageable().getCurrentPage() + );

currentPage.setOutputMarkupId(true);

add(currentPage);

 

currentPage always returns 0.

I have also tried PagingNavigator with similar results.

 

Can anyone tell me what I have missed?

 

Regards

 

Vishal



RestartResponseAtInterceptPageException / redirectToInterceptPage with PageParameters

2010-10-28 Thread Vishal Popat
Hi all,

 

I am currently using wicket-auth-roles for all pages required authorization
which is working great.

I have a page where information is shown to the user but to see further
information they are required to login. This page uses
IndexedParamUrlCodingStrategy for the URL.

I haven't to found any way to use wicket-auth-roles to do this so I have
done the following:

 

add(new Link(login) {

@Override

public void onClick() {

throw new
RestartResponseAtInterceptPageException(new Login());

}

 

@Override

public boolean isVisible() {

return
!WiaSession.get().isSignedIn();

}

});

 

In the onSubmit code in the Login page I am using the

if (!continueToOriginalDestination()) {

 
setResponsePage(getApplication().getHomePage());

}

 

When clicking the login link it goes to the login page and then back to the
info page but without the PageParameters. Therefore the url is incorrect- it
has ?wicket:interface=:1:1::: and then some of my data is missing because it
requires the PageParameters.

 

How can pass the PageParameters through?

 

Many thanks

Vishal



Wicket Dynamic Navigation

2010-05-24 Thread Vishal Popat
Hi,

 

I am looking to build a 1-2 level left navigation where the first level is a
list of categories and the 2nd is a list of optional sub categories. 

 

I have tried various ways of designing this in wicket such as a DataView for
level 1 and another DataView for level 2 which is inside a wicket enclosure.
The problem I encountered here is that level 2 component already exists when
it come to outputting the 2nd item in level 1.

 

Any thoughts on design or an example (as I have yet been unable to find one)
would be greatly appreciated.

 

Regards

 

Vishal



URL coding strategies

2010-03-17 Thread Vishal Popat
Hi there, I have a question about URL coding strategies

 

I have decided to use IndexedParamUrlCodingStrategy for friendly URL's.

 

I have set PageParameters for this strategy in the following way:

 

PageParameters pageParameters = new PageParameters();

pageParameters.add(0, categoryName);

pageParameters.add(1, productName);

 

I have then created a Bookmarkable link like the following:

Link viewItem = new BookmarkablePageLink(viewItem, ProductInfo.class,
pageParameters);

 

What I really want to do is pass the Product object to the ProductInfo class
without it being visible in the URL. 

I would rather not have to query the database for data object that I already
have.

How can this be achieved?

 

Many thanks in advance.

 

Regards

Vishal