java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-02-24 Thread singh13
Hi there I am using OpenID4java to implement an OpenID relying party and a
provider.

Whenever I try to access the provider page I get this exception in my
console 

java.lang.IllegalStateException: Can't call write(CharSequence) after
write(byte[]) has been called.

In this method I am creating an XRDS document to send to the relying party.
Could there be an issue with the outputstream

  public static void sendDiscoveryResponse(Response response) throws
IOException {
log.trace(sendDiscoveryResponse() BEGIN...);
WebResponse web = (WebResponse)response;
 web.setContentType(application/xrds+xml);
OutputStream outputStream = web.getOutputStream();
String xrdsResponse = OpenIDService.createXrdsResponse();
//
outputStream.write(xrdsResponse.getBytes());
outputStream.close();
log.trace(sendDiscoveryResponse() END...);
  }

The stack trace is below

Last cause: 0x706: GET failed on
http://localhost:8080/university/ProviderLogIn : 500
WicketMessage: Method onLinkClicked of interface
org.apache.wicket.markup.html.link.ILinkListener targeted at [ [Component id
= LogIn]] on component [ [Component id = LogIn]] threw an exception

Stacktrace

Root cause:

org.openid4java.discovery.yadis.YadisException: 0x706: GET failed on
http://localhost:8080/university/ProviderLogIn : 500
 at
org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:411)
 at
org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:252)
 at
org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:232)
 at
org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:166)
 at org.openid4java.discovery.Discovery.discover(Discovery.java:147)
 at org.openid4java.discovery.Discovery.discover(Discovery.java:129)
 at
org.openid4java.consumer.ConsumerManager.discover(ConsumerManager.java:542)
 at
com.university.RelyingPartyService.performDiscovery(RelyingPartyService.java:35)
 at com.university.SucessPage.init(SucessPage.java:64)
 at com.university.SucessPage.init(SucessPage.java:24)
 at com.university.MainPage$MainForm$1.onClick(MainPage.java:46)
 at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:188)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
 at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
 at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
 at
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
 at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
 at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
 at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
 at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
 at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
 at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
 at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
 at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
 at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
 at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
 at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
 at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
 at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)
 at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
 at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
 at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)
 at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
 at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
 at org.eclipse.jetty.server.Server.handle(Server.java:349)
 at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
 at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904)
 at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
 at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
 at

Re: JavaFX2 and Wicket

2012-02-24 Thread kamiseq
those are totally two different technologies. wicekt can generate you html
and you can embed flash or javafx applet there. I doubt there is any
integration between wicket and flash or java fx.

look at javafx tutorial first (they create html file there) and then learn
how you can create such page in wicket

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: JavaFX2 and Wicket

2012-02-24 Thread Martijn Dashorst
Check out https://github.com/dashorst/dashboard

HTML 5, CSS3

For a demo video, look at http://vimeo.com/channels/topicus#17780865

Martijn

On Fri, Feb 17, 2012 at 10:08 PM, clauspbeck b...@welovefailing.com wrote:
 Hi everyone,

 I'm going to make a Dashboard look a like thing using Wicket, i'm gone need
 a lot of graphic features and been playing around with JavaFX2, there have
 some really nice features for my needs.
 But i'm stocked with using JavaFX2 in Wicket, does anyone have some clues,
 maybe links to tutorials or other good solutions?

 Upfront thanks for your help

 Kind regads
 Claus Beck

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




-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: java.lang.IllegalStateException: Can't call write(CharSequence) after write(byte[]) has been called.

2012-02-24 Thread Martin Grigorov
Hi,

Servlet specs do not allows to write both to the servletresponse's
outputstream and its writer.
In your code you write to the stream and later somewhere else (maybe
Wicket) writes to the writer.

See the code in DownloadLink to see how it writes the file bytes.
You cannot write your OpenID response together with Wicket page response.

On Fri, Feb 24, 2012 at 12:01 PM, singh13 gso...@gmail.com wrote:
 Hi there I am using OpenID4java to implement an OpenID relying party and a
 provider.

 Whenever I try to access the provider page I get this exception in my
 console

 java.lang.IllegalStateException: Can't call write(CharSequence) after
 write(byte[]) has been called.

 In this method I am creating an XRDS document to send to the relying party.
 Could there be an issue with the outputstream

          public static void sendDiscoveryResponse(Response response) throws
 IOException {
                    log.trace(sendDiscoveryResponse() BEGIN...);
                    WebResponse web = (WebResponse)response;
                     web.setContentType(application/xrds+xml);
                    OutputStream outputStream = web.getOutputStream();
                    String xrdsResponse = OpenIDService.createXrdsResponse();
                    //
                    outputStream.write(xrdsResponse.getBytes());
                    outputStream.close();
                    log.trace(sendDiscoveryResponse() END...);
                  }

 The stack trace is below

 Last cause: 0x706: GET failed on
 http://localhost:8080/university/ProviderLogIn : 500
 WicketMessage: Method onLinkClicked of interface
 org.apache.wicket.markup.html.link.ILinkListener targeted at [ [Component id
 = LogIn]] on component [ [Component id = LogIn]] threw an exception

 Stacktrace

 Root cause:

 org.openid4java.discovery.yadis.YadisException: 0x706: GET failed on
 http://localhost:8080/university/ProviderLogIn : 500
     at
 org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:411)
     at
 org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:252)
     at
 org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:232)
     at
 org.openid4java.discovery.yadis.YadisResolver.discover(YadisResolver.java:166)
     at org.openid4java.discovery.Discovery.discover(Discovery.java:147)
     at org.openid4java.discovery.Discovery.discover(Discovery.java:129)
     at
 org.openid4java.consumer.ConsumerManager.discover(ConsumerManager.java:542)
     at
 com.university.RelyingPartyService.performDiscovery(RelyingPartyService.java:35)
     at com.university.SucessPage.init(SucessPage.java:64)
     at com.university.SucessPage.init(SucessPage.java:24)
     at com.university.MainPage$MainForm$1.onClick(MainPage.java:46)
     at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:188)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at
 org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:260)
     at
 org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
     at
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
     at
 org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
     at
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781)
     at
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
     at
 org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255)
     at
 org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212)
     at
 org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283)
     at
 org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
     at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
     at
 org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
     at
 org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
     at
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
     at
 org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
     at
 org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
     at
 org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)
     at
 org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
     at
 org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
     at
 org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)
     at
 org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
     at
 org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
   

Border-Component Problem in Migration to 1.5

2012-02-24 Thread Jürgen Lind

Hi,

I've just begun to move my application up to 1.5. and I now getting an error in 
a place that worked
just fine in 1.4. The problem seems to lie within creating a border component 
as it gives me the
following error message:

org.apache.wicket.WicketRuntimeException: You can not add a component's parent as child to the 
component (loop): Component: [BorderBodyContainer [Component id = filterTreePopup_body]]; parent == 
child: [WebMarkupContainer [Component id = popupHolder]]


This happens in this line:

InlinePopup filterTreePopup = new InlinePopup(filterTreePopup, filterTree_ 
+ this.markupId);


This is the code for the border component:

wicket:border
  div wicket:id=popupHolder
div wicket:id=popup style=display:none
  wicket:body/
/div
  /div
/wicket:border

public InlinePopup(String id, String name) {
  super(id);

  WebMarkupContainer popupHolder = new WebMarkupContainer(popupHolder);
  popupHolder.setOutputMarkupId(true);
  popupHolder.setMarkupId(name + PopupHolder);

  WebMarkupContainer popup = new WebMarkupContainer(popup);
  popup.setOutputMarkupId(true);
  popup.setMarkupId(name + Popup);

  popup.add(getBodyContainer());
  popupHolder.add(popup);
  this.add(popupHolder);
}

I have no idea what could cause the problem, the component ordering seems to be 
ok from
my point of view and, as I said before, the code works just fine in 1.4.12.

Cheers,

J.

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



unixODBC, Wicket, Tomcat

2012-02-24 Thread Alex
Dear All,
Does anybody have experience in using unixODBC with Wicket and Tomcat? It
is possible to establish connection with jetty. But it does not work with
Tomcat under Ubuntu. Stand alone java class (without using wicket) is
working under Ubuntu fine.
Any help would be highly appreciated.
Alex


Re: Border-Component Problem in Migration to 1.5

2012-02-24 Thread Jürgen Lind

Ok, I am going to answer myself on that one: changing

this.add(popupHolder);

to

this.addToBorder(popupHolder);

dis it. I had read the migration guide and the Javadoc several times but just 
did not understand it
(correctly)...

J.

On 24.02.2012 14:00, Jürgen Lind wrote:

Hi,

I've just begun to move my application up to 1.5. and I now getting an error in 
a place that worked
just fine in 1.4. The problem seems to lie within creating a border component 
as it gives me the
following error message:

org.apache.wicket.WicketRuntimeException: You can not add a component's parent 
as child to the
component (loop): Component: [BorderBodyContainer [Component id = 
filterTreePopup_body]]; parent ==
child: [WebMarkupContainer [Component id = popupHolder]]

This happens in this line:

InlinePopup filterTreePopup = new InlinePopup(filterTreePopup, filterTree_ 
+ this.markupId);


This is the code for the border component:

wicket:border
div wicket:id=popupHolder
  div wicket:id=popup style=display:none
wicket:body/
  /div
/div
/wicket:border

public InlinePopup(String id, String name) {
super(id);

WebMarkupContainer popupHolder = new WebMarkupContainer(popupHolder);
popupHolder.setOutputMarkupId(true);
popupHolder.setMarkupId(name + PopupHolder);

WebMarkupContainer popup = new WebMarkupContainer(popup);
popup.setOutputMarkupId(true);
popup.setMarkupId(name + Popup);

popup.add(getBodyContainer());
popupHolder.add(popup);
this.add(popupHolder);
}

I have no idea what could cause the problem, the component ordering seems to be 
ok from
my point of view and, as I said before, the code works just fine in 1.4.12.

Cheers,

J.

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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




--
Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



Re: unixODBC, Wicket, Tomcat

2012-02-24 Thread Martin Grigorov
It doesn't work doesn't say much about the problem ...
Give more details

On Fri, Feb 24, 2012 at 2:06 PM, Alex zeita...@googlemail.com wrote:
 Dear All,
 Does anybody have experience in using unixODBC with Wicket and Tomcat? It
 is possible to establish connection with jetty. But it does not work with
 Tomcat under Ubuntu. Stand alone java class (without using wicket) is
 working under Ubuntu fine.
 Any help would be highly appreciated.
 Alex



-- 
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: Adding extra request parameters to AJAX calls

2012-02-24 Thread gmparker2000
Hmm more problems.  This is definitely turning out to be more difficult than
I expected.  If a component already has an Ajax behavior added, then my
behavior conflicts.  Either my behavior is used and the original behavior is
affected, or vice versa.  For example if I try to do this:

public class MyAjaxButton extends AjaxButton {
public MyAjaxButton(String id) {
super(id);

this.add(new AjaxFormSubmitBehavior(onclick) {
@Override
public CharSequence getCallbackUrl(boolean onlyTargetActivePage)
{
return super.getCallbackUrl(onlyTargetActivePage) +
cID=2;
}

@Override
protected void onSubmit(AjaxRequestTarget target) {
}

@Override
protected void onError(AjaxRequestTarget target) {
}
});
}
...

my behavior interferes with the onclick AjaxFormSubmitBehavior that the
AjaxButton already has added (also tried with AjaxEventBehavior).  I guess
it makes sense that if there is already a behavior attached to onclick that
adding another one is not a great idea.

I've tried a couple of other approaches such as removing the existing
behavior, adding my own, and delegating to the original behavior to preserve
its functionality but this doesn't work because the behavior's methods are
protected.

The other problem is that controls such as in-method datagrid already
override getCallbackUrl to add their own parameters.  In cases like this
there seems to be no way I can let the datagrid add a parameter and then add
more.

Any help is appreciated.  Maybe there is an entirely different approach.






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-extra-request-parameters-to-AJAX-calls-tp4405842p4417142.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: unixODBC, Wicket, Tomcat

2012-02-24 Thread Alex
Sorry, I get:
Genral Error |
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6986) |
sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114) |
sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073) |
sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323) |
sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174) |
java.sql.DriverManager.getConnection(DriverManager.java:582) |
java.sql.DriverManager.getConnection(DriverManager.java:207) |
wicketqs.HomePage.init(HomePage.java:39) |
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) |
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
|
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
| java.lang.reflect.Constructor.newInstance(Constructor.java:513) |
org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)
|
org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)
|
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)
|
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)
|
org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)
|
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
|
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
| org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) |
org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) |
org.apache.wicket.RequestCycle.request(RequestCycle.java:545) |
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) |
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
|
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
|
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
|
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
|
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
|
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
|
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)
|
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
|
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
|
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
|
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) |
java.lang.Thread.run(Thread.java:662)

