RE: JWicket drag/drop handle

2011-02-01 Thread Stefan Lindner
You are right! jWicket is missing a setHandle method. I will implement this 
in the future. For now you can use the setRawOption() method for all 
unimplemented options. In your case you sould try

setRawOptions(cancel:'p.ui-widget-header' );

Stefan

-Ursprüngliche Nachricht-
Von: flavius [mailto:flav...@silverlion.com] 
Gesendet: Dienstag, 1. Februar 2011 05:17
An: users@wicket.apache.org
Betreff: JWicket drag/drop handle



I'm trying to create a widget/gadget (similar to google's home page or yahoo).
I've got it largely figured out except for one thing.  I'm trying to restrict 
the drag operation to just the top div (the header).  So my widget will look 
like this:

div class=widget
  div class=wheaderDrag here/div
  div class=wbodystuff goes here.../div /div

This functionality is described in JQuery here:
http://jqueryui.com/demos/draggable/#handle

It seems like DraggableBehavior should have a setHandle method so I can define 
the draggable region.

Any thoughts?
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JWicket-drag-drop-handle-tp3250469p3250469.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



Wickettester, cookies and redirects in Wicket 1.4.15

2011-02-01 Thread Robert Dahlström
Hi, I currently have an application reading a cookie in my session. All 
of my unit tests where the pattern is: Create page - submit form - 
redirect to new page fails to read this cookie after the redirect to new 
page.


The cookie is added both to the response and request before each new 
test (WicketTester gets recreated):

tester.getWicketResponse().addCookie(cookie);
tester.getServletRequest().setCookies(new Cookie[]{cookie});

This works fine during first page rendering and form submission. But 
after the form has been submitted and the redirect to new page takes 
place the cookie does not exist in the new request.


Since I'm a bit unsure if this is the wanted behavior for WicketTester 
or not I'm posting this to all users out there.


In my particular use case I would like the cookie to be persisted 
between original request and new request since that's how it is working 
in the real application.


Codewise (with Wicket 1.4.15):
In MockWebApplication.postProcessRequestCycle:
if (httpResponse.isRedirect())
{
  lastRenderedPage = generateLastRenderedPage(cycle);

  MockHttpServletRequest newHttpRequest = new 
MockHttpServletRequest(application, servletSession, 
application.getServletContext());


...
}

The call to new MockHttpServletRequest will clear all cookies set during 
initialize() and thus my cookie will not be set in the redirect request.


Any ideas on how to tackle this? For me I'd like the WicketTester to 
copy any existing cookies from the original request to the redirect 
request. I'd also be happy if there's another place in the code where I 
can set the cookie to have it available during the redirect request 
phase as well.


I also found an old bug (WICKET-1886) that felt like the same issue when 
I read it.


Regards
Robert

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



Re: Mapping wicket:id to component without changing Java code

2011-02-01 Thread Andrea Del Bene

Hi Alec,

I don't think Wicket has a configuration option that can help you. But 
you can create a web page superclass that parses HTML and adds your form 
if it finds tag div wicket:id=creditCardForm/.
For example you can override onInitialize method and add something like 
this:



MarkupParser markupParser = new MarkupParser(new XmlPullParser(), new 
MarkupResourceStream(getMarkupStream().getResource()));

Markup markup = markupParser.parse();

for(int i = 0; i  markup.size(); i++) {
if(markup.get(i) instanceof ComponentTag){
String markupId = (ComponentTag) markup.get(i);
//if markupid is equals to creditCardForm add form
}
}



bye.

Hello,

I would like to add credit card processing form to many different pages in
my application. However, I don't know which pages it will be added to and it
is up to the web designer to decide.

I would like to allow the web designer to be able to putdiv
wicket:id=creditCardForm/  anywhere in HTML. This would typically cause
Wicket to throw an error saying that a matching component was not added.

Is there a way to configure Wicket to somehow add an instance of
CreditCardForm class whenever it seesdiv wicket:id=creditCardForm/?

Thanks,

Alec



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



Provide the user with immediate feedback

2011-02-01 Thread Patrick Petermair

Hey!

In our wicket application we are using a lot of Ajax links/forms. 
Sometimes, those requests take a second or two. We now want to give the 
user some feedback, that his request is being processed (to avoid double 
clicking or the impression that the webapp is slow).


What would be the best way to execute custom javascript methods BEFORE 
the request gets sent to the webapp? Those javascript methods would then 
show a progress bar, a message like Your request is being processed.. etc.


For example: The user clicks an AjaxLink to delete an entry from the 
table and before the request gets sent to the server, some javascript 
method adds a small progress bar at the top of the table. Once the ajax 
request is done, the progress bar disappears.


Another example would be how Facebook handles sending private messages. 
As soon as I click the send button, the text area gets disabled / 
greyed out immediately and after the Ajax request has gone through, I 
get access again to the text area.


Cheers,
Patrick

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



Re: Provide the user with immediate feedback

