Re: Dealing with editing of nested objects in a multiple screens for a single entity

2020-01-20 Thread Peter Henderson
Hi Bas,

On Thu, 16 Jan 2020 at 10:41, Bas Gooren  wrote:

> Hi all!
>
> I’m currently working on an editing system which has composite elements;
>
> For example:
>
> We store Products (e.g. an iPod 64GB) and those Products have Variants
> (Blue).
> Since a variant cannot exist without a product, and we want to enforce that
> every product has at least one variant, we want to implement this in a
> single screen.
> So here the Product is a composite which contains one or more Variants.
>
> To extend my example: a Variant has pricing based on Country, Website etc.
> So the Variant is also a composite;
>
> In all previous projects we either
> a) relaxed the requirements, like don’t require a product to have at least
> one variant, which means the creation of variants happens when the Product
> already exists
> b) perform all editing in a single form, so everything is committed in one
> go
>

I would avoid b) if at all possible, users don’t like being bamboozled with
overly complex forms.


My approach to this is similar option a) but with an added work flow.

1) Present the “Add product” form to the user. Once its been created,
ensure the product has a status of “Editing” so cannot used/seen etc.

2) On the “Product detail” page show the empty list of variants, with
actions to CRUD variants.

Rinse and repeat for all sub lists of data.


Once the product info is complete and meets business rules, allow the
products status to be changed to “Live/Active/etc”.


This has worked well for me, as it keeps the number of fields on a form
small, so users are always making progress and data is saved early and
often.


Peter.



>
> But since our composites are more complex in this project, the UI becomes a
> bit crazy, so we want to break out the nested editors.
> Essentially this requires us to build some sort of change tracking feature,
> like a set of custom models that remembers what was provided in “setObject”
> and can later replay this.
> We can then track all changes that happen in editors, and replay those
> changes later (e.g. when the Product editor is submitted).
>
> Given that we want to support nested composites (Product -> List of Variant
> -> List of VariantPrice), this can get quite complex.
>
> So before embarking on this, I’d like to ask if others have implemented a
> similar system, or if they have other suggestions.
>
> I seem to recall that a long time ago there was discussion about this as
> well, perhaps it was regarding a really complex
> NestedPropertyChangeListenerModel (;-)) at topicus or hippo or similar.
> I think it was ultimately refactored into something much simpler due to the
> difficulty in maintaining it.
> But alas, I cannot seem to find any mention of it anymore.
>
> Thank you all for reading and any input you can provide.
>
> Met vriendelijke groet,
> Kind regards,
>
> Bas Gooren
>


-- 
Peter Henderson


Re: WebSockets and Page serialization, oddity.