Am 24. Februar 2012 14:13 schrieb Martin Grigorov mgrigo...@apache.org:

 It doesn't work doesn't say much about the problem ...
 Give more details

 On Fri, Feb 24, 2012 at 2:06 PM, Alex zeita...@googlemail.com wrote:
  Dear All,
  Does anybody have experience in using unixODBC with Wicket and Tomcat? It
  is possible to establish connection with jetty. But it does not work with
  Tomcat under Ubuntu. Stand alone java class (without using wicket) is
  working under Ubuntu fine.
  Any help would be highly appreciated.
  Alex



 --
 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: Adding extra request parameters to AJAX calls

2012-02-24 Thread Martin Grigorov
On Fri, Feb 24, 2012 at 2:18 PM, gmparker2000 greg.par...@brovada.com wrote:
 Hmm more problems.  This is definitely turning out to be more difficult than
 I expected.  If a component already has an Ajax behavior added, then my
 behavior conflicts.  Either my behavior is used and the original behavior is
 affected, or vice versa.  For example if I try to do this:

 public class MyAjaxButton extends AjaxButton {

Don't extend from AjaxButton at all. You are actually re-implementing it ...

    public MyAjaxButton(String id) {
        super(id);

        this.add(new AjaxFormSubmitBehavior(onclick) {
            @Override
            public CharSequence getCallbackUrl(boolean onlyTargetActivePage)
 {
                return super.getCallbackUrl(onlyTargetActivePage) +
 cID=2;
            }

            @Override
            protected void onSubmit(AjaxRequestTarget target) {
            }

            @Override
            protected void onError(AjaxRequestTarget target) {
            }
        });
    }
 ...

 my behavior interferes with the onclick AjaxFormSubmitBehavior that the
 AjaxButton already has added (also tried with AjaxEventBehavior).  I guess
 it makes sense that if there is already a behavior attached to onclick that
 adding another one is not a great idea.

 I've tried a couple of other approaches such as removing the existing
 behavior, adding my own, and delegating to the original behavior to preserve
 its functionality but this doesn't work because the behavior's methods are
 protected.

 The other problem is that controls such as in-method datagrid already
 override getCallbackUrl to add their own parameters.  In cases like this
 there seems to be no way I can let the datagrid add a parameter and then add
 more.

 Any help is appreciated.  Maybe there is an entirely different approach.






 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Adding-extra-request-parameters-to-AJAX-calls-tp4405842p4417142.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



Change input tag to span, what about value?

2012-02-24 Thread Taag
I'm overrideing onComponentTag for a textfield. I check if the field is
enabled, if not I want to replace the input tag with a span tag. It's
working nicely, except that I lose the value attatched to the input tag

@Override
protected void onComponentTag( ComponentTag tag ) {
super.onComponentTag( tag );
if (!isEnabledInHierarchy()) {
tag.setName( span );
tag.getXmlTag().setType( TagType.OPEN );
}
}

Anyone know how I can add this value between the open and close tag?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-input-tag-to-span-what-about-value-tp4417174p4417174.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: Change input tag to span, what about value?

2012-02-24 Thread Taag
Had a look on onComponentTagBody, and got it to work by overrideing that
method aswell =)

Here is the solution, fro those wondering:

@Override
protected void onComponentTag( ComponentTag tag ) {
super.onComponentTag( tag );
if (!isEnabledInHierarchy()) {
tag.setName( span );
tag.getXmlTag().setType( TagType.OPEN );
}
}

@Override
public void onComponentTagBody( MarkupStream markupStream, ComponentTag
openTag ) {
replaceComponentTagBody( markupStream, openTag,
getDefaultModelObjectAsString() );
super.onComponentTagBody( markupStream, openTag );
}

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Change-input-tag-to-span-what-about-value-tp4417174p4417196.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: Adding extra request parameters to AJAX calls

2012-02-24 Thread gmparker2000
My intention is not to re-implement it but to extend the functionality it
offers and include the concept of a conversation.  Do you mean that this is
not possible?  Or that I'm just not doing it right :).  Should I be
attempting to encapsulate the AjaxButton instead of inheritance?

thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Adding-extra-request-parameters-to-AJAX-calls-tp4405842p4417202.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: Modal Window does not open second time

2012-02-24 Thread mjop
Yes, with the latest version of Wicket (1.5.4) it works fine.
 Thanks Igor

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Modal-Window-does-not-open-second-time-tp3824184p4417206.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 Caching in 1.5.

2012-02-24 Thread Jürgen Lind

Hi,

my migration to Wicket 1.5. is progressing, but there are still some unresolved 
issues. Currently, I
am trying to prevent wicket from adding antiCache-Information to a 
PackageResourceReference. I am
using a subclassed LabelIconPanel to have my own icons in a Tree component. 
However, all icons are
loaded freshly when doing an update due to the antiCache Part that gets added 
to the URL