2011-02-01 Thread Pedro Santos
You can register an handler to show some message and another one to remove
it at the end of request. See Wicket.Ajax.registerPreCallHandler
/ registerPostCallHandler
and
https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
https://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html
On Tue, Feb 1, 2011 at 9:39 AM, Patrick Petermair 
patrick.peterm...@openforce.com wrote:

 Hey!

 In our wicket application we are using a lot of Ajax links/forms.
 Sometimes, those requests take a second or two. We now want to give the user
 some feedback, that his request is being processed (to avoid double clicking
 or the impression that the webapp is slow).

 What would be the best way to execute custom javascript methods BEFORE the
 request gets sent to the webapp? Those javascript methods would then show a
 progress bar, a message like Your request is being processed.. etc.

 For example: The user clicks an AjaxLink to delete an entry from the table
 and before the request gets sent to the server, some javascript method adds
 a small progress bar at the top of the table. Once the ajax request is done,
 the progress bar disappears.

 Another example would be how Facebook handles sending private messages. As
 soon as I click the send button, the text area gets disabled / greyed out
 immediately and after the Ajax request has gone through, I get access again
 to the text area.

 Cheers,
 Patrick

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Provide the user with immediate feedback

2011-02-01 Thread Ernesto Reinaldo Barreiro
Patrick,

I think you can:

1-use interface IAjaxIndicatorAware to mark a page or Panel as a
context for showing some indicator of AJAX activity (usually a veil +
some activity icon)
2- or you can use IAjaxCallDecorator to manually decorate your links.

Ernesto

On Tue, Feb 1, 2011 at 12:39 PM, Patrick Petermair
patrick.peterm...@openforce.com wrote:
 Hey!

 In our wicket application we are using a lot of Ajax links/forms. Sometimes,
 those requests take a second or two. We now want to give the user some
 feedback, that his request is being processed (to avoid double clicking or
 the impression that the webapp is slow).

 What would be the best way to execute custom javascript methods BEFORE the
 request gets sent to the webapp? Those javascript methods would then show a
 progress bar, a message like Your request is being processed.. etc.

 For example: The user clicks an AjaxLink to delete an entry from the table
 and before the request gets sent to the server, some javascript method adds
 a small progress bar at the top of the table. Once the ajax request is done,
 the progress bar disappears.

 Another example would be how Facebook handles sending private messages. As
 soon as I click the send button, the text area gets disabled / greyed out
 immediately and after the Ajax request has gone through, I get access again
 to the text area.

 Cheers,
 Patrick

 -
 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: Wickettester, cookies and redirects in Wicket 1.4.15

2011-02-01 Thread Pedro Santos
Hi Hobert, I reopened the WICKET-1886

2011/2/1 Robert Dahlström robert.dahlst...@bwin.org

 Hi, I currently have an application reading a cookie in my session. All of
 my unit tests where the pattern is: Create page - submit form - redirect
 to new page fails to read this cookie after the redirect to new page.

 The cookie is added both to the response and request before each new test
 (WicketTester gets recreated):
 tester.getWicketResponse().addCookie(cookie);
 tester.getServletRequest().setCookies(new Cookie[]{cookie});

 This works fine during first page rendering and form submission. But after
 the form has been submitted and the redirect to new page takes place the
 cookie does not exist in the new request.

 Since I'm a bit unsure if this is the wanted behavior for WicketTester or
 not I'm posting this to all users out there.

 In my particular use case I would like the cookie to be persisted between
 original request and new request since that's how it is working in the real
 application.

 Codewise (with Wicket 1.4.15):
 In MockWebApplication.postProcessRequestCycle:
 if (httpResponse.isRedirect())
 {
  lastRenderedPage = generateLastRenderedPage(cycle);

  MockHttpServletRequest newHttpRequest = new
 MockHttpServletRequest(application, servletSession,
 application.getServletContext());

 ...
 }

 The call to new MockHttpServletRequest will clear all cookies set during
 initialize() and thus my cookie will not be set in the redirect request.

 Any ideas on how to tackle this? For me I'd like the WicketTester to copy
 any existing cookies from the original request to the redirect request. I'd
 also be happy if there's another place in the code where I can set the
 cookie to have it available during the redirect request phase as well.

 I also found an old bug (WICKET-1886) that felt like the same issue when I
 read it.

 Regards
 Robert

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




-- 
Pedro Henrique Oliveira dos Santos


Re: Wickettester, cookies and redirects in Wicket 1.4.15

2011-02-01 Thread Robert Dahlström

Thanks, I'll add the info I have to the bug.

Regards
Robert

On 02/01/2011 01:02 PM, Pedro Santos wrote:

Hi Hobert, I reopened the WICKET-1886

2011/2/1 Robert Dahlströmrobert.dahlst...@bwin.org


Hi, I currently have an application reading a cookie in my session. All of
my unit tests where the pattern is: Create page -  submit form -  redirect
to new page fails to read this cookie after the redirect to new page.

The cookie is added both to the response and request before each new test
(WicketTester gets recreated):
tester.getWicketResponse().addCookie(cookie);
tester.getServletRequest().setCookies(new Cookie[]{cookie});

This works fine during first page rendering and form submission. But after
the form has been submitted and the redirect to new page takes place the
cookie does not exist in the new request.

