Preventing AJAX behavior to execute during page reload

2020-03-06 Thread Sebastian Lichtenfels
Hi all,

I have a problem with an AJAX behavior that I have on a stateful page. The 
behavior is triggered by the user by clicking a button (the button is outside 
my control).
The behavior then does some backend action on the server and afterwards reloads 
the page (by calling RequestCycle.get().setResponsePage(page.getPageClass(), 
page.getPageParameters());, where page is the the current page).
My problem now is that it can happen that the user clicks the button twice 
which results in the following sequence of calls:

1.   First behavior is triggered on page version 1

2.   Backend action is done

3.   Server sends 302 to reload page

4.   Second behavior is triggered (still for page version 1)

5.   Backend is done for second behavior

6.   Client cancels AJAX request for second behavior, because of the page 
redirect -> so no additional page reload here

7.   Page render is triggered by the page reload

My goal is to always reload the page if the backend action is triggered, 
because the page's state depends on the backend state.
So either the second behavior should not be triggered at all or it should be 
correctly executed (meaning backend action AND page reload should be triggered).
How can I achieve this?

Best regards,
Sebastian


Re: Redirect to relative URL

2013-02-23 Thread Sebastian Gaul
This is exactely what I tried. The problem is, that RedirectRequestTarget
handles the URL as context-specific (but it is domain-specific). Using
external links (as mentioned on the website) is not an option, because the
redirect is based on internal settings rather than user interaction.

Any other idea?

2013/2/22 Bernard bht...@gmail.com

 You will find solutions under these subjects:

 redirect to an external non-Wicket page
 redirect to an external URL

 e.g.

 https://cwiki.apache.org/WICKET/how-to-redirect-to-an-external-non-wicket-page.html

 Regards,

 Bernard

 On Fri, 22 Feb 2013 17:06:09 +0100, you wrote:

 Hello,
 
 I have a server-relative URL like /target/index (starting with a slash)
 and
 I'm looking for a way to redirect to http://mydomain.com*/target/index*.
 
 In Wicket (unfortunately still 1.4) I tried the following:
 
 RequestCycle.get().setRequestTarget(
 new RedirectRequestTarget(/target/index)
 );
 
 Unfortunately Wicket thinks that the root slash refers to the Wicket
 application rather than the server's root. Therefore the redirect ends up
 here:
 
 http://mydomain.com/*wicketapp*/target/index
 *
 *
 I don't want Wicket to change my URL, so the Servlet should redirect to
 http://mydomain.com/target/index.  Any ideas how to achieve that?


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




Redirect to relative URL

2013-02-22 Thread Sebastian Gaul
Hello,

I have a server-relative URL like /target/index (starting with a slash) and
I'm looking for a way to redirect to http://mydomain.com*/target/index*.

In Wicket (unfortunately still 1.4) I tried the following:

RequestCycle.get().setRequestTarget(
new RedirectRequestTarget(/target/index)
);

Unfortunately Wicket thinks that the root slash refers to the Wicket
application rather than the server's root. Therefore the redirect ends up
here:

http://mydomain.com/*wicketapp*/target/index
*
*
I don't want Wicket to change my URL, so the Servlet should redirect to
http://mydomain.com/target/index.  Any ideas how to achieve that?


Re: Twenty-Six Wicket Tricks Book

2013-02-22 Thread Sebastian Gaul
If somebody else wants to know it: He is not planning to finish his book.
In fact, he never really started writing it:
http://codeact.wordpress.com/coding/comment-page-1/#comment-85


2013/2/15 Ian Marshall ianmarshall...@gmail.com

 You could always visit the Coding: On Software Design Process section of
 Jonathan's blog (it's an excellent book, by the way) and ask him your
 question from there.

 Ian


 Sebastian Gaul wrote
  I cannot find anything related there. His blog started long after the
  book.
  Am 14.02.2013 14:51 schrieb Ian Marshall lt;

  IanMarshall.UK@

  gt;:
 
  Perhaps a good source of information is Jonathan's blog at:
 
 http://codeact.wordpress.com lt;http://codeact.wordpress.comgt;
 
  Ian
 
 
  Sebastian Gaul wrote
   Does anyone know what happened to the book Twenty-Six Wicket Tricks
   by Jonathan Locke? Some code looks very promising and I would like to
   read it. However, the code seems to be very old and I cannot find any
   way to purchase the book. Is the project still alive?
  
   http://code.google.com/p/twenty-six-wicket-tricks/
  
   -
   To unsubscribe, e-mail:
 
   users-unsubscribe@.apache
 
   For additional commands, e-mail:
 
   users-help@.apache
 
 
 
 
 
  --
  View this message in context:
 
 http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail:

  users-unsubscribe@.apache

  For additional commands, e-mail:

  users-help@.apache

 
 





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656414.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: Twenty-Six Wicket Tricks Book

2013-02-15 Thread Sebastian Gaul
I cannot find anything related there. His blog started long after the book.
Am 14.02.2013 14:51 schrieb Ian Marshall ianmarshall...@gmail.com:

 Perhaps a good source of information is Jonathan's blog at:

http://codeact.wordpress.com http://codeact.wordpress.com

 Ian


 Sebastian Gaul wrote
  Does anyone know what happened to the book Twenty-Six Wicket Tricks
  by Jonathan Locke? Some code looks very promising and I would like to
  read it. However, the code seems to be very old and I cannot find any
  way to purchase the book. Is the project still alive?
 
  http://code.google.com/p/twenty-six-wicket-tricks/
 
  -
  To unsubscribe, e-mail:

  users-unsubscribe@.apache

  For additional commands, e-mail:

  users-help@.apache





 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Twenty-Six-Wicket-Tricks-Book-tp4656357p4656367.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: How to null-check manually converted TextField values?

2013-02-14 Thread Sebastian Gaul
Thanks Fred, that's what I found yesterday night after hours of
searching, too. However, I think I'll go with Sebastiens approach,
because it unifies converter and validation check.

Thanks to both of you!

2013/2/14 Fred!!! schreibf...@googlemail.com:
 Hi,

 an other solution is to add a NullAcceptingValidator to your Textfield. Thus
 wicket will pass to IValidator.validate(IValidatable)

 See
 http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/validation/INullAcceptingValidator.html

 Cheers Fred

 Am 14.02.2013 00:55, schrieb Sebastien:

 Hi,

 Well, the required flag ensures that the input is not empty, not that it
 is
 of the correct type...

 If the conversion fails, is it supposed (I guessed) to throw a
 ConversionException.
 As it seems to not be the case, I would have overridden convert input as
 follow (not tested):

 class MyJodaDateTextField
 {
 protected void convertInput()
 {
  super.convertInput();

  Date value = this.getConvertedInput();

  if (value == null)
  {
  //handles the error message
  ValidationError error = new ValidationError();
  error.addKey(MyJodaDateTextField.ConversionError);
 //wicket6
  //error.addMessageKey(MyJodaDateTextField.ConversionError);
 //wicket1.5
  error.setVariable(date, value);
  this.error(error);
   }
  }
 }

 MyJodaDateTextField.properties will contain:
 MyJodaDateTextField.ConversionError='${date}' is not a valid Joda datetime

 Also pay attention to check the type in getConverter

  {
  if (Date.class.isAssignableFrom(type))
  {
  return (IConverterC)new JodaDateTimeConverter();
  }

  return super.getConverter(type);
  }


 Hope this helps,
 Sebastien.

 On Wed, Feb 13, 2013 at 4:46 PM, Sebastian Gaul
 sebast...@mgvmedia.comwrote:

 I have a TextField which overrides it's getConverter method to add a
 Joda time converter instead:

 new TextFieldP(id) {
  @Override
  public P IConverterP getConverter(ClassP type) {
  return (IConverterP) new JodaDateTimeConverter();
  }
 };

 The converter returns null if input was invalid. However, I want to be
 able to flag this field as required, and I don't know how to do that:

   - textField.isRequired(true) does not work, because required checks
 are done before conversion. This doesn't work for non-empty but
 invalid inputs.

   - textField.add(.. some validator ..) does not work because no
 validator is called if the converter returned null.

 I really don't see an approach to flag my date fields as required. Do
 you know how to do that? Probably my approach is not suited at all?

 -
 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


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



Twenty-Six Wicket Tricks Book

2013-02-14 Thread Sebastian Gaul
Does anyone know what happened to the book Twenty-Six Wicket Tricks
by Jonathan Locke? Some code looks very promising and I would like to
read it. However, the code seems to be very old and I cannot find any
way to purchase the book. Is the project still alive?

http://code.google.com/p/twenty-six-wicket-tricks/

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



How to null-check manually converted TextField values?

2013-02-13 Thread Sebastian Gaul
I have a TextField which overrides it's getConverter method to add a
Joda time converter instead:

new TextFieldP(id) {
@Override
public P IConverterP getConverter(ClassP type) {
return (IConverterP) new JodaDateTimeConverter();
}
};

The converter returns null if input was invalid. However, I want to be
able to flag this field as required, and I don't know how to do that:

 - textField.isRequired(true) does not work, because required checks
are done before conversion. This doesn't work for non-empty but
invalid inputs.

 - textField.add(.. some validator ..) does not work because no
validator is called if the converter returned null.