2019-07-03 Thread Peter Henderson
ff --git src/main/java/com/mycompany/WebSocketPage.java
> src/main/java/com/mycompany/WebSocketPage.java
> index bdcb47b..f6118fe 100644
> --- src/main/java/com/mycompany/WebSocketPage.java
> +++ src/main/java/com/mycompany/WebSocketPage.java
> @@ -16,7 +16,7 @@ import org.slf4j.LoggerFactory;
> public class WebSocketPage extends WebPage {
> - static Logger log = LoggerFactory.getLogger(WebSocketPage.class);
> + Logger log = LoggerFactory.getLogger(getClass());
> private ConnectedMessage connectedMessage = null;
> @@ -70,7 +70,7 @@ public class WebSocketPage extends WebPage {
> }
> protected void onWebSocketMessage(WebSocketRequestHandler handler,
> IWebSocketPushMessage message) {
> -
> + log.info("onWebSocketMessage: {}, {}", getClass(), message);
> }
> diff --git src/main/java/com/mycompany/WicketApplication.java
> src/main/java/com/mycompany/WicketApplication.java
> index 85346e5..dbb0c47 100644
> --- src/main/java/com/mycompany/WicketApplication.java
> +++ src/main/java/com/mycompany/WicketApplication.java
> @@ -1,6 +1,7 @@
> package com.mycompany;
> import org.apache.wicket.Application;
> +import org.apache.wicket.Page;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.protocol.http.WebApplication;
> import org.apache.wicket.protocol.ws.WebSocketSettings;
> @@ -33,10 +34,6 @@ public class WicketApplication extends WebApplication
>broadcaster.broadcast(connectedMsg, message);
>}
> -
> -
> -
> -
>/**
> * @see org.apache.wicket.Application#getHomePage()
> */
> @@ -65,13 +62,19 @@ public class WicketApplication extends WebApplication
>getFrameworkSettings().setSerializer(new
> JavaSerializer(getApplicationKey()){
>public byte[] serialize(Object obj) {
> -   log.info("serialize " + obj.getClass() + " " +
> obj.hashCode());
> +   if (obj instanceof Page) {
> +   Page p = (Page) obj;
> +   log.info("===serialize " + p.getClass() + " " +
> p.getId());
> +   }
>return super.serialize(obj);
>}
>public Object deserialize(byte[] data) {
>Object res = super.deserialize(data);
> -   log.info("deserialize " + res.getClass() + " " +
> res.hashCode());
> +   if (res instanceof Page) {
> +   Page p = (Page) res;
> +   log.info("---deserialize " + p.getClass() + " " +
> p.getId());
> +   }
>return res;
>}
>});
> diff --git src/test/java/com/mycompany/Start.java
> src/test/java/com/mycompany/Start.java
> index 9acdb08..f06825d 100644
> --- src/test/java/com/mycompany/Start.java
> +++ src/test/java/com/mycompany/Start.java
> @@ -3,7 +3,11 @@ package com.mycompany;
> import java.lang.management.ManagementFactory;
> import javax.management.MBeanServer;
> +import javax.servlet.ServletException;
> +import javax.websocket.DeploymentException;
> +import javax.websocket.server.ServerContainer;
> +import org.apache.wicket.protocol.ws.javax.WicketServerEndpointConfig;
> import org.eclipse.jetty.jmx.MBeanContainer;
> import org.eclipse.jetty.server.HttpConfiguration;
> import org.eclipse.jetty.server.HttpConnectionFactory;
> @@ -14,6 +18,7 @@ import org.eclipse.jetty.server.SslConnectionFactory;
> import org.eclipse.jetty.util.resource.Resource;
> import org.eclipse.jetty.util.ssl.SslContextFactory;
> import org.eclipse.jetty.webapp.WebAppContext;
> +import
>
> org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer;
> /**
> * Separate startup class for people that want to run the examples directly.
> Use parameter
> @@ -26,8 +31,7 @@ public class Start
> *
> * @param args
> */
> -   public static void main(String[] args)
> -   {
> +   public static void main(String[] args) throws DeploymentException,
> ServletException {
>System.setProperty("wicket.configuration", "development");
>Server server = new Server();
> @@ -80,8 +84,8 @@ public class Start
>// uncomment the next two lines if you want to start Jetty with
> WebSocket (JSR-356) support
>// you need org.apache.wicket:wicket-native-websocket-javax in the
> classpath!
> -   // ServerContainer serverContainer =
> WebSocketServerContainerInitializer.configureContext(bb);
> -   // serverContainer.addEndpoint(new WicketServerEndpointConfig());
> +   ServerContainer serverContainer =
> WebSocketServerContainerInitializer.configureContext(bb);
> +   serverContainer.addEndpoint(new WicketServerEndp

WebSockets and Page serialization, oddity.

2019-07-02 Thread Peter Henderson
Hi all,

QuickStart: https://github.com/bollinger/WicketWebsocketsTest



I have a page StartPage[1] which uses web sockets. On this page there is an
AjaxLink which redirects to a BackgroundPage[2].


The BackgroundPage also uses web sockets. It waits for a web socket
connection, then kicks off some background work. When the work completes it
tries to display the results.



When navigating directly to the Background page or via a bookmarkable link,
all works as expected.


When arriving at Background page via the AjaxLink funky stuff happens. The
background work completes but it cannot send a message to the page to
refresh because the stored connectedMessage is null.

Looking at the serialization it seems like there are 2 background pages.



I’m probably doing something incorrectly, but what?


Many thanks.

Peter.



[1]

https://github.com/bollinger/WicketWebsocketsTest/blob/master/src/main/java/com/mycompany/StartWebSocketPage.java



[2]

https://github.com/bollinger/WicketWebsocketsTest/blob/master/src/main/java/com/mycompany/BackgroundWorkPage.java


-- 
Peter Henderson


Re: Wicket 8 GA for production

2017-10-10 Thread Peter Henderson
FYI

I've just clicked on the demo link. (https://om.alteametasoft.com:8443/next/
)

Using the Google button to sign on produced an error.

*400.* That’s an error.

*Error: invalid_request*

Invalid parameter value for redirect_uri: Directory backtracking is not
allowed: https://om.alteametasoft.com:8443/../signin?oauthid=2



On 10 October 2017 at 03:44, Maxim Solodovnik <solomax...@gmail.com> wrote:

> Hello Ilia,
>
> I believe wicket 7 and 8 are fully feature compatible, my migration
> from 7 to 8 was flawless :)
> WICKET-6105 introducing API break (wicket-datetime module is dropped),
> wicket-datetime in its current state is available at wicketstuff
>
> Our project is opensource :) openmeetings.apache.org :)))
> demo is available here: https://om.alteametasoft.com:8443/next/
> It has free registration you can check it :)
>
>
> On Tue, Oct 10, 2017 at 1:40 AM, Илья Нарыжный <phan...@ydn.ru> wrote:
> > Martin, Andrea, Maxim,
> >
> > Thank you all for your answers!
> >
> > GA version will be a gift for us for sure:) Yes - we can use Java 8
> source
> > level with Wicket 7, but we have some internal dependency for resolving
> of
> > which we need to invest some good amount of time.
> > Andrea, regarding my second question. It was about compatibility by
> > features between wicket 7 and wicket 8. Are there something missing in
> > Wicket  which is present in Wicket 7?
> > Maxim, you wrote about using of Wicket 8 on production. Is that some open
> > source? Can you send a link? You can make it privately:)
> >
> > And guys, you are doing incredible web-framework! Thank you for that. I'm
> > quite surprised  that Wicket is not widely used:) Do you have some
> > marketing difficulties?
> > I personally expect that Wicket 8 release will be followed by some
> > marketing events, articles and etc. Will be glad to participate in
> > spreading this web-framework across the World.
> >
> > Thanks,
> > Ilia
> >
> > -
> > Orienteer(http://orienteer.org) - open source Business Application
> Platform
> >
> > On Mon, Oct 9, 2017 at 4:10 AM, Martin Grigorov <mgrigo...@apache.org>
> > wrote:
> >
> >> Hi,
> >>
> >> On Sun, Oct 8, 2017 at 7:28 PM, Илья Нарыжный <phan...@ydn.ru> wrote:
> >>
> >> > Dear Wicket developers,
> >> >
> >> > Could you please help with understanding of Wicket 8 status?
> >> > 1) When do you expect GA version be released? (I mean first official
> >> > release which is not a candidate and etc.)
> >> > 2) How accurately Wicket 8 branch currently mimics features from
> version
> >> 7?
> >> > 3) What the level maturity of wicket 8 M7 to try to use it even on
> >> > production? Do you recommend? Or it's better to wait?
> >> >
> >> > A little bit more context: we are starting to use RxJava 2 in our
> >> > application platform http://orienteer.org. And it's much more
> convenient
> >> > to
> >> > use it on Java 8, so we are considering to move the whole our
> platform to
> >> > Java 8, but the main our dependency is Wicket:)
> >> >
> >>
> >> You can use Wicket 7 with Java 8. I guess you already know this.
> >>
> >> I'd be interested to hear how it goes with the asynchronous rendering
> >> (RxJava2 + Wicket)!
> >>
> >>
> >> >
> >> > Thanks,
> >> > Ilia
> >> >
> >> > -
> >> > Orienteer(http://orienteer.org) - open source Business Application
> >> > Platform
> >> >
> >>
>
>
>
> --
> WBR
> Maxim aka solomax
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Peter Henderson


Re: Web socket connected event and onConfigure

2017-09-14 Thread Peter Henderson
On 14 September 2017 at 10:54, Maxim Solodovnik <solomax...@gmail.com>
wrote:

> I'm afraid you cannot update page on websocket connected
> You need to workaround this
>
> Here is what we are are using:
> Java: handling of special `connected` message:
> https://github.com/apache/openmeetings/blob/master/
> openmeetings-web/src/main/java/org/apache/openmeetings/
> web/common/MainPanel.java#L235
> JS: send `connected` message
> https://github.com/apache/openmeetings/blob/master/
> openmeetings-web/src/main/java/org/apache/openmeetings/
> web/common/MainPanel.html#L40
>
> works as expected
>

Brilliant.

Thanks




>
>
> On Thu, Sep 14, 2017 at 4:24 PM, Peter Henderson
> <peter.hender...@starjar.com> wrote:
> > Hi All,
> >
> > I have a link on a panel which should only be enabled while there is a
> > connected web socket.
> >
> > The link overrides onConfigure and calls setEnabled [1]
> >
> > When a web socket connected event is received I store the connected
> message
> > and add the link to the payload handler. [2]
> > I expect the handler to trigger a call on link.onConfigure  (just like an
> > ajax update) but it is not.
> >
> > What am I doing wrong.
> >
> > Quick start (in Java!)
> > https://github.com/bollinger/WsOnConnect
> >
> > Many thanks
> > Peter.
> >
> >
> > [1]
> > https://github.com/bollinger/WsOnConnect/blob/
> ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/
> mycompany/MyPanel.java#L48
> >
> > [2]
> > https://github.com/bollinger/WsOnConnect/blob/
> ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/
> mycompany/MyPanel.java#L99
> >
> > --
> > Peter Henderson
>
>
>
> --
> WBR
> Maxim aka solomax
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Peter Henderson


Web socket connected event and onConfigure

2017-09-14 Thread Peter Henderson
Hi All,

I have a link on a panel which should only be enabled while there is a
connected web socket.

The link overrides onConfigure and calls setEnabled [1]

When a web socket connected event is received I store the connected message
and add the link to the payload handler. [2]
I expect the handler to trigger a call on link.onConfigure  (just like an
ajax update) but it is not.

What am I doing wrong.

Quick start (in Java!)
https://github.com/bollinger/WsOnConnect

Many thanks
Peter.


[1]
https://github.com/bollinger/WsOnConnect/blob/ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/mycompany/MyPanel.java#L48

[2]
https://github.com/bollinger/WsOnConnect/blob/ba7ec25a2843c64b3e436f6054b60944adb4114c/src/main/java/com/mycompany/MyPanel.java#L99

-- 
Peter Henderson


Re: Websocket replacing a panel which uses websockets

2017-08-30 Thread Peter Henderson
Done

https://issues.apache.org/jira/browse/WICKET-6458

On 29 August 2017 at 18:29, Martin Grigorov <martin.grigo...@gmail.com>
wrote:

> Hi,
>
> Please file a ticket!
> It should be easy to implement it.
> Thanks!
>
> On Aug 29, 2017 17:15, "Peter Henderson" <peter.hender...@starjar.com>
> wrote:
>
> > Hi All,
> >
> > I've run into a possible bug.
> >
> > I've a page which initially shows a "loading..." animation panel.
> > This panel uses web sockets to trigger background loading.
> > (WebSocketBehavior::onConnected starts the background loading)
> >
> >
> > When the background loading has completed
> > (onEvent => event.getPayload => WebSocketPushPayload => ???)
> > I replace the loading place holder panel with the real data panel.
> >
> >
> >
> > The real data panel may also want to use web sockets, and show a loading
> > animation.
> > (Turtles all the way down)
> >
> > The problem I'm seeing, is that the WebSocketBehavior::onConnected method
> > is not being called on the replaced panel.
> >
> >
> > So my questions:-
> >
> > Am I doing something wrong?
> > Is this the expected behaviour?
> > (or) Is this a Bug?
> >
> >
> >
> >
> > A fairly simple example [1] although it's in Scala.
> >
> > [1] https://github.com/bollinger/WebSocketPanelReplace
> >
> > The interesting class is
> > https://github.com/bollinger/WebSocketPanelReplace/blob/
> > master/src/main/scala/com/starjar/ws/WsLoadingPanel.scala
> >
> > Many thanks
> >
> > Peter.
> >
> >
> >
> > --
> > Peter Henderson
> >
>



-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Websocket replacing a panel which uses websockets

2017-08-29 Thread Peter Henderson
Hi All,

I've run into a possible bug.

I've a page which initially shows a "loading..." animation panel.
This panel uses web sockets to trigger background loading.
(WebSocketBehavior::onConnected starts the background loading)


When the background loading has completed
(onEvent => event.getPayload => WebSocketPushPayload => ???)
I replace the loading place holder panel with the real data panel.



The real data panel may also want to use web sockets, and show a loading
animation.
(Turtles all the way down)

The problem I'm seeing, is that the WebSocketBehavior::onConnected method
is not being called on the replaced panel.


So my questions:-

Am I doing something wrong?
Is this the expected behaviour?
(or) Is this a Bug?




A fairly simple example [1] although it's in Scala.

[1] https://github.com/bollinger/WebSocketPanelReplace

The interesting class is
https://github.com/bollinger/WebSocketPanelReplace/blob/master/src/main/scala/com/starjar/ws/WsLoadingPanel.scala

Many thanks

Peter.



-- 
Peter Henderson


Re: Websocket redirect wrong url

2017-05-24 Thread Peter Henderson
On 24 May 2017 at 11:05, Peter Henderson <peter.hender...@starjar.com>
wrote:

>
>
> On 23 May 2017 at 22:24, Martin Grigorov <mgrigo...@apache.org> wrote:
>
>> Hi,
>>
>> I'm afraid a quickstart would be needed to be able to tell what goes wrong
>> there.
>>
>
> Thanks for looking, I thought you'd say that.
> Attached is a quick (ish) start.
>
> browse to
> https://localhost:/redirect/protected/path/pageA/112233
> Press the button *boom*
>
> Removing the WebSocketBehavior on  BasePage makes the page work
> (Although in a real app I need this behavior)
>
> Would it be helpful if I created this on github?
>




Sorry for the noise.

I've just tried this on Wicket 7.7 and it seems to be fixed already.
WICKET-6342

I don't know what's more embarrassing. Posting a dumb bug report or
spending days trying to narrow down the bug.
Now to upgrade my main app *fingers crossed*


-- 
Peter Henderson


Re: Websocket redirect wrong url

2017-05-24 Thread Peter Henderson
On 23 May 2017 at 22:24, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi,
>
> I'm afraid a quickstart would be needed to be able to tell what goes wrong
> there.
>

Thanks for looking, I thought you'd say that.
Attached is a quick (ish) start.

browse to
https://localhost:/redirect/protected/path/pageA/112233
Press the button *boom*

Removing the WebSocketBehavior on  BasePage makes the page work
(Although in a real app I need this behavior)

Would it be helpful if I created this on github?


>
> The appearance of /wicket/ in the url looks like either BookmarkableMapper
> (responsible for urls like /wicket/bookmarkable/com.example.Page) or
> PageInstanceMapper (responsible for urls like /wicket/page?123) is used
> instead of MountedMapper (used when the page path is configured with
> WebApplication#mountPage(String, Class) method).
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Tue, May 23, 2017 at 2:46 PM, Peter Henderson <
> peter.hender...@starjar.com> wrote:
>
> > Hi all.
> >
> >
> > I'm seeing a strange redirect problem which leads to a 404
> >
> >
> > Scenario.
> > 1) User is on fat bookmarkable page [1]
> > 2) Ajax onClick redirects to non bookmarkable SendMessagePage
> > 3) SendMessage page uses websockets + background threads.
> > 4) SendMessage page receives a websocket push event which it responds to
> > with [2] or [3]
> >
> > When redirecting back to a really simple DummyPage all is fine.
> > When redirecting back to the fat bookmarkable page I get a 404 on url
> > https://local.starjar.com:25000/Starjar/protected/wicket/35883
> >
> > Both DummyPage and PurchaseOrderPage are mounted the same way.
> >
> >
> >
> > What am I doing which is causing the incorrect redirect path?
> >
> >
> > I'm (still) trying to build a quick start that reproduces this problem.
> >
> >
> > Further testing.
> >
> > I created a new class called Dummy2 which is identical to
> > PurchaseOrderPage. Just a different name and mount point.
> > Redirecting to Dummy2 works fine .
> >
> > It looks like Dummy2 => Dummy2 and PurchaseOrderPage => PurchaseOrderPage
> > both fail with the incorrect relative url.
> >
> >
> >
> >
> > Many thanks
> >
> > Peter.
> >
> >
> >
> >
> >
> > [1]
> > https://local.starjar.com:25000/Starjar/protected/purchaseOrder/35883
> >
> > [2]
> > // This works as expected
> > // https://local.starjar.com:25000/Starjar/protected/dummy/12334
> > val pageCls = classOf[DummyDetailPage]
> > val pp = new PageParameters()
> > pp.set(WicketStarjarApplication.DetailPageIdParameterName, 12334)
> > throw new RestartResponseException(pageCls, pp)
> >
> >
> > [3]
> > // This does not work 404
> > // https://local.starjar.com:25000/Starjar/protected/wicket/35883
> > val pageCls = classOf[PurchaseOrderDetailPage]
> > val pp = new PageParameters()
> > pp.set(WicketStarjarApplication.DetailPageIdParameterName,
> businessId.pk)
> > throw new RestartResponseException(pageCls, pp)
> >
> >
> >
> > --
> > Peter Henderson
> >
>