Since I'm a bit unsure if this is the wanted behavior for WicketTester or
not I'm posting this to all users out there.

In my particular use case I would like the cookie to be persisted between
original request and new request since that's how it is working in the real
application.

Codewise (with Wicket 1.4.15):
In MockWebApplication.postProcessRequestCycle:
if (httpResponse.isRedirect())
{
  lastRenderedPage = generateLastRenderedPage(cycle);

  MockHttpServletRequest newHttpRequest = new
MockHttpServletRequest(application, servletSession,
application.getServletContext());

...
}

The call to new MockHttpServletRequest will clear all cookies set during
initialize() and thus my cookie will not be set in the redirect request.

Any ideas on how to tackle this? For me I'd like the WicketTester to copy
any existing cookies from the original request to the redirect request. I'd
also be happy if there's another place in the code where I can set the
cookie to have it available during the redirect request phase as well.

I also found an old bug (WICKET-1886) that felt like the same issue when I
read it.

Regards
Robert

-
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: Wickettester, cookies and redirects in Wicket 1.4.15

2011-02-01 Thread Pedro Santos
I attached an test case, possible simulating your described bug

2011/2/1 Robert Dahlström robert.dahlst...@bwin.org

 Thanks, I'll add the info I have to the bug.

 Regards
 Robert


 On 02/01/2011 01:02 PM, Pedro Santos wrote:

 Hi Hobert, I reopened the WICKET-1886

 2011/2/1 Robert Dahlströmrobert.dahlst...@bwin.org

  Hi, I currently have an application reading a cookie in my session. All
 of
 my unit tests where the pattern is: Create page -  submit form -
  redirect
 to new page fails to read this cookie after the redirect to new page.

 The cookie is added both to the response and request before each new test
 (WicketTester gets recreated):
 tester.getWicketResponse().addCookie(cookie);
 tester.getServletRequest().setCookies(new Cookie[]{cookie});

 This works fine during first page rendering and form submission. But
 after
 the form has been submitted and the redirect to new page takes place the
 cookie does not exist in the new request.

 Since I'm a bit unsure if this is the wanted behavior for WicketTester or
 not I'm posting this to all users out there.

 In my particular use case I would like the cookie to be persisted between
 original request and new request since that's how it is working in the
 real
 application.

 Codewise (with Wicket 1.4.15):
 In MockWebApplication.postProcessRequestCycle:
 if (httpResponse.isRedirect())
 {
  lastRenderedPage = generateLastRenderedPage(cycle);

  MockHttpServletRequest newHttpRequest = new
 MockHttpServletRequest(application, servletSession,
 application.getServletContext());

 ...
 }

 The call to new MockHttpServletRequest will clear all cookies set during
 initialize() and thus my cookie will not be set in the redirect request.

 Any ideas on how to tackle this? For me I'd like the WicketTester to copy
 any existing cookies from the original request to the redirect request.
 I'd
 also be happy if there's another place in the code where I can set the
 cookie to have it available during the redirect request phase as well.

 I also found an old bug (WICKET-1886) that felt like the same issue when
 I
 read it.

 Regards
 Robert

 -
 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




-- 
Pedro Henrique Oliveira dos Santos


Problem with Wickettester and Maven

2011-02-01 Thread Dmitriy Neretin
Hello everybody,

I have problems with unit testing.
All the time I have used NetBeans 6.9.1 with Glassfish and there wasn't any
problems. Just create a new UnitTest with WicketTester and it worked pretty
fine. Today I changed the project infrastructure to Maven with surifire
plug-in. The problem is following: usual unit test will be executet without
failures but not the tests with wickettester. Surifire report showed me
following exception:

java.lang.
NoClassDefFoundError: javax/servlet/http/HttpSession
   at de.pentasys.test.web.TestRenderPages.setUp(TestRenderPages.java:22)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
   at
org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
   at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
   at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
   at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
   at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
   at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at
org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
   at $Proxy0.invoke(Unknown Source)
   at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
   at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
   at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpSession
   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   ... 30 more

The test itself is very simple: it checkt if the start page will be
rendered. Nothing more.

Any ideas?

Thank you!


Re: Problem with Wickettester and Maven

2011-02-01 Thread Pedro Santos
You need to add the test or provided scope servlet-api dependency in your
project pom

On Tue, Feb 1, 2011 at 11:11 AM, Dmitriy Neretin 
dmitriy.nere...@googlemail.com wrote:

 Hello everybody,

 I have problems with unit testing.
 All the time I have used NetBeans 6.9.1 with Glassfish and there wasn't any
 problems. Just create a new UnitTest with WicketTester and it worked pretty
 fine. Today I changed the project infrastructure to Maven with surifire
 plug-in. The problem is following: usual unit test will be executet without
 failures but not the tests with wickettester. Surifire report showed me
 following exception:

 java.lang.
 NoClassDefFoundError: javax/servlet/http/HttpSession
   at de.pentasys.test.web.TestRenderPages.setUp(TestRenderPages.java:22)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at

 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at

 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at

 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at

 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
   at

 org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
   at

 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
   at

 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
   at

 org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
   at

 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
   at

 org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at

 org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
   at $Proxy0.invoke(Unknown Source)
   at

 org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
   at

 org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
   at
 org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
 Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpSession
   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   ... 30 more

 The test itself is very simple: it checkt if the start page will be
 rendered. Nothing more.

 Any ideas?

 Thank you!