I really don't see an approach to flag my date fields as required. Do
you know how to do that? Probably my approach is not suited at all?

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



wicketstuff-core 1.5.2 released?

2011-11-02 Thread Sebastian

Hi,

I can see a wicketstuff-core 1.5.2 release in the maven-repo, however in 
github no tag exists and no formal announcement has been made. So my 
question is, what's in it and what happened to the regular announcement?


Regards,

Seb


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



Re: wicketstuff-core 1.5.2 released?

2011-11-02 Thread Sebastian
I'm talking about wicketstuff http://wicketstuff.org/, not wicket. The 
releases used to be announced here too.


On 02.11.2011 12:13, nino martinez wael wrote:

it's right on the homepage:

http://wicket.apache.org/

But are you thinking of a announcement here on the list?

2011/11/2 Sebastiannospam...@gmx.net


Hi,

I can see a wicketstuff-core 1.5.2 release in the maven-repo, however in
github no tag exists and no formal announcement has been made. So my
question is, what's in it and what happened to the regular announcement?

Regards,

Seb


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








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



Re: wicketstuff-core 1.5.2 released?

2011-11-02 Thread Sebastian
wicketstuff 1.5.2 has been released already: 
http://repo1.maven.org/maven2/org/wicketstuff/wicketstuff-core/1.5.2/


However, especially if - as you say - anyone can do this, it is even 
more relevant to understand the release's state and the included changes.


On 02.11.2011 12:31, Martin Grigorov wrote:

Wicket is released, but WicketStuff is not yet.
Usually Michael releases it but I guess anyone can do it by following
his  howto release steps in the wiki.

On Wed, Nov 2, 2011 at 1:13 PM, nino martinez wael
nino.martinez.w...@gmail.com  wrote:

it's right on the homepage:

http://wicket.apache.org/

But are you thinking of a announcement here on the list?

2011/11/2 Sebastiannospam...@gmx.net


Hi,

I can see a wicketstuff-core 1.5.2 release in the maven-repo, however in
github no tag exists and no formal announcement has been made. So my
question is, what's in it and what happened to the regular announcement?

Regards,

Seb


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












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



Re: wicketstuff-push examples working across browsers

2011-10-27 Thread Sebastian

hi Soheb,

no problem. I gave it a try this morning on IE9 and it also failed with 
the current push version in trunk. I just committed a change that makes 
it work in IE. 
https://github.com/wicketstuff/core/commit/3e09edf3e21fdb039cdb844e88653ccfdd33a4c4


Regards,

Seb

On 27.10.2011 15:58, Soheb Mahmood wrote:

I just read my email again and I sounded really rude when asking my question. 
What I mean to ask was, out of curiousity, if you were trying to get the IE7 
browser+ working?

I'm really sorry if I've offended you or anyone. I'm very embarrassed by that 
tone in the email (it's not what I actually meant to say), and I really do 
appreciate your hard work and effort towards wicketstuff (as I have seen on 
git).

Soheb

- Original Message -
From: Sebastiannospam...@gmx.net
To: users@wicket.apache.org
Sent: Wednesday, 26 October, 2011 5:21:52 PM
Subject: Re: wicketstuff-push examples working across browsers

hi,

cometd had a bug that affects websocket support in conjunction with
chrome browsers. It is fixed in the latest 1.4.0RC1 release of cometd.
We incorporated the changes (and fixed some other issues) in wicketstuff
trunk. thus they will be available with the wicketstuff 1.5.2 release.

Regards,
Seb

On 26.10.2011 10:25, Soheb Mahmood wrote:

Hello everyone,

I'm planning to use wicketstuff-core in an actual production environment, and 
to be more specific, I'm planning to use push-cometd. I'm currently using 
wicketstuff version 1.4.14 to match the current version of Wicket we are using 
in production.

I got the example to run, and one of the things I wondered was what is the 
browser support aimed for push-cometd? So far, I can only get the cometd 
example working in Firefox and Opera, and there is a lack of support for Google 
Chrome 14.0.835.202 nor Internet Explorer 7. I can get the Wicket Timer example 
working, but the reason we are thinking of implementing comet into production 
is to minimize the request impact on our server, and with the Wicket Timer 
example, that uses TimerPushService, which if we wanted similar functionality, 
we could just use AjaxTimeoutBehavior instead. Even the Basic Cometd test 
doesn't work under IE7 and Chrome.

I was wondering if you were aware of this, and if you had any suggestions to 
solve this cross-browser issue (at least from our end). It's also worth noting 
that I haven't modified the push-parent-jdk-1.6 folder contents at all.

Many thanks,
Soheb

-
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


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






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



Re: wicketstuff-push examples working across browsers

2011-10-26 Thread Sebastian

hi,

cometd had a bug that affects websocket support in conjunction with 
chrome browsers. It is fixed in the latest 1.4.0RC1 release of cometd. 
We incorporated the changes (and fixed some other issues) in wicketstuff 
trunk. thus they will be available with the wicketstuff 1.5.2 release.


Regards,
Seb

On 26.10.2011 10:25, Soheb Mahmood wrote:

Hello everyone,

I'm planning to use wicketstuff-core in an actual production environment, and 
to be more specific, I'm planning to use push-cometd. I'm currently using 
wicketstuff version 1.4.14 to match the current version of Wicket we are using 
in production.

I got the example to run, and one of the things I wondered was what is the 
browser support aimed for push-cometd? So far, I can only get the cometd 
example working in Firefox and Opera, and there is a lack of support for Google 
Chrome 14.0.835.202 nor Internet Explorer 7. I can get the Wicket Timer example 
working, but the reason we are thinking of implementing comet into production 
is to minimize the request impact on our server, and with the Wicket Timer 
example, that uses TimerPushService, which if we wanted similar functionality, 
we could just use AjaxTimeoutBehavior instead. Even the Basic Cometd test 
doesn't work under IE7 and Chrome.

I was wondering if you were aware of this, and if you had any suggestions to 
solve this cross-browser issue (at least from our end). It's also worth noting 
that I haven't modified the push-parent-jdk-1.6 folder contents at all.

Many thanks,
Soheb

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






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



Re: [wicketstuff-push] How to disconnect cleanly?

2011-10-21 Thread Sebastian

hi,

we fixed it in trunk now. please give it a try.

regards,

seb

On 12.10.2011 11:18, vineet semwal wrote:

thank you martin !

  herald ,i have opened a issue for you
https://github.com/wicketstuff/core/issues/66
thank you !

On Wed, Oct 12, 2011 at 2:19 PM, Martin Grigorovmgrigo...@apache.org  wrote:

On Wed, Oct 12, 2011 at 11:13 AM, vineet semwal
vineetsemwal1...@gmail.com  wrote:

there is no need for the api change,its a bug and i think wicket-stuff
push developers will make that change there in
uninstallNode(component,node) ,they might be busy ..

they should be notified
add an issue in GitHub


On Wed, Oct 12, 2011 at 12:50 PM, Harald Wellmann
hwellmann...@googlemail.com  wrote:

I'm currently doing timer.stop() in my application code before calling
uninstallNode(), but that requires copying code from the private
method TimerPushService._findPushBehavior(). So it seems the API could
do with a couple of extensions for this case...

Best regards,
Harald

2011/10/11 vineet semwalvineetsemwal1...@gmail.com:

i think its better to do timerpushbehavior.stop() instead of
component.remove(behavior)
inside uninstallNode(component,node) but it might require other changes too ..


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






--
thank you,

regards,
Vineet Semwal

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






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

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










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



Re: Update Component automatically without extending Session life

2011-09-23 Thread Sebastian Lütge
As a workaround / alternate solution to my problem of eventually terminating
a session that is kept alive by an AjaxSelfUpdatingTimerBehavior I'm
currently trying to update a TextField via JavaScript (detecting user
activity) and then passing this timestamp to wicket.
My question now is: how do I send the field's content to the server
periodically? A separate attached TimerBehavior does not submit the field.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Update-Component-automatically-without-extending-Session-life-tp3827329p3837425.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: ModalX: Modal Window Enhancements library (Open Source) for wicket

2011-08-04 Thread Sebastian

Hi,

the live demo does not seem to work. Getting the following exception, no 
matter which link I click.


Cheers,
Seb

Root cause:

java.lang.NullPointerException
at 
com.sas.ui.wicket.modal.optional.ModalXPage.allocateModalWindow(ModalXPage.java:139)

at com.sas.ui.modal.example.HomePage$3.onClick(HomePage.java:83)
at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:68)
at 
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)
at 
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:302)
at 
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:157)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at 
org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
at 
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)

at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
at java.lang.Thread.run(Thread.java:619)


On 04.08.2011 11:12, Chris Colman wrote:

Hello Fellow Wicketers,

Step Ahead Software has made available new sample code and a live demo
of our open source ModalX wicket library that provides a convenient and
efficient way of defining and using modal windows/forms/message boxes in
Wicket based applications.

ModalX is a very lightweight library and can be easily integrated into
new or existing Wicket applications in just a few minutes.

The aim of the project was to make Modal Windows in wicket as easy to
define and use as they are in traditional desktop development frameworks
like MFC, .net, OWL, Swing, etc.,

You can try the live demo at:
http://demo.visualclassworks.com/modalx/