I have already search the documentation and various forums but I have not been 
able to find a way
to prevent the described behavior. The best think (I thought) was to disable anti-caching 
altogether, so I added


getResourceSettings().setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE);

to my application's init method. Unfortunately, that did not work either. Any 
suggestions how to
get around this problem?


J.

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



Re: unixODBC, Wicket, Tomcat

2012-02-24 Thread Alex
I am just trying to make connection to unixODBC using jdbcOdbc Bridge:
public class HomePage extends WebPage {
public HomePage(final PageParameters parameters) {
Connection con = null;
try {
  Class.forName(sun.jdbc.odbc.JdbcOdbcDriver) ;
  // Connect with a url string
  con = DriverManager.getConnection(jdbc:odbc:mdbtest;);
  ListString strgLst = new ArrayListString();
  strgLst.add(Connection ok.);
  add(getLst(strgLst));
  con.close();
} catch (SQLException e) {
add(getErrLst(SQLException:, e));
} catch (Exception e) {
add(getErrLst(Exception:, e));
}
}

private ListViewString getErrLst(String firstMsg, Exception e){
StackTraceElement[] err;
ListString errStrg = new ArrayListString();
err = e.getStackTrace();
errStrg.add(firstMsg);
errStrg.add(e.getMessage());
for (int i = 0; ierr.length;i++){
errStrg.add(err[i].toString());
}
return getLst(errStrg);
}

private ListViewString getLst(ListString strgLst){
ListViewString listview = new ListViewString(listview,
strgLst) {
protected void populateItem(ListItemString item) {
item.add(new Label(message, item.getModel()));
}
};
return listview;
}
}

Running on Windows with Jetty I get: Connection ok.

Running on Ubuntu 9.10 with Tomcat 6 I get:
SQLException:
 General error
 sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6986)
 sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
 sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
 sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
 sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
 java.sql.DriverManager.getConnection(DriverManager.java:582)
 java.sql.DriverManager.getConnection(DriverManager.java:207)
 wicketqs.HomePage.init(HomePage.java:42)
 sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
 java.lang.reflect.Constructor.newInstance(Constructor.java:513)

org.apache.wicket.session.DefaultPageFactory.createPage(DefaultPageFactory.java:188)

org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:65)

org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298)

org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320)

org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234)

org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)

org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)
 org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
 org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
 org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)

org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567)

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
 java.lang.Thread.run(Thread.java:662)


Running on Ubuntu as Standalone Java class (without Wicket) I get:
Connection ok.





 Am 24. Februar 2012 14:13 schrieb Martin Grigorov mgrigo...@apache.org:

 It doesn't work doesn't say much about the problem ...
 Give more details

 On Fri, Feb 24, 2012 at 2:06 PM, Alex zeita...@googlemail.com wrote:
  Dear All,
  Does anybody have experience in using unixODBC with Wicket and Tomcat?
 It
  is possible to establish connection with jetty. But it does not work
 with
  Tomcat under Ubuntu. Stand alone java class (without using wicket) is
  working 

Re: Getting new lines in RepeatingView

2012-02-24 Thread Eric Jablow
On Fri, Feb 24, 2012 at 1:54 AM, Martin Grigorov mgrigo...@apache.org
wrote:
 Hi,

 I think you can override RepeatingView's
 org.apache.wicket.markup.repeater.AbstractRepeater#renderChild():
 {

  super.renderChild(component);

  getResponse().write(br/);

 }


I don't think br / is standards-compliant mid-ul. Wouldn't it be
simpler to use getResponse().write('\n')?

Eric


Re: DropDownChoice selection won't update form fields

2012-02-24 Thread oggie
I got it working, but I'm not sure if the way I did it is correct. Here's the
final code:



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-selection-won-t-update-form-fields-tp4413980p4417640.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: Dot in DataTable Columnheader - not allowed?

2012-02-24 Thread Igor Vaynberg
perhaps the dot is being interpreted as part of a path expression by a
property model somewhere... try using normal models instead.

-igor

On Thu, Feb 23, 2012 at 11:31 PM, Rain... Is wet!
oryp-moel...@hotmail.de wrote:
 Some more info:
 My DataProvider is using a Model of the type ListHashMaplt;String,
 Object, where list-index is acting as a table-row, the string is the name
 of a column and the object is the value of a cell.

 Regards
  Rain... Is wet!

 -
 Never forget your umbrella ! In case You did, try to find a shelter ;)
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Dot-in-DataTable-Columnheader-not-allowed-tp4413767p4416416.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: Resource Caching in 1.5.

