http://wicket.apache.org/learn/examples/ still linking to wicket 5 examples

2013-06-10 Thread lucast
Dear forum,
I am sure someone has already noticed this but I thought of pointing it out.
I'm trying to get to the latest wicket examples page. My first port of call
was to go to http://wicket.apache.org/learn/examples/ and follow the live
action link but it takes me to the
http://www.wicket-library.com/wicket-examples/index.html link which displays
all wicket 5 examples.

I had to google the more up to date page:
http://www.wicket-library.com/wicket-examples-6.0.x/index.html in order to
find it.

Is the above link meant to work that way or should it be pointing to wicket
6 examples?

Thanks in advance,
Lucas



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/http-wicket-apache-org-learn-examples-still-linking-to-wicket-5-examples-tp4659308.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: http://wicket.apache.org/learn/examples/ still linking to wicket 5 examples

2013-06-10 Thread Martin Grigorov
Fixed.
Thanks!


On Mon, Jun 10, 2013 at 9:35 AM, lucast lucastol...@hotmail.com wrote:

 Dear forum,
 I am sure someone has already noticed this but I thought of pointing it
 out.
 I'm trying to get to the latest wicket examples page. My first port of call
 was to go to http://wicket.apache.org/learn/examples/ and follow the live
 action link but it takes me to the
 http://www.wicket-library.com/wicket-examples/index.html link which
 displays
 all wicket 5 examples.

 I had to google the more up to date page:
 http://www.wicket-library.com/wicket-examples-6.0.x/index.html in order to
 find it.

 Is the above link meant to work that way or should it be pointing to wicket
 6 examples?

 Thanks in advance,
 Lucas



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/http-wicket-apache-org-learn-examples-still-linking-to-wicket-5-examples-tp4659308.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: Apache Wicket + Ace Editor

2013-06-10 Thread Martin Grigorov
Hi,

What kind of problems you faced ?


On Mon, Jun 10, 2013 at 8:51 AM, Shengche Hsiao front...@gmail.com wrote:

 Hello everyone

 I want to integrate ace editor into my wicket project, but after gooogled I
 failed to do it.
 Is anyone give my some advise?



 -
 We do this not because it is easy. We do this because it is hard.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307.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: reuse Form Panel code for WizardStep?

2013-06-10 Thread Martin Grigorov
Hi,

You should (re-)use your panel in the wizard:

step.add(new MyFormPanel(someId));


On Sun, Jun 9, 2013 at 4:14 AM, always_rick sh...@hotmail.com wrote:

 The problem is wicket:idfor example: Formjavanew RequiredTextField(
 companyName );WizardStepjavanew RequiredTextField( company.companyName
 );



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/reuse-Form-Panel-code-for-WizardStep-tp4659295p4659302.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: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-10 Thread Martin Grigorov
Hi,

Since Wicket 6.7.0 there is ComponentRenderer class which does exactly the
same.


On Sat, Jun 8, 2013 at 12:01 AM, Per Newgro per.new...@gmx.ch wrote:

 Found the solution already. I did it that way:

 public class FlyingSaucerPdfResource extends ByteArrayResource {

 public FlyingSaucerPdfResource() {
 super(application/pdf);
 }

 @Override
 protected byte[] getData(Attributes attributes) {
 ByteArrayOutputStream os;
 try {
 CharSequence buf = renderPage(HomePage.class,
 attributes.getParameters());
 ITextRenderer renderer = new ITextRenderer();
 renderer.**setDocumentFromString(buf.**toString());
 renderer.layout();
 renderer.createPDF(os = new ByteArrayOutputStream());
 os.close();
 } catch (IOException | DocumentException e) {
 throw new RuntimeException(e);
 }
 return os.toByteArray();
 }

 private CharSequence renderPage(final Class? extends Page pageClass,
 PageParameters parameters) {

 final RenderPageRequestHandler handler = new
 RenderPageRequestHandler(
 new PageProvider(pageClass, parameters),
 RedirectPolicy.NEVER_REDIRECT)**;

 final PageRenderer pageRenderer = getApplication()
 .getPageRendererProvider().**get(handler);

 RequestCycle originalRequestCycle = RequestCycle.get();

 BufferedWebResponse tempResponse = new BufferedWebResponse(null);

 RequestCycleContext requestCycleContext = new RequestCycleContext(
 originalRequestCycle.**getRequest(), tempResponse,
 getApplication().**getRootRequestMapper(),
 getApplication()
 .getExceptionMapperProvider().**get());
 RequestCycle tempRequestCycle = new RequestCycle(**
 requestCycleContext);

 final Response oldResponse = originalRequestCycle.**getResponse();

 try {
 originalRequestCycle.**setResponse(tempResponse);
 pageRenderer.respond(**tempRequestCycle);
 } finally {
 originalRequestCycle.**setResponse(oldResponse);
 }

 return tempResponse.getText();
 }

 private Application getApplication() {
 return Application.get();

 }

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




Re: session event

2013-06-10 Thread Martin Grigorov
Hi,

There is JavaScript event named beforeunload that is fired when the user
leaves a page.


On Fri, Jun 7, 2013 at 8:27 PM, lc991 lorenzoc...@live.it wrote:

 how I capture  close windows event from user(from x in the upper right)



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/session-event-tp4659287.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: How to create a crosstab repeater

2013-06-10 Thread Martin Grigorov
Hi,

The image is not loadable and we cannot see what you need.
Can you upload it somewhere ?


On Wed, Jun 5, 2013 at 9:33 PM, Noven noven_...@yahoo.com wrote:

 Hi all,

 I wonder how to use wicket to repeat things like cross tab (like the one
 that have on jasper report palette).

 Example of what I want achieve can be seen here : checkcategoryxtab.png

 Thank you.


Re: wicket-guice HttpServletRequest

2013-06-10 Thread Martin Grigorov
Hi,

To be able to do this you have to know Guice internals.
HttpServletRequest is @Request scoped and since there is no http request in
unit/wicketTester tests Guice cannot provide it for you.

I guess that you can bind it manually in your TestModule so it will have a
global scope as workaround.

But your question is not for Wicket but Guice forums (if there are such,
because Guice is not very well maintained lately).



On Tue, Jun 4, 2013 at 1:01 AM, Watrous, Daniel daniel.t.watr...@hp.comwrote:

 I'm having some trouble getting my unittests to work when I use Guice to
 get an instance of the HttpServletRequest object. The page works fine when
 running in jetty, but in the unittests I get these errors.

 org.apache.wicket.WicketRuntimeException: Can't instantiate page using
 constructor 'public
 com.hp.honeybadger.console.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)'
 and argument ''. Might be it doesn't exist, may be it is not visible
 (public).

 1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot
 access scoped object. Either we are not currently inside an HTTP Servlet
 request, or you may have forgotten to apply
 com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
   at
 com.google.inject.servlet.InternalServletModule.provideHttpServletRequest(InternalServletModule.java:95)
   while locating javax.servlet.http.HttpServletRequest

 Caused by: com.google.inject.OutOfScopeException: Cannot access scoped
 object. Either we are not currently inside an HTTP Servlet request, or you
 may have forgotten to apply com.google.inject.servlet.GuiceFilter as a
 servlet filter for this request.

 This is my page

 public class HomePage extends WebPage {

 private static final long serialVersionUID = 1L;
 @Inject private HttpServletRequest request;

 public HomePage(final PageParameters parameters) {
 super(parameters);

 add(new Label(version,
 getApplication().getFrameworkSettings().getVersion()));

 // TODO Add your page's components here
 add(new Label(method, request.getMethod()));

 }
 }

 QUESTION

 How can I get around this issue or make use of a mock object to enable
 unittests?



Re: Apache Wicket + Ace Editor

2013-06-10 Thread Shengche Hsiao
Hello Martin