You can read more at the ModalX page on the Visual Classworks page:
http://www.visualclassworks.com/content/list/o/76914/type/modalx

Chris Colman
Visual Classworks Division
Step Ahead Software

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






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



Re: wicketstuff-push Documentation?

2011-07-04 Thread Sebastian

Hi Jake,

there is currently not any more documentation.

When you use push as decribed in the WIKI (EventHandler+PushNode) then 
you will need an additional message dispatching service (which often is 
the case in enterprise environments). If you want to communicate within 
a wicket application only, e.g. between pages or users, than you can use 
the channel feature provided by push: you create a named messaging 
channel using IPushService.createChannel(Name), connect the node you 
installed into a component to that channel using 
IPushService.connectToChannel(Node,Channel) and send events to a 
channel using IPushService.publish(Channel, Event).


Regards,

Seb

On 04.07.2011 20:48, jbrookover wrote:

Hey all,

Just explored the wicketstuff-push examples.  Everything works great.

The only problem is that I'm overwhelmed with the code.  I'm new to
pushing; I had no idea what Comet was before yesterday.  I understand the
fundamentals of AjaxTimerBehavior polling, but push-timer and push-core go
way beyond that: channels, listeners, etc.

Question: Is there documentation beyond the GitHub Wiki and the
push-examples module?

If not, I'll just dive in the old fashioned way, but I was hoping to get a
better understanding before doing so.  In return, I'll try to put some
JavaDoc in the source as I start playing around.

Thanks!

Jake

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicketstuff-push-Documentation-tp3644319p3644319.html
Sent from the Users forum mailing list archive at Nabble.com.

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






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



Re: regarding wicketstuff push

2011-06-23 Thread Sebastian

hi vineet,

you are right. this is probably a left over from the refactoring we did. 
I just fixed it on github.


regards,

seb

On 23.06.2011 22:58, vineet semwal wrote:

hellos !

i was just looking at wicketstuff push and i saw a lot of changes in
api and other improvements are done ,thanks for all that ! :)
as very new to the new push, could not understand the below channel
creation call..

  publicEventType  IPushChannelEventType  createChannel(final
EventType event,final String label)

why does a new channel creation needs event ?

i have also looked at the code i noticed event is just not used in
the channel creation method in AbstractPushService :|

i think method declaration can be improved or may be i am missing something ??







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



Re: facebook like notification

2011-06-19 Thread Sebastian
You can use the wicketstuff-push component 
https://github.com/wicketstuff/core/wiki/Push which can either use a 
polling approach or cometd to update clients based on server-side events.


Seb

On 19.06.2011 11:50, Noven wrote:

Hi All..

Newbie need guide , I just registered and this is my first post.

I am facing problem about creating a facebook like notification.
Like if your friend tag someone in your photos, there will be a
notification appeared on your facebook page.

My problem actually, I can't manage the user session/application state.
I have successfully presented my feedback message into jGrowl like here

The real scenario is :
There are 2 role of user in my application, a user and a supervisor.
When the user create something via a form, a notification appeared on
the supervisor page lively.

My question is how I can trigger the notification (which is a
feedback message) appears on the supervisor page. Where I have to put my
code, override some method in wicket application class?

I am sorry if there is a similar question like mine before.

Thanks,
Noven




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



Re: Moving wicketstuff to github

2010-12-28 Thread Sebastian

Hi Martijn,

can we commit to wicketstuff again? If so, where: sf.net or github?

Regards,

Seb

On 23.12.2010 11:04, Martijn Dashorst wrote:

All,

Last week we (wicket+wicketstuff devs) had a discussion on dev@ and
decided to move all wicketstuff code to github.com. Reasons to move to
github are:

  - using git
  - social features for interacting with grander community (merging,
pull requests, forking)
  - integrated wiki, issue tracker (no more maintenance for confluence/jira)

The import is currently running (albeit slowly) and as a consequence
we have disabled write access to the SVN repository at sourceforge.

We'll let you know when we're up and running again.

Martijn

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






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



Re: webapp shutdown listeners

2010-12-02 Thread Sebastian
we are working on an extension for wicket apps and want to make the 
usage as easy as possible for users. When in usage, the extension should 
be able to register itself to a webapp shutdown event transparently 
without requiring the user do modify their webapps onDestroy method or 
need to add a ServletContextListener. because this has the potential 
that the user forgets to add this potentially resulting in memory leaks 
on webapp restart.



On 02.12.2010 10:38, alex shubert wrote:

Why dont you add you very own listener to servlet container?







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



Re: webapp shutdown listeners

2010-12-02 Thread Sebastian

That is cool!

From the docs at 
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/IInitializer.html:


public interface IInitializer

Initializes something when application loads. ...

You don't have to pre-register package resources, as they can be 
initialized lazily.


Initializers can be configured by having a wicket.properties file in the 
class path root, with property 'initializer=${initializer class name}'. 
You can have one such properties per jar file, but the initializer that 
property denotes can delegate to other initializers of that library.


If an initializer also implements IDestroyer, the instance will be kept 
for destroying, so that it may clean up whatever it did when initializing.



On 02.12.2010 22:13, Rodolfo Hansen wrote:

The correct way, I believe is using the IDestryer (and Iinitializer) along
with the correct wicket.properties in the classpath.

On Thu, Dec 2, 2010 at 3:16 AM, Sebastiannospam...@gmx.net  wrote:


we are working on an extension for wicket apps and want to make the usage
as easy as possible for users. When in usage, the extension should be able
to register itself to a webapp shutdown event transparently without
requiring the user do modify their webapps onDestroy method or need to add a
ServletContextListener. because this has the potential that the user forgets
to add this potentially resulting in memory leaks on webapp restart.



On 02.12.2010 10:38, alex shubert wrote:


Why dont you add you very own listener to servlet container?







-
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



webapp shutdown listeners

2010-12-01 Thread Sebastian

Hi,

is there a generic way to add one or multiple wicket app shutdown 
listener to a wicket application instance without having to override the 
onDestroy method and roll my own listener registration code?


Regards,

Seb


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



Re: Wicket design incompatible with Web 2.0 ?

2010-11-15 Thread Sebastian
Thanks for sharing. I like the graceful Websocket fallback of Atmosphere 
in case the server or the client do not support it.


However it looks like the approach discussed in the blog entry is very 
low-level, meaning you have to work with JavaScript directly etc. to 
actually do updates (but I may be wrong here).


wicket-push (which also comes with a cometd implementation) on the other 
hand allows you to update page components the type-safe Wicket way by 
working on an AjaxRequestTarget.


Here is an example: 
http://wicketstuff.org/confluence/display/STUFFWIKI/wicket-push


Regards,

Seb

On 15.11.2010 15:06, Josh Kamau wrote:

Hi guys,

I came across this.

http://jfarcand.wordpress.com/2010/10/07/writing-websocket-application-using-apache-wicket/

regards.



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



Re: Free wicket from component hierarchy hell

2010-11-09 Thread Sebastian
From my understanding the proposal works like this that you have a 
partially code controlled hierarchy of components when you need it for 
functional reasons (security, AJAX refresh, visibility, etc). You can 
define the parent of a component but technical you allow child 
components being nested at will in the HTML markup (below that code 
controlled parent). So if you do parent.add(component) you say that the 
component must be either added as a direct or indirect child to this 
parent = if you do parent.setVisible(false) all childs will still be 
invisible no matter how they are nested among themselves.


So you give the HTML designer a bit more freedom in layouting components 
below a given code controlled parent. I think that would be a reasonable 
approach.



 On 09.11.2010 17:05, Carl-Eric Menzel wrote:

On Tue, 9 Nov 2010 17:46:13 +0200
Martin Makundimartin.maku...@koodaripalvelut.com  wrote:


@Carl-Erik
Reason why I haven't commented your enabledInHierarchy comment is
because it would not afect it in any way.

I hope the proposition will be clear when we have it ready. We are
working on Igor's proposal.


It will be interesting to see how you propose not affecting something
that depends on the hierarchy when you remove the hierarchy.

Carl-Eric
www.wicketbuch.de

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






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



Re: Free wicket from component hierarchy hell

2010-11-09 Thread Sebastian
On the other hand if you only have to do component nesting 
programmatically in case of functional reasons (like security) your code 
will probably much cleaner and you'll realize issues like using the 
wrong parent faster.


Instead of:
myComponent.add(child1)
child1.add(child2)
child2.add(child3)
child2.add(child4)
myComponent.setVisible(false / true)

You do:
myComponent.add(child1)
myComponent.add(child2)
myComponent.add(child3) // correct direct parent determined by markup
myComponent.add(child4) // correct direct parent determined by markup
myComponent.setVisible(false / true)

On 09.11.2010 18:17, James Carman wrote:

On Tue, Nov 9, 2010 at 12:06 PM, Martin Makundi
martin.maku...@koodaripalvelut.com  wrote:


(You) as a coder will be responsible for opening that can ;] For good
and for bad. Not wicket. Nor members of this discussion.



How many times have you done this:

add(new TextField(...))

when you meant to do:

someSubComponent.add(new TextField(..))

With add, you'll get an exception if the ids/hierarchy don't match up.
  Now, what if you're queueing instead?  Suppose the user does:

queue(new TextField(...))

which will work perfectly fine, but they meant to do (to enforce security):

someSubComponent.queue(new TextField(...))

Now, since security is not enforced the designer has the freedom to
move stuff around and royally hose things up.

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






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



Re: Free wicket from component hierarchy hell

2010-11-08 Thread Sebastian
I'm sorry to say, but the whole discussion makes little sense to me and 
these attempts to fix something that is not broken actually scares me a bit.


As far as I understand the philosophy of Wicket it is a Java centric and 
Java code drive web application framework. This makes it very unique to 
all other approaches I've seen so far.


The component hierarchy defined in the code means more than just to 
layout the components right for the markup. It for example also defines 
the visibility hierarchy which is important for security and usability, 
and defines the update hierarchy when doing component refreshs via AJAX. 
It simply is not right to allow the designer to move around components 
at will which are cascaded in the code with good functional reasons.


So what I want to say is, the hierarchy defined in the markup only 
represents one aspect of the hierarchy defined in the code and as such 
is NOT a good source to build the runtime component hierarchy on. Also I 
would not like to have a traditional way and another way to define 
hierarchies in Wicket as this will only cause confusion. I prefer the 
Python philosphy there should be one — and only one — obvious way to do 
something.


Regards,

Seb

On 07.11.2010 00:45, Igor Vaynberg wrote:

here is a proper very rough initial implementation:

https://github.com/ivaynberg/wicket/commit/cbe861f4028120993f5d10d575f12c4ca291fdce

now someone has to mature it to the point where it can be properly evaluated.

-igor

On Sat, Nov 6, 2010 at 6:54 AM, samketsam...@gmx.com  wrote:

We need to wait until all components are added so that we can arrange

them into correct hireracy before rendering.

May I suggest that components are added with help of a builder object, for 
example:

public MyPanel(String id) {
super(id);
Builder b = new Builder(this); // the Builder gets reference to this MyPanel
b.add(new TextField(name)); // can be child of form which is added later
b.add(new SomeForm(form));
b.build(); // after this line this MyPanel contains the components name and form
}

If MyPanel's super class needs to access the same builder, it can provide a 
constructor for it. In that case b.build() should be only invoked in MyPanel's 
constructor.

If a developer uses more than one builder in a constructor, he can restrict 
moving of components in markup to some extent:

public MyPanel(String id) {
super(id);
Builder b1 = new Builder(this);
b1.add(new TextField(name)); // in markup, name can't be put under form 
because it's in a different builder
b1.build();
Builder b2 = new Builder(this);
b2.add(new SomeForm(form);
b2.build();
}

Of course this doesn't solve the problem Igor mentioned. For that you'd need the 
old-fashioned way:

public MyPanel(String id) {
super(id);
SomeForm form = new SomeForm(form);
form.add(new TextField(name); // in markup, name can't be moved out from 
form
add(form);
}

Developers would need to mix different approaches for building hierarchies if 
security is an issue. On second thought, I should use a broader term than 
security because there is more than one reason to restrict those pesky 
designers ;)

-
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






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



Re: Free wicket from component hierarchy hell

2010-11-08 Thread Sebastian

Vigor,

as I understand the readme the queue method basically has only a 
slightly different behavior compared to the add method in the way that 
it either adds a component as a direct child to the parent or as a 
sub-child as defined in the markup. So the markup is only used to 
determine the child's location below a given (code controlled) parent. 
This means if you replace the current add method with the behavior of 
the queue method, existing code will still work and we would not have 
two separate ways to add components. That sounds like a good solution.


@Martin: please start arguing with the given arguments and stop moaning. 
Thanks.


Regards,
Seb

On 08.11.2010 17:28, Igor Vaynberg wrote:

it is not about fixing something that isnt broken, its about making it
easier. anyways, i just updated the readme in my experimental branch
that explains the solution a bit more:
https://github.com/ivaynberg/wicket/tree/component-queuing

-igor

On Mon, Nov 8, 2010 at 8:23 AM, Vitaly Tsaplinvitaly.tsap...@gmail.com  wrote:

I'm sorry to say, but the whole discussion makes little sense to me and
these attempts to fix something that is not broken actually scares me a bit.


+1

-
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






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



Re: Free wicket from component hierarchy hell

2010-11-08 Thread Sebastian
...and that makes the queue method a candidate to replace the add method 
without breaking anything.


Regards,

Seb

On 08.11.2010 18:03, Igor Vaynberg wrote:

On Mon, Nov 8, 2010 at 8:58 AM, Martin Makundi
martin.maku...@koodaripalvelut.com  wrote:

as I understand the readme the queue method basically has only a slightly
different behavior compared to the add method in the way that it either adds
a component as a direct child to the parent or as a sub-child as defined in
the markup. So the markup is only used to determine the child's location
below a given (code controlled) parent. This means if you replace the
current add method with the behavior of the queue method, existing code will
still work and we would not have two separate ways to add components. That
sounds like a good solution.

@Martin: please start arguing with the given arguments and stop moaning.
Thanks.


I would argue that it is not completely safe to _replace_ add method
with queue method. As Igor pointed out before, we might want to define
security boundaries: componentA must be inside componentB. Such code
should be implemented either traditionally or otherwise the new way of
adding components via queue must implement a security feature that
allows restricting child components inside a certain parent component
in a fluid but robust manner.


thats exactly what it does, as my readme file explains in the git branch...

-igor



Plain queue implementation, however, is a very good starting point to
begin studying various ways of imposing security boundaries.

**
Martin


On 08.11.2010 17:28, Igor Vaynberg wrote:


it is not about fixing something that isnt broken, its about making it
easier. anyways, i just updated the readme in my experimental branch
that explains the solution a bit more:
https://github.com/ivaynberg/wicket/tree/component-queuing

-igor

On Mon, Nov 8, 2010 at 8:23 AM, Vitaly Tsaplinvitaly.tsap...@gmail.com
  wrote:


I'm sorry to say, but the whole discussion makes little sense to me and
these attempts to fix something that is not broken actually scares me a
bit.


+1

-
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






-
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




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






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



Re: wicket 1.4.12 and wicket-push 1.4.8

2010-11-02 Thread Sebastian
As part of wicketstuff 1.4.13 we have the new implementation released 
now. give it a try and also check the examples since the API has changed.


Regards,

seb
On 01.11.2010 19:35, fachhoch wrote:


I am using wicket 1.4.12 and wicket-push 1.4.8 , will this combination work
fine  or can cause any issues ?
I cannot upgrade to wicket push   to 1.4.12 because of bugs .
Please   tell me if it is ok to use this combination ?




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



Re: Bug in Wicket Push TimerChannelService when used with background threads

2010-10-01 Thread Sebastian
I just realized that the current session is also bound to the thread 
context. Would it make sense to attach the Session to the background 
thread using the same way we do it for the Application?


E.g.

Session oldSession = Session.exists() ? Session.get() : null;
Session.set(_session);
try
{
... invoke...
}
finally
{
   if (oldSession == null) Session.unset();
   else Session.set(oldSession);
}

Without doing this, the exception IllegalSateException: You can only 
locate or create sessions in the context of a request cycle may be thrown.


Seb

On 01.10.2010 00:42, Rodolfo Hansen wrote:

On Thu, 2010-09-30 at 23:48 +0200, Sebastian wrote:


There was an issue in your patch where the application could be left

in the ThreadContext, which was fixed,

Hi Rodolfo,

I think you are referring to

try {
Application.set(_application);
methods[m].invoke(o, parameters);
} finally {
Application.set(originalApplication);
if (originalApplication != null) Application.set(originalApplication);
}

The problem is if this code is executed in a separate thread the
originalApplication will be null. If you just omit the null check in the
finally clause the setter will throw an IllegalArgumentException. So to
remove the app from the ThreadContext we would have to call
Application.unset() instead:

if (originalApplication == null) Application.unset();
else Application.set(originalApplication);



you are right, although i checked the source for set and didn't see the
throw...

amended in the 1.4 branches




Regards,
Seb



On 30.09.2010 23:08, Rodolfo Hansen wrote:

Hi Sebastian, your patch is in:

trunk (1.5)
1.4 branch (future 1.4.13 release)
and 1.4.12

There was an issue in your patch where the application could be left in
the ThreadContext, which was fixed,
as well as a simplification in the trigger function.

On Wed, 2010-09-29 at 21:39 +0200, Sebastian wrote:


Hi,

there is a problem in the Push TimerChannelService implementation:
Callbacks do not work reliable when they are invoked from non-Web
threads. The There is no application attached to current thread
WicketRuntimeException will occur in such a case. The attached patch
fixes this issue.

Regards,

Seb








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



Wicket Serialization

2010-10-01 Thread Sebastian

Hi,

is it possible to configure a wicket app in a way that definitely will 
use page serialization/deserializion on each request and will not hold 
any page/component instances between requests in memory? I'd like to use 
this during development time to test some aspects of my wicket components.


regards,
seb


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



Re: Wicket Serialization

2010-10-01 Thread Sebastian

hi,

on a local copy of Wicket I now temporarily modified the 
SecondLevelCacheSessionStore class and always have the 
SecondLevelCachePageMap.getLastPage() method return null. This enforces 
that a freshly deserialized page object instance is used on each request.


The reason why I am doing this is that e.g. the wicketstuff wicket-push 
projects keeps references to component instances in singleton services, 
e.g. the TimerPushService. Modifications on these components between 
requests only work as long wicket will reuse the same object instances 
on the next request. Since an HTTP session may be serialized by an app 
server between requests based an some 2nd level caching strategy it is 
important to simulate this to detect code that relies on specific object 
references and thus may break in such a case.


seb

On 01.10.2010 16:43, Igor Vaynberg wrote:

wicket already tests serialization for you in dev mode

-igor

On Fri, Oct 1, 2010 at 5:37 AM, Sebastiannospam...@gmx.net  wrote:

Hi,

is it possible to configure a wicket app in a way that definitely will use
page serialization/deserializion on each request and will not hold any
page/component instances between requests in memory? I'd like to use this
during development time to test some aspects of my wicket components.

regards,
seb


-
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






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



Re: Wicket Serialization

2010-10-01 Thread Sebastian
the push service does not directly keep references, this happens because 
of the usage of anonymous classes created within the components, e.g. 
callbacks, eventlisteners, e.g.:


final Label label = new Label(label,);

final IPushTarget pushTarget = getTimerPushService().installPush(this);
backendService.doStuff(new ProgressListener() {
  public void onEventChange(final Event event) {
if (pushTarget.isConnected()) {
label.setDefaultModelObject(event.message);
pushTarget.addComponent(label);
pushTarget.trigger();
}
}

= this will work as long as the current page does not get deserialized 
between request. the backendService gets the listener object which in 
turn has a reference to the label. as long as one can not enforce during 
dev time that pages are really deserialized you have no really chance to 
encounter the problem and thus fix it.



On 02.10.2010 00:40, Igor Vaynberg wrote:

sounds wrong, no one should be keeping references to components

-igor

On Fri, Oct 1, 2010 at 3:32 PM, Sebastiannospam...@gmx.net  wrote:

hi,

on a local copy of Wicket I now temporarily modified the
SecondLevelCacheSessionStore class and always have the
SecondLevelCachePageMap.getLastPage() method return null. This enforces that
a freshly deserialized page object instance is used on each request.

The reason why I am doing this is that e.g. the wicketstuff wicket-push
projects keeps references to component instances in singleton services, e.g.
the TimerPushService. Modifications on these components between requests
only work as long wicket will reuse the same object instances on the next
request. Since an HTTP session may be serialized by an app server between
requests based an some 2nd level caching strategy it is important to
simulate this to detect code that relies on specific object references and
thus may break in such a case.

seb

On 01.10.2010 16:43, Igor Vaynberg wrote:


wicket already tests serialization for you in dev mode

-igor

On Fri, Oct 1, 2010 at 5:37 AM, Sebastiannospam...@gmx.netwrote:


Hi,

is it possible to configure a wicket app in a way that definitely will
use
page serialization/deserializion on each request and will not hold any
page/component instances between requests in memory? I'd like to use this
during development time to test some aspects of my wicket components.

regards,
seb






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



Re: How to use jWicket ResizableBehavior

2010-09-30 Thread Sebastian
Looks like there is a problem in the ResizableBehaviour class. It does 
not ensure that the necessary jQuery CSS is added to the markup. Since 
the method that could do this has protected visibility I need to 
subclass the ResizableBehaviour like this:


ResizableBehaviour resizer = new ResizableBehaviour(){{ 
addUserProvidedResourceReferences(AbstractJqueryUiEmbeddedBehaviour.jQueryUiBaseCss); 
}};

myComponent.add(resizer);

Seb

On 29.09.2010 19:08, Sebastian wrote:

Hi,

I'd like to make a DIV resizable. The JavaDoc of ResizableBehavior says
I just need to add a new behavior instance to a Wicket component (in my
case a WebMarkupContainer) to make it resizable. Doing so results in my
HTML output referencing the minified jquery libs and containing code
like jQuery('mydiv#2').resizable(...). However the DIV did not change
at all and it is not resizable. What do I miss?

Thanks,
Seb


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






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



Re: Bug in Wicket Push TimerChannelService when used with background threads

2010-09-30 Thread Sebastian
 There was an issue in your patch where the application could be left 
in the ThreadContext, which was fixed,


Hi Rodolfo,

I think you are referring to

try {
  Application.set(_application);
  methods[m].invoke(o, parameters);
} finally {
  Application.set(originalApplication);
  if (originalApplication != null) Application.set(originalApplication);
}

The problem is if this code is executed in a separate thread the 
originalApplication will be null. If you just omit the null check in the 
finally clause the setter will throw an IllegalArgumentException. So to 
remove the app from the ThreadContext we would have to call 
Application.unset() instead:


if (originalApplication == null) Application.unset();
else Application.set(originalApplication);

Regards,
Seb



On 30.09.2010 23:08, Rodolfo Hansen wrote:

Hi Sebastian, your patch is in:

trunk (1.5)
1.4 branch (future 1.4.13 release)
and 1.4.12

There was an issue in your patch where the application could be left in
the ThreadContext, which was fixed,
as well as a simplification in the trigger function.

On Wed, 2010-09-29 at 21:39 +0200, Sebastian wrote:


Hi,

there is a problem in the Push TimerChannelService implementation:
Callbacks do not work reliable when they are invoked from non-Web
threads. The There is no application attached to current thread
WicketRuntimeException will occur in such a case. The attached patch
fixes this issue.

Regards,

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








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



How to use jWicket ResizableBehavior

2010-09-29 Thread Sebastian

Hi,

I'd like to make a DIV resizable. The JavaDoc of ResizableBehavior says 
I just need to add a new behavior instance to a Wicket component (in my 
case a WebMarkupContainer) to make it resizable. Doing so results in my 
HTML output referencing the minified jquery libs and containing code 
like jQuery('mydiv#2').resizable(...). However the DIV did not change 
at all and it is not resizable. What do I miss?


Thanks,
Seb


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



Wicket Push for Java 5?

2010-09-29 Thread Sebastian

Hi,

why is the wicket push module available in the Maven repo1 compiled with 
Java 6? I checked out the code and cannot find a single usage of any new 
Java 6 features (except the @Override annotation used on methods of 
implemented interfaces).


I'm currently working in an environment where only Java 5 is allowed. 
all other wicket components retrieved via Maven repo1 work fine here.


Regards,
Seb


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



Re: Wicket Push for Java 5?

2010-09-29 Thread Sebastian

Hi Mike,

thanks for your resoponse. Maybe you can just have the push-comet module 
being compiled with Java 6? I am using the push.timer implementation 
currently. I recompiled it using Java5 and it works fine.


Regards,

Seb

On 29.09.2010 19:55, Michael O'Cleirigh wrote:

Hi Sebastian,

Its related to the dependencies of the wicketstuff-push. When I switched
the wicketstuff build to use a real JDK 5 instead of JDK 6 in
compatibility mode errors like this were seen:

[INFO]

[INFO] Error for project: Wicketstuff Push (during deploy)
[INFO]

[INFO] Compilation failure
/home/wicket/.hudson/jobs/Wicket Stuff
Core/workspace/wicketstuff-core/push-parent/push/src/main/java/org/wicketstuff/push/cometd/CometdService.java:[11,-1]
cannot access org.cometd.bayeux.Channel
bad class file:
/home/wicket/.m2/repository/org/cometd/java/bayeux-api/2.0.0.RC2/bayeux-api-2.0.0.RC2.jar(org/cometd/bayeux/Channel.class)

class file has wrong version 50.0, should be 49.0
*
*This is why the project was moved to be built by java 6 instead of java 5.

Regards,

Mike
*
*

Hi,

why is the wicket push module available in the Maven repo1 compiled
with Java 6? I checked out the code and cannot find a single usage of
any new Java 6 features (except the @Override annotation used on
methods of implemented interfaces).

I'm currently working in an environment where only Java 5 is allowed.
all other wicket components retrieved via Maven repo1 work fine here.

Regards,
Seb


-
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



Reporting bugs for Wicketstuff components

2010-09-29 Thread Sebastian

Hi,

where can I report bugs for wicketstuff components?

Regards,

Seb


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



Bug in Wicket Push TimerChannelService when used with background threads

2010-09-29 Thread Sebastian

Hi,

there is a problem in the Push TimerChannelService implementation: 
Callbacks do not work reliable when they are invoked from non-Web 
threads. The There is no application attached to current thread 
WicketRuntimeException will occur in such a case. The attached patch 
fixes this issue.


Regards,

Seb
Index: push/src/main/java/org/wicketstuff/push/timer/TimerChannelBehavior.java
===
--- push/src/main/java/org/wicketstuff/push/timer/TimerChannelBehavior.java 
(revision 5552)
+++ push/src/main/java/org/wicketstuff/push/timer/TimerChannelBehavior.java 
(working copy)
@@ -50,6 +50,7 @@
  * appropriately the resources associated with the page.
  * 
  * @author Xavier Hanin
+ * @author Sebastian Thomschke fixed There is no application attached to 
current thread
  * 
  * @see IChannelService
  * @see TimerChannelService
@@ -157,12 +158,12 @@
 */
public void invoke(final Object o) throws 
IllegalArgumentException,
IllegalAccessException, 
InvocationTargetException {
-   final Application originalApplication = 
Application.get();
+   final Application originalApplication = 
Application.exists() ? Application.get() : null;
try {
Application.set(_application);
methods[m].invoke(o, parameters);
} finally {
-   Application.set(originalApplication);
+   if (originalApplication != null) 
Application.set(originalApplication);
}
}
}
@@ -175,8 +176,8 @@
/**
 * Construct.
 */
-   public DelayedMethodCallList() {
-   _application = Application.get();
+   public DelayedMethodCallList(final Application application) {
+   _application = application;
calls = new ArrayListDelayedMethodCall();
}
 
@@ -185,8 +186,8 @@
 * 
 * @param dmcl
 */
-   public DelayedMethodCallList(final DelayedMethodCallList dmcl) {
-   _application = Application.get();
+   public DelayedMethodCallList(final DelayedMethodCallList dmcl, 
final Application application) {
+   _application = application;
calls = new ArrayListDelayedMethodCall(dmcl.calls);
}
 
@@ -253,7 +254,7 @@
 * A trigger currently being constructed, waiting for a call to 
trigger
 * to go to the triggers list.
 */
-   private final DelayedMethodCallList currentTrigger = new 
DelayedMethodCallList();
+   private final DelayedMethodCallList currentTrigger;
/**
 * The Wicket Application in which this target is used
 */
@@ -275,6 +276,7 @@
this.application = application;
this.id = id;
this.timeout = timeout;
+   this.currentTrigger = new 
DelayedMethodCallList(application);
}
 
/**
@@ -337,7 +339,7 @@
if (currentTrigger.isEmpty()) {
return;
}
-   trigger = new 
DelayedMethodCallList(currentTrigger);
+   trigger = new 
DelayedMethodCallList(currentTrigger, application);
currentTrigger.clear();
}
final ListDelayedMethodCallList triggers = 
getTriggers();

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

Re: OT: Best practices regarding service layers DAOs

2010-08-30 Thread Sebastian

Alexander,

If I understand you correctly, you are saying: view-only operations (e.g.
listings, search forms) can access the DAOs directly, and all operations
that modify data should be routed through the service layer?
How do you deal with enforcing security constraints (e.g. user X with role Y
can only see records created by himself)? I'd like to keep such things out
of the view (wicket), so that when I also want to expose say a webservice or
REST interface I do not need to duplicate the constraints checks and
enforcement.

Brian,

I'm using warp-persist (which will be superseded by guice-persist shortly),
which provides transactional semantics comparable to Spring. This is also
one of the reasons I started building services: to have a clear boundary for
transactions.
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/OT-Best-practices-regarding-service-layers-DAOs-tp2400408p2400503.html
Sent from the Wicket - User 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



OT: Best practices regarding service layers DAOs

2010-08-30 Thread Sebastian

Hi all,

I've been struggling with some design questions in some wicket projects
lately, and hope to get some insights from fellow wicketeers.

Some years ago I started with Databinder as a DAO layer, without a service
layer. This led to UI code building queries or adding Restrictions to a jpa
(hibernate) query.
After working like that on some smaller projects, I came across warp-persist
and started using that (plus guice). Great! many new possibilities.
However, ever since I started using those tools, I have ended up with the
following:

- JPA Entities
- DAO interface per entity, with a (guice-bound) implementation
- UI either calls DAO methods directly for loading data, or specialized
IDataProvider implementation which takes a DAO and allows the UI to add
filters (e.g. a filter based on a search by name field).
- Service layer which is more or less based on the Transaction script
pattern (as described by Martin Fowler); this contains specific use cases,
such as cases where multiple objects need to be dealt with in a separate
transaction (@Transactional)

However, the above gets messy quickly. There are different ways to get to
the data: in some cases the UI calls DAOs directly, and sometimes a service
should be used since it does extra filtering etc.

So lately I started to wonder if I should make the UI only call the service
layer... Which would lead to a lot of extra classes and code which merely
forwards calls to the DAOs. Especially when combined with IDataProvider it
leads to a lot of UI-specific (findByXandY, findCountByXandY) methods in
both the DAO and service layer.

I decided to take a step back and re-evaluate. I only work on projects for
my own firm (so no external projects), and unfortunately do not have access
to people who have experience with these sorts of architectural design
issues. Well, of course there is the option of outsourcing, which I've tried
in a few projects; But let's just say that the resulting apps were by no
means well designed, even though the price was relatively high (small
project, 40.000 euro cost).

Recently I picked up Domain Driven Design by Eric Evans, and I like what I
am reading. Since most of my projects are small, I don't want to add many
layers to make things more complicated. However, I do want separation of
concerns (e.g. a clear boundary/layer for security, transactions). Injecting
services into my entities seems wrong to me, and I certainly don't want to
go the RoR ActiveRecord direction (all logic in entities, been there didn't
like it).

Since the projects are small, the effects of relatively unclean code are
negligible. On the other hand I am a purist (and a perfectionist), eager to
learn and improve; Also, some projects become more and more important (e.g.
handling millions of dollars worth of transactions), and keep on growing. 

Due to lack of experience in bigger projects I feel like I keep on
struggling with this without having a clear focus. It would really help me
to hear from other how they layer their wicket apps and why.

Thanks in advance for reading, and for posting a reply!
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/OT-Best-practices-regarding-service-layers-DAOs-tp2400408p2400408.html
Sent from the Wicket - User 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



Using up/down/remove links of ListView items clears text fields

2010-08-14 Thread Sebastian

Hi,

I am trying to use a list view component on a page where rows with text 
fields can be added, removed or moved around. I am using the removeLink, 
moveUpLink and moveDownLink methods of the listview to create the 
respective links for each list item.
The problem is that even when I enable the reuseListItems option, on 
using any of these links the text fields forget the recently entered 
data (raw input) and revert to the values of the backing model.


This issue does not occur when I am adding rows the list view.

Below is an example. I can add rows using the Add Row button. When I 
enter text into the text fields, when I use the links next to a row, the 
content of any text field is cleared.


Any suggestions?

Regards,

Seb

/ PAGE /
import java.util.*;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.markup.html.list.*;
import org.apache.wicket.model.*;

public class ListViewPage extends WebPage {
  public static class Row {
public String key;
public String value;
  }

  private final ListRow rows = new ArrayListRow();

  public ListViewPage(final PageParameters parameters) {

add(new FormListRow(rowsForm).

  add(new Button(addRowButton) {
public void onSubmit() { rows.add(new Row()); }
  }.setDefaultFormProcessing(false)).

  add(new ListViewRow(rowsList, new 
PropertyModelListRow(this, rows)) {

protected void populateItem(final ListItemRow item) {
  final Row row = item.getModelObject();

  item.add(new Label(index, new 
AbstractReadOnlyModelInteger() {

   public Integer getObject() { return item.getIndex() + 1; }
  }));

  item.add(new RequiredTextFieldString(key, new 
PropertyModelString(row, key)));


  item.add(new TextFieldString(value, new 
PropertyModelString(row, value)));


  item.add(removeLink(removeRowLink, item));
  item.add(moveUpLink(moveUpLink, item));
  item.add(moveDownLink(moveDownLink, item));
}
  }.setReuseItems(true)));
  }
}

/ HTML /
html
headtitleListView Test/title/head
body
  form wicket:id=rowsForm
  button wicket:id=addRowButtonAdd Row/button
  tabletr wicket:id=rowsList
 tdnbsp;nbsp;nbsp;#span wicket:id=index1/span/td
 tdKey: input type=text wicket:id=key //td
 tdValue: input type=text wicket:id=value //td
 td
a href=# wicket:id=moveUpLink[uarr;]/a
a href=# wicket:id=moveDownLink[darr;]/a
a href=# wicket:id=removeRowLink[X]/a
 /td
  /tr/table
  input type=submit value=Submit /
/form
/body
/html


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



Re: Using up/down/remove links of ListView items clears text fields

2010-08-14 Thread Sebastian

Hi Martin,

thanks for pointing me to the reuse component concept. It solved my 
problem partially but not completely. The problem is, that the links 
provided by the listview result in HTTP GET request which means that any 
values recently entered will not be transferred back and get lost. I am 
now using my own link implementations based on the SubmitLink class. I 
am attaching all files of my working example as reference.


Generally I think it makes great sense to have this behaviour as part of 
the ListView. At least I expected it to work this way in the first place.


Regards,

Seb

On 14.08.2010 16:40, Martin Makundi wrote:

Hi!

You can solve this in a robust manner using reusemanager:

http://osdir.com/ml/users-wicket.apache.org/2010-08/msg00161.html

2010/8/14 Sebastiannospam...@gmx.net:

Hi,

I am trying to use a list view component on a page where rows with text
fields can be added, removed or moved around. I am using the removeLink,
moveUpLink and moveDownLink methods of the listview to create the respective
links for each list item.
The problem is that even when I enable the reuseListItems option, on using
any of these links the text fields forget the recently entered data (raw
input) and revert to the values of the backing model.

This issue does not occur when I am adding rows the list view.

Below is an example. I can add rows using the Add Row button. When I enter
text into the text fields, when I use the links next to a row, the content
of any text field is cleared.

Any suggestions?

Regards,

Seb

/ PAGE /
import java.util.*;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.markup.html.list.*;
import org.apache.wicket.model.*;

public class ListViewPage extends WebPage {
  public static class Row {
public String key;
public String value;
  }

  private final ListRow  rows = new ArrayListRow();

  public ListViewPage(final PageParameters parameters) {

add(new FormListRow(rowsForm).

  add(new Button(addRowButton) {
public void onSubmit() { rows.add(new Row()); }
  }.setDefaultFormProcessing(false)).

  add(new ListViewRow(rowsList, new PropertyModelListRow(this,
rows)) {
protected void populateItem(final ListItemRow  item) {
  final Row row = item.getModelObject();

  item.add(new Label(index, new AbstractReadOnlyModelInteger() {
   public Integer getObject() { return item.getIndex() + 1; }
  }));

  item.add(new RequiredTextFieldString(key, new
PropertyModelString(row, key)));

  item.add(new TextFieldString(value, new
PropertyModelString(row, value)));

  item.add(removeLink(removeRowLink, item));
  item.add(moveUpLink(moveUpLink, item));
  item.add(moveDownLink(moveDownLink, item));
}
  }.setReuseItems(true)));
  }
}

/ HTML /
html
headtitleListView Test/title/head
body
  form wicket:id=rowsForm
  button wicket:id=addRowButtonAdd Row/button
  tabletr wicket:id=rowsList
 tdnbsp;nbsp;nbsp;#span wicket:id=index1/span/td
 tdKey:input type=text wicket:id=key //td
 tdValue:input type=text wicket:id=value //td
 td
a href=# wicket:id=moveUpLink[uarr;]/a
a href=# wicket:id=moveDownLink[darr;]/a
a href=# wicket:id=removeRowLink[X]/a
 /td
  /tr/table
  input type=submit value=Submit /
/form
/body
/html


-
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




package wickettest;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import org.apache.wicket.markup.html.form.FormComponent;

public class FormComponentReuseManager implements Serializable
{
private static final long serialVersionUID = 1L;

private final MapObject, MapString, FormComponent ?  
componentsByRowId = new HashMapObject, MapString, FormComponent ? ();

public T FormComponentT rememberOrReuse(final Object rowId, final 
FormComponentT newComponent)
{
MapString, FormComponent ?  rowComponents = 
componentsByRowId.get(rowId);
if (rowComponents == null)
componentsByRowId.put(rowId, rowComponents = new 
HashMapString, FormComponent ? ());

@SuppressWarnings(unchecked)
final FormComponentT existingComponent = (FormComponentT) 
rowComponents.get(newComponent.getId());
if (existingComponent == null)
{
   

Re: Using up/down/remove links of ListView items clears text fields

2010-08-14 Thread Sebastian
Couldn't detect the listview if it is part of a form and decide for 
SubmitLink or Link?


On 14.08.2010 18:51, James Carman wrote:

But then all listviews that need up/down links have to be in a form.

On Aug 14, 2010 12:37 PM, Sebastiannospam...@gmx.net  wrote:

Hi Martin,

thanks for pointing me to the reuse component concept. It solved my
problem partially but not completely. The problem is, that the links
provided by the listview result in HTTP GET request which means that any
values recently entered will not be transferred back and get lost. I am
now using my own link implementations based on the SubmitLink class. I
am attaching all files of my working example as reference.

Generally I think it makes great sense to have this behaviour as part of
the ListView. At least I expected it to work this way in the first place.

Regards,

Seb

On 14.08.2010 16:40, Martin Makundi wrote:

Hi!

You can solve this in a robust manner using reusemanager:

http://osdir.com/ml/users-wicket.apache.org/2010-08/msg00161.html

2010/8/14 Sebastiannospam...@gmx.net:

Hi,

I am trying to use a list view component on a page where rows with text
fields can be added, removed or moved around. I am using the removeLink,
moveUpLink and moveDownLink methods of the listview to create the

respective

links for each list item.
The problem is that even when I enable the reuseListItems option, on

using

any of these links the text fields forget the recently entered data

(raw

input) and revert to the values of the backing model.

This issue does not occur when I am adding rows the list view.

Below is an example. I can add rows using the Add Row button. When I

enter

text into the text fields, when I use the links next to a row, the

content

of any text field is cleared.

Any suggestions?

Regards,

Seb

/ PAGE /
import java.util.*;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.markup.html.list.*;
import org.apache.wicket.model.*;

public class ListViewPage extends WebPage {
public static class Row {
public String key;
public String value;
}

private final ListRow  rows = new ArrayListRow();

public ListViewPage(final PageParameters parameters) {

add(new FormListRow(rowsForm).

add(new Button(addRowButton) {
public void onSubmit() { rows.add(new Row()); }
}.setDefaultFormProcessing(false)).

add(new ListViewRow(rowsList, new PropertyModelListRow(this,
rows)) {
protected void populateItem(final ListItemRow  item) {
final Row row = item.getModelObject();

item.add(new Label(index, new AbstractReadOnlyModelInteger() {
public Integer getObject() { return item.getIndex() + 1; }
}));

item.add(new RequiredTextFieldString(key, new
PropertyModelString(row, key)));

item.add(new TextFieldString(value, new
PropertyModelString(row, value)));

item.add(removeLink(removeRowLink, item));
item.add(moveUpLink(moveUpLink, item));
item.add(moveDownLink(moveDownLink, item));
}
}.setReuseItems(true)));
}
}

/ HTML /
html
headtitleListView Test/title/head
body
form wicket:id=rowsForm
button wicket:id=addRowButtonAdd Row/button
tabletr wicket:id=rowsList
tdnbsp;nbsp;nbsp;#span wicket:id=index1/span/td
tdKey:input type=text wicket:id=key //td
tdValue:input type=text wicket:id=value //td
td
a href=# wicket:id=moveUpLink[uarr;]/a
a href=# wicket:id=moveDownLink[darr;]/a
a href=# wicket:id=removeRowLink[X]/a
/td
/tr/table
input type=submit value=Submit /
/form
/body
/html


-
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










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



Re: Using up/down/remove links of ListView items clears text fields

2010-08-14 Thread Sebastian

Hi Martin,

how would I use this in my case? I am relatively new to Wicket. Also 
does it have a graceful fallback for browsers having JS disabled?


Seb

On 14.08.2010 18:39, Martin Makundi wrote:

Hi!

Again, I have a custom solution for you :)

It's called AjaxFormSubmittingChangeListenerBehavior

http://apache-wicket.1842946.n4.nabble.com/New-behavior-AjaxFormSubmittingChangeListenerBehavior-td1909633.html#a1909633

2010/8/14 Sebastiannospam...@gmx.net:

Hi Martin,

thanks for pointing me to the reuse component concept. It solved my problem
partially but not completely. The problem is, that the links provided by the
listview result in HTTP GET request which means that any values recently
entered will not be transferred back and get lost. I am now using my own
link implementations based on the SubmitLink class. I am attaching all files
of my working example as reference.

Generally I think it makes great sense to have this behaviour as part of the
ListView. At least I expected it to work this way in the first place.

Regards,

Seb

On 14.08.2010 16:40, Martin Makundi wrote:


Hi!

You can solve this in a robust manner using reusemanager:

http://osdir.com/ml/users-wicket.apache.org/2010-08/msg00161.html

2010/8/14 Sebastiannospam...@gmx.net:


Hi,

I am trying to use a list view component on a page where rows with text
fields can be added, removed or moved around. I am using the removeLink,
moveUpLink and moveDownLink methods of the listview to create the
respective
links for each list item.
The problem is that even when I enable the reuseListItems option, on
using
any of these links the text fields forget the recently entered data
(raw
input) and revert to the values of the backing model.

This issue does not occur when I am adding rows the list view.

Below is an example. I can add rows using the Add Row button. When I
enter
text into the text fields, when I use the links next to a row, the
content
of any text field is cleared.

Any suggestions?

Regards,

Seb

/ PAGE /
import java.util.*;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.markup.html.list.*;
import org.apache.wicket.model.*;

public class ListViewPage extends WebPage {
  public static class Row {
public String key;
public String value;
  }

  private final ListRowrows = new ArrayListRow();

  public ListViewPage(final PageParameters parameters) {

add(new FormListRow(rowsForm).

  add(new Button(addRowButton) {
public void onSubmit() { rows.add(new Row()); }
  }.setDefaultFormProcessing(false)).

  add(new ListViewRow(rowsList, new PropertyModelListRow(this,
rows)) {
protected void populateItem(final ListItemRowitem) {
  final Row row = item.getModelObject();

  item.add(new Label(index, new AbstractReadOnlyModelInteger()
{
   public Integer getObject() { return item.getIndex() + 1; }
  }));

  item.add(new RequiredTextFieldString(key, new
PropertyModelString(row, key)));

  item.add(new TextFieldString(value, new
PropertyModelString(row, value)));

  item.add(removeLink(removeRowLink, item));
  item.add(moveUpLink(moveUpLink, item));
  item.add(moveDownLink(moveDownLink, item));
}
  }.setReuseItems(true)));
  }
}

/ HTML /
html
headtitleListView Test/title/head
body
  form wicket:id=rowsForm
  button wicket:id=addRowButtonAdd Row/button
  tabletr wicket:id=rowsList
 tdnbsp;nbsp;nbsp;#span wicket:id=index1/span/td
 tdKey:input type=text wicket:id=key //td
 tdValue:input type=text wicket:id=value //td
 td
a href=# wicket:id=moveUpLink[uarr;]/a
a href=# wicket:id=moveDownLink[darr;]/a
a href=# wicket:id=removeRowLink[X]/a
 /td
  /tr/table
  input type=submit value=Submit /
/form
/body
/html


-
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






-
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






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

scriptaculous SortableListView

2010-06-27 Thread Sebastian Gabriel
Hello, 

My problem is that I have multiple SortableListViews, all of them work fine, 
but I want to have the ability to drag the items between the different ListView 
also. I have tried to work with SortableListViews an DragTargets but then I 
can't sort the list furthermore I don't know how to let the sortablelistview 
allow free dragging not only horizontal or vertical. Perhaps you have some 
ideas?

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



jWicket SortableList

2010-06-10 Thread Sebastian Gabriel
Hello, 
I've figured out how to use the jWicket Drag'n'Drop components and the result 
is pretty nice. 
I have four lists, one list is in the beginning filled with elements and the 
user have so choose which element he wants in which list. It works, to drag the 
elements on the three other lists and the element is being added to the list. 
But my problem is that the lists have to be sortable by the user. 
How can I get the position of the element when it is dropped? So I can 
calculate whether it has been dropped above an element or under it. Or does 
jWicket doesn't cover this functionality.

Thanks.

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



jWicket Drag'n'Drop

2010-06-06 Thread Sebastian Gabriel
Hello,
I am trying to build a drag and drop component, which display three different 
list and the user should be able to move the listeitems between the different 
lists. 
I have the lists and I'm able to move the items to other lists where they also 
be displayed. My problem is when I drop a listitem into a list the item is 
'cloned' - after drop the item is in the list and also in the place where I 
have dropped it. So this is my first problem and the second is, that an item 
which was dropped onto a list, can't be moved at all, although all three lists 
are instances of the same class. Perhaps somebody has a clue what I'm doing 
wrong.

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



Re: jWicket Drag'n'Drop

2010-06-06 Thread Sebastian Gabriel
Well, 
in the onDrop() method of the listcontainer the droppedelement is added to the 
list. At this point I want the element which was dropped to disappear. Because 
if not the element is displayed twice.

Thanks


Am 06.06.2010 um 17:23 schrieb Stefan Lindner:

 Hallo,
 
 what exactly do you mean with cloned?
 
 Stefan
 
 -Ursprüngliche Nachricht-
 Von: Sebastian Gabriel [mailto:sebastian.gabr...@hs-augsburg.de] 
 Gesendet: Sonntag, 6. Juni 2010 13:49
 An: users@wicket.apache.org
 Betreff: jWicket Drag'n'Drop
 
 Hello,
 I am trying to build a drag and drop component, which display three different 
 list and the user should be able to move the listeitems between the different 
 lists. 
 I have the lists and I'm able to move the items to other lists where they 
 also be displayed. My problem is when I drop a listitem into a list the item 
 is 'cloned' - after drop the item is in the list and also in the place where 
 I have dropped it. So this is my first problem and the second is, that an 
 item which was dropped onto a list, can't be moved at all, although all three 
 lists are instances of the same class. Perhaps somebody has a clue what I'm 
 doing wrong.
 
 Thanks
 -
 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
 
 


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



AutoCompleteTextField Problem Submitting

2010-05-12 Thread Sebastian Gabriel
Hello,
I have an AutoCompleteTextField which works just fine. But when I select any of 
the given values from the list the validator tells me : xxx is not a valid 
value... perhaps you have any idea what I can do.

Code:

 private AutoCompleteTextFieldSubject subject = new 
AutoCompleteTextFieldSubject(subject,
new ModelSubject(event.getSubject()), autoCompleteRenderer) {

/**
 * generated UID.
 */
private static final long serialVersionUID = -928631288762101540L;

@Override
protected IteratorSubject getChoices(String term) {

ListSubject ret = new LinkedListSubject();
ListSubject subjects = controller.getAllSubjects();
for (Subject subject : subjects) {
if (subject.getName().startsWith(term)) {
ret.add(subject);
}
}

return ret.iterator();
}
};

Thanks,
Sebastian

Re: AutoCompleteTextField Problem Submitting

2010-05-12 Thread Sebastian Gabriel
Thanks for your fast answer. 
I have a question about your solution. You say setting the model to null and 
adding a getChoice method would solve the problem. This means that I set the 
AutoCompleteTextField type to String and the String in the 
AutoCompleteTextField has to be unique in order to identify the right object, 
hasn't it?

Thanks
Sebastian


Am 12.05.2010 um 19:26 schrieb Zilvinas Vilutis:

 I had the same problem, its something related to converters or how your text
 value is converted to ( in your case ) Subject - and as there is no
 converter for that - it is just failing.
 
 What I've done is set the model to null and added a method getChoice
 which does the conversion.
 
 This is not very convenient way but it works.
 
 Maybe Igor would have any suggestions how to solve this in a better way?
 
 
 Žilvinas Vilutis
 
 Mobile:   (+370) 652 38353
 E-mail:   cika...@gmail.com
 
 
 On Wed, May 12, 2010 at 7:22 AM, Sebastian Gabriel 
 sebastian.gabr...@hs-augsburg.de wrote:
 
 Hello,
 I have an AutoCompleteTextField which works just fine. But when I select
 any of the given values from the list the validator tells me : xxx is not a
 valid value... perhaps you have any idea what I can do.
 
 Code:
 
 private AutoCompleteTextFieldSubject subject = new
 AutoCompleteTextFieldSubject(subject,
   new ModelSubject(event.getSubject()), autoCompleteRenderer) {
 
   /**
* generated UID.
*/
   private static final long serialVersionUID = -928631288762101540L;
 
   @Override
   protected IteratorSubject getChoices(String term) {
 
   ListSubject ret = new LinkedListSubject();
   ListSubject subjects = controller.getAllSubjects();
   for (Subject subject : subjects) {
   if (subject.getName().startsWith(term)) {
   ret.add(subject);
   }
   }
 
   return ret.iterator();
   }
   };
 
 Thanks,
 Sebastian


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



Complex URL mapping

2008-07-30 Thread Sebastian

Hi,

I am currently trying to convert a custom application to Wicket and hit 
an issue regarding URL mappings.


We have the requirement for URL-to-page mappings as follows:

1) http://localhost/app/   - WelcomePage.java
2) http://localhost/app/info   - InfoPage.java
3) http://localhost/app/e/entry/   - EntryPage.java
4) http://localhost/app/category/  - CategoryPage.java
5) http://localhost/app/category/subcategory/  - SubCategoryPage.java