-- 
Pedro Henrique Oliveira dos Santos


Re: Problem with Wickettester and Maven

2011-02-01 Thread Dmitriy Neretin
I don't really understand how to do that?

On 1 February 2011 14:46, Pedro Santos pedros...@gmail.com wrote:

 You need to add the test or provided scope servlet-api dependency in your
 project pom

 On Tue, Feb 1, 2011 at 11:11 AM, Dmitriy Neretin 
 dmitriy.nere...@googlemail.com wrote:

  Hello everybody,
 
  I have problems with unit testing.
  All the time I have used NetBeans 6.9.1 with Glassfish and there wasn't
 any
  problems. Just create a new UnitTest with WicketTester and it worked
 pretty
  fine. Today I changed the project infrastructure to Maven with surifire
  plug-in. The problem is following: usual unit test will be executet
 without
  failures but not the tests with wickettester. Surifire report showed me
  following exception:
 
  java.lang.
  NoClassDefFoundError: javax/servlet/http/HttpSession
at de.pentasys.test.web.TestRenderPages.setUp(TestRenderPages.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
 
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
 
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
 
 
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
 
 
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
 
 
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
 
 
 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
 
 
 org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
 
 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
 
 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
 
 
 org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at
 
 
 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
at
 
 
 org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
 
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
 
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
 
 
 org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at
 
 
 org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at
 
 
 org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at
  org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
  Caused by: java.lang.ClassNotFoundException:
 javax.servlet.http.HttpSession
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 30 more
 
  The test itself is very simple: it checkt if the start page will be
  rendered. Nothing more.
 
  Any ideas?
 
  Thank you!
 



 --
 Pedro Henrique Oliveira dos Santos



Re: Problem with Wickettester and Maven

2011-02-01 Thread Dmitriy Neretin
Oh sorry!!! It works now! Thank you!

I should add this to my pom:

dependency
groupIdjavax.servlet/groupId
artifactIdservlet-api/artifactId
version2.4/version
scopeprovided/scope
/dependency

On 1 February 2011 14:51, Dmitriy Neretin dmitriy.nere...@googlemail.comwrote:

 I don't really understand how to do that?


 On 1 February 2011 14:46, Pedro Santos pedros...@gmail.com wrote:

 You need to add the test or provided scope servlet-api dependency in your
 project pom

 On Tue, Feb 1, 2011 at 11:11 AM, Dmitriy Neretin 
 dmitriy.nere...@googlemail.com wrote:

  Hello everybody,
 
  I have problems with unit testing.
  All the time I have used NetBeans 6.9.1 with Glassfish and there wasn't
 any
  problems. Just create a new UnitTest with WicketTester and it worked
 pretty
  fine. Today I changed the project infrastructure to Maven with surifire
  plug-in. The problem is following: usual unit test will be executet
 without
  failures but not the tests with wickettester. Surifire report showed me
  following exception:
 
  java.lang.
  NoClassDefFoundError: javax/servlet/http/HttpSession
at de.pentasys.test.web.TestRenderPages.setUp(TestRenderPages.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
 
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
 
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
 
 
 org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at
 
 
 org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at
 
 
 org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at
 
 
 org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at
 
 
 org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at
 
 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at
 
 
 org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at
 
 
 org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
at
 
 
 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:115)
at
 
 
 org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
 
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
 
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
 
 
 org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
at $Proxy0.invoke(Unknown Source)
at
 
 
 org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:150)
at
 
 
 org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:91)
at
  org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
  Caused by: java.lang.ClassNotFoundException:
 javax.servlet.http.HttpSession
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 30 more
 
  The test itself is very simple: it checkt if the start page will be
  rendered. Nothing more.
 
  Any ideas?
 
  Thank you!
 



 --
 Pedro Henrique Oliveira dos Santos





Re: setResponsePage weirdness

2011-02-01 Thread msj121

Worse case scenario, though I understand not wanting to do it, is using a
javascript/html redirect and by passing Wicket, not the nicest scenario, I
wish I knew more about redirects, sorry.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-weirdness-tp3248650p3251802.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: Using non-Model fields in Form

2011-02-01 Thread nimmy

I'm a newbie also but

Can't you just create a new model specifically for the RadioChoice
component? Each component can have its own model.



-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251807.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: Mapping wicket:id to component without changing Java code

2011-02-01 Thread msj121

You can add an empty label to replace the content if not adding the
component. You can have a repeating list if you have lots of dynamic
content, this way whatever you add to the list is added or you can just add
an empty component.

It does seem odd to me that in your html you know whether to add the credit
card div, but in Wicket you do not... that is certainly unclear to me.

