Re: a weird exception when update Panel

2012-12-04 Thread Martin Grigorov
Hi,

What is the type of component with id 'includeMain' ?

The exception says that the second request cannot find a behavior to
execute at position one in component 'includeMain'.
To understand why this happens we need to know what happens in onXyz()
callback in the first request/click.

I think you can avoid this by disabling the link after click on the client
side so the user cannot click second time until the first returns.



On Tue, Dec 4, 2012 at 8:33 AM, JamesXWang  wrote:

> Hi Folks,
>
> On one of my v6.1 wick page there is a set of tabs and a main panel. When
> user click on a new tab it will trigger an ajax behavior and create a
> different panel to update the main panel. Sometimes I've seen below
> exception if I click the tab quickly once the page is loaded. But it didn't
> happen everytime. Even it happened I refresh the page and wait for few
> second, then click the tabs again the page will work well without any
> exception.
>
> On the main panel java I've tried to override the getStatelessHint() to
> return false but it help nothing of this weird exception.
>
> Any one have the idea how to fix it? Many thanks in advance!
>
> Exception detail below -
>
> Unexpected RuntimeException
>
> Last cause: Cannot find behavior with id '1' on component
> 'com.myapp.web.common.LogsPanel:includeMainPanel:includeMain' in page
> '[Page
> class = com.myapp.web.home.HomePage, id = 6, render count = 1]'. Perhaps
> the
> behavior did not properly implement getStatelessHint() and returned 'true'
> to indicate that it is stateless instead of returning 'false' to indicate
> that it is stateful.
>
> Stacktrace
>
> Root cause:
>
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior
> with id '1' on component
> 'com.myapp.web.common.LogsPanel:includeMainPanel:includeMain' in page
> '[Page
> class = com.myapp.web.home.HomePage, id = 6, render count = 1]'. Perhaps
> the
> behavior did not properly implement getStatelessHint() and returned 'true'
> to indicate that it is stateless instead of returning 'false' to indicate
> that it is stateful.
> at org.apache.wicket.Behaviors.getBehaviorById(Behaviors.java:303)
> at org.apache.wicket.Component.getBehaviorById(Component.java:4479)
> at
>
> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:246)
> at
>
> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:226)
> at
>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:814)
> at
>
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
> at
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
> at
>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
> at
>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
> at
>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
> at
>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
> at
>
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
> at
>
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
> at
>
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> at
>
> org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
> at
>
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
> at
>
> org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
> at
>
> com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
> at
>
> com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
> at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
> at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
> at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
> at
>
> com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
> at
>
> com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
> at
> com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
> at
> com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
> at
>
> com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
> at
>
> com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.

Syncing files with designers

2012-12-04 Thread Edgar Merino
Hello, I would like our designers to work with a simple folder structure 
on our application pages markup, and we would like to avoid including 
java source code files with the files we share with them. What is the 
best way to do this? I though about implementing a custom 
ResourceStreamLocator, so I can for instance name our html files using 
the fqcn e.g. my.company.HomePage.html and placing these files in the 
default package (under src/main/html for example).


Is this the way to go?

Thanks in advance,
Edgar Merino

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



Re: Best way to trap Enter key in a form in a modal window

2012-12-04 Thread Martin Grigorov
Hi Chris,

I think all this is actually related to ModalWindow, not to Form.
You don't close the Form, you close the ModalWindow.
ModalWindow#close() accepts AjaxRequestTarget (ART) so it is clear that it
needs to be in Ajax request, no ?
The form is just a component in the ModalWindow. With or without a form
inside it the ModalWindow needs ART.


On Mon, Dec 3, 2012 at 11:27 PM, Chris Colman
wrote:

> The other important thing to mention in Form's Javadoc is that a form in
> a ModalWindow can not be closed without AJAX. i.e. you can't do the
> close in the standard Form.onSubmit handler as that is given no
> AjaxRequestTarget parameter which is required to perform the ModalWindow
> close. Trying to close it in the implicit way results in the browser
> throwing up a pop up asking the user if they want to "Leave this page"
> or "Stay on this page" - which is pretty bad.
>
> >-Original Message-
> >From: Martin Grigorov [mailto:mgrigo...@apache.org]
> >Sent: Monday, 3 December 2012 11:18 PM
> >To: users@wicket.apache.org
> >Subject: Re: Best way to trap Enter key in a form in a modal window
> >
> >Hi,
> >
> >On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman
> >wrote:
> >
> >> I understand that with a form in a modal window you must explicitly
> >> declare an AjaxButton component because modal windows require AJAX
> comms
> >> (BTW this should probably be mentioned in the Form Javadoc page
> >> somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/)
> >>
> >
> >I didn't get what should be better explained ?
> >
> >
> >>
> >> However, what is the best approach to providing a 'catch all' so that
> if
> >> the user presses the 'Enter' key while focus is on any field in the
> form
> >> the normal submit takes place?
> >>
> >
> >See Form#setDefaultButton.
> >Not sure whether this will help in Ajax form submit though.
> >
> >Additionally check https://github.com/kinabalu/wicket-mousetrap/
> >
> >--
> >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
>
>


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


Re: Syncing files with designers

2012-12-04 Thread Martin Grigorov
Hi Edgar,

Yes, this is the way to go.


On Tue, Dec 4, 2012 at 9:04 AM, Edgar Merino  wrote:

> Hello, I would like our designers to work with a simple folder structure
> on our application pages markup, and we would like to avoid including java
> source code files with the files we share with them. What is the best way
> to do this? I though about implementing a custom ResourceStreamLocator, so
> I can for instance name our html files using the fqcn e.g.
> my.company.HomePage.html and placing these files in the default package
> (under src/main/html for example).
>
> Is this the way to go?
>
> Thanks in advance,
> Edgar Merino
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


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


Re: Form Validation not called

2012-12-04 Thread Martin Grigorov
Hi,

Your validator needs to
implement org.apache.wicket.markup.html.form.validation.IFormValidator to
be able to validate on form level.


On Mon, Dec 3, 2012 at 11:04 PM, ttboy_01  wrote:

> Hi community,
>
> I've got a little problem here with a real simple form. Everything is
> working fine except the validation of my Validator which is never called.
> I've set a breakpoint to the "onvalidation" method... nothing. I think I am
> missunderstanding the architecture of form/validation.
>
> Here's the sample code:
>
> **
> *** Page
> **
>
> public class MyTestPage extends HomePage {
>
> /**
>  *
>  */
> private static final long serialVersionUID = 6374488865423191635L;
>
> private IModel article = Model.of(new Article());
>
> public MyTestPage() {
> this(null);
> }
>
> public MyTestPage(PageParameters params) {
> super(params);
>
> add(new FeedbackPanel("testPage.feedback", new
> ComponentFeedbackMessageFilter(this)));
>
> add(new MyTestForm("testPage.myForm", article));
> }
>
> class MyTestForm extends Form {
>
> /**
>  *
>  */
> private static final long serialVersionUID =
> -1961809427855436256L;
>
> public MyTestForm(String id, IModel model) {
> super(id, new
> CompoundPropertyModel(model));
>
> TextField myText = new
> TextField("testPage.myText", new
> PropertyModel(getModel(), "EAN"));
> add(myText);
> DropDownChoice myDropDown = new
> DropDownChoice("testPage.myDropDown", new
> PropertyModel(getModel(), "status"),
>
> Arrays.asList(ArticleStatus.values()));
> add(myDropDown);
>
> AjaxButton btSave = new
> AjaxButton("testPage.save", MyTestForm.this) {
>
> @Override
> protected void onSubmit(AjaxRequestTarget
> target, Form form) {
>
> Article article = ((Article)
> getParent().getDefaultModelObject());
> // save article -> working
>
> }
>
> @Override
> protected void onError(AjaxRequestTarget
> target, Form form) {
> // add feedback panel here -> but
> this is never called
> }
> };
> add(btSave);
>
> Button btCancel = new Button("testPage.cancel") {
>
> @Override
> public void onSubmit() {
> setResponsePage(HomePage.class);
> }
>
> };
> btCancel.setDefaultFormProcessing(false);
> add(btCancel);
>
> add(new ArticleValidator(myDropDown, myText));
> }
> }
>
> }
>
> **
> *** Validator
> **
> public class ArticleValidator extends AbstractValidator implements
> IValidator {
>
>  //...
> }
>
> Thanks for help.
> Regards,
> Erik
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Form-Validation-not-called-tp4654443.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 