The problem is that I would need to mount the /app/ four times but 
Wicket throws an exception.


An additional difficulty is that for URL mapping 3) the parameter e is 
always the first character of entry. category can never be only one 
character, thus the URLs 3) and 4)/5) are - from a logical point - 
distinguishable based on the URL pattern.


Which URL encoding strategies would I need to configure how to achieve 
such a mapping? Is it possible at all with Wicket?


Thanks in advance,

Seb


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Asynchronous Components

2008-07-30 Thread Sebastian
I used the onBeforeRender/onRender methods and was able to implement the 
desired feature using Callable and Future objects from the 
java.concurrent API.


Thanks a lot.

Seb

Igor Vaynberg wrote:

if you want the page to render all at once you have to spin off as
many threads as there are components and block rendering until all
threads are done. you can do this in page#onbeforerender() which is
called before any components start to render.

the problem with this is that if it takes a while someone can easily
dos your app because you are blocking servlet thread pool.

a better way to do this would be to drop each component into an iframe
and make it poll for data which is retrieved using some global
threadpool.

-igor

On Tue, Jul 22, 2008 at 2:12 PM, Sebastian [EMAIL PROTECTED] wrote:

Hi,

I have not yet looked much into Wicket but am quite interested in the
project.

We have a specific requirement where I could not yet find the right
information/documentation for.

We need to put multiple components onto a page receiving data through web
services. A single web services call takes some time. In our scenario it
would be bad to have the different components of a page to request their
data sequentially, therefore we'd like to have components retrieve the
required data in parallel by firing the web services call concurrenlty.

What is the best approach to achieve this (preferable in a generic, reusable
fashion).

I do not want to use AJAX for this, the whole page needs to be rendered at
once on the server side.

Thanks for any hints and thoughts in advance,

Seb








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Asynchronous Components

2008-07-22 Thread Sebastian

Hi,

I have not yet looked much into Wicket but am quite interested in the 
project.


We have a specific requirement where I could not yet find the right 
information/documentation for.


We need to put multiple components onto a page receiving data through 
web services. A single web services call takes some time. In our 
scenario it would be bad to have the different components of a page to 
request their data sequentially, therefore we'd like to have components 
retrieve the required data in parallel by firing the web services call 
concurrenlty.


What is the best approach to achieve this (preferable in a generic, 
reusable fashion).


I do not want to use AJAX for this, the whole page needs to be rendered 
at once on the server side.


Thanks for any hints and thoughts in advance,

Seb


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]