My project wants to implement java code editor on web, so I need an 
lined-textarea to show line number. First , I used Edit-Area 
(http://www.cdolivet.com/editarea/) (Demo - http://140.122.76.89), but 
It just enable at first time, when I submit the form code-area 
dissappeard. And then I tried Code-Mirror (http://codemirror.net/), the 
same problem  occurred.

I don't know how to enable them in wicket application.
Do I have to re-compose the java script into wicket component, and how?

Thanks a lot

On 2013/6/10 ?? 03:15, Martin Grigorov-4 [via Apache Wicket] wrote:
 Hi,

 What kind of problems you faced ?


 On Mon, Jun 10, 2013 at 8:51 AM, Shengche Hsiao [hidden email] 
 /user/SendEmail.jtp?type=nodenode=4659310i=0 wrote:

  Hello everyone
 
  I want to integrate ace editor into my wicket project, but after 
 gooogled I
  failed to do it.
  Is anyone give my some advise?
 
 
 
  -
  We do this not because it is easy. We do this because it is hard.
  --
  View this message in context:
  
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=4659310i=1
  For additional commands, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=4659310i=2
 
 


 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307p4659310.html
  

 To unsubscribe from Apache Wicket + Ace Editor, click here 
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4659307code=c2hlbmdjaGVoc2lhb0BnbWFpbC5jb218NDY1OTMwN3wtMTYxNzk4NTUxNA==.
 NAML 
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
  


-- 

---
We do this not because it is easy. We do this because it is hard.
---
ShengChe Hsiao
---
front...@gmail.com
front...@tc.edu.tw
---





-
We do this not because it is easy. We do this because it is hard.
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307p4659316.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 context menu component

2013-06-10 Thread Sebastien
Hi,

Did you looked at the Menu implementation? I think it should be close to
what you want to achieve:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/MenuBehavior.java

Here, the way to retrieve the menu-item id is done by:
CallbackParameter.resolved(id, ui.item.context.id)

Pay attention with this sample because the menu rendering is done
component-side, not by the behavior (Menu needs a markup)

You can find a dummy sample of component/behavior implementation here:
https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-samples/src/test/java/MyJQueryLabel.java

Hope this helps,
Sebastien.


On Mon, Jun 10, 2013 at 1:37 AM, bronius keptavi...@gmail.com wrote:

 Hello,

 I needed context menu component, but surprisingly it does not exit for
 current version, so decided to roll my own, even though i have very little
 Wicket experience and know absolutely nothing about jquery, so im like that
 dog :)
 http://apache-wicket.1842946.n4.nabble.com/file/n4659306/7TjIrsT.jpg

 Anyway I managed to get something working like this (maybe it will be
 helpful for someone or maybe someone smarter will show me my mistakes):
 1. Added https://github.com/sebfz1/wicket-jquery-ui dependency.
 2. Chosen to use this jquery plugin:
 http://medialize.github.io/jQuery-contextMenu/index.html
 3. After spending some time I managed to create Behavior like this:

 public class ContextMenuBehavior extends JQueryAbstractBehavior {

 private static final long serialVersionUID = 1L;

 private String selector;

 private ListMenuItem menuItems;

 public ContextMenuBehavior(String selector, ListMenuItem menuItems) {
 super(contextMenu);
 this.selector = selector;
 this.menuItems = menuItems;

 add(new JavaScriptResourceReference(ContextMenuBehavior.class,
 jquery.ui.position.js));
 add(new JavaScriptResourceReference(ContextMenuBehavior.class,
 jquery.contextMenu.js));
 add(new CssResourceReference(ContextMenuBehavior.class,
 jquery.contextMenu.css));
 }

 @Override
 protected String $() {
 // build menu items for jquery
 StringBuilder items = new StringBuilder(items: {);
 int nbOfMenuItems = menuItems.size();
 for (int i = 0; i  nbOfMenuItems; i++) {
 MenuItem menuItem = menuItems.get(i);
 items.append(').append(menuItem.getId()).append(': {name:
 ').append(menuItem.getTitle().getObject()).append(', icon:
 ').append(menuItem.getIcon()).append('});
 if (i  nbOfMenuItems - 1) {
 items.append(,);
 }
 }
 items.append(});
 return String.format($(function(){$.contextMenu({selector: '%s',
 callback: function(key, options) {var m = 'clicked: ' + key; window.console
  console.log(m) || alert(m); }, %s});});, selector, items.toString());
 }

 }

 4. $() method just prints jquery context menu initialization stuff from
 here: http://medialize.github.io/jQuery-contextMenu/demo.html

 5. Now when add this behavior to Page and add div class=userContextMenu
 to
 html right click on it gives me context menu so its working. Clicking on
 menu also shows me simple alert message as it is in callback parameter.

 6. So far so good, but now Im interested in how to link this to wicket
 component listener. I will put this menu on multiple links, so i would like
 to receive both on which link user clicked for context menu and which menu
 item he have chosen. How would you implement this? Also am I even on the
 right track? Is it good approach? Im sorry if this is stupid question :)



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306.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 context menu component

2013-06-10 Thread Martin Grigorov
Hi Sebastien,


On Mon, Jun 10, 2013 at 11:04 AM, Sebastien seb...@gmail.com wrote:

 Hi,

 Did you looked at the Menu implementation? I think it should be close to
 what you want to achieve:

 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/MenuBehavior.java

 Here, the way to retrieve the menu-item id is done by:
 CallbackParameter.resolved(id, ui.item.context.id)

 Pay attention with this sample because the menu rendering is done
 component-side, not by the behavior (Menu needs a markup)


I haven't checked how wicket-jquery-ui code related to Menu looks like but
you can check org.apache.wicket.markup.html.border.BorderBehavior for an
example of a behavior with a markup. It uses MarkupStream - i.e. very deep
internals of Wicket rendering machinery.



 You can find a dummy sample of component/behavior implementation here:

 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-samples/src/test/java/MyJQueryLabel.java

 Hope this helps,
 Sebastien.


 On Mon, Jun 10, 2013 at 1:37 AM, bronius keptavi...@gmail.com wrote:

  Hello,
 
  I needed context menu component, but surprisingly it does not exit for
  current version, so decided to roll my own, even though i have very
 little
  Wicket experience and know absolutely nothing about jquery, so im like
 that
  dog :)
  http://apache-wicket.1842946.n4.nabble.com/file/n4659306/7TjIrsT.jpg
 
  Anyway I managed to get something working like this (maybe it will be
  helpful for someone or maybe someone smarter will show me my mistakes):
  1. Added https://github.com/sebfz1/wicket-jquery-ui dependency.
  2. Chosen to use this jquery plugin:
  http://medialize.github.io/jQuery-contextMenu/index.html
  3. After spending some time I managed to create Behavior like this:
 
  public class ContextMenuBehavior extends JQueryAbstractBehavior {
 
  private static final long serialVersionUID = 1L;
 
  private String selector;
 
  private ListMenuItem menuItems;
 
  public ContextMenuBehavior(String selector, ListMenuItem
 menuItems) {
  super(contextMenu);
  this.selector = selector;
  this.menuItems = menuItems;
 
  add(new JavaScriptResourceReference(ContextMenuBehavior.class,
  jquery.ui.position.js));
  add(new JavaScriptResourceReference(ContextMenuBehavior.class,
  jquery.contextMenu.js));
  add(new CssResourceReference(ContextMenuBehavior.class,
  jquery.contextMenu.css));
  }
 
  @Override
  protected String $() {
  // build menu items for jquery
  StringBuilder items = new StringBuilder(items: {);
  int nbOfMenuItems = menuItems.size();
  for (int i = 0; i  nbOfMenuItems; i++) {
  MenuItem menuItem = menuItems.get(i);
  items.append(').append(menuItem.getId()).append(': {name:
  ').append(menuItem.getTitle().getObject()).append(', icon:
  ').append(menuItem.getIcon()).append('});
  if (i  nbOfMenuItems - 1) {
  items.append(,);
  }
  }
  items.append(});
  return String.format($(function(){$.contextMenu({selector: '%s',
  callback: function(key, options) {var m = 'clicked: ' + key;
 window.console
   console.log(m) || alert(m); }, %s});});, selector, items.toString());
  }
 
  }
 
  4. $() method just prints jquery context menu initialization stuff from
  here: http://medialize.github.io/jQuery-contextMenu/demo.html
 
  5. Now when add this behavior to Page and add div class=userContextMenu
  to
  html right click on it gives me context menu so its working. Clicking on
  menu also shows me simple alert message as it is in callback parameter.
 
  6. So far so good, but now Im interested in how to link this to wicket
  component listener. I will put this menu on multiple links, so i would
 like
  to receive both on which link user clicked for context menu and which
 menu
  item he have chosen. How would you implement this? Also am I even on the
  right track? Is it good approach? Im sorry if this is stupid question :)
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306.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
 
 



404 error when calling getResourceSettings().getResourceFinders()

2013-06-10 Thread Joseph Mokenela
Hi,

I need help with Wicket.


I am working on an application of which I am using Wicket framework for my
front end.

I have a folder named *markup* inside the root of webapp which i want to
put all the markup files in, the problem is that, when I call the following
line,

*getResourceSettings().getResourceFinders().add(new
WebApplicationPath(getServletContext(), markup))*

*I get the 404 error, resource not found*,  even if the folder is there on
the file system


Is there any extra setting I need to do?

Any help will be appreciated.


Regards,

-- 
*Joseph Mokenela*


*Write your code as if the person who maintains it is a homicidal maniac
who knows where you live.*

P please don't print this e-mail unless you really need to.


Re: Apache Wicket + Ace Editor

2013-06-10 Thread Martin Grigorov
Hi,


On Mon, Jun 10, 2013 at 10:45 AM, Shengche Hsiao shengchehs...@gmail.comwrote:

 Hello Martin

 My project wants to implement java code editor on web, so I need an
 lined-textarea to show line number. First , I used Edit-Area
 (http://www.cdolivet.com/editarea/) (Demo - http://140.122.76.89), but
 It just enable at first time, when I submit the form code-area
 dissappeard. And then I tried Code-Mirror (http://codemirror.net/), the
 same problem  occurred.

 I don't know how to enable them in wicket application.
 Do I have to re-compose the java script into wicket component, and how?


You have to integrate the JavaScript widget with Wicket.
Usually this means:
1) the Wicket component should create the markup needed for the JS widget.
In your case it seems that a textarea should be rendered
2) contribute all needed .js, .css and images needed by the JS widget (see
Component#renderHead() and CssHeaderItem for example)
2.1) contribute the JS widget initialization options. Most JS plugins
accept a JS object with the configuration
3) provide callback methods in your Wicket component/behavior which are
called by the JS widget when needed, e.g. when the user submits the data

Check https://github.com/sebfz1/wicket-jquery-ui project. It provides
integration with all JQuery UI widgets and some additional ones. Use it as
inspiration.
You can also check https://github.com/andunslg/Wysiwyg-Wicket - this is an
integration with yet another WYSIWYG JS widget for Wicket-JQuery-UI project.



 Thanks a lot

 On 2013/6/10 ?? 03:15, Martin Grigorov-4 [via Apache Wicket] wrote:
  Hi,
 
  What kind of problems you faced ?
 
 
  On Mon, Jun 10, 2013 at 8:51 AM, Shengche Hsiao [hidden email]
  /user/SendEmail.jtp?type=nodenode=4659310i=0 wrote:
 
   Hello everyone
  
   I want to integrate ace editor into my wicket project, but after
  gooogled I
   failed to do it.
   Is anyone give my some advise?
  
  
  
   -
   We do this not because it is easy. We do this because it is hard.
   --
   View this message in context:
  
 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307.html
   Sent from the Users forum mailing list archive at Nabble.com.
  
   -
   To unsubscribe, e-mail: [hidden email]
  /user/SendEmail.jtp?type=nodenode=4659310i=1
   For additional commands, e-mail: [hidden email]
  /user/SendEmail.jtp?type=nodenode=4659310i=2
  
  
 
 
  
  If you reply to this email, your message will be added to the
  discussion below:
 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307p4659310.html
 
  To unsubscribe from Apache Wicket + Ace Editor, click here
  
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4659307code=c2hlbmdjaGVoc2lhb0BnbWFpbC5jb218NDY1OTMwN3wtMTYxNzk4NTUxNA==
 .
  NAML
  
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
 
 

 --

 ---
 We do this not because it is easy. We do this because it is hard.
 ---
 ShengChe Hsiao
 ---
 front...@gmail.com
 front...@tc.edu.tw
 ---





 -
 We do this not because it is easy. We do this because it is hard.
 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307p4659316.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: 404 error when calling getResourceSettings().getResourceFinders()