-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


redirect.tar.gz
Description: GNU Zip compressed data

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

Websocket redirect wrong url

2017-05-23 Thread Peter Henderson
Hi all.


I'm seeing a strange redirect problem which leads to a 404


Scenario.
1) User is on fat bookmarkable page [1]
2) Ajax onClick redirects to non bookmarkable SendMessagePage
3) SendMessage page uses websockets + background threads.
4) SendMessage page receives a websocket push event which it responds to
with [2] or [3]

When redirecting back to a really simple DummyPage all is fine.
When redirecting back to the fat bookmarkable page I get a 404 on url
https://local.starjar.com:25000/Starjar/protected/wicket/35883

Both DummyPage and PurchaseOrderPage are mounted the same way.



What am I doing which is causing the incorrect redirect path?


I'm (still) trying to build a quick start that reproduces this problem.


Further testing.

I created a new class called Dummy2 which is identical to
PurchaseOrderPage. Just a different name and mount point.
Redirecting to Dummy2 works fine .

It looks like Dummy2 => Dummy2 and PurchaseOrderPage => PurchaseOrderPage
both fail with the incorrect relative url.




Many thanks

Peter.





[1]
https://local.starjar.com:25000/Starjar/protected/purchaseOrder/35883

[2]
// This works as expected
// https://local.starjar.com:25000/Starjar/protected/dummy/12334
val pageCls = classOf[DummyDetailPage]
val pp = new PageParameters()
pp.set(WicketStarjarApplication.DetailPageIdParameterName, 12334)
throw new RestartResponseException(pageCls, pp)


[3]
// This does not work 404
// https://local.starjar.com:25000/Starjar/protected/wicket/35883
val pageCls = classOf[PurchaseOrderDetailPage]
val pp = new PageParameters()
pp.set(WicketStarjarApplication.DetailPageIdParameterName, businessId.pk)
throw new RestartResponseException(pageCls, pp)



-- 
Peter Henderson


Quick Start Wicket version

2017-03-30 Thread Peter Henderson
Hi all.

I've just created a quick start from [1] using [2]

The resulting project (pom.xml) is using
7.5.0-SNAPSHOT

Probably something trivial to fix in the project template?

Peter.




[1]
http://wicket.apache.org/start/quickstart.html

[2]
mvn archetype:generate -DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=7.6.0
-DgroupId=com.mycompany -DartifactId=redirect -DarchetypeRepository=
https://repository.apache.org/ -DinteractiveMode=false




-- 
Peter Henderson


Re: DiskDataStore exception at end of day

2017-02-08 Thread Peter Henderson
Thanks Martin,

On 8 February 2017 at 10:45, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi,
>
> The WebSocket communication doesn't update the session, i.e. doesn't renew
> it. This is by Servlet specification.
> So if there is no normal HTTP request then the http session will expire and
> Wicket will clean up its resources.
> Later when a web socket message comes it might fail with such kind of
> error.
>

I've done a little more analysis of the logs and my code.

It seems this happened to only 1 used yesterday.
Tracking her session ID she logs in, 7 hours later her session times out.

My code has a HttpSessionListener which sends a message to an actor which
monitors sessions. This actor eventually does a web socket broadcast to
notify everyone who is online.

Could there be a race condition when sessions are being destroyed and
sending web socket push messages?





>
> I am not sure what is the best solution to this.
> There is an established web socket connection and there won't be a new
> handshake when the message arrives.
> The only workaround I see is to make a ping once per N minutes, where N is
> less than the session timeout duration.
>

When their session goes, does Tomcat & the browser keep a web socket
connection open.

Perhaps the simplest option is for me to mute DiskDataStore exception log
messages.



>
> But the exception in the DiskDataStore happens in a different thread, so I
> think it should not affect the thread where the application reads/writes to
> the websocket connection.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Feb 8, 2017 at 9:46 AM, Peter Henderson <
> peter.hender...@starjar.com
> > wrote:
>
> > Morning all.
> >
> > Wicket 7.6.0
> > Tomcat 8.5.11
> > Java 1.8.0_121
> >
> >
> >
> > I'm seeing several DiskDataStore Exceptions [1]. Normally towards the end
> > of the day, long after users have stopped using my app. So probably when
> > their sessions time out.
> > The file name looks very suspicious to me.
> > /opt/starjar/domains/customer/apache-tomcat-8.5.11/work/
> > Catalina/localhost/Starjar/Key[type=org.apache.wicket.protocol.ws.javax.
> > JavaxWebSocketFilter,
> > annotation=[none]]-filestore/247/7021/D69E0EE552DC1F1FE5FF986A1A919C
> > 39/data
> >
> >
> >
> > Another perhaps unrelated exception [2]
> >
> >
> > Any pointers where I should dig to solve this ?
> >
> > Thanks
> > Peter
> >
> >
> >
> >
> >
> > [1]
> > 2017-02-07 20:59:34.358 SEVERE oawp.DiskDataStore
> > /opt/starjar/domains/viper/apache-tomcat-8.5.11/work/
> > Catalina/localhost/Starjar/Key[type=org.apache.wicket.protocol.ws.javax.
> > JavaxWebSocketFilter,
> > annotation=[none]]-filesto
> > re/247/7021/D69E0EE552DC1F1FE5FF986A1A919C39/data (No such file or
> > directory)
> > java.io.FileNotFoundException:
> > /opt/starjar/domains/customer/apache-tomcat-8.5.11/work/
> > Catalina/localhost/Starjar/Key[type=org.apache.wicket.protocol.ws.javax.
> > JavaxWebSocketFilter,
> > annotation=[none]]-filestore/247/7021/D69E0EE552DC1F1FE5FF986A1A919C
> > 39/data
> > (No such file or directory)
> > at java.io.RandomAccessFile.open0(Native Method)
> > at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
> > at java.io.RandomAccessFile.(RandomAccessFile.java:243)
> > at
> > org.apache.wicket.pageStore.DiskDataStore$SessionEntry.
> > getFileChannel(DiskDataStore.java:432)
> > at
> > org.apache.wicket.pageStore.DiskDataStore$SessionEntry.
> > savePage(DiskDataStore.java:350)
> > at
> > org.apache.wicket.pageStore.DiskDataStore.storeData(
> > DiskDataStore.java:188)
> > at
> > org.apache.wicket.pageStore.AsynchronousDataStore$
> PageSavingRunnable.run(
> > AsynchronousDataStore.java:355)
> > at java.lang.Thread.run(Thread.java:745)
> >
> >
> >
> >
> >
> >
> > [2]
> > 2017-02-07 21:33:52.127 SEVERE oawpwj.WicketEndpoint An error occurred in
> > web socket connection with id : 5c1c
> > java.io.EOFException
> > at
> > org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.
> > fillReadBuffer(NioEndpoint.java:1221)
> > at
> > org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.
> > fillReadBuffer(NioEndpoint.java:1192)
> > at
> > org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.
> > read(NioEndpoint.java:1165)
> > at
> > org.apache.tomcat.websock

DiskDataStore exception at end of day

2017-02-08 Thread Peter Henderson
Morning all.

Wicket 7.6.0
Tomcat 8.5.11
Java 1.8.0_121



I'm seeing several DiskDataStore Exceptions [1]. Normally towards the end
of the day, long after users have stopped using my app. So probably when
their sessions time out.
The file name looks very suspicious to me.
/opt/starjar/domains/customer/apache-tomcat-8.5.11/work/Catalina/localhost/Starjar/Key[type=org.apache.wicket.protocol.ws.javax.JavaxWebSocketFilter,
annotation=[none]]-filestore/247/7021/D69E0EE552DC1F1FE5FF986A1A919C39/data



Another perhaps unrelated exception [2]


Any pointers where I should dig to solve this ?

Thanks
Peter





[1]
2017-02-07 20:59:34.358 SEVERE oawp.DiskDataStore
/opt/starjar/domains/viper/apache-tomcat-8.5.11/work/Catalina/localhost/Starjar/Key[type=org.apache.wicket.protocol.ws.javax.JavaxWebSocketFilter,
annotation=[none]]-filesto
re/247/7021/D69E0EE552DC1F1FE5FF986A1A919C39/data (No such file or
directory)
java.io.FileNotFoundException:
/opt/starjar/domains/customer/apache-tomcat-8.5.11/work/Catalina/localhost/Starjar/Key[type=org.apache.wicket.protocol.ws.javax.JavaxWebSocketFilter,
annotation=[none]]-filestore/247/7021/D69E0EE552DC1F1FE5FF986A1A919C39/data
(No such file or directory)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
at java.io.RandomAccessFile.(RandomAccessFile.java:243)
at
org.apache.wicket.pageStore.DiskDataStore$SessionEntry.getFileChannel(DiskDataStore.java:432)
at
org.apache.wicket.pageStore.DiskDataStore$SessionEntry.savePage(DiskDataStore.java:350)
at
org.apache.wicket.pageStore.DiskDataStore.storeData(DiskDataStore.java:188)
at
org.apache.wicket.pageStore.AsynchronousDataStore$PageSavingRunnable.run(AsynchronousDataStore.java:355)
at java.lang.Thread.run(Thread.java:745)






[2]
2017-02-07 21:33:52.127 SEVERE oawpwj.WicketEndpoint An error occurred in
web socket connection with id : 5c1c
java.io.EOFException
at
org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1221)
at
org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1192)
at
org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1165)
at
org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:63)
at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148)
at
org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53)
at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:798)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1434)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)



-- 
Peter Henderson


Re: [ANNOUNCE] Apache Wicket 8.0.0-M4 Released

2017-02-08 Thread Peter Henderson
or but without model
> * [WICKET-6315] - Optimize LinkParser by caching the compiled regex
> Pattern
>
> ** Task
>
> * [WICKET-6287] - Switch from json.org to open-json
> * [WICKET-6304] - Remove Tomcat7 support in Native WebSockets
> * [WICKET-6305] - Remove Atmosphere module
> * [WICKET-6309] - Move the Native WebSocket demo to wicket-examples
> module
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: DropDownChoice models

2017-01-11 Thread Peter Henderson
Hi

I've quickly knocked up this [1]. It's in Scala, I started with Java but
got frustrated with just how slow I was.

Note if you convert this to Java. You won't be able to use Java 8 Optional
as it is not serializable (my biggest disappointment of java 8) so back to
nullable model objects and lots of if (x  != null ) boiler plate.

I hope it helps.


[1] https://gist.github.com/bollinger/433ec1b54167baf88297b495a5df0cff





On 11 January 2017 at 10:38, Zbynek Vavros <zbynekvav...@gmail.com> wrote:

> Hey,
>
> I have a DropDownChoice for list of users. I want to display user's name
> but bind user's ID.
> So far I have come to this (ugly) solution that can surely be improved:
>
> // create model with Long userId...
> final DropDownChoice usersDropDown = new DropDownChoice<>(
> "userId", Lists.transform(User.getUsers(), new
> Function<User, Long>() {
> @Nullable
> @Override
> public Long apply(@Nullable final User user) {
> return user.getId();
> }
> }),
> new ChoiceRenderer() {
> @Override
> public Object getDisplayValue(final Long id) {
> return User.findOne(id);
> }
> }
> );
>
> Thanks for any pointers.
> Zbynek
>



-- 
Peter Henderson


Re: Free library for barcode

2016-12-21 Thread Peter Henderson
On 21 December 2016 at 12:21, ganea iulia <superbiss...@gmail.com> wrote:

> Hello,
>
> I need to generate barcodes.
> Do you know what is the best way in wicket?
> Or can you indicate any good commercially free libraries?
>
> Thank you
>



Have a look at
https://github.com/zxing/zxing



-- 
Peter Henderson


Re: Annotation for detachable field

2016-12-06 Thread Peter Henderson
On 6 December 2016 at 10:05, Martin Grigorov  wrote:

> http://markmail.org/message/qttwc5kunubl6ieo



Oh I'm glad auto detach was not included way back when I started learning
Wicket.
Coming from a legacy swing app which spoon fed components what to display
and how/when to display it,
I found wickets model approach really odd. I took, what seems, ages to
fully grok the idea. Property Models really muddied my water, to such an
extent I never use them.

I've many many panels which can either being displaying data or editing it.
When editing onDetach does not detach the underlying LoadableDetachableModel
When displaying detaching works as expected.

This way I can load and detach an entity from JPA and store it in a LDM.


Peter.


Re: WebSocket ConnectedMessage not Serializable

2016-11-19 Thread Peter Henderson
Ha! You've already fixed it.
Ignore my pull request. (I spent too much time getting my scala -> java
code compiling)

Thanks

Peter.


WebSocket ConnectedMessage not Serializable

2016-11-19 Thread Peter Henderson
Hi all.

Wicket 7.3.0
Native web sockets.
Tomcat 8.5.5

I am trying to do background processing with results being pushed to a
client as they become available.

I store the connected message when a web socket connection is made [1].
This is used to fire push data to a single client/page [2]

A little bit of googling I find [3].
Am I incorrectly using the api?
The ConnectedMessage is not serializable [4]



Thanks

Peter.




[1]
private var connected: ConnectedMessage = _

add(new WebSocketBehavior {
  override def onConnect(message: ConnectedMessage): Unit = {
super.onConnect(message)
println("web socket connected.")
connected = message
  }
})



[2]
private def broadcast(msg: IWebSocketPushMessage): Unit = {
  val application = WicketStarjarApplication.get()
  val webSocketSettings = WebSocketSettings.Holder.get(application)
  val broadcaster = new
WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry())
  broadcaster.broadcast(connected, msg)
}


[3]
http://apache-wicket.1842946.n4.nabble.com/WebSockets-IKey-not-Serializable-td4666996.html
https://issues.apache.org/jira/browse/WICKET-5670


[4]
org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$ObjectCheckException:
The object type is not Serializable!
A problem occurred while checking object with type:
org.apache.wicket.protocol.ws.api.message.ConnectedMessage






-- 
Peter Henderson


Re: What else do we want to do before 8.0.0 final ?

2016-11-10 Thread Peter Henderson
Hi

> What other improvements do we need in 8.x/master before promoting it to

> > 8.0.0 final ?
>

A bit late. But one idea I've had in the back of my mind for a long while.
(I may well be barking up the wrong tree here..)


Break IPageStore.
Replace the simple int pageId identifier with a bit more detail.

When pages are mounted to a path the path should be considered when getting
pages from the page store.
e.g
User A is looking at page
www.example.com/pageA?5


User B is looking at page
www.example.com/pageB?5

User A emails their url to B. When B clicks on the link he incorrectly sees
pageB because that page has the same pageId





> >
> > At https://cwiki.apache.org/confluence/display/WICKET/Ideas+for
> +Wicket+8.0
> > we still have:
> >
> > - new DateTime APIs for wicket-datetime *WICKET-6105
> > <https://issues.apache.org/jira/browse/WICKET-6105>* - I'll give this
> one
> > more try but the problem is that I don't believe this is the proper way
> and
> > this demotivates me.
> > If someone else wants to give it a try - please assign it to yourself!
> >
> > - Better SEO for stateful pages - the only way I see this is by using
> > ServiceWorker to add the pageId as a request header to all requests
> (normal
> > & Ajax)
> >
> >
> > Recently I wondered whether Redux.js could be in use for Wicket.
> > I don't have much experience with it, but both React and AngularJs
> > communities use it to manage the state for their components.
> > There are some Java impls, even a standard is coming:
> https://github.com/
> > jvm-redux/jvm-redux-api
> >
> > What else ?
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
>



-- 
Peter Henderson


Re: Web Socket Exceptions.

2016-11-03 Thread Peter Henderson
Thanks for looking Martin



On 3 November 2016 at 09:07, Martin Grigorov <mgrigo...@apache.org> wrote:

> Hi,
>
> It is a bug in Wicket Native WebSocket.
> https://github.com/apache/wicket/blob/d9d142b0738e289e639165523c4190
> 727e281519/wicket-native-websocket/wicket-native-
> websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/
> AbstractWebSocketProcessor.java#L310
> returns a null and still we try to push the message.
>
> Please file a ticket in JIRA! Thanks!
>

Jira created
https://issues.apache.org/jira/browse/WICKET-6267




>
>
> What is the idea of your implementation? To notify the other users of the
> app that some user have left? Like in a chat app?
>

Similar to a chat app. I need to track who is available online, so they can
be notified when something that requires their approval becomes available.