2012-02-24 Thread Igor Vaynberg
package resource references should not have anticache appended, please
create a quickstart.

-igor

On Fri, Feb 24, 2012 at 6:39 AM, Jürgen Lind juergen.l...@iteratec.de wrote:
 Hi,

 my migration to Wicket 1.5. is progressing, but there are still some
 unresolved issues. Currently, I
 am trying to prevent wicket from adding antiCache-Information to a
 PackageResourceReference. I am
 using a subclassed LabelIconPanel to have my own icons in a Tree component.
 However, all icons are
 loaded freshly when doing an update due to the antiCache Part that gets
 added to the URL

 I have already search the documentation and various forums but I have not
 been able to find a way
 to prevent the described behavior. The best think (I thought) was to disable
 anti-caching altogether, so I added

 getResourceSettings().setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE);

 to my application's init method. Unfortunately, that did not work either.
 Any suggestions how to
 get around this problem?


 J.

 --
 Dr. Jürgen Lind
 iteratec GmbH                Fon: +49 (0)89 614551-44
 Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
 82008 Unterhaching           Web: www.iteratec.de

 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

 -
 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: Resource Caching in 1.5.

2012-02-24 Thread Igor Vaynberg
actually, did you override LabelIconPanel#newImageComponent()? in
there i see code to prevent anticache...

return new Image(componentId)
{
@Override
protected boolean shouldAddAntiCacheParameter()
{
return false;
}
};
}

-igor

On Fri, Feb 24, 2012 at 8:02 AM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 package resource references should not have anticache appended, please
 create a quickstart.

 -igor

 On Fri, Feb 24, 2012 at 6:39 AM, Jürgen Lind juergen.l...@iteratec.de wrote:
 Hi,

 my migration to Wicket 1.5. is progressing, but there are still some
 unresolved issues. Currently, I
 am trying to prevent wicket from adding antiCache-Information to a
 PackageResourceReference. I am
 using a subclassed LabelIconPanel to have my own icons in a Tree component.
 However, all icons are
 loaded freshly when doing an update due to the antiCache Part that gets
 added to the URL

 I have already search the documentation and various forums but I have not
 been able to find a way
 to prevent the described behavior. The best think (I thought) was to disable
 anti-caching altogether, so I added

 getResourceSettings().setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE);

 to my application's init method. Unfortunately, that did not work either.
 Any suggestions how to
 get around this problem?


 J.

 --
 Dr. Jürgen Lind
 iteratec GmbH                Fon: +49 (0)89 614551-44
 Inselkammerstrasse 4         Fax: +49 (0)89 614551-10
 82008 Unterhaching           Web: www.iteratec.de

 Sitz und Registergericht der iteratec GmbH: München HRB 113 519
 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

 -
 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: Resource Caching in 1.5.

2012-02-24 Thread Jürgen Lind

Thx Igor, that was indeed the right call... Not it works as expected...

J.


On 24.02.2012 17:03, Igor Vaynberg wrote:

actually, did you override LabelIconPanel#newImageComponent()? in
there i see code to prevent anticache...

return new Image(componentId)
{
@Override
protected boolean shouldAddAntiCacheParameter()
{
return false;
}
};
}

-igor

On Fri, Feb 24, 2012 at 8:02 AM, Igor Vaynbergigor.vaynb...@gmail.com  wrote:

package resource references should not have anticache appended, please
create a quickstart.

-igor

On Fri, Feb 24, 2012 at 6:39 AM, Jürgen Lindjuergen.l...@iteratec.de  wrote:

Hi,

my migration to Wicket 1.5. is progressing, but there are still some
unresolved issues. Currently, I
am trying to prevent wicket from adding antiCache-Information to a
PackageResourceReference. I am
using a subclassed LabelIconPanel to have my own icons in a Tree component.
However, all icons are
loaded freshly when doing an update due to the antiCache Part that gets
added to the URL

I have already search the documentation and various forums but I have not
been able to find a way
to prevent the described behavior. The best think (I thought) was to disable
anti-caching altogether, so I added

getResourceSettings().setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE);

to my application's init method. Unfortunately, that did not work either.
Any suggestions how to
get around this problem?


J.

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

-
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




--
Mit freundlichen Grüßen,

Jürgen Lind

