Design patterns for integration of RingoJS modules in Wicket

2012-02-27 Thread Kayode Odeyemi
Hi,

I have lots of RingoJS modules that can be accessed via a url in a browser.
I have decided to use RingoJS for building simple modules that I will like
to include in wicket application as Page web parts - especially for
features I need to be completely written in Javascript.

If there's anyone using the same application design, I'll like to know how
you implemented the integration in wicket. I'm using wicket Include
component which works very well. If there is any popular pattern that is
generally adopted, I'll love to know about it.

Thanks

-- 
Odeyemi 'Kayode O.
http://ng.linkedin.com/in/kayodeodeyemi. t: @charyorde


Re: Cannot reproduce a wicket error.

2012-02-27 Thread cosmindumy
There is another exception that I don't know where it comes from. It sais: 
java.lang.IllegalStateException: ServletRequest does not contain multipart
content. One possible solution is to explicitly call
Form.setMultipart(true), Wicket tries its best to auto-detect multipart
forms but there are certain situation where it cannot.
at
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113)
at
org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83)
at
org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:504)
at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1748)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:888)
at
org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:148)
at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
...


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Cannot-reproduce-a-wicket-error-tp4185488p4424397.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 1.5.4 - Application crashing on German umlaut characters

2012-02-27 Thread toytown
Thanks. It worked. But strange that such basic settings are not enabled in
Tomcat

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-4-Application-crashing-on-German-umlaut-characters-tp4412794p4424640.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: Cannot reproduce a wicket error.

2012-02-27 Thread Martin Grigorov
Hi,

Try to submit all forms that have input type=file element.

On Mon, Feb 27, 2012 at 2:07 PM, cosmindumy cosmind...@yahoo.com wrote:
 There is another exception that I don't know where it comes from. It sais:
 java.lang.IllegalStateException: ServletRequest does not contain multipart
 content. One possible solution is to explicitly call
 Form.setMultipart(true), Wicket tries its best to auto-detect multipart
 forms but there are certain situation where it cannot.
 at
 org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:113)
 at
 org.apache.wicket.protocol.http.servlet.MultipartServletWebRequest.init(MultipartServletWebRequest.java:83)
 at
 org.apache.wicket.protocol.http.servlet.ServletWebRequest.newMultipartWebRequest(ServletWebRequest.java:504)
 at org.apache.wicket.markup.html.form.Form.handleMultiPart(Form.java:1748)
 at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:888)
 at
 org.apache.wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:148)
 at
 org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
 ...


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Cannot-reproduce-a-wicket-error-tp4185488p4424397.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Design patterns for integration of RingoJS modules in Wicket

2012-02-27 Thread Martin Grigorov
Hi,

Isn't that very slow ?
Rhino is not the fastest script engine.

On Mon, Feb 27, 2012 at 1:49 PM, Kayode Odeyemi drey...@gmail.com wrote:
 Hi,

 I have lots of RingoJS modules that can be accessed via a url in a browser.
 I have decided to use RingoJS for building simple modules that I will like
 to include in wicket application as Page web parts - especially for
 features I need to be completely written in Javascript.

 If there's anyone using the same application design, I'll like to know how
 you implemented the integration in wicket. I'm using wicket Include
 component which works very well. If there is any popular pattern that is
 generally adopted, I'll love to know about it.

 Thanks

 --
 Odeyemi 'Kayode O.
 http://ng.linkedin.com/in/kayodeodeyemi. t: @charyorde



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: ExternalLink close modalWindow

2012-02-27 Thread Martin Grigorov
On Fri, Feb 24, 2012 at 8:28 PM, DuneBug mdelau...@gmail.com wrote:
 I have a modal window with links, the links need to open a page in a new
 browser window, and close the modal window in the current window.

 This works fine with an ajaxLink with this onClick function EXCEPT THAT, it
 triggers browser pop-up blocking.

 @Override
        public void onClick(AjaxRequestTarget target) {
            String js = window.open(' + url + ');

Use window.open(url, _blank). See
http://www.w3schools.com/jsref/met_win_open.asp
_blank will tell the browser to open it in new window/tab

            target.appendJavascript(js);
            modalWindow.close(target);

        }

 If there's a way to do this without triggering pop-up blocking that's good
 enough for me.

 OTHERWISE... In non-wicket I'd attach an onClick event to the href tag that
 would simply call some javascript to hide the window... I believe the
 approach to doing this in Wicket is to switch my links to ExternalLinks and
 add a behavior to them...

 i tried the following...

    private static class CloseBehavior extends AbstractDefaultAjaxBehavior {

        private static final long serialVersionUID = 1L;
        private final ModalWindow modal;

        public CloseBehavior( ModalWindow modal)
        {
            this.modal = modal;
        }

        @Override
        protected void respond(AjaxRequestTarget target) {
            modal.close(target);
        }

        @Override
        public void renderHead( IHeaderResponse response) {

            response.renderJavascript( +
                $(document).ready(function() {\n +
                  $(document).bind('click', function(evt) {\n +
                getCallbackScript() + \n +
                });, modal.getContentId());
        }

    }

 ExternalLink link1 = new ExternalLink(linky);
 link1.add( new CloseBehavior(modalWindow));

 

 Tried to do some searching but I think the problem is in the javascript in
 my behavior. I do have jquery available. Thanks for the help!

 Michael DeLauter

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/ExternalLink-close-modalWindow-tp4418218p4418218.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: CAS with shibboleth Idp integration.

2012-02-27 Thread Martin Grigorov
Hi,

You may check how integrations with OpenId/OAuth work.
There is a recipe about this in Apache Wicket cookbook by Packt
Publishing and I think Xaloon project [1] also has OpenId integration.

1. http://code.google.com/p/xaloon/

On Sun, Feb 26, 2012 at 8:18 PM, mejat.joseph mejat13jos...@gmail.com wrote:
 Hi

  I am facing one difficulties to configure CAS with shibboleth idp.This is
 my requirement.

 I want to use CAS as a service provider and integrate with shibboleth
 idp.When i access one application its redirect to shibboleth idp. After
 success full authentication its redirect to original application.

 Please let me know know this configuration ... i will appreciate ...

 Thanks,
 Mejat joseph


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/CAS-with-shibboleth-Idp-integration-tp4422623p4422623.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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Exception (Header was already written to response!) when setting response page in IRequestCycleListener

2012-02-27 Thread Martin Grigorov
Hi,

On Sat, Feb 25, 2012 at 12:20 AM, Neil Curzon neil.cur...@gmail.com wrote:
 Hi all,

 We've been using an IRequestCycleListener in order to redirect to a certain
 page for all requests if certain conditions are met. We're finding that
 it's giving an exception in 1.5.4:

 java.lang.IllegalStateException: Header was already written to response!
 at
 org.apache.wicket.protocol.http.HeaderBufferingWebResponse.checkHeader(HeaderBufferingWebResponse.java:64)
 at
 org.apache.wicket.protocol.http.HeaderBufferingWebResponse.setDateHeader(HeaderBufferingWebResponse.java:134)
 at
 org.apache.wicket.protocol.http.BufferedWebResponse$SetDateHeaderAction.invoke(BufferedWebResponse.java:310)
 at
 org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:580)
 at
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:185)
 at
 org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
 at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)

 basically in our IRequestCycleListener we have

 @Override
 public void onBeginRequest(RequestCycle cycle) {
 if (condition)) {
 cycle.setResponsePage(SpecificPage.class);

better use: throw new RestartResponseException()

this will both save you some CPU cycles and additionally will reset
the WebResponse (drop any set headers and body)

 }
 }

 Is this the wrong way to do it? Or is this behavior expected? If it's not
 expected, I will file a bug for this.

 Thanks,
 Neil



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: How to use autoAdd?

2012-02-27 Thread Martin Grigorov
Hi,