>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Nov 2, 2016 at 5:01 PM, Peter Henderson <
> peter.hender...@starjar.com
> > wrote:
>
> > Hi  all.
> >
> > wicket 7.3
> > tomcat 8.5.5
> >
> >
> > I'm starting to see many more exceptions in relation to web sockets.
> >
> > [1]
> >
> > I have a HttpSessionListener, which sends a message to an actor when a
> > session is destroyed  (aka user logout). The actor eventually broadcasts
> a
> > web socket message.
> >
> > Am I doing something wrong in my code [2]?
> >
> >
> >
> >
> > [1]
> >
> > oawpwa.AbstractWebSocketProcessor An error occurred during processing
> of a
> > WebSocket message
> > java.lang.IllegalArgumentException: Argument 'component' may not be
> null.
> > at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
> > at
> > org.apache.wicket.protocol.ws.api.WebSocketRequestHandler.<
> > init>(WebSocketRequestHandler.java:59)
> > at
> > org.apache.wicket.protocol.ws.WebSocketSettings.
> > newWebSocketRequestHandler(WebSocketSettings.java:220)
> > at
> > org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.
> > broadcastMessage(AbstractWebSocketProcessor.java:245)
> > at
> > org.apache.wicket.protocol.ws.api.AbstractWebSocketConnection.
> sendMessage(
> > AbstractWebSocketConnection.java:43)
> > at
> > org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster$1.run(
> > WebSocketPushBroadcaster.java:124)
> > at
> > org.apache.wicket.protocol.ws.WebSocketSettings$SameThreadExecutor.run(
> > WebSocketSettings.java:246)
> > at
> > org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster.process(
> > WebSocketPushBroadcaster.java:119)
> > at
> > org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster.broadcastAll(
> > WebSocketPushBroadcaster.java:109)
> > at
> > com.starjar.engine.LoggedInUserTrackerActor.broadcastStats(
> > LoggedInUserTrackerActor.scala:69)
> > at
> > com.starjar.engine.LoggedInUserTrackerActor$$
> > anonfun$receive$1.applyOrElse(LoggedInUserTrackerActor.scala:125)
> > at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
> > at
> > com.starjar.engine.LoggedInUserTrackerActor.aroundReceive(
> > LoggedInUserTrackerActor.scala:31)
> > at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
> > at akka.actor.ActorCell.invoke(ActorCell.scala:487)
> > at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
> > at akka.dispatch.Mailbox.run(Mailbox.scala:220)
> > at
> > akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(
> > AbstractDispatcher.scala:397)
> > at
> > scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
> > at
> > scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.
> > runTask(ForkJoinPool.java:1339)
> > at
> > scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
> > at
> > scala.concurrent.forkjoin.ForkJoinWorkerThread.run(
> > ForkJoinWorkerThread.java:107)
> >
> >
> >
> >
> >
> > [2] The broadcasting code running in my actor.
> >
> > private def buildLoggedInUserMessage(): CurrentlyLoggedInUsers = {
> >   val response = ... /* snip snip snip */
> >   response
> > }
> >
> > def broadcastStats(): Unit = {
> >   val application = WicketStarjarApplication.get()
> >   val webSocketSettings = WebSocketSettings.Holder.get(application)
> >   val broadcaster = new
> > WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry())
> >   broadcaster.broadcastAll(application, buildLoggedInUserMessage)
> > }
> >
> >
> >
> >
> >
> >
> > Thanks
> >
> > Peter.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --
> > Peter Henderson
> >
>



-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Web Socket Exceptions.

2016-11-02 Thread Peter Henderson
Hi  all.

wicket 7.3
tomcat 8.5.5


I'm starting to see many more exceptions in relation to web sockets.

[1]

I have a HttpSessionListener, which sends a message to an actor when a
session is destroyed  (aka user logout). The actor eventually broadcasts a
web socket message.

Am I doing something wrong in my code [2]?




[1]

oawpwa.AbstractWebSocketProcessor An error occurred during processing of a
WebSocket message
java.lang.IllegalArgumentException: Argument 'component' may not be null.
at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
at
org.apache.wicket.protocol.ws.api.WebSocketRequestHandler.(WebSocketRequestHandler.java:59)
at
org.apache.wicket.protocol.ws.WebSocketSettings.newWebSocketRequestHandler(WebSocketSettings.java:220)
at
org.apache.wicket.protocol.ws.api.AbstractWebSocketProcessor.broadcastMessage(AbstractWebSocketProcessor.java:245)
at
org.apache.wicket.protocol.ws.api.AbstractWebSocketConnection.sendMessage(AbstractWebSocketConnection.java:43)
at
org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster$1.run(WebSocketPushBroadcaster.java:124)
at
org.apache.wicket.protocol.ws.WebSocketSettings$SameThreadExecutor.run(WebSocketSettings.java:246)
at
org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster.process(WebSocketPushBroadcaster.java:119)
at
org.apache.wicket.protocol.ws.api.WebSocketPushBroadcaster.broadcastAll(WebSocketPushBroadcaster.java:109)
at
com.starjar.engine.LoggedInUserTrackerActor.broadcastStats(LoggedInUserTrackerActor.scala:69)
at
com.starjar.engine.LoggedInUserTrackerActor$$anonfun$receive$1.applyOrElse(LoggedInUserTrackerActor.scala:125)
at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
at
com.starjar.engine.LoggedInUserTrackerActor.aroundReceive(LoggedInUserTrackerActor.scala:31)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
at akka.actor.ActorCell.invoke(ActorCell.scala:487)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
at akka.dispatch.Mailbox.run(Mailbox.scala:220)
at
akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:397)
at
scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at
scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at
scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at
scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)





[2] The broadcasting code running in my actor.

private def buildLoggedInUserMessage(): CurrentlyLoggedInUsers = {
  val response = ... /* snip snip snip */
  response
}

def broadcastStats(): Unit = {
  val application = WicketStarjarApplication.get()
  val webSocketSettings = WebSocketSettings.Holder.get(application)
  val broadcaster = new
WebSocketPushBroadcaster(webSocketSettings.getConnectionRegistry())
  broadcaster.broadcastAll(application, buildLoggedInUserMessage)
}






Thanks

Peter.












-- 
Peter Henderson


Re: Repeat every 2 rows in a table

2016-10-14 Thread Peter Henderson
Hi

Change your markup to

...

..


   
   


   










On 14 October 2016 at 09:44, ganea iulia <superbiss...@gmail.com> wrote:

> Hello Per, thank you for the links.
>
> I have following html code:
>
> 
>   
>  width="100%">
> 
> 
> Name
> Code
> 
> 
> Id
> 
> 
> 
>
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
>
> The Java code looks like this:
>
> public TestPage(IModel model) {
> super(model);
>
> TestForm tst = new TestForm("testForm", model);
> tst.setOutputMarkupId(true);
> add(tst);
>
> }
>
> class TestForm extends Form {
> /**
> *
> */
> private static final long serialVersionUID = 1L;
>
> public TestForm(String id, IModel model) {
> super(id, model);
>
> List beans = Arrays.asList(new TestBean("Name1", "Code1", 1),
> new TestBean("Name2", "Code2", 2));
> 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 PropertyModel(item.getModel(), "id")));
> }
>   });
> }
>
> @Override
> protected void onSubmit() {
>
> logger.info("OnSubmit");
>
> }
> }
>
> The code crashes here because itemId belongs to another row.
> Could you please advise?
>
> Thank you
>
>
>
> On Fri, Oct 14, 2016 at 10:29 AM, Per Newgro <per.new...@gmx.ch> wrote:
>
> > Hello ganea,
> >
> > you can find many information about your problem at
> > http://examples7x.wicket.apache.org/index.html
> > espacially
> > http://examples7x.wicket.apache.org/repeater
> >
> > The user guide can you find here
> > https://ci.apache.org/projects/wicket/guide/7.x/
> > Repeaters are explained here
> > https://ci.apache.org/projects/wicket/guide/7.x/guide/repeaters.html
> >
> > You can add a markup container to a list view item and add the required
> > row components to it.
> >
> > Hope that helps
> > Per
> >
> >
> > Am 14.10.2016 um 09:16 schrieb ganea iulia:
> >
> >> Hello,
> >>
> >> I have in the html file, a table where I need to repeat every two rows.
> >> So, my table is backed by a bean, where the bean values fill 2 rows of
> the
> >> table.
> >> When new bean instance is created, I need to add new 2 rows to the
> table.
> >>
> >> Thank you
> >>
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: Style Sheet in page head

2016-07-07 Thread Peter Henderson
On Thu, Jul 7, 2016 at 2:02 PM, Francois Meillet <francois.meil...@gmail.com
> wrote:

> If you look at what is sent by Wicket   (open the Wicket Ajax Debug panel
> or use a debugging proxy like Charles Proxy),
> you will see
>
>
> 
> 
> 
> 
> 
> 
> 
> 
>
>
> The id and type with null value are just extrapolated and added by tools
> (firebugs and so on), but are not in the html page.
>

Beautiful.

The wicket server side code creates the correct response. The problem lies
in
wicket-ajax-jquery.js line 2121

// copy required attributes
css.id = node.getAttribute("id");
css.rel = node.getAttribute("rel");
css.href = node.getAttribute("href");
css.type = node.getAttribute("type");

// add element to head
Wicket.Head.addElement(css);

This code assumes the header item has attributes "id" and "type" and
blindly adds them to the new DOM.

Thanks François







> François
>
>
>
> > Le 7 juil. 2016 à 13:12, Peter Henderson <peter.hender...@starjar.com>
> a écrit :
> >
> > Thanks François
> >
> >
> >
> > On Thu, Jul 7, 2016 at 11:51 AM, Francois Meillet <
> > francois.meil...@gmail.com <mailto:francois.meil...@gmail.com>> wrote:
> >
> >> You don't define id and type so there are null.
> >>
> >> just add id="yourid" type="text/css"
> >>
> >> 
> >>  
> >> 
> >>
> >>
> > Although MDN shows examples without an id or type [1].
> > The examples shown by the  html5 standards [2] page also don't have type
> > and id for style sheets.
> >
> >
> >
> > [1]
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples <
> https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples>
> > [2]https://www.w3.org/TR/html5/document-metadata.html#the-link-element <
> https://www.w3.org/TR/html5/document-metadata.html#the-link-element>
> >
> >
> >
> >
> >> François
> >>
> >>
> >>
> >>> Le 7 juil. 2016 à 12:24, Peter Henderson <peter.hender...@starjar.com>
> >> a écrit :
> >>>
> >>> Hello,
> >>>
> >>>
> >>> I might have found a small bug.
> >>>
> >>> I have a control which has a style sheet link in its head section.
> >>> This control is used within a ListView but is initially hidden.
> >>> An ajax action causes the control to become visible.
> >>>
> >>> The style sheet link added to the page head looks malformed.
> >>>
> >>> 
> >>> 
> >>> 
> >>>
> >>> Full page reload corrects the header link.
> >>>
> >>> 
> >>> 
> >>> 
> >>>
> >>> Am I doing something wrong or is this a bug?
> >>>
> >>>
> >>> I've created a quick start which is available
> >>> https://github.com/bollinger/wicket-style-bug
> >>>
> >>>
> >>> Thanks
> >>>
> >>> --
> >>> Peter Henderson
> >>>
> >>> Director
> >>> Starjar Ltd.
> >>> www.starjar.com
> >>> 0330 088 1662
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org  users-unsubscr...@wicket.apache.org>
> >> For additional commands, e-mail: users-h...@wicket.apache.org  users-h...@wicket.apache.org>
> >>
> >>
> >
> >
> > --
> > Peter Henderson
> >
> > Director
> > Starjar Ltd.
> > www.starjar.com <http://www.starjar.com/>
> > 0330 088 1662
>
>