Btw, I am building an e-commerce solution myself, are you using an
opensource platform or building it yourself?

 Hello,

 I would like to add credit card processing form to many different pages in
 my application. However, I don't know which pages it will be added to and
 it
 is up to the web designer to decide.

 I would like to allow the web designer to be able to putdiv
 wicket:id=creditCardForm/  anywhere in HTML. This would typically cause
 Wicket to throw an error saying that a matching component was not added.

 Is there a way to configure Wicket to somehow add an instance of
 CreditCardForm class whenever it seesdiv wicket:id=creditCardForm/?

 Thanks,

 Alec
 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Mapping-wicket-id-to-component-without-changing-Java-code-tp3250381p3251809.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: Using non-Model fields in Form

2011-02-01 Thread msj121

As Nimmy said you should be able to supply your own model to the RadioChoice
which will override the CompoundPropertyModel Assuming NUMBERS is a
list...

RadioChoiceString rc = new RadioChoiceString(numberRadioChoice, new
Model(),NUMBERS); 

Look at https://cwiki.apache.org/WICKET/working-with-wicket-models.html for
more information.


nimmy wrote:
 
 I'm a newbie also but
 
 Can't you just create a new model specifically for the RadioChoice
 component? Each component can have its own model.
 
 
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251822.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: Using non-Model fields in Form

2011-02-01 Thread Pedro Santos
Sure. When you create an radio choice like:
RadioChoiceString rc = new RadioChoiceString(numberRadioChoice,
NUMBERS);
your are passing the wicket id and a list of choices to the component, but
no model. Components without model inherit one from the first parent
CompoundPropertyModel based on the child wicket id, in this case:
numberRadioChoice. The problem is that the object at the first parament
CPM don't have de property numberRa(...), so I guess you missed to provide
your own model to the component.

On Tue, Feb 1, 2011 at 1:25 PM, nimmy nim_sa...@hotmail.com wrote:


 I'm a newbie also but

 Can't you just create a new model specifically for the RadioChoice
 component? Each component can have its own model.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251807.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




-- 
Pedro Henrique Oliveira dos Santos


Re: Provide the user with immediate feedback

2011-02-01 Thread msj121

Interesting the Ajax call decorator mentioned above sounds like a good
choice, I don't know the transactional steps for each solution, but to have
the javascript written entirely in the page without requiring some sort of
connection to the wicket server, does sound like it will be more immediate
if your worried about that 1 or 2 seconds of idle time however you want to
accomplish that.
http://radio.javaranch.com/pascarello/2005/05/17/1116340367337.html If you
need a script: 
function DisableEnableForm(xForm,xHow){
  objElems = xForm.elements;
  for(i=0;iobjElems.length;i++){
objElems[i].disabled = xHow;
  }
}

Just my two cents,
Matthew




Patrick Petermair wrote:
 In our wicket application we are using a lot of Ajax links/forms. 
 Sometimes, those requests take a second or two. We now want to give the 
 user some feedback, that his request is being processed (to avoid double 
 clicking or the impression that the webapp is slow).

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Provide-the-user-with-immediate-feedback-tp3250978p3251879.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: Mapping wicket:id to component without changing Java code

2011-02-01 Thread James Carman
On Tue, Feb 1, 2011 at 10:27 AM, msj121 msj...@gmail.com wrote:

 You can add an empty label to replace the content if not adding the
 component.

Or, use EmptyPanel or a plain ole WebMarkupContainer?

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



Re: Dynamic tab question - now to pass a model to the panel?

2011-02-01 Thread msj121

I don't quite understand the problem... some code might help. But why can't
you do something like the following:

tabs.add(new AbstractTab(item.getModel()) {
 public Panel getPanel(String panelId) {
 return new AlbumPanel(panelId, );// can be item.getModelObject() or
something
 }
}); 

The above assumes your inside some sort of Wicket Repeater (I assumed this
as you mentioned it was dynamic). Like I said, some more code might help.

nimmy wrote:
 
 Hi all,
 
 I'm having a bit of confusion with dynamic tabs and would appreciate your
 help.
 
 My page has a LDM model. The model wraps an AlbumGroup object, which has a
 list of Album objects.
 
 I'm creating a tab for each Album object by extending AbstractTab. I'm
 passing in a ModelAlbum as a constructor to the tab. This model is used
 to set the title of the tab and should also be used to populate the
 contents of the tab panel.
 
 How can I pass the ModelAlbum to the tab Panel?
 
 I don't think I can hold the model as an instance variable in the Tab
 until the getPanel() method is called as detach will never be called on
 the LDM.
 
 I cannot simply implement the IDetachable interface because AbstractTab is
 not a component and detach will not be called on it.
 
 Am I overthinking the LDM?
 
 Cheers,
 Nim
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-tab-question-now-to-pass-a-model-to-the-panel-tp3250387p3251937.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: Using non-Model fields in Form

2011-02-01 Thread James Carman
This is exactly why I tell folks not to use CPM.  People start relying
on them too heavily and when all doesn't work as planned, they freak
out.  It's like the blonde that got locked in her car because the
battery died and her automatic locks didn't work.

On Tue, Feb 1, 2011 at 10:25 AM, nimmy nim_sa...@hotmail.com wrote:

 I'm a newbie also but

 Can't you just create a new model specifically for the RadioChoice
 component? Each component can have its own model.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Using-non-Model-fields-in-Form-tp3251063p3251807.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