Use it as #add(), the only difference is that you have to add it for
each request (thus in #onBeforeRender() or onConfigure()) because it
is dropped automatically at the end of the request.

On Sat, Feb 25, 2012 at 7:11 AM, Martin Makundi
martin.maku...@koodaripalvelut.com wrote:
 if the component is stateless you can autoadd it in onbeforerender(),
 such components are removed at the end of the request

 I tried to google for an example of using autoAdd, but did not find
 anything solid.

 How would this be used to have a component (for example a label)
 autoAdded so that it would dissolve itself before page serialization?

 **
 Martin

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Design patterns for integration of RingoJS modules in Wicket

2012-02-27 Thread Kayode Odeyemi
On Mon, Feb 27, 2012 at 3:25 PM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 Isn't that very slow ?
 Rhino is not the fastest script engine.


I didn't compare rhino to the likes of node.js, rubyracer etc when I
started trying it out. My decision was based on use case and the fact that
it is Java based. I also read the Pankaj Kumar blog on Beanshell, Rhino and
Java -- Performance Comparison at the onset. His conclusion was fair enough
for me even though that blog is kind of old.

I'm still exploring though. When I have performance issues, I will
benchmark rhino with similar technologies. Right now, I feel comfortable.


 On Mon, Feb 27, 2012 at 1:49 PM, Kayode Odeyemi drey...@gmail.com wrote:
  Hi,
 
  I have lots of RingoJS modules that can be accessed via a url in a
 browser.
  I have decided to use RingoJS for building simple modules that I will
 like
  to include in wicket application as Page web parts - especially for
  features I need to be completely written in Javascript.
 
  If there's anyone using the same application design, I'll like to know
 how
  you implemented the integration in wicket. I'm using wicket Include
  component which works very well. If there is any popular pattern that is
  generally adopted, I'll love to know about it.
 
  Thanks
 
  --
  Odeyemi 'Kayode O.
  http://ng.linkedin.com/in/kayodeodeyemi. t: @charyorde



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




-- 
Odeyemi 'Kayode O.
http://ng.linkedin.com/in/kayodeodeyemi. t: @charyorde


Re: Exception (Header was already written to response!) when setting response page in IRequestCycleListener

2012-02-27 Thread Neil Curzon
Hi Martin,

Sorry, should have mentioned that I also tried doing that. The result is
the orange exception page with Unexpected Runtime Exception:

Last cause: null

Stacktrace

Root cause:

org.apache.wicket.RestartResponseException

Thanks,
Neil

On Mon, Feb 27, 2012 at 11:01 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 On Sat, Feb 25, 2012 at 12:20 AM, Neil Curzon neil.cur...@gmail.com
 wrote:
  Hi all,
 
  We've been using an IRequestCycleListener in order to redirect to a
 certain
  page for all requests if certain conditions are met. We're finding that
  it's giving an exception in 1.5.4:
 
  java.lang.IllegalStateException: Header was already written to response!
  at
 
 org.apache.wicket.protocol.http.HeaderBufferingWebResponse.checkHeader(HeaderBufferingWebResponse.java:64)
  at
 
 org.apache.wicket.protocol.http.HeaderBufferingWebResponse.setDateHeader(HeaderBufferingWebResponse.java:134)
  at
 
 org.apache.wicket.protocol.http.BufferedWebResponse$SetDateHeaderAction.invoke(BufferedWebResponse.java:310)
  at
 
 org.apache.wicket.protocol.http.BufferedWebResponse.writeTo(BufferedWebResponse.java:580)
  at
 
 org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:185)
  at
 
 org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
  at
 
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
 
  basically in our IRequestCycleListener we have
 
  @Override
  public void onBeginRequest(RequestCycle cycle) {
  if (condition)) {
  cycle.setResponsePage(SpecificPage.class);

 better use: throw new RestartResponseException()

 this will both save you some CPU cycles and additionally will reset
 the WebResponse (drop any set headers and body)

  }
  }
 
  Is this the wrong way to do it? Or is this behavior expected? If it's not
  expected, I will file a bug for this.
 
  Thanks,
  Neil



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




Re: help with drag and drop (wicket-dnd)

2012-02-27 Thread Dan12321
Thank you. I look at example of ExampleLabel. But it do not help so much

Now, I can drag element, I see that it was dragged and I can drop it on
element, that is allowed by }.dropCenter(span));
Methods onDrop (in DropTarget) and onAfterDrop (in DragSource) are
called. I use there code, that is in ExampleLabel.

But the dragged element is not moved and it stay on original place.
What I have to do for moving dragged element?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4425523.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: help with drag and drop (wicket-dnd)

2012-02-27 Thread Sven Meier
wicket-dnd doesn't change the HTML markup as popular Javascript 
libraries do.


Instead the markup must be generated on the server side, as it's done 
with Wicket most of the time.


You have to update your component tree in onDrop(), e.g. change models, 
persist something to the database. Then update the components view 
AjaxRequestTarget#add().


Hope this helps
Sven

Am 27.02.2012 19:21, schrieb Dan12321:

Thank you. I look at example of ExampleLabel. But it do not help so much

Now, I can drag element, I see that it was dragged and I can drop it on
element, that is allowed by }.dropCenter(span));
Methods onDrop (in DropTarget) and onAfterDrop (in DragSource) are
called. I use there code, that is in ExampleLabel.

But the dragged element is not moved and it stay on original place.
What I have to do for moving dragged element?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4425523.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



Re: help with drag and drop (wicket-dnd)

2012-02-27 Thread Dan12321
So I cannot modify html? Make html from this (it is without attributes):
 table tr
td spanAAA /span /td
td /td
 /tr /table

to this (span from first td was moved to second td):
 table tr
td /td
td spanAAA /span /td
 /tr /table


But, when i want to move content of first td to second td, I have to do
something like this:
 table tr
td spanAAA /span /td
td span /span /td
 /tr /table

And in onDrop method change model of first span and second span element?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/help-with-drag-and-drop-wicket-dnd-tp4422338p4425713.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: Getting new lines in RepeatingView

2012-02-27 Thread Dale Ogilvie
Using an override of RepeatView, I get better output. The only slight
imperfection being that each individual row does not take it's starting
cue from the position of the repeated element. I can live with that.

i.e. output now has the first element positioned per the template, the
remainder are left justified:

ul
lihello/li
ligoodbye/li
ligood morning/li
/ul


public class NewLineRepeatingView extends RepeatingView {

private static final long serialVersionUID = 1L;

public NewLineRepeatingView(String id) {
super(id);
}

public NewLineRepeatingView(String id, IModel? model) {
super(id, model);
}

@Override
protected void renderChild(Component child) {
super.renderChild(child);
getResponse().write(\n);
}

}


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



CheckBoxColumnProperty in inmethodgrid updates

2012-02-27 Thread Chris Colman
Has anyone used the new editable column classes in inmethod grid
provided by Tom Burton?
 
I really like the extra functionality Tom has added to inmethod grid but
I can't get the check box to appear as a check box.
 
It appears only as text showing either true or false.
 
Has anyone else tried these new classes and got them to work?
 
Regards,
Chris


RE: CheckBoxColumnProperty in inmethodgrid updates

2012-02-27 Thread Chris Colman
I'm using Wicket 1.5. It seems that 

protected EditableCellPanel newCellPanel(String componentId, IModelI
rowModel,
  IModelBoolean cellModel)
{
return new CheckBoxPanel(componentId, cellModel, rowModel,
this);
}

is never called for some reason. That would explain why a panel with a
check box in it never appears.

Chris

-Original Message-
From: Chris Colman [mailto:chr...@stepaheadsoftware.com]
Sent: Tuesday, 28 February 2012 12:43 PM
To: users@wicket.apache.org
Subject: CheckBoxColumnProperty in inmethodgrid updates

Has anyone used the new editable column classes in inmethod grid
provided by Tom Burton?

I really like the extra functionality Tom has added to inmethod grid
but
I can't get the check box to appear as a check box.

It appears only as text showing either true or false.

Has anyone else tried these new classes and got them to work?

Regards,
Chris

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



Re: Wicket-Source: Click-through from browser back to Java source

2012-02-27 Thread Jenny Brown
I've updated the Firefox plugin for wicket-source to include support for
Firefox 10.  This is just metadata so that Firefox updates will stop
complaining, as it was already code compatible.

The new wicketsou...@gmail.com.xpi plugin file is available from the
downloads area.
https://github.com/42Lines/wicket-source/downloads


So far no bug reports, but do let me know if anything gives you trouble, so
I can get it fixed.  Thanks!


Jenny Brown