2013-06-10 Thread Martin Grigorov
Hi,

I think your setup should be enough.
You can put a breakpoint in
org.apache.wicket.core.util.file.WebApplicationPath#find() method and see
what happens.


On Mon, Jun 10, 2013 at 11:23 AM, Joseph Mokenela 
matooanemoken...@gmail.com wrote:

 Hi,

 I need help with Wicket.


 I am working on an application of which I am using Wicket framework for my
 front end.

 I have a folder named *markup* inside the root of webapp which i want to
 put all the markup files in, the problem is that, when I call the following
 line,

 *getResourceSettings().getResourceFinders().add(new
 WebApplicationPath(getServletContext(), markup))*

 *I get the 404 error, resource not found*,  even if the folder is there on
 the file system


 Is there any extra setting I need to do?

 Any help will be appreciated.


 Regards,

 --
 *Joseph Mokenela*


 *Write your code as if the person who maintains it is a homicidal maniac
 who knows where you live.*

 P please don't print this e-mail unless you really need to.



Re: Wicket mail and pdf

2013-06-10 Thread Martin Grigorov
Hi,

If you use Wicket 6.7.0+ then you can use ComponentRenderer class to get
the markup of any Wicket Page/Panel/Component.
Then you can use the generated markup for mails and PDF creation.
For PDF creation you can check
https://github.com/flyingsaucerproject/flyingsaucer. There is a mail in the
users@ mail archives from the last few days by another user showing how to
use FlyingSaucer's ITextRenderer.


On Sat, Jun 8, 2013 at 8:39 PM, Piratenvisier hansheinrichbr...@yahoo.dewrote:

 I wanted to integrate mail and pdf creation in my wicket application.
 Till now I manage this by sending a request to a cocoon-2.2.0 application.
 This is a good solution but because I see no upgrade way using my cocoon
 application
 and integrating newer versions of spring I am looking for an alternative.

 Heiner

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




Re: How I get the internal html content of a dynamically updated div tag using Apache Wicket

2013-06-10 Thread Martin Grigorov
Hi,


On Mon, Jun 3, 2013 at 10:35 PM, Andun Sameera andun...@gmail.com wrote:

 Hi All,

 I have tried further with AjaxEditableLabel in following way to get the
 cotent of div tag.

 String value=Type.;
 AjaxEditableLabel ajaxEditableLabel=new
 AjaxEditableLabel(editorArea,new Model(value)){
 @Override
 public void onEdit(AjaxRequestTarget target){
 String value=getEditor().getValue();
 System.out.println(value);
 }
 @Override
 protected void onModelChanged() {
 String value=getEditor().getValue();
 System.out.println(value);
 }
 @Override
 protected void onModelChanging() {
 String value=getEditor().getValue();
 System.out.println(value);
 }
 protected void onSubmit(AjaxRequestTarget target){
 String value=getEditor().getValue();
 System.out.println(value);
 }
 };
 ajaxEditableLabel.setOutputMarkupId(true);
 ajaxEditableLabel.setMarkupId(editorArea);
 form.add(ajaxEditableLabel);

 When this applies Wysiwyg is working properly. The markup is updated. But
 the onEdit,onModelChaging methods are not invoked to update the model
 object value. Thus what will be the way to get the updated cotent from the
 ajax editable label?


The correct way is to use AjaxEditableLabel's model.



 Thanks!
 On Mon, Jun 3, 2013 at 5:17 AM, Andun Sameera andun...@gmail.com wrote:

  Hi All,
 
  Also cant we use AjaxEditableMultiLineLabel which is used in [1] for the
  task?
 
  Thanks!
 
  [1] -
 
 http://www.wicket-library.com/wicket-examples/ajax/wicket/bookmarkable/org.apache.wicket.examples.source.SourcesPage?1SourcesPage_class=org.apache.wicket.examples.ajax.builtin.EditableLabelPage
 
 
  On Sun, Jun 2, 2013 at 10:24 AM, Maxim Solodovnik solomax...@gmail.com
 wrote:
 
  Hello Martin,
 
  Thanks for the reply
 
  Is it possible to wrap component into its own form and add some behavior
  which will trigger adding DynamicExtraParameters on upper form submit?
 
  I have added new AjaxFormSubmitBehavior(this, submit) to my component
  form but it is not triggered on upper form submit :(
 
 
 
 
  On Sat, Jun 1, 2013 at 3:25 PM, Martin Grigorov mgrigo...@apache.org
  wrote:
 
   Hi Maxim,
  
   It depends what is the markup you have to work with.
   Usually WYSIWYG widgets work with just a div or textarea and
 create
   other HTML elements dynamically with JavaScript to do their job, e.g.
 an
   iframe.
   Additionally they almost always give you API to get the produced rich
   content (html, markdown, ...).
   For example:
   var richEditor = $.myWysiwyg(#myTextArea);
   var richContent = richEditor.getContent();
  
   doSomethingWithRichContent(richContent);
  
   So it is not always possible to create 1:1 mapping between the client
  and
   the server usage of form components.
  
  
  
   On Sat, Jun 1, 2013 at 11:11 AM, Maxim Solodovnik 
 solomax...@gmail.com
   wrote:
  
Hello Martin,
   
Is it possible to create FormComponentPanel as in following example
   
   
  
 
 https://cwiki.apache.org/WICKET/creating-custom-formcomponentpanels-to-build-valid-objects-using-wickets-form-validation-logic.html
   
but taking the value from the div.innerHtml and not the textfield?
   
   
On Sat, Jun 1, 2013 at 2:19 PM, Martin Grigorov 
 mgrigo...@apache.org
wrote:
   
 Hi,

 I guess you want to get the new entered text via Ajax submit.
 You can extend AjaxSubmitButton and implement
  #updateAjaxAttributes() {

attributes.getDynamicExtraParameters().add(return [ {name:
'richText',
 value: $('#editorArea').html() } ]);
 }

 Then use


   
  
 
 getRequest().getRequestParameters().getParameterValue(richText).toString()
 to get the produced HTML.


 On Sat, Jun 1, 2013 at 8:04 AM, Andun Sameera andun...@gmail.com
 
wrote:

  Hi,
 
  In my html file I have a div tag like this,
 
  div wicket:id=editorAreaType Here/div
 
  I am using a JavaScript library called bootstrap-wysiwyg to make
  this
  div tag a text are which we can type rich text. When the person
  types
  text, div tag's html content updates to represent the text
  content in
  html. I want to retrieve it in to the Java code of the html file
  in
  wicket. I tried to do it by creating reference variable to div
 tag
  like following,
 
  WebMarkupContainer editorArea=new
  WebMarkupContainer(editorArea);
  String text=editorArea.getMarkup().toString(true)
 
  But this don't give me the updated HTML content. I give only the
  initial html content. what is the problem here?
 
  Thanks!
 
  --
  Regards
  Andun S.L. Gunawardana
  Undergraduate
  Department of Computer 

Re: Connecting... in Firefox's tab title

2013-06-10 Thread Guillaume Smet
Hi Sven,

On Fri, Jun 7, 2013 at 10:36 PM, Sven Meier s...@meiers.net wrote:
 Yes please. And don't forget to add the collected information to it.

Done: https://issues.apache.org/jira/browse/WICKET-5222

Quickstart and patch attached: it fixes the problem for us.

Thanks.

-- 
Guillaume

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



Re: Apache Wicket + Ace Editor

2013-06-10 Thread Shengche Hsiao
Hi Martin

Thanks for your help, I'll check it out!


On Mon, Jun 10, 2013 at 4:26 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,


 On Mon, Jun 10, 2013 at 10:45 AM, Shengche Hsiao shengchehs...@gmail.com
 wrote:

  Hello Martin
 
  My project wants to implement java code editor on web, so I need an
  lined-textarea to show line number. First , I used Edit-Area
  (http://www.cdolivet.com/editarea/) (Demo - http://140.122.76.89), but
  It just enable at first time, when I submit the form code-area
  dissappeard. And then I tried Code-Mirror (http://codemirror.net/), the
  same problem  occurred.
 
  I don't know how to enable them in wicket application.
  Do I have to re-compose the java script into wicket component, and how?
 

 You have to integrate the JavaScript widget with Wicket.
 Usually this means:
 1) the Wicket component should create the markup needed for the JS widget.
 In your case it seems that a textarea should be rendered
 2) contribute all needed .js, .css and images needed by the JS widget (see
 Component#renderHead() and CssHeaderItem for example)
 2.1) contribute the JS widget initialization options. Most JS plugins
 accept a JS object with the configuration
 3) provide callback methods in your Wicket component/behavior which are
 called by the JS widget when needed, e.g. when the user submits the data

 Check https://github.com/sebfz1/wicket-jquery-ui project. It provides
 integration with all JQuery UI widgets and some additional ones. Use it as
 inspiration.
 You can also check https://github.com/andunslg/Wysiwyg-Wicket - this is an
 integration with yet another WYSIWYG JS widget for Wicket-JQuery-UI
 project.


 
  Thanks a lot
 
  On 2013/6/10 ?? 03:15, Martin Grigorov-4 [via Apache Wicket] wrote:
   Hi,
  
   What kind of problems you faced ?
  
  
   On Mon, Jun 10, 2013 at 8:51 AM, Shengche Hsiao [hidden email]
   /user/SendEmail.jtp?type=nodenode=4659310i=0 wrote:
  
Hello everyone
   
I want to integrate ace editor into my wicket project, but after
   gooogled I
failed to do it.
Is anyone give my some advise?
   
   
   
-
We do this not because it is easy. We do this because it is hard.
--
View this message in context:
   
  
 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307.html
Sent from the Users forum mailing list archive at Nabble.com.
   
-
To unsubscribe, e-mail: [hidden email]
   /user/SendEmail.jtp?type=nodenode=4659310i=1