--
Dr. Jürgen Lind
iteratec GmbHFon: +49 (0)89 614551-44
Inselkammerstrasse 4 Fax: +49 (0)89 614551-10
82008 Unterhaching   Web: www.iteratec.de

Sitz und Registergericht der iteratec GmbH: München HRB 113 519
Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel

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



UploadProgressBar not updating with with ajaxbutton form submit

2012-02-24 Thread bad boy


Hi 

When I submit the form with ajax button, the progress upload  bar is not 
getting  updated with progress. When I submit the same file with the non ajax 
button , the progress bar gets updated correctly. The file is uploaded 
correctly in both cases. I have configure the  webrequest in the wicket 
aplication as

 */
@Override
protected WebRequest newWebRequest(HttpServletRequest servletRequest)
{
return new UploadWebRequest(servletRequest);
}



I attached the  progrss bar as follows :

  final FileUploadForm ajaxSimpleUploadForm = new 
FileUploadForm(ajax-simpleUpload);
  ajaxSimpleUploadForm.addOrReplace(new UploadProgressBar(progress, 
ajaxSimpleUploadForm));

I am using wicket  1.4.18. This is my form




 --div wicket:id=formHolder
 --               form wicket:id=ajax-simpleUpload
 --                   fieldset
 --                       legendUpload form with ajax progress bar/legend
 --                       p
 --                           label for=uploadFile/label
 --                           input wicket:id=fileInput id=upload 
type=file/
 --                           
 --                       /p
 --                       input type=submit value=submit via ajax 
wicket:id=ajax-button/
 --                       input type=submit value=upload / 
 --                       span wicket:id=progress[[ajax upload 
progressbar]]/span
 --                   /fieldset
 --                   
 --               /form


Thanks
badami

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



ExternalLink close modalWindow

2012-02-24 Thread DuneBug
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 + ');
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



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

2012-02-24 Thread Neil Curzon
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);
}
}

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


Re: Performance optimization

2012-02-24 Thread Per
Hi Martin,

some of the things we did was (as mentioned by others) to generate HTML,
this saved a lot of memory. But also to look really hard at the component
tree and decide if everything was needed *all the time*. For instance, we
had plenty of AJAX links that were rarely used (5 per row or so). We decided
to make them load on demand only (click for admin actions). This saved
some 500 bytes per row.  Also, some optimisations like replacing
setVisible(false) by an empty component saved us some space. Some component
use more memory than others, and can be replaced. Etc.  It's really crucial
to use a profiler to see where all the bytes go. I wrote a blogpost over
here:
http://www.small-improvements.com/blog/technical/tuning-wicket-session-size 
a few months ago. You may even want to create your own eviction-policy that
collects certain pages more aggressively than others (if applicable). Many
options. 

But yeah, it's tough, it's one of the things I found most challenging about
Wicket. I'd love to hear how you end solving with the problem, maybe there's
something else to be learned! 

Good luck!
Per


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Performance-optimization-tp4412659p4419111.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: Performance optimization

2012-02-24 Thread Per

Martin Makundi wrote
 
 The problem is that the SERIALIZATION takes time. So it does not help to
 ZIP AFTER serialization...
 
 

Well, if you really only have one page in your session, and that page's
serialisation is killing you, then you're right. But if you have multiple
page versions, and other pages in your session, and your session is maybe
even 50mb, then the zipping might help: not for this particular page, but
for all the *others* that also have to get read and restored. 

Also, have you considered trying other serialisers? I'm not an expert on
that topic, but I overheard other developers that there are faster
libraries. They have tradeoffs, but maybe one of them works for you.
 
Cheers,
Per


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Performance-optimization-tp4412659p4419130.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



AjaxFallbackDefaultDataTable selected row color

