Re: Java Wickets Refresh Model Window

2017-04-04 Thread Sven Meier
You should clear the textField's model and update it:

  textField = new TextField(...);
  textField.setOutputMarkupId();

  onSubmit(AjaxRequestTarget target) {
...
textField.setModelObject(null);
ajaxRequestTarget.update(textField);
  }

Hope this helps
Sven

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Java-Wickets-Refresh-Model-Window-tp4677602p4677607.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: Bean not properly injected into another bean when using Wicket stateless page

2017-04-04 Thread Tomasz Dziurko
Hi Martin

Two questions:
1. Which class? HomePageHandler ?
2. I have digged deeper and in fact there is a check whether to use CGLib
or Objenesis (if there is no-args constructor Objenesis is chosen) but is
it an expected behaviour? Or maybe this case could be a trigger to discuss
proper way to deal with such cases?

On 4 April 2017 at 21:26, Martin Grigorov  wrote:

> Hi,
>
> On Apr 4, 2017 7:38 PM, "Tomasz Dziurko"  wrote:
>
> Hello
>
> I have a problem with wicket-spring-boot <-> wicket integration. Bean
> annotated with @Serviceis not properly injected into a backing bean that is
> injected into a stateless Page using @SpringBean annotation.
>
> Generally:
>
> @StatelessComponent
> @MountPath("home-page")
> public class HomePage extends WebPage {
>
> @SpringBean
> private HomePageHandler handler;
> }
>
> and
>
> @Service
> public class HomePageHandler {
>
> private final CommandPublisher commandPublisher;
>
> @Autowired
> public HomePageHandler(
>
>
> I think you will need an additional default constructor for this class.
> CGLIB needs it.
> It might have lesser visibility than public too.
>
> CommandPublisher commandPublisher) {
> this.commandPublisher = commandPublisher;
> }
>
> public void executeAction(String name) {
> commandPublisher.publish(name); /// <--- NPE
> (commandPublisher is null)
> }
> }
>
> and:
>
> @Service
> public class CommandPublisher {
>
> public void publish(String text) {
> eventPublisher.publishEvent(text);
> }
>
> }
>
> Wicket 7.6.0, wicket-spring-boot 1.0.6.
>
> I have created a simple starter (
> https://github.com/tdziurko/wicket-spring-bean-issue) to reproduce the
> problem. Problem disappears when page is not stateless (more info in readme
> in the starter).
>
>
> Thank you in advance for help.
>
> --
> Regards / Pozdrawiam,
> Tomek Dziurko
> http://tomaszdziurko.com/
>



-- 
Regards / Pozdrawiam,
Tomek Dziurko
http://tomaszdziurko.com/


Re: Bean not properly injected into another bean when using Wicket stateless page

2017-04-04 Thread Martin Grigorov
Hi,

On Apr 4, 2017 7:38 PM, "Tomasz Dziurko"  wrote:

Hello

I have a problem with wicket-spring-boot <-> wicket integration. Bean
annotated with @Serviceis not properly injected into a backing bean that is
injected into a stateless Page using @SpringBean annotation.

Generally:

@StatelessComponent
@MountPath("home-page")
public class HomePage extends WebPage {

@SpringBean
private HomePageHandler handler;
}

and

@Service
public class HomePageHandler {

private final CommandPublisher commandPublisher;

@Autowired
public HomePageHandler(


I think you will need an additional default constructor for this class.
CGLIB needs it.
It might have lesser visibility than public too.

CommandPublisher commandPublisher) {
this.commandPublisher = commandPublisher;
}

public void executeAction(String name) {
commandPublisher.publish(name); /// <--- NPE
(commandPublisher is null)
}
}

and:

@Service
public class CommandPublisher {

public void publish(String text) {
eventPublisher.publishEvent(text);
}

}

Wicket 7.6.0, wicket-spring-boot 1.0.6.

I have created a simple starter (
https://github.com/tdziurko/wicket-spring-bean-issue) to reproduce the
problem. Problem disappears when page is not stateless (more info in readme
in the starter).


Thank you in advance for help.

--
Regards / Pozdrawiam,
Tomek Dziurko
http://tomaszdziurko.com/


Re: Busy indicator delay with IAjaxIndicatorAware?

2017-04-04 Thread jonscher
Hi Lasse, 

I have the same probleme. Did you found a solution ?
Can you tell me which solution did you take ?

Thank you very much.

Jonathan

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Busy-indicator-delay-with-IAjaxIndicatorAware-tp4675678p4677604.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



Bean not properly injected into another bean when using Wicket stateless page

2017-04-04 Thread Tomasz Dziurko
Hello

I have a problem with wicket-spring-boot <-> wicket integration. Bean
annotated with @Serviceis not properly injected into a backing bean that is
injected into a stateless Page using @SpringBean annotation.

Generally:

@StatelessComponent
@MountPath("home-page")
public class HomePage extends WebPage {

@SpringBean
private HomePageHandler handler;
}

and

@Service
public class HomePageHandler {

private final CommandPublisher commandPublisher;

@Autowired
public HomePageHandler(CommandPublisher commandPublisher) {
this.commandPublisher = commandPublisher;
}

public void executeAction(String name) {
commandPublisher.publish(name); /// <--- NPE
(commandPublisher is null)
}
}

and:

@Service
public class CommandPublisher {

public void publish(String text) {
eventPublisher.publishEvent(text);
}

}

Wicket 7.6.0, wicket-spring-boot 1.0.6.

I have created a simple starter (
https://github.com/tdziurko/wicket-spring-bean-issue) to reproduce the
problem. Problem disappears when page is not stateless (more info in readme
in the starter).


Thank you in advance for help.

-- 
Regards / Pozdrawiam,
Tomek Dziurko
http://tomaszdziurko.com/


Java Wickets Refresh Model Window

2017-04-04 Thread ASHU_JAVA
Hello All,

I'm having a table containing a button on each row.
Onclick of this button, a model window appear, providing user two options,
either use text field for single record or upload a file for multiple
records and then click "Add Details" button to save the record(s) in
database.

The issue is if a user enter data in text field OR upload file then the user
input's reference remains existent even after the clicking of "Add Details"
button.
Thus, the data remains present and if the user clicks on "Add details"
button again, it executes the last performed operation again "single record
entry using text field input" OR "multiple record entry using File upload".

What I want to achieve is to refresh the model window after clicking the
"Add details" button, remove the reference of last executed operation and
make sure that the user enter the text field or upload the file again to
repeat the ADD DETAILS operation.
Currently I've to close the model window and refresh the Parent page to
reload everything.

The Page view looks like the below attached image.

 

Can anyone please share some input to achieve this functionality?

thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Java-Wickets-Refresh-Model-Window-tp4677602.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: Jquery Plugins

2017-04-04 Thread Sebastien
Hi,

If you would like to integrate a jquery plugin in wicket, wicket-jquery-ui
can probably help you.
You have an example here:
https://github.com/sebfz1/wicket-jquery-ui/tree/master/wicket-jquery-ui-plugins/src/main/java/com/googlecode/wicket/jquery/ui/plugins/datepicker

On Apr 4, 2017 17:18, "SeldonCrisis"  wrote:

> Hey everyone, is it possible to incorporate a Jquery plugin in my Wicket
> page? Specifically, I would like to use this:
> http://innostudio.de/fileuploader/ 
>
> It is a file upload plugin, but I am adamant on using it because it allows
> users to upload multiple documents and give their uploaded documents a
> specified metadata title. Do I need to do this in its own panel, or maybe
> create a modal? I would be grateful for any hints in the right direction.
>
> Thanks a lot guys
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Jquery-Plugins-tp4677600.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
>
>


Jquery Plugins

2017-04-04 Thread SeldonCrisis
Hey everyone, is it possible to incorporate a Jquery plugin in my Wicket
page? Specifically, I would like to use this: 
http://innostudio.de/fileuploader/   

It is a file upload plugin, but I am adamant on using it because it allows
users to upload multiple documents and give their uploaded documents a
specified metadata title. Do I need to do this in its own panel, or maybe
create a modal? I would be grateful for any hints in the right direction.

Thanks a lot guys 


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Jquery-Plugins-tp4677600.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 back button behavior

2017-04-04 Thread Martin Grigorov
Hi,

The Wicket way would be to roll your own IPageManager or IPageStore or
IDiskStore and implement #getPage(int pageId) in a such way so that it
always returns the last used page by the user (i.e. session).
You may use https://github.com/martin-g/single-page-instance as an
inspiration.

Otherwise you may also try to do it at the client side, i.e. with
JavaScript.
Play with History APIs - pushState(), replaceState(), history.forward(),
history.go(history.length-1), etc.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Apr 3, 2017 at 3:40 PM, Entropy  wrote:

> By default wicket does it's serialized back button thing.  For most of our
> apps, this has been fine.  We have a new one where this behavior, showing
> the page in a previous state and allowing the user to proceed from there,
> is
> completely inappropriate.
>
> Ideally, when a user tries to go back to a previous page version, I'd like
> to re-display the current page in it's current state (as if they hit reload
> instead).  Seems like since Wicket is tracking the page version in the
> query
> string that should be do-able.
>
> I found some articles suggesting how to put Wicket into a "stateless" mode
> where the page always displays the current/freshest data, but am not
> getting
> what I expect.
>
> I tried:
> getPageSettings().setVersionPagesByDefault(false);
>
> But this didn't seem to alter behavior at all.  I also tried:
> setStatelessHint(true);
>
> on my pages, and that didn't change any behavior either.  Maybe I'm barking
> up the wrong tree?  How can I get wicket to just re-render the current page
> in it's current state if the user tries to use the back button?  Basically
> just like as if they hit the reload button?
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Wicket-back-button-behavior-tp4677587.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: Catch-all URL mapping logic

2017-04-04 Thread Martin Grigorov
On Mon, Apr 3, 2017 at 10:49 PM, Andreas Lundblad <
andreas.lundb...@gmail.com> wrote:

> Excellent. Big thanks! (For any future reader, I needed to wrap the page in
> a PageProvider in the return statement.)
>

Great!

I've added few convinience constructors to RenderPageRequestHandler in
Wicket 8.x!


>
> I also managed to render nice corresponding URLs for
> BookmarkablePageRequestHandler in the mapHandler method.
>
> I then used the code posted at [1] to avoid redirects and keep the pretty
> URLs in the address bar.
>
> [1] http://stackoverflow.com/a/27827875/276052
>
>
> On Mon, Apr 3, 2017 at 9:02 AM, Martin Grigorov 
> wrote:
>
> > Hi,
> >
> > You can use a custom root request mapper!
> >
> > In YourApplication#init():
> > old = application.getRootRequestMapper()
> > application.setRootRequestMapper(new CustomRequestMapper(old))
> >
> > In CustomRequestMapper#mapRequest() first use 'old' to try to return
> > IRequestHandler. If it returns null then use request.getUrl() and
> > request#getQueryParameters() to try to find a product in your DB.
> > If you have a match then return RenderPageRequestHandler(new
> > ProductPage(product))
> >
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Sun, Apr 2, 2017 at 10:19 AM, Andreas Lundblad <
> > andreas.lundb...@gmail.com> wrote:
> >
> > > Searched like crazy without finding any documentation on this...
> > >
> > > I would like to maintain functionality of all my currently mounted
> pages
> > > and resources.
> > >
> > > In addition to this, I would like to have a "catch all" mapping logic
> > that
> > > picks up urls like
> > >
> > > http://www.example.com/product-A.html
> > > http://www.example.com/product-B.html
> > > ...
> > >
> > > And if my logic doesn't find "product-X" in the database, it should
> fall
> > > through to the 404-page.
> > >
> > > Some products gets mapped to ProductPage.class, others get mapped to
> > > OtherProductPage.class.
> > >
> > > Further more I would like these links to be bookmarkable, and that
> > > parameters gets appended with the usual ?foo=bar
> > >
> > > I'm on Wicket 6.24.
> > >
> > > cheers,
> > > Andreas Lundblad
> > >
> >
>


[OT] Wicket opportunity in Munich, Germany

2017-04-04 Thread Martin Grigorov
Hi,

The company I'm consulting at the moment is looking for few more
(freelance) developers with Wicket experience.

The main technologiies we use are:
- Web app: Wicket, Spring (Boot), Hibernate, Java 8
- REST app: Spring (MVC, Boot), Hibernate, Kotlin. Currently experimenting
with GraphQL
- Mobile app: Ionic 2 (Angular 2)

The office is located in Munich, Germany.
Remote work is also possible after initial "get-to-know" period of few
months.

Please contact me personally if you are interested!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov