Come see Wicket at ApacheCon EU Nov 17-19 in Sevilla!

2016-10-19 Thread Martijn Dashorst
All,

ApacheCon EU 2016 features two presentations concerning Apache Wicket:

- Andrea del Bene with "Apache Wicket: the story so far and beyond"
- Martijn Dashorst with "What's up with Wicket 8 and Java 8"

Both are great sessions, and you have a good opportunity to meet and
speak with us about your deepest desires concerning Wicket, the
ecosystem or your applications.

And of course you shouldn't just come for Wicket, but to learn more
about other tools, frameworks and languages. You can meet with lots of
great folks, discuss the future of Java EE and join us for coffee,
beer or wine.

Find out more about ApacheCon and the Wicket sessions, and register here:

http://events.linuxfoundation.org/events/apachecon-europe

There appears to be a discount if you register soon, so get to it and
join us in Sevilla!

Hope seeing you in Sevilla!

Martijn

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



Re: Wicket Appl - Cleanup & Scale

2016-10-19 Thread Martin Grigorov
Hi,

On Tue, Oct 18, 2016 at 2:25 AM, fzb  wrote:

> Hi
>
>
> Here are few UI snaps of the application we had built using wicket.
>
> 
>  2016-10-17_08.png>
>  2016-10-18_08.png>
>
> The stack we had used to build this app are ..
>
> Wicket - Client
> Hibernate - Persistence
> ehCache - Caching
> Spring - to glue all pieces together
> MySql (AWS RDS)  - Database
> CXF - REST
> Jasper - Reports
> Open Flash Chart - Chart (Pending Migration to JS based)
> DropWizard Metrics - to collect metrics & report
> Jetty in dev & Tomcat in live server
>
> The Pros.. in this app
>  1. Easy to maintain
>  2. Easy to write custom components.
>  3. Not much of browser issues since we don't use JS much except for those
> which wicket does.
>  4. Use heavily Ajax via Wickets approach. Nothing on our own.
>  5. Consistent look n feel, since developers use pre developed with css
> built in components for new screens.
>
> Overall meets the current requirement.
>
> The Top 3 problems we want to address are ..
>
> *1. Do not have URL for any document .. say Purchase Doc..  because it is
> nested inside component hierarchy.
> *
>
> We designed only the top level icon based navigation as Page based. Which
> means to navigate from one page to another we use
> setResponsePage.(newPage)..  For these pages we have URLs.  For the second
> level menu (black bar - below the icon menu) & internal tab navigation,
> going from list view to detail view etc we had use component replace .. by
> repainting the container with the new content.
>
> cntr.addOrReplace(newComponent);
> target.add(cntr);
>
> 90% of user interactions are via this method. Hence we are not able to
> generate URLs for these internal UIs. If user needs to traverse to any of
> these, then they navigate to the page.. click menu.. click tab to navigate.
>

Take a look at https://github.com/martin-g/blogs/tree/master/ajax-history
This project shows how to use HTML5 History API to manipulate the url even
for Ajax interactions.

If you need deep linking since the beginning you will have to put the menus
ids/names in the mount path.
E.g. /level1/#{level2}/#{level3}
where
- level1 is the icon menu. It links to a page, as it does now.
- level 2 and level 3 are optional parameters. If they are available in
page.getPageParameters() then initialize the TabbedPanel active tab to
match the provided value


>
> *2. We are using single server.  We want to use a load balancer and
> increase
> the servers to be able to meet scaling requirement.
> *
>  Currently we just store the user details in session, after authentication.
> We need to be able to identify each request and associate session details
> (from cache) to the request, so that the request can be served by either
> servers..
>

Normal Session replication should work just fine.
But you can also take a look at
https://github.com/magro/memcached-session-manager and/or
https://github.com/wicketstuff/core/tree/master/datastores-parent


>
>
> *3. Move all static contents out of war file. *
> To reduce the traffic coming in to application server, we intend to move
> the
> static resources out of appl war file to CDN.
>

We have used a custom IRequestMapper that wraps Wicket's ResourceMapper
that in Production mode produces CDN urls instead of
.../wicket/resource/com.example.Scope/css/some-123456.css.
This way all the traffic for static resources goes directly to the CDN.


>
> *4. It is getting bigger n bigger.. Need to avoid making it monolithic *
> We wanted to develop new features as micro services and slowly break the
> whole app in to..  For service layers we understand how to group
> functionalities.. for UI how to we break it in to multiple ? how to regroup
> them as single app for the user.
>

Here are some options:
1) micro services == several small apps
Here the question is whether you need to share the user session between
those apps. Most probably - yes

2) I think you really need build (Maven, Gradle) modules
Each "microservice" lives in its own module. This module provides
everything specific to this functionality. The module depends on at least
to other modules:
-  common - provides common "glue" code
- components - provides smaller Wicket components re-used in other modules
and base pages
Each module could register itself in the Application e.g. by using Wicket's
IInitializer, or Spring's component scan, or anything else


>
> Addressing these 4 will take our app to the next level. Please give your
> suggestions on these ..
>
> - fzb
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Wicket-Appl-Cleanup-Scale-tp4675820.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> 

ApacheCon is now less than a month away!

2016-10-19 Thread Rich Bowen
Dear Apache Enthusiast,

ApacheCon Sevilla is now less than a month out, and we need your help
getting the word out. Please tell your colleagues, your friends, and
members of related technical communities, about this event. Rates go up
November 3rd, so register today!

ApacheCon, and Apache Big Data, are the official gatherings of the
Apache Software Foundation, and one of the best places in the world to
meet other members of your project community, gain deeper knowledge
about your favorite Apache projects, learn about the ASF. Your project
doesn't live in a vacuum - it's part of a larger family of projects that
have a shared set of values, as well as a shared governance model. And
many of our project have an overlap in developers, in communities, and
in subject matter, making ApacheCon a great place for cross-pollination
of ideas and of communities.

Some highlights of these events will be:

* Many of our board members and project chairs will be present
* The lightning talks are a great place to hear, and give, short
presentations about what you and other members of the community are
working on
* The key signing gets you linked into the web of trust, and better
able to verify our software releases
* Evening receptions and parties where you can meet community
members in a less formal setting
* The State of the Feather, where you can learn what the ASF has
done in the last year, and what's coming next year
* BarCampApache, an informal unconference-style event, is another
venue for discussing your projects at the ASF

We have a great schedule lined up, covering the wide range of ASF
projects, including:

* CI and CD at Scale: Scaling Jenkins with Docker and Apache Mesos -
Carlos Sanchez
* Inner sourcing 101 - Jim Jagielski
* Java Memory Leaks in Modular Environments - Mark Thomas

ApacheCon/Apache Big Data will be held in Sevilla, Spain, at the Melia
Sevilla, November 14th through 18th. You can find out more at
http://apachecon.com/  Other ways to stay up to date with ApacheCon are:

* Follow us on Twitter at @apachecon
* Join us on IRC, at #apachecon on the Freenode IRC network
* Join the apachecon-discuss mailing list by sending email to
apachecon-discuss-subscr...@apache.org
* Or contact me directly at rbo...@apache.org with questions,
comments, or to volunteer to help

See you in Sevilla!

-- 
Rich Bowen: VP, Conferences
rbo...@apache.org
http://apachecon.com/
@apachecon

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



Re: ModalWindow and OnDomReady

2016-10-19 Thread Martin Grigorov
Hi,

It depends on what you add the OnDomReady header item.
Is it the ModalWindow ? Or its content (Panel or Page) ?

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

On Wed, Oct 19, 2016 at 5:06 PM, Rob Audenaerde 
wrote:

> Hi all,
>
> I have a panel that needs some JavaScript for sizing etc. to run after a
> ModalWindow is shown, but as I now see it the Javascript is run *before*
> the modal window is shown.
>
> What is the proper way to run javascript after a ModalWindow is shown? It
> seems OnDomReady is not sufficient here?
>
> Thanks,
>
> Rob
>


Re: Check Group selected items called from other form loses the checked values

2016-10-19 Thread Francois Meillet
Have a look at 

https://cwiki.apache.org/confluence/display/WICKET/Listview+with+checkboxes 


https://www.mkyong.com/wicket/wicket-multiple-checkboxes-example-checkboxmultiplechoice/
 




François



