Re: Injecting proxy services in page.

2013-06-06 Thread harmoniaa
If you are already using XmlWebApplicationContext (extends
AbstractRefreshableWebApplicationContext like
AnnotationConfigWebApplicationContext) that is probably not the issue, but
you can set the context class in your web.xml like this:

servlet
...
init-param
param-namecontextClass/param-name
param-value
   
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
/param-value
/init-param
/servlet




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Injecting-proxy-services-in-page-tp4659209p4659252.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 6 and FilterToolbar

2013-06-06 Thread Marcel Hoerr
Hey folks,

i am currently trying to use a FilterToolbar with a DataTable (wicket 6). 
Everything works fine without the FilterToolbar (the filering of course not), 
if the FilterToolbar is added via dataTable.add(new FilterToolbar(dataTable, 
form, dataProvider)); wicket throws the following exception:

Last cause: The component(s) below failed to render. Possible reasons could be 
that: 1) you have added a component in code but forgot to reference it in the 
markup (thus the component will never be rendered), 2) if your components were 
added in a parent container then make sure the markup for the child container 
includes them in wicket:extend.

1. [FilterToolbar [Component id = 5]]
2. [ListView [Component id = filters]]
3. [ListItem [Component id = 0]]
4. [NoFilter [Component id = filter]]
...

Do i have to add something else to get the FilterToolbar working? While using 
other toolbars (NavigationToolbar, HeaderToolbar) there is no need to adjust 
anything else than simple add them to the DataTable.

Best regards

marcel

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



Re: WicketTester CDI and WicketApplication

2013-06-06 Thread David Beer

Hi Cedric

Thanks for this most useful with some searching th internet I managed to 
get the test class running with testng as well. One thing to note 
though, if you don not use Conversations you need to add the following 
to the new CdiConfiguration, .setPropagation(NONE).


Thanks

David
On 02/06/13 18:57, Cedric Gatay wrote:

Hi David,
you can have a look at the base CDI enabled test class we're using at
code-troopers in the following gist :
https://gist.github.com/CedricGatay/5694293

Regards,

__
Cedric Gatay (@Cedric_Gatay http://twitter.com/Cedric_Gatay)
http://code-troopers.com | http://www.bloggure.info | http://cedric.gatay.fr


On Sat, Jun 1, 2013 at 6:15 PM, David Beer david.m.b...@gmail.com wrote:


Hi Cedric

Thanks for the reply I will take a look at Arquillian and see how I can
use it. Any guides are helpful especially when used with wicket.

Thanks

David

On 01/06/13 16:20, Cedric Gatay wrote:


Hi,

I usually use Arquillian to deploy a CDI context in my tests which require
injection to work (often it happens for pages tests). When testing
individual components it is easy to manually inject references (either
via package visibility or via PowerMock's Whitebox for instance).

Regards,

__
Cedric Gatay (@Cedric_Gatay 
http://twitter.com/Cedric_**Gatayhttp://twitter.com/Cedric_Gatay

)

http://code-troopers.com | http://www.bloggure.info |
http://cedric.gatay.fr


On Sat, Jun 1, 2013 at 5:13 PM, David Beer david.m.b...@gmail.com
wrote:

  Hi All

I am having difficulty finding information on how I can create a CDI
context for use in my tests. Is there some kind of way of creating a mock
cdi environment for testing. Currently my tests fail trying to retrieve
the
CDI Bean Manager as this is normally controlled by the Web Application
Container.

Do I need to create a mock Web Application class which simulates a dummy
Bean Manager? Is there any guides specific to Wicket?

Thanks

David

--**
--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.orghttp://apache.org
users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org




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





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



Re: Wicket ID sometimes changes, sometimes stays the same

2013-06-06 Thread eugenebalt
Solution # 2 (setMarkupId) worked for us.

But Sven's Solution # 1 did not. Even after adding id=datefield
wicket:id=datefield to input type=text, the output still contained the
attribute id=datefield7 or something similar.

# 2 works for us, but I'm just wondering, is there something preventing # 1
from working?

There are no Ajax events on this TextField. Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ID-sometimes-changes-sometimes-stays-the-same-tp4659238p4659255.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 6 and FilterToolbar

2013-06-06 Thread Sven Meier

Hi Marcel,

adding a FilterForm/FilterToolbar to the DataTablePage in 
wicket-examples works fine here.


Time to create a quickstart?

Sven

On 06/06/2013 12:47 PM, Marcel Hoerr wrote:

Hey folks,

i am currently trying to use a FilterToolbar with a DataTable (wicket 6). 
Everything works fine without the FilterToolbar (the filering of course not), 
if the FilterToolbar is added via dataTable.add(new FilterToolbar(dataTable, 
form, dataProvider)); wicket throws the following exception:

Last cause: The component(s) below failed to render. Possible reasons could be that: 
1) you have added a component in code but forgot to reference it in the markup (thus 
the component will never be rendered), 2) if your components were added in a parent 
container then make sure the markup for the child container includes them in 
wicket:extend.