For additional commands, e-mail: [hidden email]
   /user/SendEmail.jtp?type=nodenode=4659310i=2
   
   
  
  
  
 
   If you reply to this email, your message will be added to the
   discussion below:
  
 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307p4659310.html
  
   To unsubscribe from Apache Wicket + Ace Editor, click here
   
 
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4659307code=c2hlbmdjaGVoc2lhb0BnbWFpbC5jb218NDY1OTMwN3wtMTYxNzk4NTUxNA==
  .
   NAML
   
 
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
  
  
 
  --
 
  ---
  We do this not because it is easy. We do this because it is hard.
  ---
  ShengChe Hsiao
  ---
  front...@gmail.com
  front...@tc.edu.tw
  ---
 
 
 
 
 
  -
  We do this not because it is easy. We do this because it is hard.
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Ace-Editor-tp4659307p4659316.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 context menu component

2013-06-10 Thread bronius
Hi,

Yes I checked it. I also was reading this:
http://code.google.com/p/wicket-jquery-ui/wiki/HowToCreatePlugin2. However
context menu plug in was not standard here is jquery example:
$(function(){
$.contextMenu({
selector: '.context-menu-one', 
callback: function(key, options) {
var m = clicked:  + key;
window.console  console.log(m) || alert(m); 
},
items: {
edit: {name: Edit, icon: edit},
cut: {name: Cut, icon: cut},
copy: {name: Copy, icon: copy},
paste: {name: Paste, icon: paste},
delete: {name: Delete, icon: delete},
sep1: -,
quit: {name: Quit, icon: quit}
}
});

$('.context-menu-one').on('click', function(e){
console.log('clicked', this);
})
});
Now the problem is I don't have knowledge about jquery, but from what I
understand it creates context menu instance with parameters: selector,
callback and items.  Differently from menu it does not have any markup
(items are passed as parameters and thats it) and also jquery syntax is
different. Menu jquery example is just like this:
 $(function() {
$( #menu ).menu();
});
 Thats why I extended JQueryAbstractBehavior, as jquery initialization is
quite different. What I implemented shows context menu, and callback
function is invoked(from jquery parameter), but I lack knowledge on how to
convert that callback function to wicket one. Menu example is ok, but its
different and also it seems I understand what separate methods do, but
because of my inexperience I lack bigger picture understanding how
everything works together. Any help is really appreciated :)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659334.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



Resource that produces JSON and JQuery

2013-06-10 Thread Andrea Del Bene

Hi,

can anybody point me to some code that illustrates how to produce a JSON 
valid text with a mounted resource? My goal is to load it via AJAX in a 
page with JQuery function getJSON.
I've tried to directly write JSON into the response object without any 
success.


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



Re: Resource that produces JSON and JQuery

2013-06-10 Thread Martin Grigorov
Hi Andrea,

I guess your problem is related to jQuery's validation of the response.
To parse the text response to JSON jQuery needs
1) correct response content-type header
2) valid JSON - make sure the keys are in double quotes

Show us your code and the produced response for more help.


On Mon, Jun 10, 2013 at 2:02 PM, Andrea Del Bene an.delb...@gmail.comwrote:

 Hi,

 can anybody point me to some code that illustrates how to produce a JSON
 valid text with a mounted resource? My goal is to load it via AJAX in a
 page with JQuery function getJSON.
 I've tried to directly write JSON into the response object without any
 success.

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




Reusing behaviors across components

2013-06-10 Thread Marios Skounakis
Hi all,

Is there any obvious reason why adding the same behavior instance that
implements onBeforeRender and onAfterRender cannot be used on multiple
components on the same form?

Thanks
Marios


Re: Reusing behaviors across components

2013-06-10 Thread Martin Grigorov
Hi,

You can reuse instances of simple behaviors.
You cannot reuse behaviors which can work with only one component like Ajax
behaviors because they need the component to create the callback url.


On Mon, Jun 10, 2013 at 2:25 PM, Marios Skounakis msc...@gmail.com wrote:

 Hi all,

 Is there any obvious reason why adding the same behavior instance that
 implements onBeforeRender and onAfterRender cannot be used on multiple
 components on the same form?

 Thanks
 Marios



Re: Resource that produces JSON and JQuery

2013-06-10 Thread Andrea Del Bene

The code is quite simple as it's basically a prototype. Java code:

@Override
public void respond(Attributes attributes) {
StringValue action = attributes.getParameters().get(SEGMENT);
attributes.getResponse().write(calculateResponse(action, 
attributes));

}

private String calculateResponse(StringValue action, Attributes 
attributes) {

String response = {{ +
  \Herausgeber\: \Xema\,  +
  \Nummer\: \1234-5678-9012-3456\}};

if(action.toString().equals(SAVE)){
IRequestParameters requestParameters = 
attributes.getRequest().getRequestParameters();
response = 
requestParameters.getParameterValue(teamCalendarJson).toString();

}
System.out.println(response);
return response;
}


As  you said the error could be a missing settings for content-type 
header. Should I use application/json?



Hi Andrea,

I guess your problem is related to jQuery's validation of the response.
To parse the text response to JSON jQuery needs
1) correct response content-type header
2) valid JSON - make sure the keys are in double quotes

Show us your code and the produced response for more help.


On Mon, Jun 10, 2013 at 2:02 PM, Andrea Del Bene an.delb...@gmail.comwrote:


Hi,

can anybody point me to some code that illustrates how to produce a JSON
valid text with a mounted resource? My goal is to load it via AJAX in a
page with JQuery function getJSON.
I've tried to directly write JSON into the response object without any
success.

--**--**-
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: Resource that produces JSON and JQuery

2013-06-10 Thread Martin Grigorov
On Mon, Jun 10, 2013 at 3:11 PM, Andrea Del Bene an.delb...@gmail.comwrote:

 The code is quite simple as it's basically a prototype. Java code:

 @Override
 public void respond(Attributes attributes) {
 StringValue action = attributes.getParameters().**get(SEGMENT);
 attributes.getResponse().**write(calculateResponse(**action,
 attributes));
 }

 private String calculateResponse(StringValue action, Attributes
 attributes) {
 String response = {{ +
   \Herausgeber\: \Xema\,  +
   \Nummer\: \1234-5678-9012-3456\}};


Why there are doubled '{' and '}' ?



 if(action.toString().equals(**SAVE)){
 IRequestParameters requestParameters = attributes.getRequest().
 **getRequestParameters();
 response = requestParameters.**getParameterValue(**
 teamCalendarJson).toString();
 }
 System.out.println(response);
 return response;
 }


 As  you said the error could be a missing settings for content-type
 header. Should I use application/json?


Yes.



  Hi Andrea,

 I guess your problem is related to jQuery's validation of the response.
 To parse the text response to JSON jQuery needs
 1) correct response content-type header
 2) valid JSON - make sure the keys are in double quotes

 Show us your code and the produced response for more help.


 On Mon, Jun 10, 2013 at 2:02 PM, Andrea Del Bene an.delb...@gmail.com
 wrote:

  Hi,

 can anybody point me to some code that illustrates how to produce a JSON
 valid text with a mounted resource? My goal is to load it via AJAX in a
 page with JQuery function getJSON.
 I've tried to directly write JSON into the response object without any
 success.

 --**
 --**-
 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




Re: Wicket context menu component

2013-06-10 Thread Sebastien
Hi Martin,

Thanks for the tips!
Actually, the way how the wicket-jquery-ui Menu works can a little bit be
compared to the Tree implementation in wicket-extensions.
In my case, I think the markup is easier to use, considering there is a
recursive loop for sub-menus...

Thanks again  best regards,
Sebastien.


On Mon, Jun 10, 2013 at 10:17 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi Sebastien,


 On Mon, Jun 10, 2013 at 11:04 AM, Sebastien seb...@gmail.com wrote:

  Hi,
 
  Did you looked at the Menu implementation? I think it should be close to
  what you want to achieve:
 
 
 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui/src/main/java/com/googlecode/wicket/jquery/ui/widget/menu/MenuBehavior.java
 
  Here, the way to retrieve the menu-item id is done by:
  CallbackParameter.resolved(id, ui.item.context.id)
 
  Pay attention with this sample because the menu rendering is done
  component-side, not by the behavior (Menu needs a markup)
 

 I haven't checked how wicket-jquery-ui code related to Menu looks like but
 you can check org.apache.wicket.markup.html.border.BorderBehavior for an
 example of a behavior with a markup. It uses MarkupStream - i.e. very deep
 internals of Wicket rendering machinery.


 
  You can find a dummy sample of component/behavior implementation here:
 
 
 https://github.com/sebfz1/wicket-jquery-ui/blob/master/wicket-jquery-ui-samples/src/test/java/MyJQueryLabel.java
 
  Hope this helps,
  Sebastien.
 
 
  On Mon, Jun 10, 2013 at 1:37 AM, bronius keptavi...@gmail.com wrote:
 
   Hello,
  
   I needed context menu component, but surprisingly it does not exit for
   current version, so decided to roll my own, even though i have very
  little
   Wicket experience and know absolutely nothing about jquery, so im like
  that
   dog :)
   http://apache-wicket.1842946.n4.nabble.com/file/n4659306/7TjIrsT.jpg
  
   Anyway I managed to get something working like this (maybe it will be
   helpful for someone or maybe someone smarter will show me my mistakes):
   1. Added https://github.com/sebfz1/wicket-jquery-ui dependency.
   2. Chosen to use this jquery plugin:
   http://medialize.github.io/jQuery-contextMenu/index.html
   3. After spending some time I managed to create Behavior like this:
  
   public class ContextMenuBehavior extends JQueryAbstractBehavior {
  
   private static final long serialVersionUID = 1L;
  
   private String selector;
  
   private ListMenuItem menuItems;
  
   public ContextMenuBehavior(String selector, ListMenuItem
  menuItems) {
   super(contextMenu);
   this.selector = selector;
   this.menuItems = menuItems;
  
   add(new JavaScriptResourceReference(ContextMenuBehavior.class,
   jquery.ui.position.js));
   add(new JavaScriptResourceReference(ContextMenuBehavior.class,
   jquery.contextMenu.js));
   add(new CssResourceReference(ContextMenuBehavior.class,
   jquery.contextMenu.css));
   }
  
   @Override
   protected String $() {
   // build menu items for jquery
   StringBuilder items = new StringBuilder(items: {);
   int nbOfMenuItems = menuItems.size();
   for (int i = 0; i  nbOfMenuItems; i++) {
   MenuItem menuItem = menuItems.get(i);
   items.append(').append(menuItem.getId()).append(':
 {name:
   ').append(menuItem.getTitle().getObject()).append(', icon:
   ').append(menuItem.getIcon()).append('});
   if (i  nbOfMenuItems - 1) {
   items.append(,);
   }
   }
   items.append(});
   return String.format($(function(){$.contextMenu({selector:
 '%s',
   callback: function(key, options) {var m = 'clicked: ' + key;
  window.console
console.log(m) || alert(m); }, %s});});, selector,
 items.toString());
   }
  
   }
  
   4. $() method just prints jquery context menu initialization stuff from
   here: http://medialize.github.io/jQuery-contextMenu/demo.html
  
   5. Now when add this behavior to Page and add div
 class=userContextMenu
   to
   html right click on it gives me context menu so its working. Clicking
 on
   menu also shows me simple alert message as it is in callback parameter.
  
   6. So far so good, but now Im interested in how to link this to wicket
   component listener. I will put this menu on multiple links, so i would
  like
   to receive both on which link user clicked for context menu and which
  menu
   item he have chosen. How would you implement this? Also am I even on
 the
   right track? Is it good approach? Im sorry if this is stupid question
 :)
  
  
  
   --
   View this message in context:
  
 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306.html
   Sent from the Users forum mailing list archive at Nabble.com.
  
   -
   To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
   For additional 