> Le 19 oct. 2016 à 16:11, ganea iulia  a écrit :
> 
> Hello,
> 
> I have actually made this to work by adding this behaviour to the
> checkgroup:
> 
> group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
>private static final long serialVersionUID =
> 1654345477970524731L;
> 
>@Override
>protected void onUpdate(AjaxRequestTarget target) {
>target.add(group);
>}
> 
>});
> 
> However, now I face following issue:
> If I replace my ListView component, with a RefreshingView, I cannot check
> any of the checks from the items. I check it, but then it gets unchecked
> right away.
> This is because the RefreshingView repaints its model at every roundtrip to
> the server.
> 
> I have tried this:
> http://stackoverflow.com/questions/12282492/add-row-to-refreshingview-without-repainting-entire-refreshingview
> by setting:
> listOfItems.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());
> 
> But it did not change a thing for me.
> 
> Please guide on how to have a Check for every item of the RepeatingView,
> that can be checked.
> 
> Thank you.
> 
> 
> 
> On Tue, Oct 18, 2016 at 1:28 PM, ganea iulia  wrote:
> 
>> Hi,
>> I have 2 forms.
>> 
>> Bottom form = testForm
>> - I have a listview with checkboxes.
>> As I needed a checkAll control also, I have uses CheckGroup,
>> CheckGroupSelector and Check wicket components.
>> 
>> Top form = testForm0
>> -I have only an link
>> 
>> The use case is the following:
>> I check one item (or all) in bottom form, but then I need to get the
>> selected values when click on link in top form.
>> 
>> The check doesn't do submit so the values are not retained. I alsways get
>> the
>> size = 0 message.
>> 
>> Could you tell me how I can manage this?
>> 
>> Here is the code:
>> =HTML=
>> 
>>   > width="100%">
>> 
>> 
>> > />
>> 
>> 
>> 
>>
>> 
>> 
>> > width="100%">
>> 
>> 
>> Name
>> Code
>> 
>> 
>> Id
>> 
>> 
>> 
>> 
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> > />
>> 
>> 
>>   
>> 
>> 
>> 
>> > name="btnSave" value="OK" />
>> 
>>   
>> 
>> 
>> 
>> 
>> 
>> 
>> ==JAVA==
>> private static final long serialVersionUID = 311508940740808005L;
>> private static final Logger logger = LogManager.getLogger(TestPage.class);
>> private TestForm tst;
>> 
>> public TestPage(IModel model) {
>> super(model);
>> 
>> TestForm0 tst0 = new TestForm0("testForm0");
>> tst0.setOutputMarkupId(true);
>> add(tst0);
>> tst = new TestForm("testForm", model);
>> tst.setOutputMarkupId(true);
>> add(tst);
>> 
>> }
>> 
>> class TestForm0 extends Form {
>> 
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> 
>> public TestForm0(String id) {
>> super(id);
>> 
>> Link print = new Link("print") {
>> private static final long serialVersionUID = 15L;
>> 
>> @Override
>> public void onClick() {
>> System.out.println("size=" + tst.getCheckedTestBeans().size());
>> }
>> };
>> add(print);
>> }
>> }
>> class TestForm extends Form {
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> 
>> private List checkedTestBeans;
>> public List getCheckedTestBeans() {
>> return checkedTestBeans;
>> }
>> 
>> public void setCheckedTestBeans(List checkedTestBeans) {
>> this.checkedTestBeans = checkedTestBeans;
>> }
>> 
>> public TestForm(String id, IModel model) {
>> super(id, model);
>> 
>> checkedTestBeans = new ArrayList();
>> TextField txtName = new TextField("txtName", new
>> PropertyModel(getModelObject(), "name"));
>> add(txtName);
>> txtName.setOutputMarkupId(true);
>> txtName.add(new AjaxFormComponentUpdatingBehavior("change") {
>> private static final long serialVersionUID = 1654345477970524731L;
>> 
>> @Override
>> protected void onUpdate(AjaxRequestTarget target) {
>> target.add(txtName);
>> }
>> 
>> });
>> 
>> SubmitLink clearForm = new SubmitLink("clearForm", this){
>> 
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> @Override
>> public void onSubmit() {
>> model.setObject(new TestBean());
>> TestForm.this.clearInput();
>> };
>> };
>> clearForm.setOutputMarkupId(true);
>> add(clearForm);
>> AjaxLink clearLink = new AjaxLink("clearLink", model)
>> {
>> /**
>> *
>> */
>> private static final long serialVersionUID = 1L;
>> 
>> @Override
>> public void onClick(AjaxRequestTarget target) {
>> model.setObject(new TestBean());
>> TestForm.this.clearInput();
>> target.add(TestForm.this);
>> txtName.setConvertedInput("");
>> 
>> }
>> 
>> };
>> clearLink.setOutputMarkupId(true);
>> add(clearLink);
>> ///
>> CheckGroup group = new CheckGroup("group",
>> 

Re: ModalWindow and OnDomReady

2016-10-19 Thread Ernesto Reinaldo Barreiro
Repainting the panel after the modal is shown? On the same ART That way
JavaScript will be executed again.

On Wed, Oct 19, 2016 at 5:06 PM, Rob Audenaerde 
wrote:

> Hi all,
>
> I have a panel that needs some JavaScript for sizing etc. to run after a
> ModalWindow is shown, but as I now see it the Javascript is run *before*
> the modal window is shown.
>
> What is the proper way to run javascript after a ModalWindow is shown? It
> seems OnDomReady is not sufficient here?
>
> Thanks,
>
> Rob
>



-- 
Regards - Ernesto Reinaldo Barreiro


ModalWindow and OnDomReady

2016-10-19 Thread Rob Audenaerde
Hi all,

I have a panel that needs some JavaScript for sizing etc. to run after a
ModalWindow is shown, but as I now see it the Javascript is run *before*
the modal window is shown.

What is the proper way to run javascript after a ModalWindow is shown? It
seems OnDomReady is not sufficient here?

Thanks,

Rob


Re: Check Group selected items called from other form loses the checked values

2016-10-19 Thread ganea iulia
Hello,

I have actually made this to work by adding this behaviour to the
checkgroup:

group.add(new AjaxFormChoiceComponentUpdatingBehavior() {
private static final long serialVersionUID =
1654345477970524731L;

@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(group);
}

});

However, now I face following issue:
If I replace my ListView component, with a RefreshingView, I cannot check
any of the checks from the items. I check it, but then it gets unchecked
right away.
This is because the RefreshingView repaints its model at every roundtrip to
the server.

I have tried this:
http://stackoverflow.com/questions/12282492/add-row-to-refreshingview-without-repainting-entire-refreshingview
by setting:
listOfItems.setItemReuseStrategy(new ReuseIfModelsEqualStrategy());

But it did not change a thing for me.

Please guide on how to have a Check for every item of the RepeatingView,
that can be checked.

Thank you.



On Tue, Oct 18, 2016 at 1:28 PM, ganea iulia  wrote:

> Hi,
> I have 2 forms.
>
> Bottom form = testForm
> - I have a listview with checkboxes.
> As I needed a checkAll control also, I have uses CheckGroup,
> CheckGroupSelector and Check wicket components.
>
> Top form = testForm0
> -I have only an link
>
> The use case is the following:
> I check one item (or all) in bottom form, but then I need to get the
> selected values when click on link in top form.
>
> The check doesn't do submit so the values are not retained. I alsways get
> the
> size = 0 message.
>
> Could you tell me how I can manage this?
>
> Here is the code:
> =HTML=
> 
> width="100%">
> 
> 
>  />
> 
> 
> 
> 
> 
> 
>  width="100%">
> 
> 
> Name
> Code
> 
> 
> Id
> 
> 
> 
> 
> 
>
> 
> 
> 
> 
> 
>  />
> 
> 
>
> 
> 
> 
>  name="btnSave" value="OK" />
> 
>
> 
> 
> 
> 
>
>
> ==JAVA==
> private static final long serialVersionUID = 311508940740808005L;
> private static final Logger logger = LogManager.getLogger(TestPage.class);
> private TestForm tst;
>
> public TestPage(IModel model) {
> super(model);
>
> TestForm0 tst0 = new TestForm0("testForm0");
> tst0.setOutputMarkupId(true);
> add(tst0);
> tst = new TestForm("testForm", model);
> tst.setOutputMarkupId(true);
> add(tst);
>
> }
>
> class TestForm0 extends Form {
>
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> public TestForm0(String id) {
> super(id);
>
> Link print = new Link("print") {
> private static final long serialVersionUID = 15L;
>
> @Override
> public void onClick() {
> System.out.println("size=" + tst.getCheckedTestBeans().size());
> }
> };
> add(print);
> }
> }
> class TestForm extends Form {
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> private List checkedTestBeans;
> public List getCheckedTestBeans() {
> return checkedTestBeans;
> }
>
> public void setCheckedTestBeans(List checkedTestBeans) {
> this.checkedTestBeans = checkedTestBeans;
> }
>
> public TestForm(String id, IModel model) {
> super(id, model);
>
> checkedTestBeans = new ArrayList();
> TextField txtName = new TextField("txtName", new
> PropertyModel(getModelObject(), "name"));
> add(txtName);
> txtName.setOutputMarkupId(true);
> txtName.add(new AjaxFormComponentUpdatingBehavior("change") {
> private static final long serialVersionUID = 1654345477970524731L;
>
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> target.add(txtName);
> }
>
> });
>
> SubmitLink clearForm = new SubmitLink("clearForm", this){
>
> /**
> *
> */
> private static final long serialVersionUID = 1L;
> @Override
> public void onSubmit() {
> model.setObject(new TestBean());
> TestForm.this.clearInput();
> };
> };
> clearForm.setOutputMarkupId(true);
> add(clearForm);
> AjaxLink clearLink = new AjaxLink("clearLink", model)
> {
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> @Override
> public void onClick(AjaxRequestTarget target) {
> model.setObject(new TestBean());
> TestForm.this.clearInput();
> target.add(TestForm.this);
> txtName.setConvertedInput("");
>
> }
>
> };
> clearLink.setOutputMarkupId(true);
> add(clearLink);
> ///
> CheckGroup group = new CheckGroup("group",
> checkedTestBeans);
> CheckGroupSelector cgs = new CheckGroupSelector("allCheck");
> group.add(cgs);
> List beans = Arrays.asList(new TestBean("Name1", "Code1", 1),
> new TestBean("Name2", "Code2", 2));
> final WebMarkupContainer itemsContainer = new WebMarkupContainer("
> itemsContainer");
> itemsContainer.setOutputMarkupId(true);
> itemsContainer.add(new ListView("forEachItem", beans) {
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> @Override
> protected void populateItem(ListItem item) {
>   item.add(new Label("itemName", new PropertyModel(item.getModel(),
> "name")));
>   item.add(new Label("itemCode", new PropertyModel(item.getModel(),
> "code")));
>   item.add(new Label("itemId", new 

Re: Wicket Appl - Cleanup & Scale

2016-10-19 Thread Ernesto Reinaldo Barreiro
Hi,



> Do you mean you had used lot of OFC or JS based charts. Can give few
> choices
> u had used for JS.
>
>
I have used client based charts like Flot,
http://morrisjs.github.io/morris.js/, and a few others.



> Is it better to design all entities as pages ? I was worried about
> reconstructing the header for each click if we were to keep redirecting
> pages. Reconstructing the header requires to iterate the roles, fetching
> menus, etc..  Are there ways to cache the generated components say header
> in
> this case and render only entity related contents.
>

What I said is that wicket does not enforces any pattern it all depends of
your use case: either AJAX replacement or navigating to another page is
fine depending on what you want to offer to your users. You can always
offer a button "See details in a separate page" if you want to offer
something that is bookmarkable.


>
> Ernesto Reinaldo Barreiro-4 wrote
> >>
> >> cntr.addOrReplace(newComponent);
> >> target.add(cntr);
> >>
> >> 90% of user interactions are via this method. Hence we are not able to
> >> generate URLs for these internal UIs. If user needs to traverse to any
> of
> >> these, then they navigate to the page.. click menu.. click tab to
> >> navigate.
> >>
> > This is not enforced by wicket at all
>
> Sorry i did not get this. Can you elaborate a little bit.. Is using replace
> component heavy ? As per my understanding only the changed portion of the
> page gets refreshed..  This is what is being done by JS fwk like react to
> compare virtual DOM & actuam DOM. In this case we are doing it, whereas in
> React it does it by itself.
>

Again you can design your navigation as you want. Ajax (not bookmarkable)
or navigation to a different page.


Re: Wicket Appl - Cleanup & Scale

2016-10-19 Thread Vit Rozkovec

There exists also java wrapper:
https://github.com/jhonnymertz/java-wkhtmltopdf-wrapper



On 10/18/2016 05:13 PM, Ernesto Reinaldo Barreiro wrote:

Thanks for the pointer: did not know about this project :-)

On Tue, Oct 18, 2016 at 4:19 PM, Vit Rozkovec  wrote:


I would recommend wkhtmltopdf as flying saucer does not play well with
Bootstrap and CSS3 features in general.

https://github.com/wkhtmltopdf/wkhtmltopdf

For generating PDF I prefer flying-saucer and wicket

https://github.com/reiern70/wicket-flyingsaucer



-
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