-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: Style Sheet in page head

2016-07-07 Thread Peter Henderson
Thanks François



On Thu, Jul 7, 2016 at 11:51 AM, Francois Meillet <
francois.meil...@gmail.com> wrote:

> You don't define id and type so there are null.
>
> just add id="yourid" type="text/css"
>
> 
>   
> 
>
>
Although MDN shows examples without an id or type [1].
The examples shown by the  html5 standards [2] page also don't have type
and id for style sheets.



[1]https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#Examples
[2]https://www.w3.org/TR/html5/document-metadata.html#the-link-element




> François
>
>
>
> > Le 7 juil. 2016 à 12:24, Peter Henderson <peter.hender...@starjar.com>
> a écrit :
> >
> > Hello,
> >
> >
> > I might have found a small bug.
> >
> > I have a control which has a style sheet link in its head section.
> > This control is used within a ListView but is initially hidden.
> > An ajax action causes the control to become visible.
> >
> > The style sheet link added to the page head looks malformed.
> >
> > 
> >  
> > 
> >
> > Full page reload corrects the header link.
> >
> > 
> >  
> > 
> >
> > Am I doing something wrong or is this a bug?
> >
> >
> > I've created a quick start which is available
> > https://github.com/bollinger/wicket-style-bug
> >
> >
> > Thanks
> >
> > --
> > Peter Henderson
> >
> > Director
> > Starjar Ltd.
> > www.starjar.com
> > 0330 088 1662
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Style Sheet in page head

2016-07-07 Thread Peter Henderson
Hello,


I might have found a small bug.

I have a control which has a style sheet link in its head section.
This control is used within a ListView but is initially hidden.
An ajax action causes the control to become visible.

The style sheet link added to the page head looks malformed.


  


Full page reload corrects the header link.


  


Am I doing something wrong or is this a bug?


I've created a quick start which is available
https://github.com/bollinger/wicket-style-bug


Thanks

-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: Use a Factory to create a Panel (Yay or Nay)?

2016-02-21 Thread Peter Henderson
On Thu, Feb 18, 2016 at 9:15 AM, Martin Grigorov 
wrote:

> On Thu, Feb 18, 2016 at 10:12 AM, Urbani, Edmund <
> edmund.urb...@lilandit.com
> > wrote:
>
> > Hello,
> >
> > I have at times used factories and then found that they made some simply
> > things more complicated. Eg. I could no longer simply override
> isEnabled()
> > or isVisible() methods to suit the page I was
> >
>
> Overriding isVisible/isEnabled() is a bad idea anyway!
> Use onConfigure() + setVisible/setEnabled instead.
>


Oh dear, I override isVisible/isEnabled quite a lot.
Why is it considered a bad idea?


Re: Wicket 7.1.0 breaks OnChangeAjaxBehavior on Select2

2015-10-28 Thread Peter Henderson
I've tried

Wicket 7.1.0 with
libraryDependencies += "org.wicketstuff" % "wicketstuff-select2" % "7.0.0"
withSources() withJavadoc()
and
libraryDependencies += "org.wicketstuff" % "wicketstuff-select2" % "7.1.0"
withSources() withJavadoc()


Wicket 7.0.0 with select2 7.0.0  (which works)


On Wed, Oct 28, 2015 at 12:34 PM, Maxim Solodovnik <solomax...@gmail.com>
wrote:

> BTW which wicket library for select2 are you using?
>
> On Wed, Oct 28, 2015 at 6:33 PM, Maxim Solodovnik <solomax...@gmail.com>
> wrote:
>
> > Will try to check later today
> > Please file ticket on the github, will try to address it ASAP
> >
> > On Wed, Oct 28, 2015 at 6:31 PM, Peter Henderson <
> > peter.hender...@starjar.com> wrote:
> >
> >> Hi fellow users.
> >>
> >> A quick heads up.
> >>
> >> I've just upgraded from wicket 7.0.0 to 7.1.0.
> >>
> >> It looks like something has broken
> >> OnChangeAjaxBehavior on Select2 form fields.
> >>
> >> Hopefully I'll be able to build a quickstart later.
> >>
> >>
> >>
> >>
> >> The exception for the record.
> >>
> >> org.apache.wicket.core.request.handler.ComponentNotFoundException:
> >> Component 'form:partFF:fg:fg_body:edit:location' has been removed from
> >> page.
> >> at
> >>
> >>
> org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:177)
> >> at
> >>
> >>
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:865)
> >> at
> >>
> >>
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
> >> at
> >>
> >>
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
> >> at
> >>
> >>
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
> >> at
> >>
> >>
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
> >> at
> >>
> >>
> org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:70)
> >> at
> >>
> >>
> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
> >> at
> >>
> >>
> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284)
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Peter Henderson
> >>
> >> Director
> >> Starjar Ltd.
> >> www.starjar.com
> >> 0330 088 1662
> >>
> >
> >
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>
>
>
> --
> WBR
> Maxim aka solomax
>



-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Wicket 7.1.0 breaks OnChangeAjaxBehavior on Select2

2015-10-28 Thread Peter Henderson
Hi fellow users.

A quick heads up.

I've just upgraded from wicket 7.0.0 to 7.1.0.

It looks like something has broken
OnChangeAjaxBehavior on Select2 form fields.

Hopefully I'll be able to build a quickstart later.




The exception for the record.

org.apache.wicket.core.request.handler.ComponentNotFoundException:
Component 'form:partFF:fg:fg_body:edit:location' has been removed from page.
at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:177)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:865)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:265)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:222)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:293)
at
org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:70)
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:203)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:284)









-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: Wicket 7.1.0 breaks OnChangeAjaxBehavior on Select2

2015-10-28 Thread Peter Henderson
Hi Gabriel,

Yes I think it is.

While cobbling together my quick start. I noticed my form group panel was
using a TransparentWebMarkupContainer.
Changing this to a WebMarkupContainer and my quick start works fine with
wicket 7.1.0

I've created an issued WICKET-6014
<https://issues.apache.org/jira/browse/WICKET-6014> with my quick start.


Peter.







On Wed, Oct 28, 2015 at 7:39 PM, Gabriel Landon <glan...@piti.pf> wrote:

> Maybe it is also related to the problem I'm having in 7.1.0 with wicket
> path
> and TransparentWebMarkupContainer
>
> See :
>
> http://apache-wicket.1842946.n4.nabble.com/wicket-7-1-0-change-in-wicket-path-with-TransparentWebMarkupContainer-tp4672400.html
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-7-1-0-breaks-OnChangeAjaxBehavior-on-Select2-tp4672402p4672415.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
>
>


-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: HttpServlet vs ServletWebRequest vs AbstractResource

2015-07-19 Thread Peter Henderson
On Sun, Jul 19, 2015 at 9:57 PM, Martin Grigorov mgrigo...@apache.org
wrote:

 Hi,

 Please read
 http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/
 On Jul 19, 2015 5:00 PM, Peter Henderson peter.hender...@starjar.com
 wrote:


Thanks Marin,

That's exactly what I described in my requirements. But my initial
impression of the solution is that: This is way too verbose from the image
users perspective.

Time to roll a new component new ActionImage(id: String, actionId: Int)
so the ActionImage{Servlet|Resource} implementation can be buried deeper
than an undead zombie.


Thanks guys

Peter.









  Hi guys.
 
  I have a choice and I'm looking for advice on choosing the correct
  solution.
 
 
  I need to send images which are stored outside of the my web application.
  I'd like the images to have a consistent URL (e.g.
  /School/resources/images/activities/123.png)
 
 
 
  Should I choose
 
  1) Native HttpServlet,
  Independent of Wicket
  I'd have to use an attribute modifier on my img tag to point to the
  Servlet
  Needs to be mounted via Servlet xml or via guice or another filter.
 
  2) Use ServletWebRequest
  I get access to the Wicket session if needed.
  Again have to use attribute modifier
  Cant be mounted within my applications .init()
 
  3) Use a resource
  These seem to work but I must be using them incorrectly.
  When mounting in the application I need a ResouceReference which needs to
  build my resource. But that build resource is never used.
  (gist https://gist.github.com/bollinger/b951ed7e85233188df9c)
 
  This approach is really nice from the image user point of view.
  add(new Image(img, new ActionImage(123))
 
 
 
  Your help is appreciated.
 
  Peter.
 
 
 
 
  --
  Peter Henderson
 
  Director
  Starjar Ltd.
  www.starjar.com
  0330 088 1662
 




-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: HttpServlet vs ServletWebRequest vs AbstractResource

2015-07-19 Thread Peter Henderson
Tobias

On Sun, Jul 19, 2015 at 9:38 PM, Tobias Soloschenko 
tobiassolosche...@googlemail.com wrote:

 Hi,

 Maybe this is what you are looking for?


 /wicket-core/src/main/java/org/apache/wicket/request/resource/UrlResourceReference.java


 https://ci.apache.org/projects/wicket/guide/6.x/guide/resources.html#resources_6


Thanks for looking.

The images are on the same server and not hosted elsewhere. So I need to
stream them to clients.
I don't think UrlResourceReference is suitable, I'd still need a servlet to
stream them.


Thanks

Peter.




 kind regards

 Tobias


 Am 19.07.15 um 21:59 schrieb Peter Henderson:

 Hi guys.

 I have a choice and I'm looking for advice on choosing the correct
 solution.


 I need to send images which are stored outside of the my web application.
 I'd like the images to have a consistent URL (e.g.
 /School/resources/images/activities/123.png)



 Should I choose

 1) Native HttpServlet,
 Independent of Wicket
 I'd have to use an attribute modifier on my img tag to point to the
 Servlet
 Needs to be mounted via Servlet xml or via guice or another filter.

 2) Use ServletWebRequest
 I get access to the Wicket session if needed.
 Again have to use attribute modifier
 Cant be mounted within my applications .init()

 3) Use a resource
 These seem to work but I must be using them incorrectly.
 When mounting in the application I need a ResouceReference which needs to
 build my resource. But that build resource is never used.
 (gist https://gist.github.com/bollinger/b951ed7e85233188df9c)

 This approach is really nice from the image user point of view.
 add(new Image(img, new ActionImage(123))



 Your help is appreciated.

 Peter.






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




-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


HttpServlet vs ServletWebRequest vs AbstractResource

2015-07-19 Thread Peter Henderson
Hi guys.

I have a choice and I'm looking for advice on choosing the correct solution.


I need to send images which are stored outside of the my web application.
I'd like the images to have a consistent URL (e.g.
/School/resources/images/activities/123.png)



Should I choose

1) Native HttpServlet,
Independent of Wicket
I'd have to use an attribute modifier on my img tag to point to the
Servlet
Needs to be mounted via Servlet xml or via guice or another filter.