AjaxEditableMultiLineLabel inside Link

2013-06-10 Thread heikki
hello,

I have a Link, used in a menu to go to a different page. When a content
editor is logged in, the link's text is rendered by an
AjaxEditableMultiLineLabel.

In that case, when you click on the link, the AjaxEditableMultiLineLabel
opens an input textarea with the current value selected. Updating it works
fine as long as the user doesn't click in it, because then the surrounding
link takes you to another page.

I would like to disable the link on onEdit() and re-enable it onSubmit(). I
tried using link.setEnabled(true/false) for it, but that has the effect that
the AjaxEditableMultiLineLabel no longer works, I guess because it is a
child component of the link and also gets disabled.


Do you have any tips ?

Kind regards
Heikki Doeleman



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxEditableMultiLineLabel-inside-Link-tp4659348.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 context menu component

2013-06-10 Thread Sebastien
Hi,

I think what is missing you is the AjaxBehavior / Event / jQuery event
binding.

Basically, your ContextMenuBehavior (CMB) should embed an ajax behavior
(JQueryAjaxBehavior, let's say AB). A common Event object (E) should be
shared between CMB  AB. Note that CMB should implement IJQueryAjaxAware
the its instance (this) should be passed to AB's contructor.

Once bound to the CMB (see #bind() ), you can get the
AB#getCallbackFunction() (if using wicket-jquery-ui-6.x) that you will
transmit to the jQuery function 'callback' like this:
{ selector: '.the selector', callback:  + ab.getCallbackFunction() +  }.

At this stage, AB should be invoked when the jQuery event is fired, and you
can do things in CMD#onAjax(AjaxRequestTarget target, JQueryEvent event).
(note the JQueryEvent here)

The question is now how you transmit an additional information to AB (means
wicket side).
First, you need to know what parameter context-menu will give you when the
callback is triggered. If I see that the callback have 2 parameters (key
and options), I will suppose that the key is the menu-id I am interested to
get back, so in AB:

protected CallbackParameter[] getCallbackParameters()
{
return new CallbackParameter[] {
CallbackParameter.explicit(key) //considering key is the
menu-item key, see CallbackParameter javadoc
CallbackParameter.context(option),
};
}

Once invoked AB will create a new E. What you need is a custom event that
have a key property (ie: getKey()) which have the value coming the jquery
callback:
protected static class MyCallbackEvent extends JQueryEvent
{
private final String key;

public MyCallbackEvent()
{
this.key =
RequestCycleUtils.getQueryParameterValue(key).toString(); //the menu key!
}

public String getKey()
{
return this.key;
}
}

Here we are, in the onAjax above, get the key, eventually the menu-item
associated to the key, and fire a custom event (for instance onClick,
onMenuClicked, onWhatYouWant)

if (event instanceof MyCallbackEvent )
{
String key = ((MyCallbackEvent)event).getKey();
MenuItem item = null; // FIXME: get the menu item using the key from
the ListMenuItem

this.onClick(target, item); //the custom event
}


If you encounter other problem(s), you can post a quickstart on the
wicket-jquery-ui googlegroup. (but my home PC is currently under
re-installation so feel free to investigate a little bit on your own
before... ;))

Best regards,
Sebastien.



On Mon, Jun 10, 2013 at 12:14 PM, bronius keptavi...@gmail.com wrote:

 Hi,

 Yes I checked it. I also was reading this:
 http://code.google.com/p/wicket-jquery-ui/wiki/HowToCreatePlugin2. However
 context menu plug in was not standard here is jquery example:
 $(function(){
 $.contextMenu({
 selector: '.context-menu-one',
 callback: function(key, options) {
 var m = clicked:  + key;
 window.console  console.log(m) || alert(m);
 },
 items: {
 edit: {name: Edit, icon: edit},
 cut: {name: Cut, icon: cut},
 copy: {name: Copy, icon: copy},
 paste: {name: Paste, icon: paste},
 delete: {name: Delete, icon: delete},
 sep1: -,
 quit: {name: Quit, icon: quit}
 }
 });

 $('.context-menu-one').on('click', function(e){
 console.log('clicked', this);
 })
 });
 Now the problem is I don't have knowledge about jquery, but from what I
 understand it creates context menu instance with parameters: selector,
 callback and items.  Differently from menu it does not have any markup
 (items are passed as parameters and thats it) and also jquery syntax is
 different. Menu jquery example is just like this:
  $(function() {
 $( #menu ).menu();
 });
  Thats why I extended JQueryAbstractBehavior, as jquery initialization is
 quite different. What I implemented shows context menu, and callback
 function is invoked(from jquery parameter), but I lack knowledge on how to
 convert that callback function to wicket one. Menu example is ok, but its
 different and also it seems I understand what separate methods do, but
 because of my inexperience I lack bigger picture understanding how
 everything works together. Any help is really appreciated :)



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Wicket-context-menu-component-tp4659306p4659334.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: AjaxEditableMultiLineLabel inside Link

2013-06-10 Thread Martin Grigorov
Hi,

You should read about JavaScript event propagation and
event.stopPropagation()


On Mon, Jun 10, 2013 at 3:25 PM, heikki tropic...@gmail.com wrote:

 hello,

 I have a Link, used in a menu to go to a different page. When a content
 editor is logged in, the link's text is rendered by an
 AjaxEditableMultiLineLabel.

 In that case, when you click on the link, the AjaxEditableMultiLineLabel
 opens an input textarea with the current value selected. Updating it works
 fine as long as the user doesn't click in it, because then the surrounding
 link takes you to another page.

 I would like to disable the link on onEdit() and re-enable it onSubmit(). I
 tried using link.setEnabled(true/false) for it, but that has the effect
 that
 the AjaxEditableMultiLineLabel no longer works, I guess because it is a
 child component of the link and also gets disabled.


 Do you have any tips ?

 Kind regards
 Heikki Doeleman



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxEditableMultiLineLabel-inside-Link-tp4659348.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: Resource that produces JSON and JQuery

2013-06-10 Thread Andrea Del Bene

On 06/10/2013 02:17 PM, Martin Grigorov wrote:

On Mon, Jun 10, 2013 at 3:11 PM, Andrea Del Bene an.delb...@gmail.comwrote:


The code is quite simple as it's basically a prototype. Java code:

@Override
 public void respond(Attributes attributes) {
 StringValue action = attributes.getParameters().**get(SEGMENT);
 attributes.getResponse().**write(calculateResponse(**action,
attributes));
 }

 private String calculateResponse(StringValue action, Attributes
attributes) {
 String response = {{ +
   \Herausgeber\: \Xema\,  +
   \Nummer\: \1234-5678-9012-3456\}};


Why there are doubled '{' and '}' ?


Just the result of some bad ideas :)





 if(action.toString().equals(**SAVE)){
 IRequestParameters requestParameters = attributes.getRequest().
**getRequestParameters();
 response = requestParameters.**getParameterValue(**
teamCalendarJson).toString();
 }
 System.out.println(response);
 return response;
 }


As  you said the error could be a missing settings for content-type
header. Should I use application/json?


Yes.


I've tried with :

@Override
public void respond(Attributes attributes) {
StringValue action = attributes.getParameters().get(SEGMENT);
WebResponse response = (WebResponse) attributes.getResponse();
response.setContentType(application/json);
response.write(calculateResponse(action, attributes));
}

private String calculateResponse(StringValue action, Attributes 
attributes) {

String response = { +
  \Herausgeber\: \Xema\,  +
  \Nummer\: \1234-5678-9012-3456\};

if(action.toString().equals(SAVE)){
IRequestParameters requestParameters = 
attributes.getRequest().getRequestParameters();
response = 
requestParameters.getParameterValue(teamCalendarJson).toString();

}
System.out.println(response);
return response;
}


but it still fail calling the error  function of getJSON.


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



Re: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-10 Thread harmoniaa
FYI:

I had a problem using ComponentRenderer with ListView (it was complaining
the there was no markup for wicket-id my-wicket-id).

Additionally, ITextRenderer (or xerces actually) was not able to parse XML
from the markup with Wicket tags (The prefix wicket for element
wicket:container is not bound.).

I found another solution here: http://stackoverflow.com/a/11898702/536265

Then I added this before rendering:

  IMarkupSettings markupSettings =
component.getApplication().getMarkupSettings();
  boolean originalStripWicketTags = markupSettings.getStripWicketTags();
  markupSettings.setStripWicketTags(true);

And to the finally block:

  markupSettings.setStripWicketTags(originalStripWicketTags);

If you think ComponentRenderer could/should be improved, maybe this will
give you some ideas.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Can-i-display-a-WepPage-in-a-PDF-How-to-get-the-rendered-markup-tp4659290p4659352.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: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-10 Thread Martin Grigorov
Hi Edvard,

Thank you for the feedback.

ComponentRenderer (CR) just asks Wicket to render a component. The
rendering process uses all the application settings so if the wicket
tags/attributes cause any problems then the application can turn them off
before using CR and turn on after.
So I think CR doesn't need to be changed to have this code in itself.

In production mode Wicket strips these tags and attributes unless you
explicitly turn them on.


On Mon, Jun 10, 2013 at 4:05 PM, harmoniaa 
edvard.fons...@nitorcreations.com wrote:

 FYI:

 I had a problem using ComponentRenderer with ListView (it was complaining
 the there was no markup for wicket-id my-wicket-id).

 Additionally, ITextRenderer (or xerces actually) was not able to parse XML
 from the markup with Wicket tags (The prefix wicket for element
 wicket:container is not bound.).

 I found another solution here: http://stackoverflow.com/a/11898702/536265

 Then I added this before rendering:

   IMarkupSettings markupSettings =
 component.getApplication().getMarkupSettings();
   boolean originalStripWicketTags = markupSettings.getStripWicketTags();
   markupSettings.setStripWicketTags(true);

 And to the finally block:

   markupSettings.setStripWicketTags(originalStripWicketTags);

 If you think ComponentRenderer could/should be improved, maybe this will
 give you some ideas.



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-i-display-a-WepPage-in-a-PDF-How-to-get-the-rendered-markup-tp4659290p4659352.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: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-10 Thread harmoniaa
Good point. Anyway, that still leaves me the issue with ListView...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Can-i-display-a-WepPage-in-a-PDF-How-to-get-the-rendered-markup-tp4659290p4659354.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: Can i display a WepPage in a PDF (How to get the rendered markup)?

2013-06-10 Thread Martin Grigorov
On Mon, Jun 10, 2013 at 4:30 PM, harmoniaa 
edvard.fons...@nitorcreations.com wrote:

 Good point. Anyway, that still leaves me the issue with ListView...


Please create a ticket with a quickstart for this.





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Can-i-display-a-WepPage-in-a-PDF-How-to-get-the-rendered-markup-tp4659290p4659354.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: 404 error when calling getResourceSettings().getResourceFinders()

2013-06-10 Thread Joseph Mokenela
Thanks for the quick response Martin,

I have tried to debug the application but without success, I am using jetty
server and i keep getting the following stacktrace on jetty. I am using
Wicket 6.8.0

INFO  - RequestListenerInterface   - registered listener interface
[RequestListenerInterface name=IBehaviorListener, method=public abstract
void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
INFO  - RequestListenerInterface   - registered listener interface
[RequestListenerInterface name=IFormSubmitListener, method=public abstract
void
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
INFO  - RequestListenerInterface   - registered listener interface
[RequestListenerInterface name=ILinkListener, method=public abstract void
org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
INFO  - RequestListenerInterface   - registered listener interface
[RequestListenerInterface name=IOnChangeListener, method=public abstract
void
org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
INFO  - RequestListenerInterface   - registered listener interface
[RequestListenerInterface name=IRedirectListener, method=public abstract
void org.apache.wicket.IRedirectListener.onRedirect()]
INFO  - RequestListenerInterface   - registered listener interface
[RequestListenerInterface name=IResourceListener, method=public abstract
void org.apache.wicket.IResourceListener.onResourceRequested()]
INFO  - Application- [wicket.radar-marketing] init: Wicket
extensions initializer
WARN  - AbstractLifeCycle  - FAILED wicket.radar-marketing:
java.lang.NoSuchMethodError:
org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
java.lang.NoSuchMethodError:
org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
at
org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)
at org.apache.wicket.Application.initInitializers(Application.java:612)
at org.apache.wicket.Application.initializeComponents(Application.java:521)
at org.apache.wicket.Application.initApplication(Application.java:817)
at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:424)
at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748)
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
at org.eclipse.jetty.server.Server.doStart(Server.java:260)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at com.mmjmicrosystems.radarmarketing.Start.main(Start.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
WARN  - AbstractLifeCycle  - FAILED
o.e.j.w.WebAppContext{/radarmarketing,file:/N:/Projects/Java%20Enterprise/radar-marketing/src/main/webapp/},src/main/webapp:
java.lang.NoSuchMethodError:
org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
java.lang.NoSuchMethodError:
org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
at
org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)
at org.apache.wicket.Application.initInitializers(Application.java:612)
at org.apache.wicket.Application.initializeComponents(Application.java:521)
at org.apache.wicket.Application.initApplication(Application.java:817)
at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:424)
at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748)
at

Re: 404 error when calling getResourceSettings().getResourceFinders()

2013-06-10 Thread Joseph Mokenela
The line at com.mmjmicrosystems.radarmarketing.Start.main(Start.java:66)

is simply the call to server.start();

on the jetty server instance.


On Mon, Jun 10, 2013 at 4:26 PM, Joseph Mokenela matooanemoken...@gmail.com
 wrote:

 Thanks for the quick response Martin,

 I have tried to debug the application but without success, I am using
 jetty server and i keep getting the following stacktrace on jetty. I am
 using Wicket 6.8.0

 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IBehaviorListener, method=public abstract
 void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IFormSubmitListener, method=public abstract
 void
 org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=ILinkListener, method=public abstract void
 org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IOnChangeListener, method=public abstract
 void
 org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IRedirectListener, method=public abstract
 void org.apache.wicket.IRedirectListener.onRedirect()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IResourceListener, method=public abstract
 void org.apache.wicket.IResourceListener.onResourceRequested()]
 INFO  - Application- [wicket.radar-marketing] init: Wicket
 extensions initializer
 WARN  - AbstractLifeCycle  - FAILED wicket.radar-marketing:
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 at
 org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
  at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)
 at org.apache.wicket.Application.initInitializers(Application.java:612)
  at
 org.apache.wicket.Application.initializeComponents(Application.java:521)
 at org.apache.wicket.Application.initApplication(Application.java:817)
  at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:424)
 at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
  at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102)
 at
 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
  at
 org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748)
 at
 org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
  at
 org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222)
 at
 org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
  at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
 at
 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
  at
 org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
 at org.eclipse.jetty.server.Server.doStart(Server.java:260)
  at
 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at com.mmjmicrosystems.radarmarketing.Start.main(Start.java:66)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:601)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
 WARN  - AbstractLifeCycle  - FAILED
 o.e.j.w.WebAppContext{/radarmarketing,file:/N:/Projects/Java%20Enterprise/radar-marketing/src/main/webapp/},src/main/webapp:
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 at
 org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
  at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)
 at org.apache.wicket.Application.initInitializers(Application.java:612)
  at
 org.apache.wicket.Application.initializeComponents(Application.java:521)
 at org.apache.wicket.Application.initApplication(Application.java:817)
  at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:424)
 at 

Re: 404 error when calling getResourceSettings().getResourceFinders()

2013-06-10 Thread Martin Grigorov
Hi,


On Mon, Jun 10, 2013 at 5:26 PM, Joseph Mokenela matooanemoken...@gmail.com
 wrote:

 Thanks for the quick response Martin,

 I have tried to debug the application but without success, I am using jetty
 server and i keep getting the following stacktrace on jetty. I am using
 Wicket 6.8.0

 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IBehaviorListener, method=public abstract
 void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IFormSubmitListener, method=public abstract
 void
 org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=ILinkListener, method=public abstract void
 org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IOnChangeListener, method=public abstract
 void
 org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IRedirectListener, method=public abstract
 void org.apache.wicket.IRedirectListener.onRedirect()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IResourceListener, method=public abstract
 void org.apache.wicket.IResourceListener.onResourceRequested()]
 INFO  - Application- [wicket.radar-marketing] init: Wicket
 extensions initializer
 WARN  - AbstractLifeCycle  - FAILED wicket.radar-marketing:
 java.lang.NoSuchMethodError:

 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 java.lang.NoSuchMethodError:

 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 at

 org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
 at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)


The error above says that you use different version of wicket-extensions. A
guess it is something before Wicket 6.0.0.



 at org.apache.wicket.Application.initInitializers(Application.java:612)
 at org.apache.wicket.Application.initializeComponents(Application.java:521)
 at org.apache.wicket.Application.initApplication(Application.java:817)
 at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:424)
 at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
 at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102)
 at

 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at

 org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748)
 at

 org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
 at

 org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222)
 at

 org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
 at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
 at

 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at

 org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
 at org.eclipse.jetty.server.Server.doStart(Server.java:260)
 at

 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at com.mmjmicrosystems.radarmarketing.Start.main(Start.java:66)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

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

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:601)
 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
 WARN  - AbstractLifeCycle  - FAILED

 o.e.j.w.WebAppContext{/radarmarketing,file:/N:/Projects/Java%20Enterprise/radar-marketing/src/main/webapp/},src/main/webapp:
 java.lang.NoSuchMethodError:

 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 java.lang.NoSuchMethodError:

 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 at

 org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
 at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)
 at org.apache.wicket.Application.initInitializers(Application.java:612)
 at org.apache.wicket.Application.initializeComponents(Application.java:521)
 at org.apache.wicket.Application.initApplication(Application.java:817)
 at org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:424)
 at 

Re: 404 error when calling getResourceSettings().getResourceFinders()

2013-06-10 Thread Joseph Mokenela
Thanks a lot Martin,

I had an earlier version of wicket-extensions indeed. That solved it,

Thanks again.

Let me debug and I will feedback on the original error.

Regards,