Re: Serialization of anonymous classes?

2012-12-04 Thread Julio Gonnet
Actually, it can be quite a problem when you pass anonymous classes between
pages/requests. Example: user opens a dialog to search for a specific value
to set in the parent page. the parent page creates and passes an anonymous
callback instance to the dialog, which the dialog calls once the the desired
value has been selected. The callback then theoretically stores the value
somewhere in the parent page's model for further processing. 

But once the Dialog closes and the parent page is refreshed - the value is
nowhere to be seen - doesn't exist. What happened. Well, because of
serialization, the anonymous callback in the dialog holds a reference to the
parent page that has long been serialized. Setting the value within the
callback will not set it in the serialized version, but rather in a
'version' that's attached to the anonymous class that now part of the
dialog. Once the dialog closes, it's all serialized. You now have 2
serialized parent pages, the original and one attached to the dialog via the
anonymous callback. But when refreshing the parent page, it deserializes the
original (the parent page prior to the setting of the value) as it has no
idea of any other version and not the hidden version within the dialog that
has the value set - hence no value to be seen.

This little inconvenience is very hard to detect - cost me a couple of hours
to find! So YES, anonymous classes can cause issues due to serialization!



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Serialization-of-anonymous-classes-tp1843728p4654454.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: UrlResourceReference escapes too much?

2012-12-04 Thread Andreas Kappler
I created an issue for this: WICKET-4907 



Best Regards,
Andreas

Am 03.12.2012 16:21, schrieb Martin Grigorov:

I'm not sure. I have to debug it to be able to say what happens.


On Mon, Dec 3, 2012 at 4:16 PM, Andreas Kappler <
andreas.kapp...@jato-consulting.de> wrote:


Hi Martin,

thanks for your quick reply, it does indeed work with forUrl but what I
didn't mention before is that I am using a ResourceReference because I want
to declare a dependency using ResourceReference#**getDependencies. Is
there a way to do this?

Best Regards,
Andreas

Am 03.12.2012 16:10, schrieb Martin Grigorov:


Hi,

Try with org.apache.wicket.markup.head.**JavaScriptHeaderItem#forUrl()
This method cares about context relative urls.


On Mon, Dec 3, 2012 at 4:06 PM, Andreas Kappler <
andreas.kappler@jato-**consulting.de >
wrote:

  Hi,

I am trying to render a reference to a Javascript library which is stored
somewhere in my webapp directory using UrlResourceReference:

public void renderHead(IHeaderResponse response) {
  super.renderHead(response);
  response.render(JavaScriptHeaderItem.forReference(new
UrlResourceReference(Url.parse("public/scripts/jquery-***
*ui-1.8.6.custom.min.js"))

.setContextRelative(true)));
}

This does not work, because our wicket servlet is using a prefix ("nui"),
and thus the URL to the resource (corrently) contains ".." but this is
escaped for some reason to "::".

So the URL generated by the ResourceReference is e.g. "
http://localhost:8080/app/nui/::/public/scripts/jquery-
ui-1.8.6.custom.min.js

"

leading to a 404. The correct URL would be "http://localhost:8080/app/**
nui/../public/scripts/jquery-ui-1.8.6.custom.min.jshttp://localhost:8080/app/nui/../public/scripts/jquery-ui-1.8.6.custom.min.js>

"

As far as I can see, ParentPathReferenceRewriter does the escaping.

Am I using the API not correctly? Thanks for your help!

Best Regards,
Andreas

--**
--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.org

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




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








Re: a question on different data grid components available for wicket

2012-12-04 Thread Martin Grigorov
Great work, Ernesto !

I just tried the samples application and the only problem that I've found
is related to the editable grids.
In both Editable Grid and Editable TreeGrid the 'ESC' keypress doesn't work.
In Editable TreeGrid I can edit only folders but I can't edit leafs.

Other than this I find it better than the YUI version. The column resizing
and reordering works better than before!
I'll update Brix and try it there before 6.4.0.


On Mon, Dec 3, 2012 at 10:24 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Martin,
>
> All grid functionality seems to be ported to jquery... I have pushed the
> changes  master.
>
>
> https://github.com/wicketstuff/core/commit/85920962aa601e6114234caa9e7b2304c603ba49
>
> It would be nice if someone with a real application using inMethod grid can
> give it a try.
>
> Cheers,
>
> Ernesto
>
> On Sat, Dec 1, 2012 at 5:40 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Martin,
> >
> > On Sat, Dec 1, 2012 at 5:20 PM, Martin Grigorov  >wrote:
> >
> >> Well done, Ernesto !
> >>
> >> Since YUI implementation will be preserved for some time I think it is
> OK
> >> to commit directly in master branch.
> >> The announcement for WicketStuff 6.4.0 will have a special note about
> this
> >> change with a description how to use the old YUI impl.
> >>
> >> Ok. I will add a useYui flag and some javadoc for it,
> >
> >
> >> Another problem that I see is that "Select All" checkbox is not selected
> >> after using it.
> >>
> >>
> > Thanks for the feedback, I will try fix that and the other issues
> tomorrow.
> >
> >
> >>
> >> On Sat, Dec 1, 2012 at 5:07 PM, Ernesto Reinaldo Barreiro <
> >> reier...@gmail.com> wrote:
> >>
> >> > Martin.
> >> >
> >> > On Wed, Nov 28, 2012 at 9:25 AM, Martin Grigorov <
> mgrigo...@apache.org
> >> > >wrote:
> >> >
> >> > > On Wed, Nov 28, 2012 at 9:22 AM, Ernesto Reinaldo Barreiro <
> >> > > reier...@gmail.com> wrote:
> >> > >
> >> > > > Hi,
> >> > > >
> >> > > > On Wed, Nov 28, 2012 at 9:14 AM, Martin Grigorov <
> >> mgrigo...@apache.org
> >> > > > >wrote:
> >> > > >
> >> > > > > Hi,
> >> > > > >
> >> > > > > InMethod Grid is more smarter. It supports column reordering,
> >> > resizing,
> >> > > > > better Ajax support. But it is no active maintainer at the
> moment.
> >> > > > > Different community members provide patches when they need fixes
> >> but
> >> > > > that's
> >> > > > > all.
> >> > > > > It is also based on Yahoo UI v.2.
> >> > > > >
> >> > > > >
> >> > > > Maybe it is time to try to rewrite all column reordering,
> re-sizing
> >> > logic
> >> > > > based on jquery (instead of YUI). Now that jquery comes "for free"
> >> with
> >> > > > wicket 6.x
> >> > > >
> >> > > >
> >> > > I'm sure many users will be happy of such change.
> >> > > Even upgrading to YUI 3 will be a big improvement.
> >> > > The same is valid for wicket-datetime module.
> >> > >
> >> > >
> >> > I have managed to port grid functionality  to  use jquery. See [1]
> (just
> >> > deployed a temporary version of the sample application).
> >> >
> >> > Issues.
> >> >
> >> > 1- sorting columns do not update grid properly.
> >> > 2- Tree grid column reordering do work yet.
> >> >
> >> > I will try to fix those tomorrow.
> >> >
> >> > The only needed dependency is jquery itself.
> >> >
> >> > I will add a flag that allows to choose between jquery and YUI backed
> >> grid
> >> > (with default to jquery;-). Shall I commit those changes? Create a
> >> branch?
> >> > Or a patch?
> >> >
> >> > References,
> >> >
> >> > 1-http://antiliasoft.com/inmethod-grid-examples/
> >> >
> >> > --
> >> > Regards - Ernesto Reinaldo Barreiro
> >> > Antilia Soft
> >> > http://antiliasoft.com/ 
> >> >
> >>
> >>
> >>
> >> --
> >> Martin Grigorov
> >> jWeekend
> >> Training, Consulting, Development
> >> http://jWeekend.com 
> >>
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> > Antilia Soft
> > http://antiliasoft.com/ 
> >
> >
>



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


Re: a question on different data grid components available for wicket

2012-12-04 Thread Ernesto Reinaldo Barreiro
Martin,

On Tue, Dec 4, 2012 at 9:28 AM, Martin Grigorov wrote:

> Great work, Ernesto !
>
> I just tried the samples application and the only problem that I've found
> is related to the editable grids.
> In both Editable Grid and Editable TreeGrid the 'ESC' keypress doesn't
> work.
> In Editable TreeGrid I can edit only folders but I can't edit leafs.
>
> Thanks for the feedback! I will look into those issues ASAP.


> Other than this I find it better than the YUI version. The column resizing
> and reordering works better than before!
> I'll update Brix and try it there before 6.4.0.
>
>
> On Mon, Dec 3, 2012 at 10:24 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Martin,
> >
> > All grid functionality seems to be ported to jquery... I have pushed the
> > changes  master.
> >
> >
> >
> https://github.com/wicketstuff/core/commit/85920962aa601e6114234caa9e7b2304c603ba49
> >
> > It would be nice if someone with a real application using inMethod grid
> can
> > give it a try.
> >
> > Cheers,
> >
> > Ernesto
> >
> > On Sat, Dec 1, 2012 at 5:40 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> > > Martin,
> > >
> > > On Sat, Dec 1, 2012 at 5:20 PM, Martin Grigorov  > >wrote:
> > >
> > >> Well done, Ernesto !
> > >>
> > >> Since YUI implementation will be preserved for some time I think it is
> > OK
> > >> to commit directly in master branch.
> > >> The announcement for WicketStuff 6.4.0 will have a special note about
> > this
> > >> change with a description how to use the old YUI impl.
> > >>
> > >> Ok. I will add a useYui flag and some javadoc for it,
> > >
> > >
> > >> Another problem that I see is that "Select All" checkbox is not
> selected
> > >> after using it.
> > >>
> > >>
> > > Thanks for the feedback, I will try fix that and the other issues
> > tomorrow.
> > >
> > >
> > >>
> > >> On Sat, Dec 1, 2012 at 5:07 PM, Ernesto Reinaldo Barreiro <
> > >> reier...@gmail.com> wrote:
> > >>
> > >> > Martin.
> > >> >
> > >> > On Wed, Nov 28, 2012 at 9:25 AM, Martin Grigorov <
> > mgrigo...@apache.org
> > >> > >wrote:
> > >> >
> > >> > > On Wed, Nov 28, 2012 at 9:22 AM, Ernesto Reinaldo Barreiro <
> > >> > > reier...@gmail.com> wrote:
> > >> > >
> > >> > > > Hi,
> > >> > > >
> > >> > > > On Wed, Nov 28, 2012 at 9:14 AM, Martin Grigorov <
> > >> mgrigo...@apache.org
> > >> > > > >wrote:
> > >> > > >
> > >> > > > > Hi,
> > >> > > > >
> > >> > > > > InMethod Grid is more smarter. It supports column reordering,
> > >> > resizing,
> > >> > > > > better Ajax support. But it is no active maintainer at the
> > moment.
> > >> > > > > Different community members provide patches when they need
> fixes
> > >> but
> > >> > > > that's
> > >> > > > > all.
> > >> > > > > It is also based on Yahoo UI v.2.
> > >> > > > >
> > >> > > > >
> > >> > > > Maybe it is time to try to rewrite all column reordering,
> > re-sizing
> > >> > logic
> > >> > > > based on jquery (instead of YUI). Now that jquery comes "for
> free"
> > >> with
> > >> > > > wicket 6.x
> > >> > > >
> > >> > > >
> > >> > > I'm sure many users will be happy of such change.
> > >> > > Even upgrading to YUI 3 will be a big improvement.
> > >> > > The same is valid for wicket-datetime module.
> > >> > >
> > >> > >
> > >> > I have managed to port grid functionality  to  use jquery. See [1]
> > (just
> > >> > deployed a temporary version of the sample application).
> > >> >
> > >> > Issues.
> > >> >
> > >> > 1- sorting columns do not update grid properly.
> > >> > 2- Tree grid column reordering do work yet.
> > >> >
> > >> > I will try to fix those tomorrow.
> > >> >
> > >> > The only needed dependency is jquery itself.
> > >> >
> > >> > I will add a flag that allows to choose between jquery and YUI
> backed
> > >> grid
> > >> > (with default to jquery;-). Shall I commit those changes? Create a
> > >> branch?
> > >> > Or a patch?
> > >> >
> > >> > References,
> > >> >
> > >> > 1-http://antiliasoft.com/inmethod-grid-examples/
> > >> >
> > >> > --
> > >> > Regards - Ernesto Reinaldo Barreiro
> > >> > Antilia Soft
> > >> > http://antiliasoft.com/ 
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Martin Grigorov
> > >> jWeekend
> > >> Training, Consulting, Development
> > >> http://jWeekend.com 
> > >>
> > >
> > >
> > >
> > > --
> > > Regards - Ernesto Reinaldo Barreiro
> > > Antilia Soft
> > > http://antiliasoft.com/ 
> > >
> > >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 
>



-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ 


Re: Wicket and Struts together have a problem when not adding mountpath to the Wicket-Page

2012-12-04 Thread cknafl
Could be a possibility. I am trying it right now, I have to overwrite
newUrlRenderer in RequestCycle but how do I set my own RequestCycle?

What I do not understand is that this behavior changed from wicket1.4 to
wicket6.

When I call a page with mountpath(value="bla") then I get a URL like
http://.../wicket/bla. When on this page is a button that makes a
setResponsePage(otherpage) I get a URL like http://.../wicket/wicket/page?1.

One "/wicket/" is added altough I was in Wicket.

You know what I mean.

Regards
Christoph



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Struts-together-have-a-problem-when-not-adding-mountpath-to-the-Wicket-Page-tp4654359p4654458.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 and Struts together have a problem when not adding mountpath to the Wicket-Page

2012-12-04 Thread Martin Grigorov
On Tue, Dec 4, 2012 at 9:58 AM, cknafl  wrote:

> Could be a possibility. I am trying it right now, I have to overwrite
> newUrlRenderer in RequestCycle but how do I set my own RequestCycle?
>
> What I do not understand is that this behavior changed from wicket1.4 to
> wicket6.
>

I'm not sure that you need a custom UrlRenderer but if you do then
see org.apache.wicket.Application#setRequestCycleProvider


>
> When I call a page with mountpath(value="bla") then I get a URL like
> http://.../wicket/bla. When on this page is a button that makes a
> setResponsePage(otherpage) I get a URL like http://
> .../wicket/wicket/page?1.
>
> One "/wicket/" is added altough I was in Wicket.
>

Yes. Wicket uses 'wicket' namespace for all pages which has no explicit
mount path.
See org.apache.wicket.Application#newMapperContext
and org.apache.wicket.DefaultMapperContext#getNamespace


>
> You know what I mean.
>
> Regards
> Christoph
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Struts-together-have-a-problem-when-not-adding-mountpath-to-the-Wicket-Page-tp4654359p4654458.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 


Re: understanding ajax response

2012-12-04 Thread Martin Grigorov
see https://issues.apache.org/jira/browse/WICKET-4881


On Fri, Nov 30, 2012 at 8:23 PM, Martin Grigorov wrote:

> I see a solution for this case.
> If you can provide a quickstart app then please attach it to a ticket in
> our Jira so I can test with it.
>
>
> On Fri, Nov 30, 2012 at 7:45 PM, saty  wrote:
>
>> Below  is a part of overall response, the error in this run is:
>>
>> [13:33:14.799] Wicket.Ajax: Wicket.Ajax.Call.processEvaluation: Exception
>> evaluating javascript: InternalError: too much recursion, text:
>>
>> Wicket.Ajax.ajax({"f":"form371","u":"./?2-5.IBehaviorListener.0-homePageTabs-panel-pricingPropertyTabs-panel-fitlerGridPanel-snapshotGridForm-snapshotGrid-form-bodyContainer-body-row-2-item-checkBox-checkbox","e":"click","c":"checkbox383","pre":[function(attrs){window.setTimeout(function(){this.checked=!this.checked}.bind(this),0);null}],"m":"POST"});
>>
>> Also included this portion under ...
>>
>>
>> 
>>
>> 
>> ...
>> 
>> 
>> .
>> .
>> .
>>
>> 
>> 
>> .
>> .
>> .
>> 
>> 
>>
>>   
>> 
>>
>>  
>>
>>   
>> 
>>
>>   
>> .
>> .
>> .
>> .
>> .
>> 
>>
>>   
>>
>>  
>>
>>   
>> 
>>   
>> 
>>
>>   
>> 
>>
>>   
>> 
>>
>>   
>> 
>>
>>   
>> .
>> .
>> .
>> .
>> .
>> 
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/understanding-ajax-response-tp4654310p4654393.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 
>
>


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


Re: Wicket and Struts together have a problem when not adding mountpath to the Wicket-Page

2012-12-04 Thread cknafl
I am currently overwriting getNamespace(). But that is really dirty. When I
make this method to return "" everytime, then my css, js and so on cannot be
found anymore, that I added with renderHead(..).
So I implemented an if-else logic:
if(path.contains("resource") 
   return "wicket";
...

Can you tell me how you would use this
UrlRenderer#renderContextRelativeUrl() instead of setting my own UrlRenderer
please?

Regards
Christoph



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Struts-together-have-a-problem-when-not-adding-mountpath-to-the-Wicket-Page-tp4654359p4654461.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: Model is null after submit, using FormComponentPanel

2012-12-04 Thread Raul
Thank Col, But I have no validation, my component code is the code of the
component is

public class CustomerAccountCode extends
FormComponentPanel {

private FormComponent entity;
private FormComponent office;
private FormComponent dc;
private FormComponent number;


public CustomerAccountCode(String id, Model model) {
super(id, model);

entity = new TextField("entity", new Model());
office = new TextField("office", new Model());
dc = new TextField("dc", new Model());
number = new TextField("number", new Model());

onModelChanged();
add(entity);
add(office);
add(dc);
add(number);
//  add(CustomerAccountCodeValidator.getInstance());

}

protected void onModelChanged() {
super.onModelChanged();
CustomerAccountCodeModel ccc = getModelObject();
if (ccc != null) {
entity.setModelObject(ccc.getEntity());
office.setModelObject(ccc.getOffice());
dc.setModelObject(ccc.getDc());
number.setModelObject(ccc.getAccount());
} else {
entity.setModelObject(null);
office.setModelObject(null);
dc.setModelObject(null);
number.setModelObject(null);
}
}

@Override
protected void convertInput() {
Account account = new Account(
entity.getConvertedInput(), 
office.getConvertedInput(),
dc.getConvertedInput(), 
number.getConvertedInput());

if (Strings.isEmpty(account.getEntity()) &&
Strings.isEmpty(account.getDc())
&& Strings.isEmpty(account.getOffice()) &&
Strings.isEmpty(account.getNumber())) {
account = null;
}
setConvertedInput(account);
}

@Override 
public void updateModel(){
System.err.println("UPDATE MODEL" +entity.getConvertedInput()); 
}

@Override
public Component add(final Behavior... behaviors) {
entity.add(behaviors);
office.add(behaviors);
dc.add(behaviors);
number.add(behaviors);
return this;
}
}

The model takes it perfectly when constrye the object, but loses to do
submit, I use the component on the form as follows

HTML FORM





CCC:

 Editar 
  



...
JAVA FORM

ccc = new CustomerAccountCode("ccc",
new Model(
new Account(config.getCcc(;
   add(ccc);
   



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Model-is-null-after-submit-using-FormComponentPanel-tp4654441p4654462.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 and Struts together have a problem when not adding mountpath to the Wicket-Page

2012-12-04 Thread Martin Grigorov
On Tue, Dec 4, 2012 at 10:29 AM, cknafl  wrote:

> I am currently overwriting getNamespace(). But that is really dirty. When I
> make this method to return "" everytime, then my css, js and so on cannot
> be
> found anymore, that I added with renderHead(..).
> So I implemented an if-else logic:
> if(path.contains("resource")
>return "wicket";
> ...
>

Just return "mine" or anything that looks non-dirty to you.


>
> Can you tell me how you would use this
> UrlRenderer#renderContextRelativeUrl() instead of setting my own
> UrlRenderer
> please?
>

class StrutsModel extends AbstractReadOnlyModel {
  private final String relativeUrl;

  public StrutsModel(String relUrl) {
 this.relativeUrl = relUrl;
  }
 @Override
  public String getObject() {
 return
RequestCycle.get().getUrlRenderer().renderContextRelativeUrl("struts/" +
relativeUrl);
  }
}

class StrutsLink extends ExternalLink {

  public StrutsLink(String id, String strutsUrl) {
 super(id, new StrutsModel(strutsUrl))
  }
}

add(new StrutsLink("linkId", "struts.html");


>
> Regards
> Christoph
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Struts-together-have-a-problem-when-not-adding-mountpath-to-the-Wicket-Page-tp4654359p4654461.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 


Re: Syncing files with designers

2012-12-04 Thread Jan Riehn

Hello Edgar,

Yes, this is how it works.

For the best separation of the responsibilities, you may store the 
resources outside of the web application (Think about a complete 
physical separation).
We've made a good experience to break-off with wicket's given package 
structure - wicket's resource localization does not fit with a 
separation of the responsibilities: the web designer has no knowledge 
about the internal package  structure and it's not resistant against 
refactoring. Therefore, we use a more technical mechanism based on 
style, variation locale and the filename.


1. /

Form change detection behaviour in Wicket

2012-12-04 Thread Ganesh
how to add form change detection behaviour to all form's of my application
using wicket framework,I am using
"http://www.jroller.com/karthikg/date/20061003"; to detect form change but
it's not detecting for file components and also when we use hide / show
functionality for form using ajax.I want it to work for multiple forms in a
page.
Thanks
Gani 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Form-change-detection-behaviour-in-Wicket-tp4654467.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: Form change detection behaviour in Wicket

2012-12-04 Thread Martin Grigorov
Hi,

Your question is pure JavaScript related.
In this article Wicket is used only to contribute the .js file.

http://lmgtfy.com/?q=javascript+form+elements+change+detection


On Tue, Dec 4, 2012 at 12:32 PM, Ganesh  wrote:

> how to add form change detection behaviour to all form's of my application
> using wicket framework,I am using
> "http://www.jroller.com/karthikg/date/20061003"; to detect form change but
> it's not detecting for file components and also when we use hide / show
> functionality for form using ajax.I want it to work for multiple forms in a
> page.
> Thanks
> Gani
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Form-change-detection-behaviour-in-Wicket-tp4654467.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 


wicket-stuff progressbar problem in Wicket 6.3

2012-12-04 Thread hsteisjo
Hi all,

I've really banged my head with this problem for some time now, and
hopefully someone can point me in the right direction.

I have a base popup class which is extended from ModalWindow. Most actions
requires some sort of visual response to the user that actions are taking
place so this popup class holds switchable panels where one is the content
panel and one a progressbar panel.

The idea was to send in whatever content is needed for an action and then
start the progressbar. This has worked very well based upon the wicketstuff
progressbar and their taskservice running on Wicket 1.4.20.

It was time to upgrade Wicket and I did so to 6.3 via 1.5.9. Unfortunately I
never tested this exact functionality when the port to 1.5.9 was completed
so I can't say whether it worked or not in 1.5.9. With Wicket 6.3 it doesn't
work. The popup is displayed fine and the task gets going as expected, but
then when the AjaxSelfUpdatingTimerBehavior of the progressbar finishes
things break apart with a WicketRuntimeException saying there's no page
found for the component (the panel holding the progressbar in the base popup
class).

We end up in the getPage() function of the Component class via several
function calls in AbstractAjaxTimerBehavior, AbstractDefaultAjaxBehavior and
AbstractAjaxBehavior. It all starts off with the AbstractAjaxTimerBehavior's
respond() and getJsTimeoutCall() functions, and eventually the
AbstractAjaxBehavior's getCallbackUrl() function is called which takes us to
the getPage() function, and once there the panel, holding the progressbar in
the popup class, is not attached to a page and I can't figure out why.

I realize a lot has happened in Wicket since 1.4.20, especially in Wicket 6
and the new jQuery back-end and I was hoping someone could give me some
pointers where I should start looking when it comes to these types of
problems with ajax updates.

Thanks.

-Håkan



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-stuff-progressbar-problem-in-Wicket-6-3-tp4654469.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: Read Twitter tweets

2012-12-04 Thread Thomas Götz
Ahm, sure: just go to http://twitter.com or use 
 ;-)

SCNR,
   -Tom


On 04.12.2012, at 15:57,  wrote:

> Hi People
> 
> Any experience/recommendation on subject?
> 
> Thanks in advance
> 
> Regards
> /Ronny
> 


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



Upload file and display its contents using AJAX

2012-12-04 Thread pureza
Hi,

I need to upload a file, parse it and display its contents inside a
textarea, all this using ajax.

At first I tried to use jquery-file-upload, and I was able to upload the
file to an IResource as explained at
http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/.
However, I have no idea as to how to display the contents of the file inside
the textarea when the upload is finished.

Then I tried to use a plain FileUploadField component and I attached an
AjaxFormSubmitBehavior to it, but it seems that the model is always null and
I am unable to access the uploaded files.

Any help is appreciated.

Thanks!




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Upload-file-and-display-its-contents-using-AJAX-tp4654473.html
Sent from the Users forum mailing list archive at Nabble.com.

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



How to display PDF in wicket 6.0?

2012-12-04 Thread appwicket
Hi all,
I have been trying all the ways to display PDF through wicket.
I have my pdf resource in Byte[].
I tried the following methods in my AjaxButton's onSubmit method:
1. this gives me exception:
Header was already written to response!
Wicket.Ajax.Call.failure: Error while parsing response: Error: Invalid XML:
%PDF-1.4

WebResponse r = (WebResponse)getRequestCycle().getResponse();
r.setContentType("application/pdf");
r.setHeader("Content-Disposition", "inline; filename=\"data.pdf\"");
r.write(reportService.generatePDF());
getRequestCycle().setResponsePage(DownloadPopup.class);
-
2.this gives me exception:
Wicket.Ajax.Call.failure: Error while parsing response: Error: Invalid XML:
%PDF-1.4

ByteArrayResource bar = new ByteArrayResource("application/pdf",
reportService.generatePDF());
RequestCycle.get().scheduleRequestHandlerAfterCurrent(new
ResourceRequestHandler(bar, null));
-
3. I also tried example from AJAX update and file download in one blow
https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html

  
but Im not able to convert Byte array to IResourceStream.

Anyone knows how to do this?

appreciated!





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-display-PDF-in-wicket-6-0-tp4654471.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: Upload file and display its contents using AJAX

2012-12-04 Thread Nick Pratt
Once the file is uploaded, set the contents of the IModel backing the
TextArea, and then add the Form(or TextArea) to the AjaxRequestTarget.

On Tue, Dec 4, 2012 at 11:51 AM, pureza  wrote:

> Hi,
>
> I need to upload a file, parse it and display its contents inside a
> textarea, all this using ajax.
>
> At first I tried to use jquery-file-upload, and I was able to upload the
> file to an IResource as explained at
> http://wicketinaction.com/2012/11/uploading-files-to-wicket-iresource/.
> However, I have no idea as to how to display the contents of the file
> inside
> the textarea when the upload is finished.
>
> Then I tried to use a plain FileUploadField component and I attached an
> AjaxFormSubmitBehavior to it, but it seems that the model is always null
> and
> I am unable to access the uploaded files.
>
> Any help is appreciated.
>
> Thanks!
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Upload-file-and-display-its-contents-using-AJAX-tp4654473.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 display PDF in wicket 6.0?

2012-12-04 Thread Nick Pratt
Do you want to display the PDF on screen, or provide a PDF download so that
the file could be opened in Acrobat Reader (or PDF viewer of your choice)?

On Tue, Dec 4, 2012 at 11:06 AM, appwicket  wrote:

> Hi all,
> I have been trying all the ways to display PDF through wicket.
> I have my pdf resource in Byte[].
> I tried the following methods in my AjaxButton's onSubmit method:
> 1. this gives me exception:
> Header was already written to response!
> Wicket.Ajax.Call.failure: Error while parsing response: Error: Invalid XML:
> %PDF-1.4
>
> WebResponse r = (WebResponse)getRequestCycle().getResponse();
> r.setContentType("application/pdf");
> r.setHeader("Content-Disposition", "inline; filename=\"data.pdf\"");
> r.write(reportService.generatePDF());
> getRequestCycle().setResponsePage(DownloadPopup.class);
> -
> 2.this gives me exception:
> Wicket.Ajax.Call.failure: Error while parsing response: Error: Invalid XML:
> %PDF-1.4
>
> ByteArrayResource bar = new ByteArrayResource("application/pdf",
> reportService.generatePDF());
> RequestCycle.get().scheduleRequestHandlerAfterCurrent(new
> ResourceRequestHandler(bar, null));
> -
> 3. I also tried example from AJAX update and file download in one blow
>
> https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
> <
> https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
> >
> but Im not able to convert Byte array to IResourceStream.
>
> Anyone knows how to do this?
>
> appreciated!
>
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-display-PDF-in-wicket-6-0-tp4654471.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 display PDF in wicket 6.0?

2012-12-04 Thread appwicket
Hi,
thanks for reply.
I want to open it in a new window.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-display-PDF-in-wicket-6-0-tp4654471p4654476.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: Upload file and display its contents using AJAX

2012-12-04 Thread pureza
Nick,

As I said on my previous email, I can't access the file contents within an
AjaxBehavior, because FileInputField.getModelObject() is always null (maybe
I'm not setting it up correctly when I instantiate the FileInputField?).



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Upload-file-and-display-its-contents-using-AJAX-tp4654473p4654477.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: Upload file and display its contents using AJAX

2012-12-04 Thread pureza
Hi again,

I was able to get the desired result by putting an AjaxButton on the form
containing the  component. So, the user selects a file,
presses submit and everything works.

However, I'd prefer if the upload would start immediately after the user
selects a file. Can I get rid of the button?

Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Upload-file-and-display-its-contents-using-AJAX-tp4654473p4654478.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 display PDF in wicket 6.0?

2012-12-04 Thread Martin Grigorov
Hi,

You cannot return the PDF data in the Ajax response.
Read
https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
for
a solution.


On Tue, Dec 4, 2012 at 6:20 PM, appwicket  wrote:

> Hi,
> thanks for reply.
> I want to open it in a new window.
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-to-display-PDF-in-wicket-6-0-tp4654471p4654476.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 


Re: Model is null after submit, using FormComponentPanel

2012-12-04 Thread Joachim Schrod
Raul wrote:
> Thank Col, But I have no validation, my component code is the code of the
> component is
> 
> public class CustomerAccountCode extends
>   FormComponentPanel {
> 
>   private FormComponent entity;
>   private FormComponent office;
>   private FormComponent dc;
>   private FormComponent number;
> 
> 
>   public CustomerAccountCode(String id, Model model) {
>   super(id, model);
>   
>   entity = new TextField("entity", new Model());
>   office = new TextField("office", new Model());
>   dc = new TextField("dc", new Model());
>   number = new TextField("number", new Model());
> 
>   onModelChanged();
>   add(entity);
>   add(office);
>   add(dc);
>   add(number);
> //add(CustomerAccountCodeValidator.getInstance());
> 
>   }
> 
>   protected void onModelChanged() {
>   super.onModelChanged();
>   CustomerAccountCodeModel ccc = getModelObject();
>   if (ccc != null) {
>   entity.setModelObject(ccc.getEntity());
>   office.setModelObject(ccc.getOffice());
>   dc.setModelObject(ccc.getDc());
>   number.setModelObject(ccc.getAccount());
>   } else {
>   entity.setModelObject(null);
>   office.setModelObject(null);
>   dc.setModelObject(null);
>   number.setModelObject(null);
>   }
>   }

Did you try to use PropertyModels of your account object, maybe a
CompoundPropertyModel instead of setting the TextField's model
objects in the constructor that way?

Joachim

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Joachim Schrod, Roedermark, Germany
Email: jsch...@acm.org


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



Re: a question on different data grid components available for wicket

2012-12-04 Thread Martin Grigorov
I compared it against
http://www.wicket-library.com/inmethod-grid/data-grid/simple?0 - this uses
InMethod Grid 1.5 though


On Tue, Dec 4, 2012 at 8:24 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Martin,
>
> On Tue, Dec 4, 2012 at 9:28 AM, Martin Grigorov  >wrote:
>
> > Great work, Ernesto !
> >
> > I just tried the samples application and the only problem that I've found
> > is related to the editable grids.
> > In both Editable Grid and Editable TreeGrid the 'ESC' keypress doesn't
> > work.
> >
>
> 'Esc' Keypress does not work either with YUI. It gives JS error.
>
> TypeError: elements[0].onclick is null
>
> row = findParent(row, "TR");
>
>
>  I will also fix that.
>
>
> > In Editable TreeGrid I can edit only folders but I can't edit leafs.
> >
> >
> You can't edit leafs (also) with YUI based version (just checked that). So,
> this might be a regression on YUI version?
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ 
>



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


Re: Read Twitter tweets

2012-12-04 Thread Flemming Boller
LOL


On Tue, Dec 4, 2012 at 5:17 PM, Thomas Götz  wrote:

> Ahm, sure: just go to http://twitter.com or use
>  ;-)
>
> SCNR,
>-Tom
>
>
> On 04.12.2012, at 15:57,  wrote:
>
> > Hi People
> >
> > Any experience/recommendation on subject?
> >
> > Thanks in advance
> >
> > Regards
> > /Ronny
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


RE: Best way to trap Enter key in a form in a modal window

2012-12-04 Thread Chris Colman
>Hi Chris,
>
>I think all this is actually related to ModalWindow, not to Form.
>You don't close the Form, you close the ModalWindow.
>ModalWindow#close() accepts AjaxRequestTarget (ART) so it is clear that
it
>needs to be in Ajax request, no ?
>The form is just a component in the ModalWindow. With or without a form
>inside it the ModalWindow needs ART.

I know logically it all makes sense but logic and newbies don't always
mix ;) I thought it could help any newbies who might have just learned
all about how to handle forms in a page and then tried to apply that
same knowledge to a form in a modal only to find it doesn't work.

Some people are experiencing this issue in their learning curve:

http://stackoverflow.com/questions/7239917/wicket-form-in-a-modal-window

Maybe the hint could go in ModalWindow Javadoc, not the form Javadoc.

There is already a mention of special treatment of forms in the
ModalWindow Javadoc:

"If you want to use form in modal window component make sure that you
put the modal window itself in another form (nesting forms is legal in
Wicket) and that the form on modal window is submitted before the window
get closed."

Perhaps an additional mention, with possible example, of how you can't
use the implicit form submission mechanism to close a ModalWindow with a
form would be appropriate to add to this existing section on dealing
with forms in a ModalWindow.

>
>
>On Mon, Dec 3, 2012 at 11:27 PM, Chris Colman
>wrote:
>
>> The other important thing to mention in Form's Javadoc is that a form
in
>> a ModalWindow can not be closed without AJAX. i.e. you can't do the
>> close in the standard Form.onSubmit handler as that is given no
>> AjaxRequestTarget parameter which is required to perform the
ModalWindow
>> close. Trying to close it in the implicit way results in the browser
>> throwing up a pop up asking the user if they want to "Leave this
page"
>> or "Stay on this page" - which is pretty bad.
>>
>> >-Original Message-
>> >From: Martin Grigorov [mailto:mgrigo...@apache.org]
>> >Sent: Monday, 3 December 2012 11:18 PM
>> >To: users@wicket.apache.org
>> >Subject: Re: Best way to trap Enter key in a form in a modal window
>> >
>> >Hi,
>> >
>> >On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman
>> >wrote:
>> >
>> >> I understand that with a form in a modal window you must
explicitly
>> >> declare an AjaxButton component because modal windows require AJAX
>> comms
>> >> (BTW this should probably be mentioned in the Form Javadoc page
>> >> somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/)
>> >>
>> >
>> >I didn't get what should be better explained ?
>> >
>> >
>> >>
>> >> However, what is the best approach to providing a 'catch all' so
that
>> if
>> >> the user presses the 'Enter' key while focus is on any field in
the
>> form
>> >> the normal submit takes place?
>> >>
>> >
>> >See Form#setDefaultButton.
>> >Not sure whether this will help in Ajax form submit though.
>> >
>> >Additionally check https://github.com/kinabalu/wicket-mousetrap/
>> >
>> >--
>> >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
>>
>>
>
>
>--
>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: Best way to trap Enter key in a form in a modal window

2012-12-04 Thread Martin Grigorov
On Tue, Dec 4, 2012 at 11:31 PM, Chris Colman
wrote:

> >Hi Chris,
> >
> >I think all this is actually related to ModalWindow, not to Form.
> >You don't close the Form, you close the ModalWindow.
> >ModalWindow#close() accepts AjaxRequestTarget (ART) so it is clear that
> it
> >needs to be in Ajax request, no ?
> >The form is just a component in the ModalWindow. With or without a form
> >inside it the ModalWindow needs ART.
>
> I know logically it all makes sense but logic and newbies don't always
> mix ;) I thought it could help any newbies who might have just learned
> all about how to handle forms in a page and then tried to apply that
> same knowledge to a form in a modal only to find it doesn't work.
>
> Some people are experiencing this issue in their learning curve:
>
> http://stackoverflow.com/questions/7239917/wicket-form-in-a-modal-window
>
> Maybe the hint could go in ModalWindow Javadoc, not the form Javadoc.
>
> There is already a mention of special treatment of forms in the
> ModalWindow Javadoc:
>
> "If you want to use form in modal window component make sure that you
> put the modal window itself in another form (nesting forms is legal in
> Wicket) and that the form on modal window is submitted before the window
> get closed."
>
> Perhaps an additional mention, with possible example, of how you can't
>

The problem is that you actually can do it.
You just don't know how yet.


> use the implicit form submission mechanism to close a ModalWindow with a
> form would be appropriate to add to this existing section on dealing
> with forms in a ModalWindow.
>

If I remember correctly you contributed
https://github.com/wicketstuff/core/tree/core-1.5.x/jdk-1.5-parent/modalx-parent
,
right ?
I thought you know the internals of this component better than me ;-)


>
> >
> >
> >On Mon, Dec 3, 2012 at 11:27 PM, Chris Colman
> >wrote:
> >
> >> The other important thing to mention in Form's Javadoc is that a form
> in
> >> a ModalWindow can not be closed without AJAX. i.e. you can't do the
> >> close in the standard Form.onSubmit handler as that is given no
> >> AjaxRequestTarget parameter which is required to perform the
> ModalWindow
> >> close. Trying to close it in the implicit way results in the browser
> >> throwing up a pop up asking the user if they want to "Leave this
> page"
> >> or "Stay on this page" - which is pretty bad.
> >>
> >> >-Original Message-
> >> >From: Martin Grigorov [mailto:mgrigo...@apache.org]
> >> >Sent: Monday, 3 December 2012 11:18 PM
> >> >To: users@wicket.apache.org
> >> >Subject: Re: Best way to trap Enter key in a form in a modal window
> >> >
> >> >Hi,
> >> >
> >> >On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman
> >> >wrote:
> >> >
> >> >> I understand that with a form in a modal window you must
> explicitly
> >> >> declare an AjaxButton component because modal windows require AJAX
> >> comms
> >> >> (BTW this should probably be mentioned in the Form Javadoc page
> >> >> somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/)
> >> >>
> >> >
> >> >I didn't get what should be better explained ?
> >> >
> >> >
> >> >>
> >> >> However, what is the best approach to providing a 'catch all' so
> that
> >> if
> >> >> the user presses the 'Enter' key while focus is on any field in
> the
> >> form
> >> >> the normal submit takes place?
> >> >>
> >> >
> >> >See Form#setDefaultButton.
> >> >Not sure whether this will help in Ajax form submit though.
> >> >
> >> >Additionally check https://github.com/kinabalu/wicket-mousetrap/
> >> >
> >> >--
> >> >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
> >>
> >>
> >
> >
> >--
> >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
>
>


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


Re: Model is null after submit, using FormComponentPanel

2012-12-04 Thread Raul
I tried to use CompoundPropertyModel  in CustomerAccountCode object
constructor, and similarly



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Model-is-null-after-submit-using-FormComponentPanel-tp4654441p4654490.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: Best way to trap Enter key in a form in a modal window

2012-12-04 Thread Chris Colman
>On Tue, Dec 4, 2012 at 11:31 PM, Chris Colman
>wrote:
>
>> >Hi Chris,
>> >
>> >I think all this is actually related to ModalWindow, not to Form.
>> >You don't close the Form, you close the ModalWindow.
>> >ModalWindow#close() accepts AjaxRequestTarget (ART) so it is clear
that
>> it
>> >needs to be in Ajax request, no ?
>> >The form is just a component in the ModalWindow. With or without a
form
>> >inside it the ModalWindow needs ART.
>>
>> I know logically it all makes sense but logic and newbies don't
always
>> mix ;) I thought it could help any newbies who might have just
learned
>> all about how to handle forms in a page and then tried to apply that
>> same knowledge to a form in a modal only to find it doesn't work.
>>
>> Some people are experiencing this issue in their learning curve:
>>
>>
http://stackoverflow.com/questions/7239917/wicket-form-in-a-modal-window
>>
>> Maybe the hint could go in ModalWindow Javadoc, not the form Javadoc.
>>
>> There is already a mention of special treatment of forms in the
>> ModalWindow Javadoc:
>>
>> "If you want to use form in modal window component make sure that you
>> put the modal window itself in another form (nesting forms is legal
in
>> Wicket) and that the form on modal window is submitted before the
window
>> get closed."
>>
>> Perhaps an additional mention, with possible example, of how you
can't
>>
>
>The problem is that you actually can do it.
>You just don't know how yet.
>
>> use the implicit form submission mechanism to close a ModalWindow
with a
>> form would be appropriate to add to this existing section on dealing
>> with forms in a ModalWindow.

By 'implicit' I mean the non AJAX way - which isn't possible inside a
modal unless the model is in a page in an iframe - It may be unfounded
but I've always regarded anything that needs an iframe as 'hacky' -
doesn't mean I haven't been forced to use them in the past though ;)

>If I remember correctly you contributed
>https://github.com/wicketstuff/core/tree/core-1.5.x/jdk-1.5-parent/moda
lx-
>parent
>,
>right ?

Correct. The issue about the forms in Modal's needing AJAX submit
processing is an issue I had many years ago when I was a Wicket newbie
so as an aside to this thread I thought a note in the Javadoc might help
future newbies.

>I thought you know the internals of this component better than me ;-)

ModalX doesn't currently support 'Enter' key processing and that was the
main thrust of this thread - working out the best way to implement that.

>
>
>>
>> >
>> >
>> >On Mon, Dec 3, 2012 at 11:27 PM, Chris Colman
>> >wrote:
>> >
>> >> The other important thing to mention in Form's Javadoc is that a
form
>> in
>> >> a ModalWindow can not be closed without AJAX. i.e. you can't do
the
>> >> close in the standard Form.onSubmit handler as that is given no
>> >> AjaxRequestTarget parameter which is required to perform the
>> ModalWindow
>> >> close. Trying to close it in the implicit way results in the
browser
>> >> throwing up a pop up asking the user if they want to "Leave this
>> page"
>> >> or "Stay on this page" - which is pretty bad.
>> >>
>> >> >-Original Message-
>> >> >From: Martin Grigorov [mailto:mgrigo...@apache.org]
>> >> >Sent: Monday, 3 December 2012 11:18 PM
>> >> >To: users@wicket.apache.org
>> >> >Subject: Re: Best way to trap Enter key in a form in a modal
window
>> >> >
>> >> >Hi,
>> >> >
>> >> >On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman
>> >> >wrote:
>> >> >
>> >> >> I understand that with a form in a modal window you must
>> explicitly
>> >> >> declare an AjaxButton component because modal windows require
AJAX
>> >> comms
>> >> >> (BTW this should probably be mentioned in the Form Javadoc page
>> >> >> somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/)
>> >> >>
>> >> >
>> >> >I didn't get what should be better explained ?
>> >> >
>> >> >
>> >> >>
>> >> >> However, what is the best approach to providing a 'catch all'
so
>> that
>> >> if
>> >> >> the user presses the 'Enter' key while focus is on any field in
>> the
>> >> form
>> >> >> the normal submit takes place?
>> >> >>
>> >> >
>> >> >See Form#setDefaultButton.
>> >> >Not sure whether this will help in Ajax form submit though.
>> >> >
>> >> >Additionally check https://github.com/kinabalu/wicket-mousetrap/
>> >> >
>> >> >--
>> >> >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
>> >>
>> >>
>> >
>> >
>> >--
>> >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: Best way to trap Enter key in a form in a modal window

2012-12-04 Thread Martin Grigorov
OK, please send a patch for ModalWindow's javadoc.


On Wed, Dec 5, 2012 at 1:41 AM, Chris Colman
wrote:

> >On Tue, Dec 4, 2012 at 11:31 PM, Chris Colman
> >wrote:
> >
> >> >Hi Chris,
> >> >
> >> >I think all this is actually related to ModalWindow, not to Form.
> >> >You don't close the Form, you close the ModalWindow.
> >> >ModalWindow#close() accepts AjaxRequestTarget (ART) so it is clear
> that
> >> it
> >> >needs to be in Ajax request, no ?
> >> >The form is just a component in the ModalWindow. With or without a
> form
> >> >inside it the ModalWindow needs ART.
> >>
> >> I know logically it all makes sense but logic and newbies don't
> always
> >> mix ;) I thought it could help any newbies who might have just
> learned
> >> all about how to handle forms in a page and then tried to apply that
> >> same knowledge to a form in a modal only to find it doesn't work.
> >>
> >> Some people are experiencing this issue in their learning curve:
> >>
> >>
> http://stackoverflow.com/questions/7239917/wicket-form-in-a-modal-window
> >>
> >> Maybe the hint could go in ModalWindow Javadoc, not the form Javadoc.
> >>
> >> There is already a mention of special treatment of forms in the
> >> ModalWindow Javadoc:
> >>
> >> "If you want to use form in modal window component make sure that you
> >> put the modal window itself in another form (nesting forms is legal
> in
> >> Wicket) and that the form on modal window is submitted before the
> window
> >> get closed."
> >>
> >> Perhaps an additional mention, with possible example, of how you
> can't
> >>
> >
> >The problem is that you actually can do it.
> >You just don't know how yet.
> >
> >> use the implicit form submission mechanism to close a ModalWindow
> with a
> >> form would be appropriate to add to this existing section on dealing
> >> with forms in a ModalWindow.
>
> By 'implicit' I mean the non AJAX way - which isn't possible inside a
> modal unless the model is in a page in an iframe - It may be unfounded
> but I've always regarded anything that needs an iframe as 'hacky' -
> doesn't mean I haven't been forced to use them in the past though ;)
>
> >If I remember correctly you contributed
> >https://github.com/wicketstuff/core/tree/core-1.5.x/jdk-1.5-parent/moda
> lx-
> >parent
> >,
> >right ?
>
> Correct. The issue about the forms in Modal's needing AJAX submit
> processing is an issue I had many years ago when I was a Wicket newbie
> so as an aside to this thread I thought a note in the Javadoc might help
> future newbies.
>
> >I thought you know the internals of this component better than me ;-)
>
> ModalX doesn't currently support 'Enter' key processing and that was the
> main thrust of this thread - working out the best way to implement that.
>
> >
> >
> >>
> >> >
> >> >
> >> >On Mon, Dec 3, 2012 at 11:27 PM, Chris Colman
> >> >wrote:
> >> >
> >> >> The other important thing to mention in Form's Javadoc is that a
> form
> >> in
> >> >> a ModalWindow can not be closed without AJAX. i.e. you can't do
> the
> >> >> close in the standard Form.onSubmit handler as that is given no
> >> >> AjaxRequestTarget parameter which is required to perform the
> >> ModalWindow
> >> >> close. Trying to close it in the implicit way results in the
> browser
> >> >> throwing up a pop up asking the user if they want to "Leave this
> >> page"
> >> >> or "Stay on this page" - which is pretty bad.
> >> >>
> >> >> >-Original Message-
> >> >> >From: Martin Grigorov [mailto:mgrigo...@apache.org]
> >> >> >Sent: Monday, 3 December 2012 11:18 PM
> >> >> >To: users@wicket.apache.org
> >> >> >Subject: Re: Best way to trap Enter key in a form in a modal
> window
> >> >> >
> >> >> >Hi,
> >> >> >
> >> >> >On Mon, Dec 3, 2012 at 1:05 PM, Chris Colman
> >> >> >wrote:
> >> >> >
> >> >> >> I understand that with a form in a modal window you must
> >> explicitly
> >> >> >> declare an AjaxButton component because modal windows require
> AJAX
> >> >> comms
> >> >> >> (BTW this should probably be mentioned in the Form Javadoc page
> >> >> >> somewhere: http://ci.apache.org/projects/wicket/apidocs/6.0.x/)
> >> >> >>
> >> >> >
> >> >> >I didn't get what should be better explained ?
> >> >> >
> >> >> >
> >> >> >>
> >> >> >> However, what is the best approach to providing a 'catch all'
> so
> >> that
> >> >> if
> >> >> >> the user presses the 'Enter' key while focus is on any field in
> >> the
> >> >> form
> >> >> >> the normal submit takes place?
> >> >> >>
> >> >> >
> >> >> >See Form#setDefaultButton.
> >> >> >Not sure whether this will help in Ajax form submit though.
> >> >> >
> >> >> >Additionally check https://github.com/kinabalu/wicket-mousetrap/
> >> >> >
> >> >> >--
> >> >> >Martin Grigorov
> >> >> >jWeekend
> >> >> >Training, Consulting, Development
> >> >> >http://jWeekend.com 
> >> >>
> >> >>
> -
> >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> >> For additional commands,