1. [FilterToolbar [Component id = 5]]
2. [ListView [Component id = filters]]
3. [ListItem [Component id = 0]]
4. [NoFilter [Component id = filter]]
...

Do i have to add something else to get the FilterToolbar working? While using 
other toolbars (NavigationToolbar, HeaderToolbar) there is no need to adjust 
anything else than simple add them to the DataTable.

Best regards

marcel

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




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



Re: Wicket ID sometimes changes, sometimes stays the same

2013-06-06 Thread Sven Meier
Check Component#getMarkupIdImpl(), it gets the id from the markup if no 
id was explicitly set.
Perhaps you're trying to access the markup id before the component is 
attached to a page?


Sven

On 06/06/2013 05:30 PM, eugenebalt wrote:

Solution # 2 (setMarkupId) worked for us.

But Sven's Solution # 1 did not. Even after adding id=datefield
wicket:id=datefield to input type=text, the output still contained the
attribute id=datefield7 or something similar.

# 2 works for us, but I'm just wondering, is there something preventing # 1
from working?

There are no Ajax events on this TextField. Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-ID-sometimes-changes-sometimes-stays-the-same-tp4659238p4659255.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




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



Quick Start - Project not created

2013-06-06 Thread rjain15
Hi

I am newbie to Apache Wicket .. sorry about a very basic question. 

As per the quick start guide 
http://wicket.apache.org/start/quickstart.html

If I try to execute the following command 

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.8.0
-DgroupId=example -DartifactId=test
-DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false

I expect wicket to create the directory structure. 


If I execute it from say C:\tmp , nothing gets created and mvn exits saying
unable to find pom.xml

If I execute it from C:\apache-wicket (which is where I have installed
wicket) it creates the folder

If I execute it from C:\apache-wicket\archetypes\ -- again same issue,
nothing gets created. 

So my very basic/newbie question is , do I have to exceute this command from
the place where I have installed Wicket. 

I am just following the instructions on the quick start website, and it
doesn't tell me where to execute this from. 

Or do I need to include the wicket jar files in classpath?

Thanks, 
Rajesh




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Quick-Start-Project-not-created-tp4659258.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: Quick Start - Project not created

2013-06-06 Thread Paul Bors
c:\srcmvn archetype:generate -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.8.0
-DgroupId=com.example -DartifactId=wicket-webapp -DinteractiveMode=false

c:\srccd wicket-webapp

c:\src\wicket-webappmvn eclipse:eclipse

Then open your eclipse and import the project from c:\src\wicket-webapp
where wicket-webapp is your artifactId.
You should have a package called com.example. To run the quick start:

c:\src\wicket-webappmvn jetty:run

Then load the URL in your browser.

~ Thank you,
  Paul Bors

-Original Message-
From: rjain15 [mailto:rjai...@yahoo.com] 
Sent: Thursday, June 06, 2013 3:18 PM
To: users@wicket.apache.org
Subject: Quick Start - Project not created