On Mon, Jun 10, 2013 at 4:33 PM, Joseph Mokenela matooanemoken...@gmail.com
 wrote:

 The line at com.mmjmicrosystems.radarmarketing.Start.main(Start.java:66)

 is simply the call to server.start();

 on the jetty server instance.


 On Mon, Jun 10, 2013 at 4:26 PM, Joseph Mokenela 
 matooanemoken...@gmail.com wrote:

 Thanks for the quick response Martin,

 I have tried to debug the application but without success, I am using
 jetty server and i keep getting the following stacktrace on jetty. I am
 using Wicket 6.8.0

 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IBehaviorListener, method=public abstract
 void org.apache.wicket.behavior.IBehaviorListener.onRequest()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IFormSubmitListener, method=public abstract
 void
 org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=ILinkListener, method=public abstract void
 org.apache.wicket.markup.html.link.ILinkListener.onLinkClicked()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IOnChangeListener, method=public abstract
 void
 org.apache.wicket.markup.html.form.IOnChangeListener.onSelectionChanged()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IRedirectListener, method=public abstract
 void org.apache.wicket.IRedirectListener.onRedirect()]
 INFO  - RequestListenerInterface   - registered listener interface
 [RequestListenerInterface name=IResourceListener, method=public abstract
 void org.apache.wicket.IResourceListener.onResourceRequested()]
 INFO  - Application- [wicket.radar-marketing] init:
 Wicket extensions initializer
 WARN  - AbstractLifeCycle  - FAILED wicket.radar-marketing:
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 at
 org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
  at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)
 at org.apache.wicket.Application.initInitializers(Application.java:612)
  at
 org.apache.wicket.Application.initializeComponents(Application.java:521)
 at org.apache.wicket.Application.initApplication(Application.java:817)
  at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:424)
 at
 org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:351)
  at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:102)
 at
 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
  at
 org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:748)
 at
 org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
  at
 org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1222)
 at
 org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:676)
  at
 org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:455)
 at
 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
  at
 org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:90)
 at org.eclipse.jetty.server.Server.doStart(Server.java:260)
  at
 org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)
 at com.mmjmicrosystems.radarmarketing.Start.main(Start.java:66)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:601)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
 WARN  - AbstractLifeCycle  - FAILED
 o.e.j.w.WebAppContext{/radarmarketing,file:/N:/Projects/Java%20Enterprise/radar-marketing/src/main/webapp/},src/main/webapp:
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 java.lang.NoSuchMethodError:
 org.apache.wicket.SharedResources.add(Ljava/lang/String;Lorg/apache/wicket/Resource;)V
 at
 org.apache.wicket.extensions.ajax.markup.html.form.upload.UploadProgressBar$ComponentInitializer.init(UploadProgressBar.java:55)
  at org.apache.wicket.extensions.Initializer.init(Initializer.java:36)
 at org.apache.wicket.Application.initInitializers(Application.java:612)

CDI WELD-000070 Simple bean cannot be a non-static inner class

2013-06-10 Thread Phill
I'm trying to use wicket-cdi with Glassfish 4.0 and get the following 
exceptions.

Should wicket-cdi work with soon-to-be-released Java EE 7 / CDI 1.1 ?

2013-06-10 17:12:34,351 [http-listener-2(2)] DEBUG 
o.apache.wicket.MarkupContainer - Add markupHighlight to [Page class = 
org.apache.wicket.markup.html.pages.ExceptionErrorPage, id = 3, render 
count = 0]
2013-06-10 17:12:34,354 [http-listener-2(2)] ERROR 
o.a.w.DefaultExceptionMapper - An error occurred while handling a 
previous error: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl]  
class org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be 
a non-static inner class
org.jboss.weld.exceptions.IllegalArgumentException: WELD-70 Simple 
bean [EnhancedAnnotatedTypeImpl]  class 
org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a 
non-static inner class
	at 
org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:82) 
~[weld-osgi-bundle.jar:20130513-1450]
	at 
org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:68) 
~[weld-osgi-bundle.jar:20130513-1450]
	at 
org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1039) 
~[weld-osgi-bundle.jar:20130513-1450]
	at 
org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201) 
~[weld-osgi-bundle.jar:20130513-1450]
	at org.apache.wicket.cdi.NonContextual.init(NonContextual.java:118) 
~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at org.apache.wicket.cdi.NonContextual.of(NonContextual.java:84) 
~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.cdi.NonContextualManager.inject(NonContextualManager.java:54) 
~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.cdi.AbstractInjector.inject(AbstractInjector.java:43) 
~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.cdi.ComponentInjector.onInstantiation(ComponentInjector.java:43) 
~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80) 
~[wicket-util-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at org.apache.wicket.Component.init(Component.java:683) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at org.apache.wicket.MarkupContainer.init(MarkupContainer.java:121) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.markup.html.WebMarkupContainer.init(WebMarkupContainer.java:52) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:57) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:44) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at org.apache.wicket.markup.html.link.Link.init(Link.java:105) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.markup.html.pages.ExceptionErrorPage$1.init(ExceptionErrorPage.java:97) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.markup.html.pages.ExceptionErrorPage.init(ExceptionErrorPage.java:96) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:128) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.DefaultExceptionMapper.map(DefaultExceptionMapper.java:62) 
~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.request.cycle.RequestCycle.handleException(RequestCycle.java:352) 
[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:229) 
[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289) 
[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.protocol.http.WicketFilter.processRequestCycle(WicketFilter.java:259) 
[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201) 
[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282) 
[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
	at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) 

Re: CDI WELD-000070 Simple bean cannot be a non-static inner class

2013-06-10 Thread Igor Vaynberg
you cannot inject non-static classes...

class org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot
be a non-static inner class

-igor

On Mon, Jun 10, 2013 at 8:32 AM, Phill gilberth...@gmail.com wrote:
 I'm trying to use wicket-cdi with Glassfish 4.0 and get the following
 exceptions.
 Should wicket-cdi work with soon-to-be-released Java EE 7 / CDI 1.1 ?

 2013-06-10 17:12:34,351 [http-listener-2(2)] DEBUG
 o.apache.wicket.MarkupContainer - Add markupHighlight to [Page class =
 org.apache.wicket.markup.html.pages.ExceptionErrorPage, id = 3, render count
 = 0]
 2013-06-10 17:12:34,354 [http-listener-2(2)] ERROR
 o.a.w.DefaultExceptionMapper - An error occurred while handling a previous
 error: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl]  class
 org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a
 non-static inner class
 org.jboss.weld.exceptions.IllegalArgumentException: WELD-70 Simple bean
 [EnhancedAnnotatedTypeImpl]  class
 org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a
 non-static inner class
 at
 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:82)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:68)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1039)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201)
 ~[weld-osgi-bundle.jar:20130513-1450]
 at
 org.apache.wicket.cdi.NonContextual.init(NonContextual.java:118)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at org.apache.wicket.cdi.NonContextual.of(NonContextual.java:84)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.NonContextualManager.inject(NonContextualManager.java:54)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.AbstractInjector.inject(AbstractInjector.java:43)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.ComponentInjector.onInstantiation(ComponentInjector.java:43)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
 ~[wicket-util-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at org.apache.wicket.Component.init(Component.java:683)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.MarkupContainer.init(MarkupContainer.java:121)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.WebMarkupContainer.init(WebMarkupContainer.java:52)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:57)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:44)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at org.apache.wicket.markup.html.link.Link.init(Link.java:105)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.pages.ExceptionErrorPage$1.init(ExceptionErrorPage.java:97)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.markup.html.pages.ExceptionErrorPage.init(ExceptionErrorPage.java:96)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.DefaultExceptionMapper.internalMap(DefaultExceptionMapper.java:128)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.DefaultExceptionMapper.map(DefaultExceptionMapper.java:62)
 ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.request.cycle.RequestCycle.handleException(RequestCycle.java:352)
 [wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:229)
 [wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
 [wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 

Re: CDI WELD-000070 Simple bean cannot be a non-static inner class

2013-06-10 Thread Phil
I'm not injecting anything yet, it seems to be triggered by the 
inclusion of the DebugBar on my page. If I remove the DebugBar it works 
fine.


Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-70 
Simple bean [EnhancedAnnotatedTypeImpl]  class 
org.apache.wicket.devutils.debugbar.DebugBar$3 cannot be a non-static 
inner class


-Phill

On 10 Jun 2013, at 20:41, Igor Vaynberg wrote:


you cannot inject non-static classes...

class org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot
be a non-static inner class

-igor



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



Re: CDI WELD-000070 Simple bean cannot be a non-static inner class

2013-06-10 Thread Martin Grigorov
As far as I see the problem is caused by IComponentInstantiationListener
provided by wicket-cdi:


 org.apache.wicket.cdi.NonContextualManager.inject(
NonContextualManager.java:54)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.AbstractInjector.inject(AbstractInjector.java:43)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at
 org.apache.wicket.cdi.ComponentInjector.onInstantiation(
ComponentInjector.java:43)
 ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
 at


and it fails at

Caused by: org.jboss.weld.exceptions.DefinitionException: WELD-70 Simple
 bean [EnhancedAnnotatedTypeImpl]  class
 org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a
 non-static inner class


Looking at ExceptionErrorPage the first inner anonymous class is:

add(new LinkVoid(displayPageViewLink)
 {
private static final long serialVersionUID = 1L;

@Override
public void onClick()
 {
ExceptionErrorPage.this.replace(new PageView(componentTree, page));
 setVisible(false);
}
});

i.e. the application code is not guilty.

On Mon, Jun 10, 2013 at 9:41 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 you cannot inject non-static classes...

 class org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot
 be a non-static inner class

 -igor

 On Mon, Jun 10, 2013 at 8:32 AM, Phill gilberth...@gmail.com wrote:
  I'm trying to use wicket-cdi with Glassfish 4.0 and get the following
  exceptions.
  Should wicket-cdi work with soon-to-be-released Java EE 7 / CDI 1.1 ?
 
  2013-06-10 17:12:34,351 [http-listener-2(2)] DEBUG
  o.apache.wicket.MarkupContainer - Add markupHighlight to [Page class =
  org.apache.wicket.markup.html.pages.ExceptionErrorPage, id = 3, render
 count
  = 0]
  2013-06-10 17:12:34,354 [http-listener-2(2)] ERROR
  o.a.w.DefaultExceptionMapper - An error occurred while handling a
 previous
  error: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl]  class
  org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a
  non-static inner class
  org.jboss.weld.exceptions.IllegalArgumentException: WELD-70 Simple
 bean
  [EnhancedAnnotatedTypeImpl]  class
  org.apache.wicket.markup.html.pages.ExceptionErrorPage$1 cannot be a
  non-static inner class
  at
 
 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:82)
  ~[weld-osgi-bundle.jar:20130513-1450]
  at
 
 org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:68)
  ~[weld-osgi-bundle.jar:20130513-1450]
  at
 
 org.jboss.weld.manager.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1039)
  ~[weld-osgi-bundle.jar:20130513-1450]
  at
 
 org.jboss.weld.util.ForwardingBeanManager.createInjectionTarget(ForwardingBeanManager.java:201)
  ~[weld-osgi-bundle.jar:20130513-1450]
  at
  org.apache.wicket.cdi.NonContextual.init(NonContextual.java:118)
  ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at org.apache.wicket.cdi.NonContextual.of(NonContextual.java:84)
  ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.cdi.NonContextualManager.inject(NonContextualManager.java:54)
  ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
  org.apache.wicket.cdi.AbstractInjector.inject(AbstractInjector.java:43)
  ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.cdi.ComponentInjector.onInstantiation(ComponentInjector.java:43)
  ~[wicket-cdi-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:38)
  ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.application.ComponentInstantiationListenerCollection$1.notify(ComponentInstantiationListenerCollection.java:34)
  ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.util.listener.ListenerCollection.notify(ListenerCollection.java:80)
  ~[wicket-util-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.application.ComponentInstantiationListenerCollection.onInstantiation(ComponentInstantiationListenerCollection.java:33)
  ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at org.apache.wicket.Component.init(Component.java:683)
  ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
  org.apache.wicket.MarkupContainer.init(MarkupContainer.java:121)
  ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.markup.html.WebMarkupContainer.init(WebMarkupContainer.java:52)
  ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:57)
  ~[wicket-core-6.9.0-SNAPSHOT.jar:6.9.0-SNAPSHOT]
  at
 
 org.apache.wicket.markup.html.link.AbstractLink.init(AbstractLink.java:44)
  