[1.4.15] FLAG_INHERITABLE_MODEL and default model change

2011-02-01 Thread Alexander Morozov

Hi,

I have the question about correctness of Component#setDefaultModel
(Component#setModelImpl) method behavior. I expect that the flag
FLAG_INHERITABLE_MODEL should be checked there and turned off if the
provided model is not a IComponentInheritedModel.

Let check the next code:


public MyPanel(String id) {
 super(id);
  ...
  form.setModel(new CompoundPropertyModel(this));
  DropDownChoice ddc = new DropDownChoice(variant, Arrays.ofList(...)) {   
// p1
@Override
protected void onInitialize() {
   super.onInitialize();
   setModel(new DefaultingWrapModel(getModel(), Model.of(default
value));// p2
}
  };
  ddc.setNullValid(false);
  ddc.setRequired(true);
  form.add(ddc);
  ...
}


In the (p1) the DDC will initialize with CompoundPropertyModel and the
FLAG_INHERITABLE_MODEL will be turned on soon by the first invocation of
FormComponent#getModel().

In the (p2) we wrap the DDC model with the model which provide the default
value (DefaultingWrapModel implements IWrapModel). So we change the model,
but the FLAG_INHERITABLE_MODEL is still turned on.

On the Component#detach() event, the method Component#setModelImpl(null)
will be invoked for the ddc and the DefaultingWrapModel instance will be
lost

// reset the model to null when the current model is a 
IWrapModel and
// the model that created it/wrapped in it is a 
IComponentInheritedModel
// The model will be created next time.
if (getFlag(FLAG_INHERITABLE_MODEL))
{
setModelImpl(null);
setFlag(FLAG_INHERITABLE_MODEL, false);
}


I think that such behavior is unexpected. Am I right :) ?

Thanks

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-4-15-FLAG-INHERITABLE-MODEL-and-default-model-change-tp3252093p3252093.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: export to excel AjaxFallbackDefaultDataTable

2011-02-01 Thread fachhoch

Now I want to export the same table in PDF , I did the export to excel using
apache POI, Now I have to export the same table to PDF. Is there any libray
which serves export to various formats ? 

 

I saw display Tag  

http://displaytag.sourceforge.net/10/export.html

it provides  export to pdf , xml , excel  , I am looking for  a similar
solution  , is there any way I can use the display tag to export from wicket
datatable ?

Please suggest me what are the available options to provide export to
various formats from a wicket datatable ?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3252116.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: Dynamic tab question - now to pass a model to the panel?

2011-02-01 Thread nimmy

Hi,

Thanks for your reply. I'm pretty much doing what you suggested but have a
concrete Tab class as it is reused on another page:

public class AlbumTab extends AbstractTab {

private static final long serialVersionUID = 1L;
private IModelAlbum model;

public AlbumTab(IModelAlbum model) {
super(new PropertyModelString(model, name));
this.model = model;
}

@Override
public Panel getPanel(String id) {
return new TabPanel(id, model);
}
}

The Page has a hibernate backed LoadableDetachableModel - AlbumGroup.
AlbumGroup has a list of Albums. I iterate through the list and create a tab
for each Album and create a tabbed panel:

//create a tab for each album
ListITab tabs = new ArrayListITab();
for (Album album: model.getObject().getAlbums()) {
ITab tab = new AlbumTab(new ModelAlbum(album));
tabs.add(tab);
}
add(new TabbedPanel(content-tabs, tabs));

My confusion was/is on who calls detach() on the LDM. Each tab will have a
reference to the LDM.

I am now setting the LDM as the default model for the page (even though the
page does not use it). My reasoning is that once the page is Serialised, it
will call detach() on the LDM.


Any thoughts on my approach?
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-tab-question-now-to-pass-a-model-to-the-panel-tp3250387p3252157.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



Using DataView newItem method to display a BreadCrumbPanel

2011-02-01 Thread shetc

Hi All,

I am trying to add an onclick event to a table row -- each row is created
using a DataView.
To make an entire row clickable, I add an AjaxEventBehavior via the
DataView's Item newItem method.
This seems to work as far as an onEvent event being raised when I click on a
table row.
However, I am trying to activate a BreadCrumbPanel from within the onEvent
event. Nothing seems
to happen as far as showing the next panel (called JobDescPanel). If I click
on the row again
then a component not found on page exception is thrown. I have supplied a
snippet of code below.
Is it wrong to try and activate a breadcrumb from this Ajax event?

Thanks,
Steve

P.S. Using Wicket 1.4.10


private void buildDataView() 
{
final DataViewJobSearchResult dv = new
DataViewJobSearchResult(dataView, jsdp) {
private static final long serialVersionUID = 1L;

@Override
protected ItemJobSearchResult newItem(String id, int 
index, final
IModelJobSearchResult model) {
ItemJobSearchResult item = super.newItem(id, 
index, model);
item.add(new AjaxEventBehavior(onclick) {
private static final long 
serialVersionUID = 1L;
@Override
protected void 
onEvent(AjaxRequestTarget target) {
activate(new 
IBreadCrumbPanelFactory() {
private static final 
long serialVersionUID = 1L;
public BreadCrumbPanel 
create(String componentId, IBreadCrumbModel
bcm) {
JobSearchResult 
jsr = model.getObject();
return new 
JobDescPanel(componentId, bcm, homePage,
jsr.getOrderId());
}
});
}
});
return item;
}

...
}

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-DataView-newItem-method-to-display-a-BreadCrumbPanel-tp3252215p3252215.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: [1.4.15] FLAG_INHERITABLE_MODEL and default model change

2011-02-01 Thread Igor Vaynberg
please file a jira

-igor


On Tue, Feb 1, 2011 at 8:16 AM, Alexander Morozov
alexander.v.moro...@gmail.com wrote:

 Hi,

 I have the question about correctness of Component#setDefaultModel
 (Component#setModelImpl) method behavior. I expect that the flag
 FLAG_INHERITABLE_MODEL should be checked there and turned off if the
 provided model is not a IComponentInheritedModel.

 Let check the next code:


 public MyPanel(String id) {
  super(id);
  ...
  form.setModel(new CompoundPropertyModel(this));
  DropDownChoice ddc = new DropDownChoice(variant, Arrays.ofList(...)) {
 // p1
    @Override
    protected void onInitialize() {
       super.onInitialize();
       setModel(new DefaultingWrapModel(getModel(), Model.of(default
 value));            // p2
    }
  };
  ddc.setNullValid(false);
  ddc.setRequired(true);
  form.add(ddc);
  ...
 }


 In the (p1) the DDC will initialize with CompoundPropertyModel and the
 FLAG_INHERITABLE_MODEL will be turned on soon by the first invocation of
 FormComponent#getModel().

 In the (p2) we wrap the DDC model with the model which provide the default
 value (DefaultingWrapModel implements IWrapModel). So we change the model,
 but the FLAG_INHERITABLE_MODEL is still turned on.

 On the Component#detach() event, the method Component#setModelImpl(null)
 will be invoked for the ddc and the DefaultingWrapModel instance will be
 lost

                // reset the model to null when the current model is a 
 IWrapModel and
                // the model that created it/wrapped in it is a 
 IComponentInheritedModel
                // The model will be created next time.
                if (getFlag(FLAG_INHERITABLE_MODEL))
                {
                        setModelImpl(null);
                        setFlag(FLAG_INHERITABLE_MODEL, false);
                }


 I think that such behavior is unexpected. Am I right :) ?

 Thanks

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/1-4-15-FLAG-INHERITABLE-MODEL-and-default-model-change-tp3252093p3252093.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



Set default locale when suitable locale not found

2011-02-01 Thread planime

In project i have several *.properties files for custom locale (page_en_GB
and page_ru_RU).When user with default locale en US come, hes got exception.
Can I do that if a suitable location has not been found to use my custom
locale ?
I try to use Locale.setDafault(...), but it doesnt work.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Set-default-locale-when-suitable-locale-not-found-tp3252800p3252800.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: Dynamic tab question - now to pass a model to the panel?

2011-02-01 Thread msj121

the method .detach() or some variation should be called on every Loadable
Detachable Model (LDM) if your model is being used as a default model to any
component in the page hierarchy. To make this LDM your page model, I think
there is a trick in the sense you should call super(model), and not just
set the page's default model. It should be detached automatically.

The best way is probably to test the code with a breakpoint or override the
method and print with log4j or something

Sorry I misunderstood the question.

Matthew
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dynamic-tab-question-now-to-pass-a-model-to-the-panel-tp3250387p3252947.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: Using DataView newItem method to display a BreadCrumbPanel

2011-02-01 Thread msj121

not sure what activate does, I would hope though that it would add the object
to a panel on the page, and then you call target.addComponent(panel); As
this target (the AjaxRequestTarget) deals with actually updating the front
end of the page.

Also Data Repeaters are somewhat dubious in that they refresh their content
on each reload, so don't try to add the content to the DataView itself
(which I assume you are not). Similarly using the model and not the value of
the model might cause some issues, I am not sure. The stack error trace
after this first visual issue is fixed would be useful.

I do presume they are somewhat separate (ie: fixing one won't solve the
other).

Matthew


shetc wrote:
 
 Hi All,
 
 I am trying to add an onclick event to a table row -- each row is created
 using a DataView.
 To make an entire row clickable, I add an AjaxEventBehavior via the
 DataView's Item newItem method.
 This seems to work as far as an onEvent event being raised when I click on
 a table row.
 However, I am trying to activate a BreadCrumbPanel from within the onEvent
 event. Nothing seems
 to happen as far as showing the next panel (called JobDescPanel). If I
 click on the row again
 then a component not found on page exception is thrown. I have supplied a
 snippet of code below.
 Is it wrong to try and activate a breadcrumb from this Ajax event?
 
 Thanks,
 Steve
 
 P.S. Using Wicket 1.4.10
 
 
   private void buildDataView() 
   {
   final DataViewJobSearchResult dv = new
 DataViewJobSearchResult(dataView, jsdp) {
   private static final long serialVersionUID = 1L;
 
   @Override
   protected ItemJobSearchResult newItem(String id, int 
 index, final
 IModelJobSearchResult model) {
   ItemJobSearchResult item = super.newItem(id, 
 index, model);
   item.add(new AjaxEventBehavior(onclick) {
   private static final long 
 serialVersionUID = 1L;
   @Override
   protected void 
 onEvent(AjaxRequestTarget target) {
   activate(new 
 IBreadCrumbPanelFactory() {
   private static final 
 long serialVersionUID = 1L;
   public BreadCrumbPanel 
 create(String componentId, IBreadCrumbModel
 bcm) {
   JobSearchResult 
 jsr = model.getObject();
   return new 
 JobDescPanel(componentId, bcm, homePage,
 jsr.getOrderId());
   }
   });
   }
   });
   return item;
   }
 
   ...
   }
 
 

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Using-DataView-newItem-method-to-display-a-BreadCrumbPanel-tp3252215p3252973.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: Set default locale when suitable locale not found

2011-02-01 Thread Igor Vaynberg
if no matches are made the user should fall back to page.html and
page.properties. so put your default locale into those files instead
of specific locales.

otherwise you can call session.setlocale() to force it.

-igor


On Tue, Feb 1, 2011 at 11:36 AM, planime planime...@mailforspam.com wrote:

 In project i have several *.properties files for custom locale (page_en_GB
 and page_ru_RU).When user with default locale en US come, hes got exception.
 Can I do that if a suitable location has not been found to use my custom
 locale ?
 I try to use Locale.setDafault(...), but it doesnt work.
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Set-default-locale-when-suitable-locale-not-found-tp3252800p3252800.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: export to excel AjaxFallbackDefaultDataTable

2011-02-01 Thread jcgarciam

See http://itextpdf.com/

On Tue, Feb 1, 2011 at 1:21 PM, fachhoch [via Apache Wicket] 
ml-node+3252116-297151156-65...@n4.nabble.comml-node%2b3252116-297151156-65...@n4.nabble.com
 wrote:

 Now I want to export the same table in PDF , I did the export to excel
 using apache POI, Now I have to export the same table to PDF. Is there any
 libray which serves export to various formats ?



 I saw display Tag

 http://displaytag.sourceforge.net/10/export.html

 it provides  export to pdf , xml , excel  , I am looking for  a similar
 solution  , is there any way I can use the display tag to export from wicket
 datatable ?

 Please suggest me what are the available options to provide export to
 various formats from a wicket datatable ?


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3252116.html
  To start a new topic under Apache Wicket, email
 ml-node+1842946-398011874-65...@n4.nabble.comml-node%2b1842946-398011874-65...@n4.nabble.com
 To unsubscribe from Apache Wicket, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=1842946code=amNnYXJjaWFtQGdtYWlsLmNvbXwxODQyOTQ2fDEyNTYxMzc3ODY=.





-- 
Sincerely,
JC (http://www.linkedin.com/in/jcgarciam)
--Anyone who has never made a mistake has never tried anything new.--

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/export-to-excel-AjaxFallbackDefaultDataTable-tp3225458p3253047.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: JWicket drag/drop handle

2011-02-01 Thread flavius

This did the trick.  setRawOptions is exactly what I needed.

Thanks Stefan
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/JWicket-drag-drop-handle-tp3250469p3253344.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 set cookie domain?

2011-02-01 Thread Paolo
Hi,
I want add a cookie, and I saw on this site, how to do this.

https://cwiki.apache.org/WICKET/dealing-with-cookies.html

 ((WebResponse)RequestCycle.get().getResponse()).addCookie(new 
Cookie(cookieName, cookieValue));

but I need to specify also the domanin.

I need something like this PHP code, but for Wicket:

ini_set('session.cookie_domain', '.otherdomain.com');

thank you!

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



Re: Mapping wicket:id to component without changing Java code

2011-02-01 Thread Alec Swan
Thank you everybody for the clever ideas.

msj121, I just started building the credit card form and was planning to
just use Authorize.net APIs. This is not directly related to Wicket, so we
should take this discussion off this forum. Email me directly if you have
some thoughts or just wanted to bounce ideas off.

Thanks,

Alec

On Tue, Feb 1, 2011 at 8:50 AM, James Carman ja...@carmanconsulting.comwrote:

 On Tue, Feb 1, 2011 at 10:27 AM, msj121 msj...@gmail.com wrote:
 
  You can add an empty label to replace the content if not adding the
  component.

 Or, use EmptyPanel or a plain ole WebMarkupContainer?

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




How to set cookie domain?

2011-02-01 Thread Paolo
Hi,
I want add a cookie, and I saw on this site, how to do this.

https://cwiki.apache.org/WICKET/dealing-with-cookies.html

 ((WebResponse)RequestCycle.get().getResponse()).addCookie(new 
Cookie(cookieName, cookieValue));

but I need to specify also the domanin.

I need something like this PHP code, but for Wicket:

ini_set('session.cookie_domain', '.otherdomain.com');

thank you!

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