Hi

I am newbie to Apache Wicket .. sorry about a very basic question. 

As per the quick start guide
http://wicket.apache.org/start/quickstart.html

If I try to execute the following command 

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.8.0
-DgroupId=example -DartifactId=test
-DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false

I expect wicket to create the directory structure. 


If I execute it from say C:\tmp , nothing gets created and mvn exits saying
unable to find pom.xml

If I execute it from C:\apache-wicket (which is where I have installed
wicket) it creates the folder

If I execute it from C:\apache-wicket\archetypes\ -- again same issue,
nothing gets created. 

So my very basic/newbie question is , do I have to exceute this command from
the place where I have installed Wicket. 

I am just following the instructions on the quick start website, and it
doesn't tell me where to execute this from. 

Or do I need to include the wicket jar files in classpath?

Thanks,
Rajesh




--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Quick-Start-Project-not-created-t
p4659258.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



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



RE: Quick Start - Project not created

2013-06-06 Thread Paul Bors
Forgot to mention, the default TCP/IP port of your web-app when you use the
Jetty MOJO (http://mojo.codehaus.org/jetty-maven-plugin/usage.html) is 8080
unless you changed it.

Thus the URL to load in your browser is http://localhost:8080 

You should get familiar with the Maven build system at:
http://maven.apache.org/

I recommend you also read the free Wicket user guide:
http://wicket.apache.org/learn/books/

~ Thank you,
  Paul Bors

-Original Message-
From: Paul Bors [mailto:p...@bors.ws] 
Sent: Thursday, June 06, 2013 4:25 PM
To: users@wicket.apache.org
Subject: RE: Quick Start - Project not created

c:\srcmvn archetype:generate -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.8.0
-DgroupId=com.example -DartifactId=wicket-webapp -DinteractiveMode=false

c:\srccd wicket-webapp

c:\src\wicket-webappmvn eclipse:eclipse

Then open your eclipse and import the project from c:\src\wicket-webapp
where wicket-webapp is your artifactId.
You should have a package called com.example. To run the quick start:

c:\src\wicket-webappmvn jetty:run

Then load the URL in your browser.

~ Thank you,
  Paul Bors

-Original Message-
From: rjain15 [mailto:rjai...@yahoo.com]
Sent: Thursday, June 06, 2013 3:18 PM
To: users@wicket.apache.org
Subject: Quick Start - Project not created

Hi

I am newbie to Apache Wicket .. sorry about a very basic question. 

As per the quick start guide
http://wicket.apache.org/start/quickstart.html

If I try to execute the following command 

mvn archetype:generate -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=6.8.0
-DgroupId=example -DartifactId=test
-DarchetypeRepository=https://repository.apache.org/ -DinteractiveMode=false

I expect wicket to create the directory structure. 


If I execute it from say C:\tmp , nothing gets created and mvn exits saying
unable to find pom.xml

If I execute it from C:\apache-wicket (which is where I have installed
wicket) it creates the folder

If I execute it from C:\apache-wicket\archetypes\ -- again same issue,
nothing gets created. 

So my very basic/newbie question is , do I have to exceute this command from
the place where I have installed Wicket. 

I am just following the instructions on the quick start website, and it
doesn't tell me where to execute this from. 

Or do I need to include the wicket jar files in classpath?

Thanks,
Rajesh




--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Quick-Start-Project-not-created-t
p4659258.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




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



UrlResourceReference for images

2013-06-06 Thread bronius
Hello,

Im trying to serve images from other server, but need to build url for
images on server side. This looks very simple and on most frameworks very
easy to accomplish, but on wicket I simply do not understand what to do...
Im trying like this: 
final Image img = new Image(IMAGE_ID_ADIMG, new
UrlResourceReference(createUrl(null)));

First of all Url api is extremely hard to work with, very hard to create url
i need, I think there should be some option to simply create it with simple
string. Anyway Url.parse method does not create full url for me (i have
localhost:8080/site1 and localhost:8080/site2, but when url is created i get
only site2 without full address). So I tried it myself like this:
 private Url createUrl(Charset charset) {
Url url = new Url(charset) {
private static final long serialVersionUID = 1L;
@Override
public String toString(final Charset charset)
{
return toString(StringMode.FULL, charset);
}
};
url.setProtocol(http);
url.setHost(localhost);
url.setPort(8080);
url.getSegments().add(site2);
url.getSegments().add(image);
url.setQueryParameter(param1, 1);
url.setQueryParameter(param2, 2);
return url;
}

Not really nice, but at least Url object returned normal full url that i
needed in toString. However UrlResourceReference still rendered not full url
and thats where i got too pissed off and decided I need some rest :) I'm
just interested if I'm even on the right track? How you would implement it?
And why this simple thing is so complicated? :) I admit I was a bit drunk :)
and don't have that much of experience with wicket, but this part looked
really strange for me. But I suspect I'm missing something. The problem is
probably because both applications have same start (http://localhost:8080)
and wicket is too smart. As image from other random website is shown
successfully.

Looking forward hearing from you :)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/UrlResourceReference-for-images-tp4659261.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: UrlResourceReference for images