PageableListView with two rows

2013-06-10 Thread Pierre Goupil
Good evening,

Is there a way to have a PageableListView with two rows?

Here is my code:

final PageableListViewProfile columnListView = new
PageableListViewProfile(
columnListView, secondLine, SearchPage.RESULTS / 2)
{
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(final ListItemProfile item)
{
final IModelProfile p = item.getModel();

item.add(new ProfilePanel(profile, p));
}
};

this.add(columnListView);
this.add(new AjaxPagingNavigator(navigator, columnListView));

It works perfectly well for one line of results, but I'd like to have two
lines of 4 columns instead of one line of 8 columns.

I don't think a DataTable would fit my needs since the ProfilePanel object
is a complex display.

Any help will be much appreciated.

Regards,

Pierre


-- 
Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas
mal.
Alors frappez-moi de musique !
Frappez-moi de musique, maintenant !

(Bob Marley : Trenchtown Rock)


Re: PageableListView with two rows

2013-06-10 Thread Dan Retzlaff
Hi Pierre,

Associate your PageableListView with a div that wraps your two trs.
Use item.setRenderBodyOnly(true) to prevent the div from being rendered
so your table markup is still valid.

Dan


On Mon, Jun 10, 2013 at 12:49 PM, Pierre Goupil goupilpie...@gmail.comwrote:

 Good evening,

 Is there a way to have a PageableListView with two rows?

 Here is my code:

 final PageableListViewProfile columnListView = new
 PageableListViewProfile(
 columnListView, secondLine, SearchPage.RESULTS / 2)
 {
 private static final long serialVersionUID = 1L;

 @Override
 protected void populateItem(final ListItemProfile item)
 {
 final IModelProfile p = item.getModel();

 item.add(new ProfilePanel(profile, p));
 }
 };

 this.add(columnListView);
 this.add(new AjaxPagingNavigator(navigator, columnListView));

 It works perfectly well for one line of results, but I'd like to have two
 lines of 4 columns instead of one line of 8 columns.

 I don't think a DataTable would fit my needs since the ProfilePanel object
 is a complex display.

 Any help will be much appreciated.

 Regards,

 Pierre


 --
 Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas
 mal.
 Alors frappez-moi de musique !
 Frappez-moi de musique, maintenant !

 (Bob Marley : Trenchtown Rock)



Re: PageableListView with two rows

2013-06-10 Thread Pierre Goupil
I'm sorry, but I don't understand what you mean. I've tried this:

table class=large-space-centered-table align=center
div wicket:id=columnListView
tr wicket:id=separator
td class=normal-text border-cell
span wicket:id=profile/span
/td
/tr
/div
/table




final PageableListViewProfile columnListView = new
PageableListViewProfile(
columnListView, allMatches, SearchPage.COLUMNS)
{
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(final ListItemProfile item)
{
final IModelProfile p = item.getModel();

final WebMarkupContainer separator = new
WebMarkupContainer(separator);
if (item.getIndex() == (SearchPage.COLUMNS / 2))
{
separator.setRenderBodyOnly(false);
}
else
{
separator.setRenderBodyOnly(true);
}

separator.add(new ProfilePanel(profile, p));
item.add(separator);
}
};

columnListView.setRenderBodyOnly(true);
this.add(columnListView);
this.add(new AjaxPagingNavigator(navigator, columnListView));




I think I did what you've suggested but instead of two rows of 5 columns, I
got one line of 5 columns, one of one column and a last line of 4 columns.
I've missed something, I'm afraid.

Thank you anyway!

Regards,

Pierre




On Mon, Jun 10, 2013 at 10:17 PM, Dan Retzlaff dretzl...@gmail.com wrote:

 Hi Pierre,

 Associate your PageableListView with a div that wraps your two trs.
 Use item.setRenderBodyOnly(true) to prevent the div from being rendered
 so your table markup is still valid.

 Dan


 On Mon, Jun 10, 2013 at 12:49 PM, Pierre Goupil goupilpie...@gmail.com
 wrote:

  Good evening,
 
  Is there a way to have a PageableListView with two rows?
 
  Here is my code:
 
  final PageableListViewProfile columnListView = new
  PageableListViewProfile(
  columnListView, secondLine, SearchPage.RESULTS / 2)
  {
  private static final long serialVersionUID = 1L;
 
  @Override
  protected void populateItem(final ListItemProfile item)
  {
  final IModelProfile p = item.getModel();
 
  item.add(new ProfilePanel(profile, p));
  }
  };
 
  this.add(columnListView);
  this.add(new AjaxPagingNavigator(navigator, columnListView));
 
  It works perfectly well for one line of results, but I'd like to have two
  lines of 4 columns instead of one line of 8 columns.
 
  I don't think a DataTable would fit my needs since the ProfilePanel
 object
  is a complex display.
 
  Any help will be much appreciated.
 
  Regards,
 
  Pierre
 
 
  --
  Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as
 pas
  mal.
  Alors frappez-moi de musique !
  Frappez-moi de musique, maintenant !
 
  (Bob Marley : Trenchtown Rock)
 




-- 
Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas
mal.
Alors frappez-moi de musique !
Frappez-moi de musique, maintenant !

(Bob Marley : Trenchtown Rock)


Re: PageableListView with two rows

2013-06-10 Thread Dan Retzlaff
Maybe I just don't understand your requirements. I thought you want two
rows for each Profile. So:

add(new PageableListView(profile, profiles) {
  populateItem(item) {
item.add(new Label(row1column1));
item.add(new Label(row2column1));
item.setRenderBodyOnly(true);
  }
});

table
div wicket:id=profile
  trtd wicket:id=row1column1/td/tr
  trtd wicket:id=row2column1/td/tr
/div
/table

Obviously you can add as many columns as you'd like.


On Mon, Jun 10, 2013 at 1:58 PM, Pierre Goupil goupilpie...@gmail.comwrote:

 I'm sorry, but I don't understand what you mean. I've tried this:

 table class=large-space-centered-table align=center
 div wicket:id=columnListView
 tr wicket:id=separator
 td class=normal-text border-cell
 span wicket:id=profile/span
 /td
 /tr
 /div
 /table




 final PageableListViewProfile columnListView = new
 PageableListViewProfile(
 columnListView, allMatches, SearchPage.COLUMNS)
 {
 private static final long serialVersionUID = 1L;

 @Override
 protected void populateItem(final ListItemProfile item)
 {
 final IModelProfile p = item.getModel();

 final WebMarkupContainer separator = new
 WebMarkupContainer(separator);
 if (item.getIndex() == (SearchPage.COLUMNS / 2))
 {
 separator.setRenderBodyOnly(false);
 }
 else
 {
 separator.setRenderBodyOnly(true);
 }

 separator.add(new ProfilePanel(profile, p));
 item.add(separator);
 }
 };

 columnListView.setRenderBodyOnly(true);
 this.add(columnListView);
 this.add(new AjaxPagingNavigator(navigator, columnListView));




 I think I did what you've suggested but instead of two rows of 5 columns, I
 got one line of 5 columns, one of one column and a last line of 4 columns.
 I've missed something, I'm afraid.

 Thank you anyway!

 Regards,

 Pierre




 On Mon, Jun 10, 2013 at 10:17 PM, Dan Retzlaff dretzl...@gmail.com
 wrote:

  Hi Pierre,
 
  Associate your PageableListView with a div that wraps your two trs.
  Use item.setRenderBodyOnly(true) to prevent the div from being rendered
  so your table markup is still valid.
 
  Dan
 
 
  On Mon, Jun 10, 2013 at 12:49 PM, Pierre Goupil goupilpie...@gmail.com
  wrote:
 
   Good evening,
  
   Is there a way to have a PageableListView with two rows?
  
   Here is my code:
  
   final PageableListViewProfile columnListView = new
   PageableListViewProfile(
   columnListView, secondLine, SearchPage.RESULTS / 2)
   {
   private static final long serialVersionUID = 1L;
  
   @Override
   protected void populateItem(final ListItemProfile item)
   {
   final IModelProfile p = item.getModel();
  
   item.add(new ProfilePanel(profile, p));
   }
   };
  
   this.add(columnListView);
   this.add(new AjaxPagingNavigator(navigator, columnListView));
  
   It works perfectly well for one line of results, but I'd like to have
 two
   lines of 4 columns instead of one line of 8 columns.
  
   I don't think a DataTable would fit my needs since the ProfilePanel
  object
   is a complex display.
  
   Any help will be much appreciated.
  
   Regards,
  
   Pierre
  
  
   --
   Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as
  pas
   mal.
   Alors frappez-moi de musique !
   Frappez-moi de musique, maintenant !
  
   (Bob Marley : Trenchtown Rock)
  
 



 --
 Un truc bien avec la musique, c'est que quand elle te frappe, tu n'as pas
 mal.
 Alors frappez-moi de musique !
 Frappez-moi de musique, maintenant !

 (Bob Marley : Trenchtown Rock)