2) Use ServletWebRequest
I get access to the Wicket session if needed.
Again have to use attribute modifier
Cant be mounted within my applications .init()

3) Use a resource
These seem to work but I must be using them incorrectly.
When mounting in the application I need a ResouceReference which needs to
build my resource. But that build resource is never used.
(gist https://gist.github.com/bollinger/b951ed7e85233188df9c)

This approach is really nice from the image user point of view.
add(new Image(img, new ActionImage(123))



Your help is appreciated.

Peter.




-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Re: [ANNOUNCE] Apache Wicket 6.20.0 adds InlineImage and CSRF prevention measure

2015-06-23 Thread Peter Henderson
On Wed, Jun 17, 2015 at 10:03 AM, Martijn Dashorst dasho...@apache.org
wrote:

 The Apache Wicket PMC is proud to announce Apache Wicket 6.20.0!


It looks like the main wicket.apache.org site needs an update to show that
version 6.20.0 is out.


Thanks for all the hard work guys

Peter.







-- 
Peter Henderson


Re: Render a component in a background thread.

2015-05-29 Thread Peter Henderson
On Fri, May 29, 2015 at 9:22 AM, Christoph Läubrich lae...@googlemail.com
wrote:

 Can you explain what is the reason for using a background-thread?
 Depending on your container you might want to use e.g. Continuations or
 Servlet-Async to compute lengthy values in the background and then let
 render the page as normal in the RequestCycle depending on that result.


In my real application the background thread is a data export routine. I
want to run a list panel with saved page parameters and instead of
rendering the html I'll access the underlying list model to extract the
data, export to csv (or json,etc) and pass it out for other processing.
This way the user can fiddle about with the search filters on the list to
see exactly what they want and later get the raw data (accountants love
spreadsheets).

For example.
This page [1] I'd like to have a plain servlet which can run the component
outside of wicket.


Peter.



[1]
https://demo.starjar.com:25000/Starjar/protected/project/1210005?rpp=25fn1=Description+Containsfn2=Date+%5Bmonth+year%5Dfv2=2015+1+1tab=Time+Sheets



 Am 28.05.2015 11:51, schrieb Peter Henderson:

 Hi

 I am trying to render a component in a background thread.

 My first attempt fails with an Exception
 There is no application attached to current thread Thread-4



 So I link the application with the background thread and now a different
 exception.
 java.lang.IllegalArgumentException: Argument 'requestCycle' may not be
 null.
  at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
  at

 org.apache.wicket.Application.fetchCreateAndSetSession(Application.java:1568)
  at org.apache.wicket.Session.get(Session.java:171)


 Is component renderer designed to work from a background thread?


 I've put a quick start on git hub.
 https://github.com/bollinger/wicket-ComponentRenderer








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




-- 
Peter Henderson

Director
Starjar Ltd.
www.starjar.com
0330 088 1662


Render a component in a background thread.

2015-05-28 Thread Peter Henderson
Hi

I am trying to render a component in a background thread.

My first attempt fails with an Exception
There is no application attached to current thread Thread-4



So I link the application with the background thread and now a different
exception.
java.lang.IllegalArgumentException: Argument 'requestCycle' may not be null.
at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
at
org.apache.wicket.Application.fetchCreateAndSetSession(Application.java:1568)
at org.apache.wicket.Session.get(Session.java:171)


Is component renderer designed to work from a background thread?


I've put a quick start on git hub.
https://github.com/bollinger/wicket-ComponentRenderer




-- 
Peter Henderson


Re: Not able to get Wicket Session even though WicketSessionFilter has been added

2014-07-17 Thread Peter Henderson
On 17 July 2014 09:24, Martin Grigorov mgrigo...@apache.org wrote:

 I'd suggest you to upgrade to something we support (1.5.11+).
 1.3.5 is very old. There is 1.3.7 but I cannot guarantee that it will solve
 the issue.

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


 On Thu, Jul 17, 2014 at 10:59 AM, rsi610 rahul.i...@lntinfotech.com
 wrote:

  Any suggestions on the above issue ?
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Not-able-to-get-Wicket-Session-even-though-WicketSessionFilter-has-been-added-tp4666469p434.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
 
 



​I was curious about when 1.3.5 was released. A little big of git magic.
(thanks to
http://stackoverflow.com/questions/6269927/how-can-i-list-all-tags-in-my-git-repository-by-the-date-they-were-created
)


refs/tags/wicket-1.3.5 Wed Oct 15 21:16:22 2008 +

Very old indeed.
​



-- 
Peter Henderson


Wicket 7 M1 different behaviour on button

2014-05-16 Thread Peter Henderson
Hi Wicket users.

It looks like Wicket 7 treats all button without a type attribute as
submit buttons (6.15 does not)

Would it be possible revert this? or at least add a warning log message
when button is missing the attribute?


I think the code should control if the button submits the form.
(AjaxSubmitLink or AjaxLink) not the type attribute.


I've attached a quick start




-- 
Peter Henderson


myproject.tar.gz
Description: GNU Zip compressed data

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

Re: Show textfield as plaintext when disabled?

2014-03-04 Thread Peter Henderson
Hi guys,


On 4 March 2014 18:39, Entropy blmulholl...@gmail.com wrote:

 What a great bunch of ideas.  I'll be implementing at least one of them.
 Thanks for all your ideas.  Does anyone have similar techniques for
 dropdowns?

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Show-textfield-as-plaintext-when-disabled-tp4664723p4664771.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


​
I'll add my 0.02 BTC worth.

I use the panel approach, which contains an edit form field and display
label.
Mainly because I tend to display additional information.

e.g.
MoneyDisplayEditField shows not only the amount but also the currency
25.99[GBP]
StockQty shows the units of the stock.  50 [units]
PartNumber a link in display mode, a fancy ajax chooser in edit mode.
PaymentTerms, a drop down in edit, link in display
etc.


Hope that helps.



Peter​


Re: AjaxLazyLoadPanel loading asynchronously

2014-01-29 Thread Peter Henderson
On 29 January 2014 12:28, Vishal Popat vishal.po...@cipriati.co.uk wrote:

 Hi,

 I have a situation where I have to make multiple REST calls to different
 suppliers.
 I currently am using AjaxLazyLoadPanel to make these calls but loading
 time is very slow and not scaleable if I wanted to add more suppliers.

 Is there a way to make AjaxLazyLoadPanel asynchronously?
 I have read some older posts on the forum but not sure if they are the
 best way in Wicket 6.
 Or is there an alternative approach?

 Many thanks
 Vishal


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


​You could try native web sockets​. Get your worker threads to broadcast a
message to the page, it ends up being very similar to an ajax update.






-- 
Peter Henderson


Re: AjaxFormComponentUpdatingBehavior works only on first element in a ListView

2014-01-04 Thread Peter Henderson
Hi Igor.

Try calling
listView.setReuseItems(true)

Hope that helps

Peter.






On 4 January 2014 17:09, Igor Dvorzhak idm...@gmail.com wrote:

 I am attaching AjaxFormComponentUpdatingBehavior to a DropDownChoice
 element in a ListView which displays a hidden panel on change event. It
 works for the first element in the ListView but not for subsequently added
 elements.

 I have tracked the cause:

 All subsequent AJAX behaviours are bounded to the first element, because
 all DropDownChoice elements in the ListView have the same generated HTML
 id.

 Actually when change event triggered on the first element the number of
 AJAX requests sent is equal to the number of elements in ListView.


 Does anybody know how to fix this?



Wicket 6.12 and wicket-native-websocket-javax

2013-12-18 Thread Peter Henderson
Is there a 6.X branch I can use which contains native javax websockets?



My git kung fu is letting me down. (Still only a white belt)

Thanks

Peter.


Re: Wicket 6.12 and wicket-native-websocket-javax

2013-12-18 Thread Peter Henderson
Hi Martin,

Tomcat 7.0.47 back ported javax websockets from 8.
Which means wicket-native-websocket-tomcat no longer works
(well I couldn't get it working but I didn't try too hard)


Wicket 7 sounds lovely.


Many thanks

Peter.


On 18 December 2013 11:23, Martin Grigorov mgrigo...@apache.org wrote:

 Hi,

 https://twitter.com/mtgrigorov/status/364323832490110976

 The main problem is that JSR 356 API and all impls are build with JDK7, and
 Wicket 6.x uses JDK 1.6 ...
 But it seems this is not a problem for the -jetty9 module. The build works
 (somehow) without problems.
 If there are no objections from others then I can port the module to
 wicket-6.x branch.

 But why do you prefer the -javax impl ?
 The Wicket Native WebSocket APIs for Jetty and Tomcat are the same, the
 only difference is the WicketFilter impl you should use.


 Martin Grigorov
 Wicket Training and Consulting


 On Wed, Dec 18, 2013 at 1:09 PM, Peter Henderson 
 peter.hender...@starjar.com wrote:

  Is there a 6.X branch I can use which contains native javax websockets?
 
 
 
  My git kung fu is letting me down. (Still only a white belt)
 
  Thanks
 
  Peter.
 



Re: Thanks!

2013-12-06 Thread Peter Henderson
Totally agree too!.

After trying several Java web frameworks, finally selected Wicket. ~2 years
later and I've ported a huge legacy swing client to a very nice web app.
(in Scala too. but that's another story).

Many thanks guys.

Peter.


On 6 December 2013 13:49, Bas Gooren b...@iswd.nl wrote:

 Hi *,

 I have to say, the more I work with wicket, the happier I become. A big
 thank you! to both the excellent developers and those helping others on
 the mailing list! Wicket is a truly amazing piece of kit.

 Having recently played with a number of other frameworks for real
 production apps, wicket continues to impress me. Even after using it for
 years in rather big projects.
 I love the whole less magic is better-attitude and configurability.

 --

 Met vriendelijke groet,
 Kind regards,

 Bas Gooren




Re: upgrade from 1.5 to Wicket 6 Form field issue and Ajax Link

2013-11-18 Thread Peter Henderson
Hi,

Another approach. Add OnChangeAjaxBehavior or
AjaxFormComponentUpdatingBehavior to the fields to keep the server side up
to date.

Peter.


On 18 November 2013 12:57, Martin Grigorov mgrigo...@apache.org wrote:

 Hi,

 AjaxLink does not submit values.
 Use AjaxSubmitLink or AjaxButton instead.


 On Mon, Nov 18, 2013 at 2:51 PM, lucast lucastol...@hotmail.com wrote:

  Dear Forum,
  I have a main form and within this form, I have two fields: a drop-down
  list
  and a text field followed by an ajax-link which is meant to add the
 values
  from two fields to a list (scenario described in previous
  AjaxFormComponentUpdatingBehavior( change ) on a DropDownChoice
  
 
 http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-quot-change-quot-on-a-DropDownChoice-td4660065.html
  
  post).
 
  On the form, I change the value of the drop down list and the integer
 text
  field.
  But when I click on the ajax-link, the value from the integer text field
 is
  set to its original value (of 1). Even after I have manually changed the
  value on the form, I still get the default value of 1.
  The drop-down list behaves with no problem, though.
 
  I have tried every single function available on wicket, from
  getConvertedInput() to getValue().
 
  This only occurs on wicket 6.
 
  If I click on the submit button, instead of the ajax-link, then I get the
  updated value from the form and not the default value from the integer
 text
  field.
 
  How can I get the updated value that I enter on the form, when I click on
  the ajax-link?
 
  Thanks in advance,
  Lucas
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/upgrade-from-1-5-to-Wicket-6-Form-field-issue-and-Ajax-Link-tp4662497.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
 
 




-- 
Peter Henderson

Director
Starjar Ltd.
0330 088 1662
www.starjar.com


Re: Bizarre undentified error resulting in blank page

2013-11-07 Thread Peter Henderson
Hi,

Just a though.
Could it be the constructor of the base class calling abstract methods,
before the child instance has been initialized fully? I've done that a
couple of times and it produces some very weird results.

Peter.





On 7 November 2013 03:33, Rafael Barrera Oro boraf...@gmail.com wrote:

 Hello!

 I've stumbled across a tricky one, i am getting a blank screen withouth any
 error in the logs, the only thing i can observe is the following javascript
 error on the js console:

 *Uncaught TypeError: Cannot call method 'appendChild' of
 null wicket-ajax-debug.js:207*

 *GET http://localhost:8080/lars/app/src/debug.js
 
 http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A8080%2Flars%2Fapp%2Fsrc%2Fdebug.jssa=Dsntz=1usg=AFQjCNFTx3mceKhWiXKl1lTEwHaeEdOAyQ
 
 404
 (Not Found)*

 This only happens if development mode is set in the web.xml of the
 project (the js error happens because document.body is null).

 I still don't know if this the cause or a consequence of whatever is going
 wrong.

 The really weird thing is the error does not happen if i comment certain
 lines of code within a class all pages in the project inherit from, these
 lines invoke some getters for attributes of the page, set a few
 pageParameters properties and retrieve the session to do stuff. For
 example, there is a line that is quite like the following:

 PageParameters pageParameters = getBean().getParameters();

 To my amazement, if i comment it out and replace it for, lets say...

 PageParameters pageParameters = new PageParameters();

 everything goes smoothly...

 Has anyone ran across something similar?

 Thanks in advance!
 Rafael




-- 
Peter Henderson

Director
Starjar Ltd.
0330 088 1662
www.starjar.com


Re: How to pre-populate a file in FileUpload field using wicket 6.9

2013-08-26 Thread Peter Henderson
I think you will find this is prevented by the browser for security reasons.

A naughty web app could fill in the upload with say /etc/passwd which
would be bad.

Peter.


On 25 August 2013 12:12, eeshan.laddha eeshan.lad...@gmail.com wrote:

 How to per-populate a file in FileUpload field using wicket 6.9?



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-pre-populate-a-file-in-FileUpload-field-using-wicket-6-9-tp4661067.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




-- 
Peter Henderson

Director
Starjar Ltd.
0330 088 1662
www.starjar.com


Sharing Bookmarkable pages.

2013-07-22 Thread Peter Henderson
When a user emails a link to another user sometimes the wrong page is
rendered.

Alice sends
http://starjar.com/Part/123?111
to Bob who is was recently looking at
http://starjar.com/Order/456?111


Instead of seeing the part page he see the order page.
I assume this is because of the page version ?111 parameter.

The pages are mounted.

mountPage(/Order, classOf[OrderPage])
mountPage(/Part, classOf[PartPage])

and each page uses the page parameters to extract the id at index 0


  def decode(parameters: PageParameters): Id = {
try {
  val idValue = parameters.get(0).toInt;
 

Should I be mounting the pages differently to prevent the wicket page
revision version overriding the mount path?




-- 
Peter Henderson


Re: Sharing Bookmarkable pages.

2013-07-22 Thread Peter Henderson
Hmm. My initial description is incorrect.

Alice sends  /Order/123?8 to Bob.
Bob was recently looking at /Order/222?8

Bob shows a url of /Order/123?8  but is actually viewing /Order/222

I used 2  browsers (firefox+chromium) to reproduce.
I am using wicket 6.8

Should I be mounting the pages with some form of place holder to indicate I
am using index parameters?



Peter




On 22 July 2013 13:50, Sven Meier s...@meiers.net wrote:

 Hi,

 I cannot reproduces the problem here, which Wicket version are you using?

 Note that PageProvider#getStoredPage(**int) has a safety check to make
 sure the page classes matches.

 Sven


 On 07/22/2013 01:38 PM, Peter Henderson wrote:

 When a user emails a link to another user sometimes the wrong page is
 rendered.

 Alice sends
 http://starjar.com/Part/123?**111 http://starjar.com/Part/123?111
 to Bob who is was recently looking at
 http://starjar.com/Order/456?**111 http://starjar.com/Order/456?111


 Instead of seeing the part page he see the order page.
 I assume this is because of the page version ?111 parameter.

 The pages are mounted.

  mountPage(/Order, classOf[OrderPage])
  mountPage(/Part, classOf[PartPage])

 and each page uses the page parameters to extract the id at index 0


def decode(parameters: PageParameters): Id = {
  try {
val idValue = parameters.get(0).toInt;
   

 Should I be mounting the pages differently to prevent the wicket page
 revision version overriding the mount path?






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




Re: A Wicket in Ruby

2013-06-27 Thread Peter Henderson
 for
  viruses.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 
  EMAIL DISCLAIMER This email message and its attachments are confidential
 and may also contain copyright or privileged material. If you are not the
 intended recipient, you may not forward the email or disclose or use the
 information contained in it. If you have received this email message in
 error, please advise the sender immediately by replying to this email and
 delete the message and any associated attachments. Any views, opinions,
 conclusions, advice or statements expressed in this email message are those
 of the individual sender and should not be relied upon as the considered
 view, opinion, conclusions, advice or statement of this company except
 where the sender expressly, and with authority, states them to be the
 considered view, opinion, conclusions, advice or statement of this company.
 Every care is taken but we recommend that you scan any attachments for
 viruses.
 
  -
  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




-- 
Peter Henderson

Director
Starjar Ltd.
0330 088 1662
www.starjar.com


Field with OnChangeAjaxBehavior Not updating.

2012-05-04 Thread Peter Henderson
) {
  return ;
}

if (negativeShowCR  o.compareTo(BigDecimal.ZERO)0) {
  return String.format(%.2f CR, o.abs());
}

return String.format(%.2f, o);
  }
}



= HomePage.html =
!DOCTYPE html
html xmlns:wicket=http://wicket.apache.org;
head
meta charset=utf-8 /
titleApache Wicket Quickstart/title
link href='
http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,bold'
rel='stylesheet' type='text/css' /
link rel=stylesheet href=style.css type=text/css
media=screen title=Stylesheet /
/head
body

form wicket:id=someForm

  div wicket:id=feedback/div

  table

tr
  tdWith OnUpdate/td
  tdWithout OnUpdate/td
/tr

tr
  tdinput wicket:id=withTF type=number/td
  tdinput wicket:id=withoutTF type=number/td
/tr

tr
  tdbutton wicket:id=withBtnPress Me/button/td
  tdbutton wicket:id=withoutBtnPress Me/button/td
/tr

tr
  td
This TextField has required=True and an OnChangeAjaxBehaviorbr
Press Button, everything works finebr
Empty the text field (blank value), then press button,br
field does not get updated to the value loaded from the DB
  /td
  td
This TextField has required=True but no OnChangeAjaxBehaviorbr
Press Button, everything works finebr
empty the text field, then press button updates OK.
  /td
/tr


tr
  td colspan=2
Is this a bug or am I doing something wrong?
  /td
/tr

  /table
/form


/body
/html




-- 
Peter Henderson