2013-06-06 Thread Bertrand Guay-Paquet

Hello,

See inline.

On 06/06/2013 5:27 PM, bronius wrote:

First of all Url api is extremely hard to work with, very hard to create url
i need, I think there should be some option to simply create it with simple
string. Anyway Url.parse method does not create full url for me (i have
localhost:8080/site1 and localhost:8080/site2, but when url is created i get
only site2 without full address). So I tried it myself like this:
  private Url createUrl(Charset charset) {
 Url url = new Url(charset) {
 private static final long serialVersionUID = 1L;
 @Override
 public String toString(final Charset charset)
 {
 return toString(StringMode.FULL, charset);
 }
 };
 url.setProtocol(http);
 url.setHost(localhost);
 url.setPort(8080);
 url.getSegments().add(site2);
 url.getSegments().add(image);
 url.setQueryParameter(param1, 1);
 url.setQueryParameter(param2, 2);
 return url;
 }
The key here as you probably noticed is StringMode.FULL passed to the 
toString method. The Url class stores separately the protocol, host 
name, port and path (the segments array) of a Url.


Either way, toString is only used to build a resource key name in the 
constructor of UrlResourceReference. The actual url is still used in 
full by UrlResourceReference. However, see below.



Not really nice, but at least Url object returned normal full url that i
needed in toString. However UrlResourceReference still rendered not full url
and thats where i got too pissed off and decided I need some rest :) I'm
just interested if I'm even on the right track? How you would implement it?
And why this simple thing is so complicated? :) I admit I was a bit drunk :)
and don't have that much of experience with wicket, but this part looked
really strange for me. But I suspect I'm missing something. The problem is
probably because both applications have same start (http://localhost:8080)
and wicket is too smart. As image from other random website is shown
successfully.
You are right. In a way, Wicket is too smart. Here is the code of 
interest from org.apache.wicket.request.UrlRenderer:

protected boolean shouldRenderAsFull(final Url url)
{
Url clientUrl = request.getClientUrl();

if (!Strings.isEmpty(url.getProtocol()) 
!url.getProtocol().equals(clientUrl.getProtocol()))
{
return true;
}
if (!Strings.isEmpty(url.getHost())  
!url.getHost().equals(clientUrl.getHost()))

{
return true;
}
if ((url.getPort() != null)  
!url.getPort().equals(clientUrl.getPort()))

{
return true;
}
if (url.isContextAbsolute())
{
// do not relativize urls like /a/b
return true;
}
return false;
}

What I don't understand however is why this relative url is not good for 
you. You talked about serving resources from another server, but I don't 
get it. Either a relative url or an absolute url would both point to the 
same resource when interpreted on the client.


Regards,
Bertrand

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