2012-02-24 Thread pkc
Is there a way to highlight the selected row after clicking on a link in a
DataTable cell? 


  public final class ColumnList extends
  ArrayListIColumnlt;QuikViewEnv
  {
public ColumnList()
{
  add(new AbstractColumnQuikViewEnv(new ModelString(Environment),
name){
public void populateItem(final
ItemICellPopulatorlt;QuikViewEnv cellItem, String componentId,
final IModelQuikViewEnv model)
{
  Fragment nameCellFrag = new
Fragment(componentId,envTableCell, QuikViewEnvPage.this);
  AjaxLinkQuikViewEnv link = new
AjaxLinkQuikViewEnv(envLink,model){
@Override
public void onClick(AjaxRequestTarget target)
{
  quikViewEnv = model.getObject();
  form.setModel(new
CompoundPropertyModelQuikViewEnv(quikViewEnv)); 
  success(quikViewEnv.name +  selected.);
  *//TODO - make the row for this cellItem look selected
with a css class*
  target.add(form);
  target.add(feedbackPanel);
}
  };
  nameCellFrag.add(link);
  link.add(new Label(envLabel, model.getObject().name));
  cellItem.add(nameCellFrag);
}
});
  add(new PropertyColumnQuikViewEnv(
  new ModelString(OHS Host), ohsPort, ohsHost));


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFallbackDefaultDataTable-selected-row-color-tp4419138p4419138.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: Performance optimization

2012-02-24 Thread Martin Makundi
 For instance, we
 had plenty of AJAX links that were rarely used (5 per row or so).
 We decided to make them load on demand only (click for admin actions).

Yeah, we did this too.

 some of the things we did was (as mentioned by others) to generate HTML,
 this saved a lot of memory. But Also, some optimisations like replacing
 setVisible(false) by an empty component saved us some space.

Ok... this might be something to look at, because in our matrix most
of it is empty really, so there must be lots of invisible items.

 I wrote a blogpost over here:
 http://www.small-improvements.com/blog/technical/tuning-wicket-session-size

Great post, thanks!

 Well, if you really only have one page in your session, and that page's
 serialisation is killing you, then you're right. But if you have multiple
 page versions, and other pages in your session, and your session is maybe
 even 50mb, then the zipping might help: not for this particular page, but
 for all the *others* that also have to get read and restored.

We have already disabled versioning and page history ;) No back button
support... who really needs that ;)

 Also, have you considered trying other serialisers? I'm not an expert on
 that topic, but I overheard other developers that there are faster
 libraries. They have tradeoffs, but maybe one of them works for you.

I worry about maintenance overhead and possible bugs, the code is
alreay quite complex to add some unknown variables is not possible
at the moment.

**
Martin

 Cheers,
 Per


 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Performance-optimization-tp4412659p4419130.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: Performance optimization

2012-02-24 Thread Martin Makundi
@Per

 I wrote a blogpost over here:
 http://www.small-improvements.com/blog/technical/tuning-wicket-session-size

Did you try this approach:

 if the component is stateless you can autoadd it in onbeforerender(),
 such components are removed at the end of the request

?

**
Martin

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



RE: Performance optimization

2012-02-24 Thread Chris Colman
The advice to try a different serializer is spot on.

Serialize any object tree to file using Java's standard serializer and
then open that file in a binary editor and then you'll see why the
standard Java serialization stream takes a surprisingly large amount of
bytes to store each object.

I had this problem in a desktop application years ago. We were pulling
in  .CSV files, converting each row to objects and then serializing the
lot. We were getting massive 15MB files from relatively small .CSV
files. For the majority of objects the header info stored for each
object in the stream is usually orders of magnitude larger than the
space taken up by the object's attributes.



-Original Message-
From: Per [mailto:p...@hamburg.de]
Sent: Saturday, 25 February 2012 12:13 PM
To: users@wicket.apache.org
Subject: Re: Performance optimization


Martin Makundi wrote

 The problem is that the SERIALIZATION takes time. So it does not help
to
 ZIP AFTER serialization...



Well, if you really only have one page in your session, and that page's
serialisation is killing you, then you're right. But if you have
multiple
page versions, and other pages in your session, and your session is
maybe
even 50mb, then the zipping might help: not for this particular page,
but
for all the *others* that also have to get read and restored.

Also, have you considered trying other serialisers? I'm not an expert
on
that topic, but I overheard other developers that there are faster
libraries. They have tradeoffs, but maybe one of them works for you.

Cheers,
Per


--
View this message in context: http://apache-
wicket.1842946.n4.nabble.com/Performance-optimization-
tp4412659p4419130.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



How to use autoAdd?

2012-02-24 Thread Martin Makundi
 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



Re: Performance optimization

2012-02-24 Thread Martin Makundi
@Per about 
http://www.small-improvements.com/blog/technical/tuning-wicket-session-size

You say If condition A is met, show label A. If not, use
setVisible(false) to hide it. Combine that with Enclosures... Trouble
is, while the hidden component doesn't show up in the markup, it's
still part of the component tree! 

I remember sometimes when using enclosures, I have rendered a page
which has not added some components inside an enclosure. Maybe there
could be a way to mark a region in the markup (like enclosure) where a
component can be optionally added.

This way setVisible=false could be achieved simply by not adding
that component.



**
Martin

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