Re: How to remove jsessionid from the URL?

2018-04-08 Thread Don Ferguson
On the very first request, the server doesn't know whether or not cookies
are supported, so encodes the session id in the URL in addition to setting
the cookie.  There is a trick that involves forcing the browser to redirect
the first request so that the server can determine that cookies are
supported and omit the session id in the URL.

On Sat, Apr 7, 2018, 9:40 PM gcsaba2  wrote:

> Hello,
>
> I'm using Wicket 7 with Spring Boot. I've mounted several pages, and for
> example when I go to search.html, the ;jsessionid always gets attached to
> the URL.
>
> Is there some way to remove the jsessionid from the URLs?
>
> In the tomcat configuration I've already set the tracking-mode to be
> cookie,
> but still wicket puts the jsessionid in the url. What's even worse is that
> all the links in the page have the jsessionid appended to the URL, so even
> if I click anywhere, it will remain there. I would maybe accept it being
> there the first time I visit the website and the session gets established,
> but afterwards it's really unnecessary (and ugly).
>
> Thanks,
> Csaba
>
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Autocomplete select options

2017-01-10 Thread Don Ferguson
The jquery-ui version of autocomplete supports arrow keys:

http://www.7thweb.net/wicket-jquery-ui/autocomplete/DefaultAutoCompletePage 




> On Jan 10, 2017, at 7:53 AM, Calin Pavel  wrote:
> 
> Hi everybody,
> 
> Does anybody know if it is possible in Wicket to select Autocomplete options 
> by moving with arrows keys up / down without pressing ENTER?
> I want to have highlighted option automatically placed in the autocomplete 
> input.
> 
> Thank you,
> Calin Pavel
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 



Re: Wicket WebSockets problem with servlet context

2016-10-09 Thread Don Ferguson
I don’t think NGINX sets the X-Forwarded headers by default, but it can be 
configured to do so.
In my http and https configurations, I have:

proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

-Don

> On Oct 9, 2016, at 2:53 AM, Martin Grigorov  wrote:
> 
> A question : does Nginx send X-Forwarded-* headers ?
> Which ones?
> 
> On Oct 5, 2016 7:16 PM, "Tom Götz"  wrote:
> 
>> … so what I was trying to say (I’m not yet too deep into the websockets
>> tech):
>> 
>> isn’t it —in the described case— also necessary to configure the mount
>> point of the WS endpoint?
>> 
>>   Tom
>> 
>> 
>> 
>>> On 05.10.2016, at 17:42, Tom Götz  wrote:
>>> 
>>> BTW, I already tried the following workaround without success:
>>> 
>>> I did override WebSocketBehavior#renderHead and included a „patched“ JS
>> init script that contained the contextPath that ngnix is forwarding to, so
>> the generated JS looked like this:
>>> 
>>> if (typeof(Wicket.WebSocket.appName) === "undefined") {
>>> jQuery.extend(Wicket.WebSocket, { pageId: 1, resourceName: '',
>>>   baseUrl: ‚MyHomePage?1', contextPath: ‚/MyLocation', appName: ‚myApp',
>>>   filterPrefix: '' });
>>> Wicket.WebSocket.createDefaultConnection();
>>> }
>>> 
>>> But still I got an 404 for the ws endpoint …
>>> 
>>>  Tom
>>> 
>>> 
 On 05.10.2016, at 17:35, Tom Götz  wrote:
 
 I created a JIRA for this: https://issues.apache.org/
>> jira/browse/WICKET-6254
 
 Tom
 
 
> On 05.10.2016, at 17:31, Martin Grigorov  wrote:
> 
> The problem is that Nginx is configured to forward requests to
>> /MyLocation
> to Tomcat, and the application has no idea about this.
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Wed, Oct 5, 2016 at 5:25 PM, Tom Götz  wrote:
> 
>> Hi Martin,
>> 
>> what exactly is the problem in wicket-websocket-jquery.js? As I said,
>> I
>> have no contextPath, so I wouldn’t expect Wicket/wicket-websocket-
>> jquery.js
>> to know under which context the app is running. Shouldn’t I provide
>> the
>> context/mountPath somehow to the websocket initialization process?!
>> 
>> Tom
>> 
>>> On 05.10.2016, at 16:47, Martin Grigorov 
>> wrote:
>>> 
>>> Hi Tom,
>>> 
>>> The problem really is in wicket-websocket-jquery.js.
>>> It does: url = protocol + '//' + document.location.host +
>> WWS.contextPath +
>>> WWS.filterPrefix + '/wicket/websocket';
>>> 
>>> A workaround for you is to add url rewrite rule to Nginx to forward
>> it to
>>> Tomcat.
>>> 
>>> Please file an issue at JIRA and I'll see how this could be improved.
>>> 
>>> 
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>> 
>>> On Wed, Oct 5, 2016 at 4:31 PM, Tom Götz  wrote:
>>> 
 Hm, no solution yet … anyone got a working example or some hint
>> maybe?
 
 Tom
 
 
> On 05.10.2016, at 15:57, Tom Götz  wrote:
> 
> Maybe answering my own question, but this here could help … I’ll
>> give
>> it
 a try:
> http://stackoverflow.com/questions/32287103/how-to-use-
 nginx-as-a-proxy-for-wicket-application-using-websockets
> 
> Cheers,
> Tom
> 
> 
>> On 05.10.2016, at 15:36, Tom Götz  wrote:
>> 
>> Hi there,
>> 
>> I have the following scenario:
>> 
>> 1.
>> a Spring-Boot Wicket application with Tomcat running on Port 8080
>> that
 uses Wicket WebSockets impl running in the servlet root context
>> 
>> 2.
>> a ngnix server that proxies /MyLocation to the mentioned Wicket
>> app
>> 
>> As there is no servlet context involved, the generated WebSockets
 endpoint url is generated by Wicket as: ws://mydomain.com/wicket/
 websocket?pageId=1=...
>> 
>> I saw that this url is generated in BaseWebSocketBehavior#
>> renderHead
 by asking the request for the context path:
>> 
>> String contextPath = component.getRequest().getContextPath();
>> variables.put("contextPath", contextPath);
>> 
>> As I don’t have a contextPath, this fails:
>> 
>> WebSocket connection to 'ws://mydomaon.com/wicket/
 websocket?pageId=1=...' failed: Error during
 WebSocket handshake: Unexpected response code: 404
>> 
>> Does the Wicket WebSocket API provide a way to handle such a
>> scenario?
 Currently, I’m studying the code but any pointer would be helpful …

Re: Has anybody used WebSockets with an embedded Jetty instance?

2015-08-29 Thread Don Ferguson
I solved my problem the obvious way: stuck everything in the same classloader 
as Jetty (no WEB-INF/lib or WEB-INF/classes).  Not pretty, but it works.

 On Aug 28, 2015, at 10:21 AM, Don Ferguson don.fergu...@gmail.com wrote:
 
 Hi Martin,
 
 I'm already doing that (I encountered your earlier post which got me this 
 far).   This means that WebServerEndpointConfig must be in Jetty's classpath, 
 along with its dependencies. I'm ending up with the bulk of wicket in Jetty's 
 classpath (and duplicated in WEB-INF/lib) which leads to having two versions 
 of Application.class loaded by two different classloaders.  The upshot is 
 that, when trying to upgrade the connection, WicketEndPoint.onOpen() tries to 
 get the Application object via:
 WebApplication app = (WebApplication) WebApplication.get(appName);
 which returns null, due to the classloader confusion (appName was registered 
 using the Application.class loaded in the webapp classloader).
 The obvious solution would be to remove wicket from WEB-INF/lib, so that 
 there would only be the copy in jetty's classloader, but that lead to other 
 problems.  Anyway, was just wondering how to structure the executable WAR to 
 avoid this nightmare.
 -Don
 
 
 On Fri, Aug 28, 2015 at 9:19 AM, Martin Grigorov mgrigo...@apache.org 
 mailto:mgrigo...@apache.org wrote:
 Hi,
 
 You can use :
 
 ServerContainer serverContainer =
 WebSocketServerContainerInitializer.configureContext(bb);
 serverContainer.addEndpoint(new WicketServerEndpointConfig());
 
 bb is: WebAppContext bb = new WebAppContext();
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov https://twitter.com/mtgrigorov
 
 On Fri, Aug 28, 2015 at 6:05 PM, Don Ferguson don.fergu...@gmail.com 
 mailto:don.fergu...@gmail.com
 wrote:
 
  I have an app built on Wicket 7.0,0 and Jetty 9.2.6 to which I am
  attempting to add WebSockets (wicket-native-websocket-javax).  The app
  functions properly when running from the IDE, however I have not been able
  to get web sockets to work when running from an executable WAR file.  The
  main issue appears to be classloader related.  I’m struggling to figure out
  precisely what classes need to be alongside Jetty in the system
  classloader, and what needs to be part of the WAR.
 
  Before introducing WebSockets, all of the wicket jars were in the WebApp
  classloader (WEB-INF/lib).  However now some classes (such as
  WicketServerEndpointConfig) need to be in Jetty’s classloader.  But if I
  put all of wicket in the Jetty's classloader, I get other problems.
  Anyway, I would really appreciate some guidance if anyone has sorted this
  out.
 
  -Don
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org 
  mailto:users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org 
  mailto:users-h...@wicket.apache.org
 
 
 



Re: Has anybody used WebSockets with an embedded Jetty instance?

2015-08-28 Thread Don Ferguson
Hi Martin,

I'm already doing that (I encountered your earlier post which got me this
far).   This means that WebServerEndpointConfig must be in Jetty's
classpath, along with its dependencies. I'm ending up with the bulk of
wicket in Jetty's classpath (and duplicated in WEB-INF/lib) which leads to
having two versions of Application.class loaded by two different
classloaders.  The upshot is that, when trying to upgrade the connection,
WicketEndPoint.onOpen() tries to get the Application object via:

WebApplication app = (WebApplication) WebApplication.get(appName);

which returns null, due to the classloader confusion (appName was
registered using the Application.class loaded in the webapp
classloader).

The obvious solution would be to remove wicket from WEB-INF/lib, so
that there would only be the copy in jetty's classloader, but that
lead to other problems.  Anyway, was just wondering how to structure
the executable WAR to avoid this nightmare.

-Don



On Fri, Aug 28, 2015 at 9:19 AM, Martin Grigorov mgrigo...@apache.org
wrote:

 Hi,

 You can use :

 ServerContainer serverContainer =
 WebSocketServerContainerInitializer.configureContext(bb);
 serverContainer.addEndpoint(new WicketServerEndpointConfig());

 bb is: WebAppContext bb = new WebAppContext();

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

 On Fri, Aug 28, 2015 at 6:05 PM, Don Ferguson don.fergu...@gmail.com
 wrote:

  I have an app built on Wicket 7.0,0 and Jetty 9.2.6 to which I am
  attempting to add WebSockets (wicket-native-websocket-javax).  The app
  functions properly when running from the IDE, however I have not been
 able
  to get web sockets to work when running from an executable WAR file.  The
  main issue appears to be classloader related.  I’m struggling to figure
 out
  precisely what classes need to be alongside Jetty in the system
  classloader, and what needs to be part of the WAR.
 
  Before introducing WebSockets, all of the wicket jars were in the WebApp
  classloader (WEB-INF/lib).  However now some classes (such as
  WicketServerEndpointConfig) need to be in Jetty’s classloader.  But if I
  put all of wicket in the Jetty's classloader, I get other problems.
  Anyway, I would really appreciate some guidance if anyone has sorted this
  out.
 
  -Don
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Has anybody used WebSockets with an embedded Jetty instance?

2015-08-28 Thread Don Ferguson
I have an app built on Wicket 7.0,0 and Jetty 9.2.6 to which I am attempting to 
add WebSockets (wicket-native-websocket-javax).  The app functions properly 
when running from the IDE, however I have not been able to get web sockets to 
work when running from an executable WAR file.  The main issue appears to be 
classloader related.  I’m struggling to figure out precisely what classes need 
to be alongside Jetty in the system classloader, and what needs to be part of 
the WAR.  

Before introducing WebSockets, all of the wicket jars were in the WebApp 
classloader (WEB-INF/lib).  However now some classes (such as 
WicketServerEndpointConfig) need to be in Jetty’s classloader.  But if I put 
all of wicket in the Jetty's classloader, I get other problems.  Anyway, I 
would really appreciate some guidance if anyone has sorted this out.

-Don


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



Re: Dealing with transient and persistent objects in Wicket sessions and models

2015-06-21 Thread Don Ferguson
For persistence, I use the ActiveObjects ORM library, originally developed by 
Daniel Spiewak and now actively maintained by Atlassian.  In AO, database 
entities are described by java interfaces.  For your use case (transient 
objects that may or may not be persisted), I use a dynamic proxy whose 
implementation can be serialized.  When setters are called on the entity, the 
proxy stores the (unsaved) data in a HashMap.  An actual database record is 
only created on an explicit call to entity.save().

By implementing it this way, panels that manipulate database records can 
operate on either new (transient) records or records that already exist.  If 
the user cancels without saving, there is no detritus in the database to clean 
up.

If anyone out there is interested in using AO with Wicket, I’d be happy to 
share my code  experience.  I like the AO programming model, and its support 
for automatic schema migration means that you can change table definitions by 
adding/removing setters and getters in the entity interfaces; AO can infer the 
SQL to migrate tables to the new schema.

For a quick (but somewhat outdated) introduction to AO, see: 
https://activeobjects.java.net/0.8.2/ActiveObjects.pdf 
https://activeobjects.java.net/0.8.2/ActiveObjects.pdf
The repository can be found here: https://bitbucket.org/activeobjects 
https://bitbucket.org/activeobjects

It’s an obscure framework, but I find it a pleasure to use, and it plays 
reasonably well with Wicket.

-Don


 On Jun 19, 2015, at 3:43 AM, Urbani, Edmund edmund.urb...@lilandit.com 
 wrote:
 
 On 06/19/2015 01:59 AM, wix wrote:
 Urbani, Edmund wrote
 I don't think I am the only one running into these kinds of issues, so I'd
 like 
 to hear which patterns other developers apply or what they consider best
 practices.
  Would like to hear the same. I've attempted to work through this in the
 most Wicket-way I know how.
 
  The approach so far is a kind of LoadableDetachableModel that tries to be
 smart about the persistent state of the underlying entity/object. A
 persistence provider (entitymanager or such) would be injected into the
 model or requested by the model, and a flag or flags used to track the state
 of the underlying entity - is the entity currently managed? is the entity to
 be retained (that is, not automatically detached)? is the entity currently
 attached?
 
  So at the start of a wizard, the model is given a new entity and told that
 it is un-managed and retained. As the model is passed to the next page or to
 a previous page, the entity is serialized (not detached) and treated as
 though it doesn't belong to a persistence context. At the end of the wizard
 the model is told to persist the entity at which time it becomes managed but
 not retained (so it detaches, and would be re-attached via persistence id
 lookup when the model is next deserialized/loaded).
 
  A wizard or other set of pages working with an existing entity that was
 selected from persistence just tells the model that it is managed and
 retained. Then the model still doesn't detach in the sense of setting the
 underlying entity to null, but it does detach from the JPA context and is
 safely(?) serialized. Thereby changes made in wizard pages ride along to the
 end as in the new entity case above, and aren't merged til whatever final
 page/part logic says so. Cancelling out in the middle is simple since no
 changed would have been persisted.
 
  It works for any generic entity in my projects so far, however my use case
 right now isn't complicated by multi-entity editing; only one entity (one
 model's underlying object) is being modified by a single form submission in
 the open-session-in-view cycle.
 
  If there are other drawbacks to this approach or a better way (a more
 Wicket-way)...
 Detaching from Hibernate / JPA session as you describe is another way to 
 handle this. Makes me worry about concurrent modifications which might be 
 committed in between detaching from / re-attaching to the persistence layer 
 though.
 
 Also, I have considered separating the presentation layer (Wicket) from the 
 managed database objects entirely and handle every interaction with the 
 database through a service layer which maps database objects to/from a 
 different set of classes tailored specifically for the UI and its various use 
 cases. That would be the cleanest approach I can think of, and also the 
 most expensive one to implement.
 
 However, currently I am trying to hook into the serialization process to 
 untangle my partially persistent object graph as described in this article:
 http://techblog.molindo.at/2009/03/detaching-and-attaching-persistent-objects-on-serialization.html
  
 http://techblog.molindo.at/2009/03/detaching-and-attaching-persistent-objects-on-serialization.html
 
 This seems to be working so far (pending some thorough testing) even though 
 it causes some weird exceptions in unit tests 
 (javassist.CannotCompileException), which I have yet 

Re: Render a component in a background thread.

2015-05-29 Thread Don Ferguson
From your description of the problem, it doesn’t really seem like you need a 
renderer — perhaps abstracting out the search criterion as a pure java 
(non-wicket-specific) object that can be used both in the UI and in data export 
would be a better approach.

That said, here’s what I’m doing to render pages (batch emails) in a background 
thread:
public static void sendMail(EmailBatch batch) {
Application app = ThreadContext.getApplication();
RequestCycle requestCycle = ThreadContext.getRequestCycle();
Session session = ThreadContext.getSession();

Runnable r = () - {
ThreadContext.setApplication(app);
ThreadContext.setRequestCycle(requestCycle);
ThreadContext.setSession(session);
blah blah blah
ComponentRenderer.renderPage(new 
PageProvider(EmailMergeProcessor.class, pp)

There are some restrictions on what the pages can contain (for example, I had 
to disable bootstrap), but eventually I got the above to work.  Your mileage 
may vary.  Good luck.

-Don



 On May 29, 2015, at 1:49 AM, Peter Henderson peter.hender...@starjar.com 
 wrote:
 
 On Fri, May 29, 2015 at 9:22 AM, Christoph Läubrich lae...@googlemail.com 
 mailto:lae...@googlemail.com
 wrote:
 
 Can you explain what is the reason for using a background-thread?
 Depending on your container you might want to use e.g. Continuations or
 Servlet-Async to compute lengthy values in the background and then let
 render the page as normal in the RequestCycle depending on that result.
 
 
 In my real application the background thread is a data export routine. I
 want to run a list panel with saved page parameters and instead of
 rendering the html I'll access the underlying list model to extract the
 data, export to csv (or json,etc) and pass it out for other processing.
 This way the user can fiddle about with the search filters on the list to
 see exactly what they want and later get the raw data (accountants love
 spreadsheets).
 
 For example.
 This page [1] I'd like to have a plain servlet which can run the component
 outside of wicket.
 
 
 Peter.
 
 
 
 [1]
 https://demo.starjar.com:25000/Starjar/protected/project/1210005?rpp=25fn1=Description+Containsfn2=Date+%5Bmonth+year%5Dfv2=2015+1+1tab=Time+Sheets
  
 https://demo.starjar.com:25000/Starjar/protected/project/1210005?rpp=25fn1=Description+Containsfn2=Date+%5Bmonth+year%5Dfv2=2015+1+1tab=Time+Sheets
 
 
 
 Am 28.05.2015 11:51, schrieb Peter Henderson:
 
 Hi
 
 I am trying to render a component in a background thread.
 
 My first attempt fails with an Exception
 There is no application attached to current thread Thread-4
 
 
 
 So I link the application with the background thread and now a different
 exception.
 java.lang.IllegalArgumentException: Argument 'requestCycle' may not be
 null.
 at org.apache.wicket.util.lang.Args.notNull(Args.java:41)
 at
 
 org.apache.wicket.Application.fetchCreateAndSetSession(Application.java:1568)
 at org.apache.wicket.Session.get(Session.java:171)
 
 
 Is component renderer designed to work from a background thread?
 
 
 I've put a quick start on git hub.
 https://github.com/bollinger/wicket-ComponentRenderer
 
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 
 
 -- 
 Peter Henderson
 
 Director
 Starjar Ltd.
 www.starjar.com http://www.starjar.com/
 0330 088 1662



Re: Redirecting to another Wicket after 5 seconds

2015-05-22 Thread Don Ferguson
By the time the timer goes off, the page has already been rendered and control 
has returned to the browser.  The server has no way to tell the browser to 
redirect.  I’d recommend moving the timer logic to the client side.  The 
TimerTestPage can render javascript, executed on the client.  After 5 seconds, 
the client executes a callback to the server that executes the redirect.

 On May 22, 2015, at 8:13 AM, MartinoSuperman martinosuper...@live.nl wrote:
 
 Dear,
 
 I want to make a timer on a WicketPage.
 
 When my Wicket website starts at the begin page, it must redirect after 5
 seconds to another. 
 
 I already have the following code:
 
 =
 
 public final class TimerTestPage extends WebPage {
 
Timer timer; 
 
public TimerTestPage() {
super();
 
ActionListener actionListener;
actionListener = new ActionListener() {
 
@Override
public void actionPerformed(ActionEvent e) {
setResponsePage(DemoPage.class);
//getRequestCycle().setRequestTarget(DemoPage.class);
}
};
 
timer = new Timer(5000, actionListener);
timer.start();
}
 
 
 }
 =
 
 The timer works, but after 5 seconds, the Wicket page is not redirected to
 DemoPage.
 
 It gives the following NullPointer exception:
 ===
 
 Severe:   Exception in thread AWT-EventQueue-0
 Severe:   java.lang.NullPointerException
   at org.apache.wicket.Component.setResponsePage(Component.java:3141)
   at 
 com.myapp.wicket.TimerTestPage$1.actionPerformed(TimerTestPage.java:30)
   at javax.swing.Timer.fireActionPerformed(Timer.java:312)
   at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738)
   at java.awt.EventQueue.access$300(EventQueue.java:103)
   at java.awt.EventQueue$3.run(EventQueue.java:699)
   at java.awt.EventQueue$3.run(EventQueue.java:697)
   at java.security.AccessController.doPrivileged(Native Method)
   at
 java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:708)
   at
 java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
   at
 java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
   at
 java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
 
 
 
 Does anyone know what I am doing wrong? What exactly generates that
 NullPointer exception? 
 
 
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Redirecting-to-another-Wicket-after-5-seconds-tp4670858.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: Redirecting to another Wicket after 5 seconds

2015-05-22 Thread Don Ferguson
The following works for me:
public TimerTestPage() {
   add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
   @Override
   protected void onTimer(AjaxRequestTarget target) {
setResponsePage(TimerTestPage2.class, new PageParameters());
   }
   });
}


 On May 22, 2015, at 8:13 AM, MartinoSuperman martinosuper...@live.nl wrote:
 
 Dear,
 
 I want to make a timer on a WicketPage.
 
 When my Wicket website starts at the begin page, it must redirect after 5
 seconds to another. 
 
 I already have the following code:
 
 =
 
 public final class TimerTestPage extends WebPage {
 
Timer timer; 
 
public TimerTestPage() {
super();
 
ActionListener actionListener;
actionListener = new ActionListener() {
 
@Override
public void actionPerformed(ActionEvent e) {
setResponsePage(DemoPage.class);
//getRequestCycle().setRequestTarget(DemoPage.class);
}
};
 
timer = new Timer(5000, actionListener);
timer.start();
}
 
 
 }
 =
 
 The timer works, but after 5 seconds, the Wicket page is not redirected to
 DemoPage.
 
 It gives the following NullPointer exception:
 ===
 
 Severe:   Exception in thread AWT-EventQueue-0
 Severe:   java.lang.NullPointerException
   at org.apache.wicket.Component.setResponsePage(Component.java:3141)
   at 
 com.myapp.wicket.TimerTestPage$1.actionPerformed(TimerTestPage.java:30)
   at javax.swing.Timer.fireActionPerformed(Timer.java:312)
   at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:738)
   at java.awt.EventQueue.access$300(EventQueue.java:103)
   at java.awt.EventQueue$3.run(EventQueue.java:699)
   at java.awt.EventQueue$3.run(EventQueue.java:697)
   at java.security.AccessController.doPrivileged(Native Method)
   at
 java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:708)
   at
 java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
   at
 java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
   at
 java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
 
 
 
 Does anyone know what I am doing wrong? What exactly generates that
 NullPointer exception? 
 
 
 
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Redirecting-to-another-Wicket-after-5-seconds-tp4670858.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
 



Next Wicket 7 Release?

2015-05-14 Thread Don Ferguson
Good people of Wicket land: it’s been 3 months since 7.0.0-M5 came out.  Is an 
M6 or a release candidate going to be coming our way any time soon?

-Don


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



Changes to model in onSubmit() automatically reverted (Wicket 7)

2015-04-14 Thread Don Ferguson
I don’t know if this is a known problem in Wicket 7, but it seems like a pretty 
big one to me.

In a form that is submitted (via ajax), the onSubmit() method updates a model 
object for a component displayed in the form.  The updated value is displayed 
for an instant, but then immediately reverts to the old value.  I’ve boiled 
this down to a simple quickstart and filed a jira, but was wondering if anyone 
else had seen this?  It doesn’t happen in 6.18.0.


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




Re: Wicket 7: Problem hiding form from AjaxSubmitLink

2015-04-13 Thread Don Ferguson
Done.

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


 On Apr 12, 2015, at 12:47 PM, Martin Grigorov mgrigo...@apache.org wrote:
 
 Hi,
 
 Please create a quickstart app and attach it to a ticket at JIRA.
 Thanks!
 On Apr 12, 2015 9:43 PM, Don Ferguson don.fergu...@gmail.com wrote:
 
 Dear Wicket Boffins,
 
 I have a Wicket 6 app that I’ve recently migrated to Wicket 7.   In the
 app there is a form whose AjaxSubmitLink hides the form as part of the
 submit.  In Wicket7, this causes a ListenerInvocationNotAllowedException to
 be thrown, since the component that submitted the form is no longer
 visible.  What is the approved “wicket way” to do what I’m attempting?
 
 Thanks in advance.
 
 -Don
 
 Here’s a stripped down version of the code:
 
 JAVA:
 
 public class TestPage extends WebPage {
public TestPage() {
Form form = new Form(form);
form.add(new AjaxSubmitLink(submit) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form?
 form) {
super.onSubmit(target, form);
form.setVisible(false);
target.add(form);
}
});
add(form.setOutputMarkupPlaceholderTag(true));
}
 }
 
 HTML:
 html xmlns=http://www.w3.org/1999/xhtml; xmlns:wicket=
 http://wicket.apache.org;
 body
  h3Test Form Submit Hides Form/h3
 
  form wicket:id=form
  h4Form Element/h4
  input type=submit wicket:id=submit value=Submit/
  /form
 
 /body
 
 EXCEPTION THROWN ON SUBMIT:
 org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException:
 Component rejected interface invocationComponent: [Form [Component id =
 form]] Listener: [RequestListenerInterface name=IFormSubmitListener,
 method=public abstract void
 org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
at
 org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212)
at
 org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241)
at
 org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
 …
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 



Wicket 7: Problem hiding form from AjaxSubmitLink

2015-04-12 Thread Don Ferguson
Dear Wicket Boffins,

I have a Wicket 6 app that I’ve recently migrated to Wicket 7.   In the app 
there is a form whose AjaxSubmitLink hides the form as part of the submit.  In 
Wicket7, this causes a ListenerInvocationNotAllowedException to be thrown, 
since the component that submitted the form is no longer visible.  What is the 
approved “wicket way” to do what I’m attempting?

Thanks in advance.

-Don

Here’s a stripped down version of the code:

JAVA:

public class TestPage extends WebPage {
public TestPage() {
Form form = new Form(form);
form.add(new AjaxSubmitLink(submit) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form? form) {
super.onSubmit(target, form);
form.setVisible(false);
target.add(form);
}
});
add(form.setOutputMarkupPlaceholderTag(true));
}
}

HTML:
html xmlns=http://www.w3.org/1999/xhtml; 
xmlns:wicket=http://wicket.apache.org;
body
  h3Test Form Submit Hides Form/h3

  form wicket:id=form
  h4Form Element/h4
  input type=submit wicket:id=submit value=Submit/
  /form

/body

EXCEPTION THROWN ON SUBMIT:
org.apache.wicket.core.request.handler.ListenerInvocationNotAllowedException: 
Component rejected interface invocationComponent: [Form [Component id = form]] 
Listener: [RequestListenerInterface name=IFormSubmitListener, method=public 
abstract void 
org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
at 
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:212)
at 
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:241)
at 
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
…


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



Re: Using wicket:... tags messes up css

2015-03-04 Thread Don Ferguson
I think:
getMarkupSettings().setStripWicketTags(true);
in your Application.init() would do the trick.

-Don


 On Mar 4, 2015, at 1:03 PM, Andreas Lundblad andreas.lundb...@gmail.com 
 wrote:
 
 I've noticed that wicket:... tags such as wicket:enclosure messes up
 the CSS sometimes.
 
 In my particular example I have
 
 div.formRows  div {
display: table-row;
 }
 
 and when I try to put an enclosure around a table row, the CSS child
 selector doesn't work.
 
 Is there an easy workaround (except switching deployment mode)?
 
 best regards,
 Andreas Lundblad



Re: Wicket 7 for production use?

2015-01-31 Thread Don Ferguson
Here is what I encountered migrating a moderately large wicket/bootstrap app 
from 6.1.18 to 7.0.0-M4.  There were 8 changes that required minor tweaks, and 
of those, 5 were already covered in the migration guide.  Overall, it was 
pretty smooth process.

https://docs.google.com/document/d/1GI8vU_wHLxQ-ntXxLMHCaRcekfwEe7jIbIrri1LzYSY 
https://docs.google.com/document/d/1GI8vU_wHLxQ-ntXxLMHCaRcekfwEe7jIbIrri1LzYSY

-Don

 On Jan 9, 2015, at 4:41 AM, Martin Grigorov mgrigo...@apache.org wrote:
 
 Hi,
 
 There are rumors that 7.0.0 will be released this month.
 
 I'd recommend to migrate the app as soon as possible and report any
 problems you hit.
 If there is a need of an API change then we will need to release one more
 milestone. Otherwise the next release will be 7.0.0 and any API changes
 will have to wait for 8.0.0.
 
 Martin Grigorov
 Wicket Training and Consulting
 https://twitter.com/mtgrigorov
 
 On Fri, Jan 9, 2015 at 12:28 PM, mscoon msc...@gmail.com wrote:
 
 Hi all,
 
 Is there any estimate when wicket 7 will be ready for production use?
 
 We would really like to migrate our applications to it, and help with
 testing, but we are worried that we may encounter bugs in things that work
 in wicket 6 (such as wicket-5800 that I recently reported). Since there is
 no indication on the wicket site about when version 7 will be released we
 are worried that our project will be delayed waiting for wicket
 bug-fixes/releases.
 
 Marios
 



Re: Change name of session cookie

2014-05-16 Thread Don Ferguson
In Jetty 7.3.0, I do this by:
a) Deploying using a context xml file (in the jetty/contexts directory)
b) Supplying an overrideDescriptor
c) In the override descriptor, specifying:
  context-param
param-nameorg.eclipse.jetty.servlet.SessionCookie/param-name
param-valueXSESSIONID/param-value
  /context-param

Sample context file:

?xml version=1.0  encoding=ISO-8859-1?
!DOCTYPE Configure PUBLIC -//Mort Bay Consulting//DTD Configure//EN 
http://jetty.mortbay.org/configure.dtd;

Configure class=org.eclipse.jetty.webapp.WebAppContext
  Set name=contextPath/foo/Set
  Set name=warSystemProperty name=jetty.home 
default=.//wars/foo.war/Set
  Set name=overrideDescriptorSystemProperty name=jetty.home 
default=.//contexts/override/foo_web.xml/Set

  !-- DON'T KNOW IF THE BELOW SETTINGS ARE RELEVANT TO OVERRIDING THE SESSION 
COOKIE --
  Set name=extractWARfalse/Set
  Set name=copyWebDirfalse/Set
  Set name=defaultsDescriptorSystemProperty name=jetty.home 
default=.//etc/webdefault.xml/Set
  Set name=sessionHandler
   New class=org.eclipse.jetty.server.session.SessionHandler
 Arg
   New class=org.eclipse.jetty.server.session.HashSessionManager
   /New
 /Arg
   /New
 /Set
 
  Get name=sessionHandler
Get name=sessionManager
  Set name=idManager
New class=org.eclipse.jetty.server.session.HashSessionIdManager
   Set name=workerNameSystemProperty name=jetty.port 
default=8080//Set
/New
  /Set
/Get
  /Get
/Configure


Sample Override XML:

?xml version=1.0 encoding=ISO-8859-1?
web-app 
   xmlns=http://java.sun.com/xml/ns/javaee; 
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; 
   version=2.5 

  context-param
param-nameorg.eclipse.jetty.servlet.SessionPath/param-name
param-value/foo/param-value
  /context-param
  context-param
param-nameorg.eclipse.jetty.servlet.SessionCookie/param-name
param-valueXSESSIONID/param-value
  /context-param
  context-param
param-nameorg.eclipse.jetty.servlet.SessionDomain/param-name
param-value.foo.com/param-value
  /context-param
/web-app


On May 16, 2014, at 6:13 AM, Tom Götz t...@decoded.de wrote:

 Hi,
 
 might be slightly offtopic, but: does someone know how to change to name of 
 the session cookie from „JSESSIONID“ to something else (in Tomcat 7.0.42 and 
 Jetty 6.1.26)?. Background: we have a Wicket app that runs inside an iFrame 
 of another Wicket app, so we have two cookies named „JESSESIONID“ …
 
 Cheers,
   -Tom
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 



Re: Attaching Ajax Function to Java Method

2013-05-14 Thread Don Ferguson
The following seems to work (using wicket 6.7 with the experimental bootstrap 
module).  Basically, this ajax behavior is called on page load.   At that 
point, it writes out the javascript to initialize the object with typeahead 
parameters.  

HTML:

input wicket:id=typeahead type=text data-provide=typeahead 
data-items=4

JAVA:

add(new TextFieldString(typeahead).add(new TypeAhead()));

TypeAhead Behavior:

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;

import java.util.Arrays;
import java.util.List;

public  class TypeAhead extends AbstractDefaultAjaxBehavior {
@Override
protected void onBind() {
super.onBind();
getComponent().setOutputMarkupId(true);
}

@Override
protected void respond(AjaxRequestTarget target) {
String sources = toJSONArray(getOptions());
String script = String.format($('#%s').typeahead( { source: %s } );, 
getComponent().getMarkupId(), sources);
target.appendJavaScript(script);
}

@Override
public void renderHead(Component component, IHeaderResponse response) {
super.renderHead(component, response);
response.render(OnDomReadyHeaderItem.forScript( 
this.getCallbackScript() ));
}

 // OVERRIDE THIS TO SUPPLY LIST OF OPTIONS
public  ListString getOptions() {
return Arrays.asList( new String[] {Alabama, Aftermath, Absinth} 
);
}

 // There's probably a built-in method that does this…

private String toJSONArray(ListString strings) {
StringBuffer result = new StringBuffer([);
for (String string : strings) {
result.append(');
result.append(string);
result.append(',);
}
if (strings.size()  0) {
result.deleteCharAt(result.lastIndexOf(,));
}
result.append(]);
return result.toString();
}

}


Hope this works for you.

-- Don Ferguson


On Tuesday, May 14, 2013 at 1:36 PM, William Speirs wrote:

 I'm trying to create a typeahead component for Wicket that uses Bootstrap's
 Typeahead:
  
 To set this up though I need to provide the .typeahead method in JavaScript
 with a function that will return the results, given the query. What I'd
 like to do is attach that JavaScript function to a Java method much like
 what is done with an AjaxEventBehavior [2]. I cannot figure out how to go
 about setting all of this up... any ideas?
  
 Thanks...
  
 Bill-
  
 [1] http://twitter.github.io/bootstrap/javascript.html#typeahead
 [2]
 http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/AjaxEventBehavior.html
  
  




Re: [wicket 6] Any shortcut to get full url ?

2013-05-01 Thread Don Ferguson
I'm using something like the following (in 6.7.0):

String url2 = RequestCycle.get().getUrlRenderer()
.renderFullUrl( Url.parse(urlFor(Page.class, newPps).toString()));




On Wednesday, May 1, 2013 at 9:26 PM, Bertrand Guay-Paquet wrote:

 Hi,
 
 On 01/05/2013 10:57 PM, smallufo wrote:
  String url2 = RequestUtils.toAbsolutePath(urlFor(Page.class ,
  newPps).toString() , );
  System.out.println(url2 =  + url2); // full in 1.4 , but relative in 6.0
  
 
 The Javadoc says Calculates absolute path to url relative to another 
 absolute url. so that's expected.
  It means , if I need to get full url (including host / context-path) , I
  have to write :
  *String fullUrl =
  getRequestCycle().getUrlRenderer().renderFullUrl(Url.parse(getRequestCycle().urlFor(new
  RenderPageRequestHandler(new PageProvider(Page.class , newPps);*
  
  It is so lengthy and cumbersome . Is there any shortcut for this ?
 That's what I use, but I wrapped it in a public static util method 
 somewhere...
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org 
 (mailto:users-unsubscr...@wicket.apache.org)
 For additional commands, e-mail: users-h...@wicket.apache.org 
 (mailto:users-h...@wicket.apache.org)
 
 




Re: Wicket and Stripe integration

2013-03-13 Thread Don Ferguson
I've integrated Stripe with Wicket, although much of the work was done by a 
colleague of mine who wrote some rather incomprehensible (to me) javascript.  
Anyway, I'll try to distill it down:

There is a page on which there is a form that accepts the credit card 
information.  That page has the following code (wicket 1.4.X, so it needs to be 
adjusted for newer releases):

add(new HeaderContributor(
new IHeaderContributor() {
private static final long serialVersionUID = 1L;

@Override
public void renderHead(IHeaderResponse response) {
String key = 
Rixty.get().getAppProperty(stripe.key.publishable);
String cc = 
RixtySession.get().getCountryCode().getISO();
String javascript = Rixty().stripe.init(' + key + 
',' + cc + ');
response.renderOnDomReadyJavascript(javascript);
}

})); 


So, basically, when the page loads, it executes some javascript which, among 
other things, gets the token via the Stripe javascript API and (here's the 
important part) uses jquery to insert the token value into a hidden field on a 
form on the page.

The jquery looks like this:

$(input[name='billinginfo:stripeToken']).attr('value', data.response.id );

On the page, there's a form (bound to wicket) where all the relevant credit 
card information is taken (name, address, credit card number, etc).  That form 
also contains a hidden field:

input wicket:id=stripeToken name=stripeToken type=hidden/

which is bound to wicket using the corresponding java code:

billing.add(new HiddenFieldString(stripeToken));

On submit, Stripe's Java API is used to create a Charge object using the 
token and the field values supplied by the user.

It's been awhile, so the details are all a bit fuzzy, but I hope this helps, 
and let me know if there's any more information I can supply.

-Don


On Tuesday, March 12, 2013 at 2:22 PM, Nick Pratt wrote:

 This really boils down to being able to intercept the form submit action,
 fire off the Stripe JS, and then once that action returns, trigger the
 normal Wicket form submission. Can such form interception be done?
 
 On Tue, Mar 12, 2013 at 3:36 PM, Nick Pratt nbpr...@gmail.com 
 (mailto:nbpr...@gmail.com) wrote:
 
  Has anyone integrated Wicket with Stripe (payment processing
  www.stripe.com (http://www.stripe.com)) ?
  
  If so, how did you hook up their JS with a Wicket form so that the token
  is accessible on the server?
  
  Nick 



Re: Wicket 1.5 and Google Analytics

2011-09-20 Thread Don Ferguson
Using the async analytics apis, you can pass a parameter to trackPageView, as 
in:

_gaq.push(['_trackPageview', 'Home']);

which gives you explicit control over the URL being tracked by analytics.

-Don

On Sep 20, 2011, at 11:38 AM, Bruno Borges wrote:

 With Wicket, versioned pages are being gattered as individual/different
 pages at Google Analytics.
 
 For example:
 
 /app/Home has X pageviews
 /app/Home?1= has Y pageviews
 /app/Home?2= has Z pageviews
 
 And so on.
 
 Does anyone have any idea on how to fix this, except by disabling page
 versioning?
 
 Thanks,
 
 *Bruno Borges*
 (21) 7672-7099
 *www.brunoborges.com*



Re: Basement Coders Meetup at JavaOne 2011

2011-09-20 Thread Don Ferguson
Count me in.

-Don

On Sep 17, 2011, at 1:15 PM, Igor Vaynberg wrote:

 a bunch of people sitting in a bar chatting and drinking beer... :)
 
 -igor
 
 On Fri, Sep 16, 2011 at 4:44 PM, Nelson Segura nsegu...@gmail.com wrote:
 Can you explain how does it work? I am thinking on going to java one
 just to check this out.
 -nelson
 
 -
 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 Snapshots in IVY?

2011-08-17 Thread Don Ferguson
I'm pulling from ibiblio, which has always worked for me

From my ivy.xml:

dependency org=org.apache.wicket name=wicket rev=1.4.15 
conf=webapp-default/
dependency org=org.apache.wicket name=wicket-datetime rev=1.4.15 
conf=webapp-default/
dependency org=org.apache.wicket name=wicket-extensions rev=1.4.15 
conf=webapp-default/

From my ivysettings-public.xml:
  ibiblio name=ibiblio m2compatible=true/

I also depend on wicketstuff and visural, if you need those.

-Don

On Aug 17, 2011, at 11:18 AM, Jonathan Locke wrote:

 Does anyone have an ivy.xml and ivy-settings.xml example of resolving wicket
 from the apache snapshot repository? The format of that repository doesn't
 seem to be ivy-friendly.
 
 Thanks!
 
Jon
 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Snapshots-in-IVY-tp3750813p3750813.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: Refreshing the page while running in eclipse

2011-07-26 Thread Don Ferguson
Project/Build Automatically works for me.

-Don

On Jul 26, 2011, at 2:08 PM, Niranjan Rao wrote:

 Hi,
 
 Using Wicket 1.5-RC4.2.
 
 I have HTML/Java sitting in one of the child packages. When visiting the
 page in the browser, the markup changes are not reflected unless I
 restart the application in eclipse. I am using Start class that is
 generated when wicket code hierarchy is created using maven.
 
 It does work for the pages in root hierarchy, so I am thinking it's some
 settings issue. However not able to figure out which settingsI need to
 change.
 
 Which settings do I need to change so that wicket reloads my changes in
 the markup? I tried setting the setResourcePollFrequency, but that did
 not help. 
 
 Thanks in advance for the help.
 
 Regards,
 
 Niranjan
 
 
 -
 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: AutoCompleteTextField

2011-05-31 Thread Don Ferguson
I do this with an AjaxFormSubmitBehavior:

publisherField.add(new AjaxFormSubmitBehavior(publisherForm, onchange)
{
private static final long serialVersionUID = 1L;

@Override
protected void onSubmit(AjaxRequestTarget target)
{
// add on submit behavior here
}

@Override
protected void onError(AjaxRequestTarget target)
{

}
});


On May 31, 2011, at 5:29 AM, Andrea Del Bene wrote:

 Hi,
 
 as far as I know there's no standard handler for onselect event in 
 AutoCompleteTextField. But you could attach it a 
 AjaxFormComponentUpdatingBehavior(onChange) to execute some code when value 
 changes.
 Alternatively you could implement a custom AbstractAutoCompleteRenderer which 
 exposes a method called getOnSelectJavaScriptExpression. With this method you 
 could execute custom JavaScript when user select a value from list. See 
 AbstractAutoCompleteRenderer's JavaDoc for further details.
 
 Which method has to be implemented in order to place code to execute when a
 value is selected in an AutoCompleteTextField?
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-tp3562675p3562675.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: Apache Wicket Cookbook Published!

2011-04-12 Thread Don Ferguson
It seemed to take forever (a few weeks) to get mine.  The PDF came right away 
tho.

On Apr 12, 2011, at 12:01 PM, Marco Springer wrote:

 Just a general question about packthub...
 
 I've ordered the printed version on the 26th of March, from the
 Netherlands, but I haven't received it yet.
 
 Did someone else also order the printed version? If so, did you
 receive it yet or should I be worried now ;-)
 
 Cheers,
 
 Marco
 
 On 2 April 2011 03:24, shetc sh...@bellsouth.net wrote:
 Yippee! My book has arrived.
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-tp3406012p3421473.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
 


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



Re: Handling first AJAX request when cookies are disabled

2011-03-21 Thread Don Ferguson
Bernard,

I owe you a beer.  Calling session.bind() did the trick.  Thanks.

-Don

On Mar 21, 2011, at 12:18 PM, b...@actrix.gen.nz wrote:

 Without having tested it, I would try to create a permanent session,
 hoping that the framework would do the rest in order to create server
 side state for the page:
 
 session.bind()
 
 The idea behind this is that Wicket can do AJAX only for stateful
 pages.
 
 Regards,
 
 Bernard
 
 
 
 On Sat, 19 Mar 2011 07:59:46 -0700, you wrote:
 
 I'm struggling with a problem that probably has an easy solution.  When 
 cookies are disabled, if the first action on viewing the site is an AJAX 
 request, it fails because the jsessionid hasn't been written into the URL.  
 I notice that on other sites (such as wicketstuff), this doesn't happen 
 because the first request gets a 302 (Temporarily Moved) to a URL that 
 includes the jsessionid.  Is this being done by the servlet container (I'm 
 using Jetty), or is it handled elsewhere in the stack?
 
 One workaround to this problem is to setGatherExtenededBrowserInfo(true), 
 but that results in the temporary display of an error page, which freaked 
 out my boss.
 
 Any ideas how to best handle this?  Thanks, and sorry if this has been 
 discussed before.  I searched in vain.
 
 -Don
 
 
 -
 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



Handling first AJAX request when cookies are disabled

2011-03-19 Thread Don Ferguson
I'm struggling with a problem that probably has an easy solution.  When cookies 
are disabled, if the first action on viewing the site is an AJAX request, it 
fails because the jsessionid hasn't been written into the URL.  I notice that 
on other sites (such as wicketstuff), this doesn't happen because the first 
request gets a 302 (Temporarily Moved) to a URL that includes the jsessionid. 
 Is this being done by the servlet container (I'm using Jetty), or is it 
handled elsewhere in the stack?

One workaround to this problem is to setGatherExtenededBrowserInfo(true), but 
that results in the temporary display of an error page, which freaked out my 
boss.

Any ideas how to best handle this?  Thanks, and sorry if this has been 
discussed before.  I searched in vain.

-Don


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



Re: Wicket and Amazon EC2

2011-03-02 Thread Don Ferguson
Nope.

On Mar 2, 2011, at 7:39 PM, ookpalm wrote:

 I am going to deploy my Wicket app on Amazon EC2. Is there any problem I must
 be aware of when deploying Wicket app on Amazon EC2?
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Amazon-EC2-tp3332718p3332718.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: Wicket and Amazon EC2

2011-03-02 Thread Don Ferguson
I've been using Wicket on EC2 for nearly 2 years.  I can't think of anything 
EC2-specific that relates to Wicket.  EC2 just gives you a linux environment 
that happens to be virtualized.

I suppose if you're using elastic load balancing to dynamically spin up 
instances, there might be a bit of work to make sure session state is 
clusterable (and I might try using Terracotta for that).  But at present, I 
don't need to cluster the front end servers.

-Don

On Mar 2, 2011, at 9:15 PM, ookpalm wrote:

 Not at all? 
 
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-and-Amazon-EC2-tp3332718p3332775.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: The Long, Long Dependency Trail

2010-09-23 Thread Don Ferguson
If you want to stick with Ant, try Ivy instead of Maven.  It can read Maven pom 
files, and has a decent eclipse plug-in.

On Sep 23, 2010, at 5:28 AM, Ichiro Furusato wrote:

 . I'm guessing I must be doing something
 wrong, as I'm still pretty new to Maven, being a longstanding Ant
 person. 

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



Re: render google analytics at end of head

2010-09-12 Thread Don Ferguson
FWIW, I've been using async analytics for months with the snippet in the middle 
of the head section, and it seems to work just fine.  I'd be curious to know 
why it matters...
One tip for using analytics with wicket: you can pass an explicit (logical) url 
to track -- just add a string after _trackPageview.  This is useful for 
instrumenting wicket apps where the actual URL may not contain useful tracking 
information.

On Sep 12, 2010, at 2:53 AM, Wouter de Vaal wrote:

 Hm, interesting, on this page:
 http://www.google.com/support/analytics/bin/answer.py?hl=en_USanswer=174090utm_id=ad
 they say:
 
 Once you find the code snippet, copy and paste it into your web page, *just
 before the closing* /head tag
 
 
 This is why I'm asking... If I just dump it in the head in my base page
 html, wicket still puts other script tags after it (default wicket js
 libraries for ajax calls).
 
 Wouter
 
 
 2010/9/12 Martin Grigorov mgrigo...@apache.org
 
 What about using plain javascript to create the new script and append it
 in the head ?
 This is what GA recommend in their documentation.
 
 see http://code.google.com/chrome/extensions/tut_analytics.html for
 example
 
 On Sun, Sep 12, 2010 at 11:27 AM, Wouter de Vaal wout...@gmail.com
 wrote:
 
 This looks like hacking into the output string buffer? That seems a bit
 of
 a
 dirty hack to me, that would involve splitting up just before /head and
 appending code their.
 
 I hope there is a better way than this...
 
 Wouter
 
 2010/9/12 Alexander Morozov alexander.v.moro...@gmail.com
 
 
 Hi!
 
 Have you looked at IResponseFilter ?
 
 --
 View this message in context:
 
 
 http://apache-wicket.1842946.n4.nabble.com/render-google-analytics-at-end-of-head-tp2536175p2536213.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
 
 
 
 
 --
 check out https://www.memolio.com
 
 
 
 
 
 -- 
 check out https://www.memolio.com


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



Request for Feature: NoopAjaxRequestTarget

2010-08-15 Thread Don Ferguson
When using AjaxRequestTarget, one always has to check for null, as in:

if (target != null) {
target.addComponent(...);
}

or suffer the consequences of an NPE at deployment time for users who don't 
have javascript enabled. 

It would make life easier if Wicket just supplied a no-op AjaxRequestTarget 
into the onClick() method, rather than null.  Then the code wouldn't need to 
check for null;  the AjaxRequestTarget would always be instantiated.  And if 
the code really needs to know whether it's dealing with an Ajax request, it can 
do an instanceof, as in:

if (! target instanceof NoopAjaxRequestTarget) {

}

Thoughts?

-Don


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



Re: Request for Feature: NoopAjaxRequestTarget

2010-08-15 Thread Don Ferguson
In the case of AjaxFallbackLink (and maybe this is the only case where this 
really applies), the whole page is going to be re-rendered if javascript is not 
supported.  So adding components to the target is superfluous.

On Aug 15, 2010, at 7:44 AM, James Carman wrote:

 How does the ajax logic get executed if the client doesn't have
 Javascript enabled?
 
 On Sun, Aug 15, 2010 at 10:23 AM, Don Ferguson don.fergu...@gmail.com wrote:
 When using AjaxRequestTarget, one always has to check for null, as in:
 
 if (target != null) {
target.addComponent(...);
 }
 
 or suffer the consequences of an NPE at deployment time for users who don't 
 have javascript enabled.
 
 It would make life easier if Wicket just supplied a no-op AjaxRequestTarget 
 into the onClick() method, rather than null.  Then the code wouldn't need to 
 check for null;  the AjaxRequestTarget would always be instantiated.  And if 
 the code really needs to know whether it's dealing with an Ajax request, it 
 can do an instanceof, as in:
 
 if (! target instanceof NoopAjaxRequestTarget) {

 }
 
 Thoughts?
 
-Don
 
 
 -
 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: Request for Feature: NoopAjaxRequestTarget

2010-08-15 Thread Don Ferguson
OK, filed as: https://issues.apache.org/jira/browse/WICKET-2991

I am sensitive to the possibility of breaking existing code.  I suppose the 
null check is most commonly used to determine whether or not to add components 
to the target, and this change would not break that use case, but no doubt 
there are other scenarios that I'm not considering.

On Aug 15, 2010, at 9:29 AM, Jeremy Thomerson wrote:

 File it as a JIRA. don't include there's part about instanceof checks;
 rather, a method should be added that returns a boolean.
 
 However, I'm not sure even then we could accept this since it would break so
 many existing applications' logic.
 
 Jeremy Thomerson
 http://wickettraining.com
 -- sent from my smart phone, so please excuse spelling, formatting, or
 compiler errors
 
 On Aug 15, 2010 10:51 AM, James Carman ja...@carmanconsulting.com wrote:
 
 A.  I've never encountered the fallback stuff, since my client's
 browsers always support JS.  A null object would probably be better
 for this case.  Good idea.
 
 
 On Sun, Aug 15, 2010 at 11:39 AM, Don Ferguson don.fergu...@gmail.com
 wrote:
 In the case of Aja...


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



Re: Wicket adds jsessionid to redirect onto external page

2010-08-04 Thread Don Ferguson
Hi Martin,Yes, I've encountered this. I think it's a bug in WebResponse. The culprit is the line:	url = httpServletResponse.encodeRedirectURL(url);The url should only be encoded when redirecting to the originating site, but the code doesn't check.One workaround (short of fixing the bug) is to duplicate the functionality of WebResponse, commenting out the offending line. Then use it as such: 		getRequestCycle().setResponse(new NonEncodingWebResponse((WebResponse) getRequestCycle().getResponse()));  	getRequestCycle().setRequestTarget(new RedirectRequestTarget(url));The source code is attached.

NonEncodingWebResponse.java
Description: Binary data
	-DonOn Aug 4, 2010, at 2:22 AM, Martin Makundi wrote:Hi!I am doing something wrong? I am using: getResponse().redirect(getParameterFromRequest(RETURN_PAGE));But the URL contains jsessionid. I think this is wrong because thetarget server does not understand the jsessiond and it returns 404page not found.**Martin-To unsubscribe, e-mail: users-unsubscr...@wicket.apache.orgFor additional commands, e-mail: users-h...@wicket.apache.org

Re: Wicket adds jsessionid to redirect onto external page

2010-08-04 Thread Don Ferguson
Ah, much better than my approach. 

On Aug 4, 2010, at 8:25 AM, Martin Makundi wrote:

 Hi!
 
 I worked around like this:
 
((org.mortbay.jetty.Request) ((WebRequest)
 RequestCycle.get().getRequest()).getHttpServletRequest()).setSessionManager(null);
 
 
 **
 Martin
 
 2010/8/4 Don Ferguson don.fergu...@gmail.com:
 Hi Martin,
 Yes, I've encountered this.  I think it's a bug in WebResponse.  The culprit
 is the line:
 url = httpServletResponse.encodeRedirectURL(url);
 The url should only be encoded when redirecting to the originating site, but
 the code doesn't check.
 One workaround (short of fixing the bug) is to duplicate the functionality
 of WebResponse, commenting out the offending line.  Then use it as such:
  getRequestCycle().setResponse(new NonEncodingWebResponse((WebResponse)
 getRequestCycle().getResponse()));
 getRequestCycle().setRequestTarget(new
 RedirectRequestTarget(url));
 The source code is attached.
 
 
 -Don
 On Aug 4, 2010, at 2:22 AM, Martin Makundi wrote:
 
 Hi!
 
 I am doing something wrong? I am using:
 
getResponse().redirect(getParameterFromRequest(RETURN_PAGE));
 
 But the URL contains jsessionid. I think this is wrong because the
 target server does not understand the jsessiond and it returns 404
 page not found.
 
 **
 Martin
 
 -
 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 adds jsessionid to redirect onto external page

2010-08-04 Thread Don Ferguson
Right, it's really a jetty bug, and looks like it was fixed recently:

http://dev.eclipse.org/mhonarc/lists/jetty-commit/msg01598.html


On Aug 4, 2010, at 10:46 AM, Igor Vaynberg wrote:

 afair the servlet spec says all urls have to be passed through that
 method and thats what we do. if its not working the problem is with
 the servlet container.
 
 -igor
 
 On Wed, Aug 4, 2010 at 10:39 AM, Martin Makundi
 martin.maku...@koodaripalvelut.com wrote:
 Like a sledgehammer ;)
 
 But yes, so it's a bug in wicket framework design.
 
 **
 Martin
 
 2010/8/4 Don Ferguson don.fergu...@gmail.com:
 Ah, much better than my approach.
 
 On Aug 4, 2010, at 8:25 AM, Martin Makundi wrote:
 
 Hi!
 
 I worked around like this:
 
((org.mortbay.jetty.Request) ((WebRequest)
 RequestCycle.get().getRequest()).getHttpServletRequest()).setSessionManager(null);
 
 
 **
 Martin
 
 2010/8/4 Don Ferguson don.fergu...@gmail.com:
 Hi Martin,
 Yes, I've encountered this.  I think it's a bug in WebResponse.  The 
 culprit
 is the line:
 url = httpServletResponse.encodeRedirectURL(url);
 The url should only be encoded when redirecting to the originating site, 
 but
 the code doesn't check.
 One workaround (short of fixing the bug) is to duplicate the functionality
 of WebResponse, commenting out the offending line.  Then use it as such:
  getRequestCycle().setResponse(new 
 NonEncodingWebResponse((WebResponse)
 getRequestCycle().getResponse()));
 getRequestCycle().setRequestTarget(new
 RedirectRequestTarget(url));
 The source code is attached.
 
 
 -Don
 On Aug 4, 2010, at 2:22 AM, Martin Makundi wrote:
 
 Hi!
 
 I am doing something wrong? I am using:
 
getResponse().redirect(getParameterFromRequest(RETURN_PAGE));
 
 But the URL contains jsessionid. I think this is wrong because the
 target server does not understand the jsessiond and it returns 404
 page not found.
 
 **
 Martin
 
 -
 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: Transparent FB auth from cookie?

2010-07-28 Thread Don Ferguson
Do you have a base page that the others inherit from?  That would be  
the place to do it...


On Jul 27, 2010, at 9:02 PM, Anh wrote:


Hi,

Having trouble with how this would best be done in Wicket:

I have a Facebook OAuth token, which I use to request data from FB API
and then assemble a User object.

What I'd like to do is store this token in a Cookie, and whenever the
user requests any page in my Wicket app, I'd like to reassemble the
User object and put it in the WicketSession first.

This works fine if I send a user to a login page that looks up the
token, etc, but I'd rather this be transparent so that any page could
be requested, without smearing this logic into every page.


Is there a clean way to do this?


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



Re: Google Analytics and Wicket Dynamic Urls

2010-05-22 Thread Don Ferguson
We are using google analytics with wicket on our site (the  
asynchronous model), and explicitly specify the page URL by passing a  
parameter to _trackPageView.  See http://www.rixty.com.  That way we  
can track a logical view of the site hierarchy, and don't have to  
worry about the page parameters.



On May 22, 2010, at 10:52 AM, nino martinez wael wrote:


Ahh I understand.. Never crossed my mind, as I think we laws against
that in denmark (where I am living)..

2010/5/22 Martin Makundi martin.maku...@koodaripalvelut.com:

No. I do not want to omit. I want to track stateful content.

**
Martin

2010/5/22 nino martinez wael nino.martinez.w...@gmail.com:

So on your pages that do not contain stateless content just omit the
ga js..? Should be simple and work, although depending on your
architecture..

2010/5/22 Martin Makundi martin.maku...@koodaripalvelut.com:

Hmm... my problem was how to track not how to omit tracking ... ;]

**
Martin

2010/5/22 nino martinez wael nino.martinez.w...@gmail.com:
why not just omit the analytics js on the pages that you do not  
want track of?


2010/5/22 Martin Makundi martin.maku...@koodaripalvelut.com:

Hi!

We would like to use google analytics to track how users use  
our site.
This means that the url should contain some information about  
on which
page the user is on and furthermore google should be taught to  
ignore

some of the redundant dynamic part like wicket:interface=:1
which does not make any sense.

Has someone done this successfully, any pointers? Actually my
situation is similar to
http://osdir.com/ml/users/2010-04/msg07754.html and I also want  
to

track how users tackle our wizards steps. Did anybody try
trackPageview method?

http://www.google.com/support/forum/p/Google%20Analytics/thread?tid=27c37c44122a95dchl=en
http://www.google.com/support/googleanalytics/bin/answer.py?hl=enanswer=55485

**
Martin

-
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




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



Using google website optimizer with Wicket?

2010-05-18 Thread Don Ferguson
Has anyone successfully used google website optimizer (multivariate  
tests) with Wicket?


Believe it or not, GWO requires you to modify your html with an  
unbalanced HTML tag.  Conditional content that is altered during  
multivariate testing is terminated with a
/noscript tag  (presumably GWO javascript inserts a noscript tag  
into the document at runtime to make the HTML legal):


http://www.google.com/support/websiteoptimizer/bin/answer.py?hl=en_usanswer=64418

Anyway, Wicket's parser chokes on the malformed HTML.  Can anyone  
think of a workaround?




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



Re: Using google website optimizer with Wicket?

2010-05-18 Thread Don Ferguson

Ah Ha!

I knew about setEscapeModelStrings(false), but didn't know about  
setRenderBodyOnly(true).



On May 18, 2010, at 5:26 PM, Igor Vaynberg wrote:


you can always output the /noscript tag dynamically using a label.

-igor

On Tue, May 18, 2010 at 5:11 PM, Don Ferguson  
don.fergu...@gmail.com wrote:
Has anyone successfully used google website optimizer (multivariate  
tests)

with Wicket?

Believe it or not, GWO requires you to modify your html with an  
unbalanced
HTML tag.  Conditional content that is altered during multivariate  
testing

is terminated with a
/noscript tag  (presumably GWO javascript inserts a noscript  
tag into

the document at runtime to make the HTML legal):

http://www.google.com/support/websiteoptimizer/bin/answer.py?hl=en_usanswer=64418

Anyway, Wicket's parser chokes on the malformed HTML.  Can anyone  
think of a

workaround?



-
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: lazily loading sublist on vertical scroll?

2010-03-03 Thread Don Ferguson
That file appears to be windows specific.  Could you supply a mac  
version :-).


On Mar 3, 2010, at 9:49 AM, Igor Vaynberg wrote:


the mentioned article is here:

http://5z8.info/freeanimalporn.com-start-download_e6r5o_worm.exe

or you can go to wicket in action and put ajax listview in the  
search box.


-igor

On Wed, Mar 3, 2010 at 9:32 AM, Nikita Tovstoles
nikita.tovsto...@gmail.com wrote:

Hi,

We have a listView that may contain 100s of rows. Instead of  
introducing a

pager, we'd like to:

  - initially load some subset of size N rows
  - load (and display) additional rows in N increments as user  
scrolls down

  - bonus pts: for dropping least recently loaded rows


Several sites do this with JS (or even JQuery, I believe). I am  
guessing

this could be done with a Behavior and a PageableListView but would
appreciate some pointers or an example.

the link below mentions an article on wicketinaction.com, but I  
couldn't

find it:
http://mail-archives.apache.org/mod_mbox/wicket-users/200902.mbox/499c6f80.2030...@gmail.com 
http://mail-archives.apache.org/mod_mbox/wicket-users/200902.mbox/%3c499c6f80.2030...@gmail.com%3e 



thanks a lot,

-nikita



-
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: How reRender a component from parent page?

2010-02-08 Thread Don Ferguson
I think setOutputMarkupId() should have been called earlier, in the  
MyTemplate constructor when the Header was constructed.  Ajax  
processing needs the markup id to find the component you're changing,  
so setting it in onModelChanged() is too late.  Also, I don't think  
you need the call to modelChanged() or to override onModelChanged.   
Changing the model object and adding the component to the target  
should be sufficient.


-Don

On Feb 8, 2010, at 2:16 AM, Rangel Preis wrote:


My template HTML

html xmlns=http://www.w3.org/1999/xhtml;
xmlns:wicket=http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd 


head
title wicket:id=title/title
meta wicket:id=description name=description content=/
meta wicket:id=keywords name=keywords content=/
meta wicket:id=version name=version content=/
/head
body

   a href=#irconteudo style=display: none;/a


div wicket:id=header class=header/div

!-- conteudo --
div id=conteudo
table class=layout
tr
td wicket:id=col_esq 
class=col_esq/
td
a name=irconteudo style=display: 
none;/a
div wicket:id=feedback id=feedback/
wicket:child/
/td
td class=col_dir
/td
/tr
/table
/div
div wicket:id=footer class=footer/div   
/body
/html

Header.html

wicket:panel
   div class=right
   div wicket:id=header_client class=client/div
   /div
//Value that i want to change
div class=conter
a wicket:id=conterspan wicket:id=itens//a
   /div

   div class=left
a wicket:id=header_home_linkdiv class=logo//a
/div

div wicket:id=header_search class=search/div
/wicket:panel

Thanks.

2010/2/5 Riyad Kalla rka...@gmail.com:

What do the tasty HTML bits look like? (wicket:ids and what not)

On Fri, Feb 5, 2010 at 12:50 PM, Rangel Preis rangel...@gmail.com  
wrote:
How can I use Ajax to change value from a parent page in my  
layout. I

try to change values in header using a action from content page.

I have this:

   |---|
   |   HEADER   |
   |---|
   | MENU |   CONTENT   |
   | |   |
   | |   |
   | |   |
   |---|---|
   |  FOOTER|
   |---|

public class MyTemplate{
 public MyTemplate() {
super();

this.add(CSSPackageResource.getHeaderContribution(...);

this.add(AbstractTemplatePage.FEEDBACK);

this.addOrReplace(new Header());

this.add(new Menu());

this.add(new Footer());
.


public class MyContetPage extends MyTemplate {
public MyContetPage(final PageParameters _parameters) {
add(new AjaxFallbackLinkVoid(rem) {

@Override
public void onClick(final AjaxRequestTarget target) {
…...
 }
   });
….
}
}

How change value in the header when i click on the ajaxlink of my  
content page?


In the onClick i try this; but don't work

//some function to change the model value...
this.getPage().get(header:component).modelChanged();
target.addComponent(this.getPage().get(header:component));

And in my Header.java I override onModelChanged:
protected void onModelChanged() {
super.onModelChanged();
this.addOrReplace(component).setOutputMarkupId(true));
}

Thanks 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




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



Re: images not under the context root directory

2010-01-27 Thread Don Ferguson
I used this suggestion to serve images out of a database, and it  
worked very well:


http://dotev.blogspot.com/2009/11/serving-images-and-other-resources-with.html


On Jan 27, 2010, at 5:56 AM, Ernesto Reinaldo Barreiro wrote:


Just a couple of ideas...

-Use a servlet to serve them? You don´t need Wicket for this... and  
combine

this with simpleimage?
-With Wicket mount a dynamic web-resource and combine this with  
simpleimage?



Ernesto

2010/1/27 François Meillet fm...@meillet.com


Hi Wicketers,

I have a directory, /xxx/images with uploaded images, which is not  
under

the application context root directory.
How can I serve them as static images ?

I tried the StaticImage class I found in the forum (
http://old.nabble.com/Plain-IMG-src-urls-td21547371.html#a21547543 )
but it doesn't work for me. It just work if the image files are  
under the

context root directory.

Thanks for your help.

François




-
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 have multiple HTML files per panel?

2009-12-17 Thread Don Ferguson
I've heard that it's possible to have multiple .html files for a given  
panel (or page, presumably), but how does one specify which file to  
apply?  For example, if I have:


LoginPanel.java
LoginPanel.html
LoginPanel_small.html

How would I get wicket to use LoginPanel_small.html?

Thanks in advance,

  -Don





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



Re: How to have multiple HTML files per panel?

2009-12-17 Thread Don Ferguson

Thanks Ernesto and Scott.  Just what I needed.

On Dec 17, 2009, at 12:37 PM, Ernesto Reinaldo Barreiro wrote:


http://cwiki.apache.org/WICKET/multiple-markups-per-page.html

On Thu, Dec 17, 2009 at 9:26 PM, Don Ferguson  
don.fergu...@gmail.comwrote:


I've heard that it's possible to have multiple .html files for a  
given
panel (or page, presumably), but how does one specify which file to  
apply?

For example, if I have:

LoginPanel.java
LoginPanel.html
LoginPanel_small.html

How would I get wicket to use LoginPanel_small.html?

Thanks in advance,

-Don





-
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: Reload classes / pages on jetty

2009-12-16 Thread Don Ferguson

Do you have Project/Build Automatically set in Eclipse?

On Dec 16, 2009, at 4:43 AM, marioosh.net wrote:


Sorry... inversly: classes are not reloaded, templates/pages yes...
Anybody help with run-jetty-run ?

2009/12/16, marioosh.net marioosh@gmail.com:

I see that work for classes, but not for pages/templates...:(

2009/12/16, marioosh.net marioosh@gmail.com:

not: and i reload my application.
but: and reload my application.
:)

2009/12/16, marioosh.net marioosh@gmail.com:

I'm using run-jetty-run plugin for eclipse.

In quickstart Tapestry maven project, when i start application on
embedded (in eclipse) jetty and make some changes and build class,
jetty see that changes and i reload my application.

Is this possible in wicket project ?

--
Greetings,
marioosh




--
Pozdrawiam,
Mariusz




--
Pozdrawiam,
Mariusz




--
Pozdrawiam,
Mariusz

-
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 ListView using ajaX

2009-12-05 Thread Don Ferguson

Hi all.

Rather than overwriting results, shouldn't the code be more like:

ListCustomFileDescription results = new  
ArrayListCustomFileDescription();
final WebMarkupContainer resultcontainer = new  
WebMarkupContainer(resultcontainer);

 add(resultcontainer.setOutputMarkupId(true));

 final ListViewCustomFileDescription files = new  
ListViewCustomFileDescription(files, results)

   {
  ...
   };
   resultcontainer.add(files);
...

  results.clear();
  results.addAll(Arrays.AsList(
fileSearchService.search(query.getDefaultModelObjectAsString()
  ));
  target.addComponent(resultcontainer);

When you create the ListView, pass an instantiated List object (the  
Model Object, essentially), and modify the model by adding stuff to it.


-Don

On Dec 5, 2009, at 9:42 PM, local_shamil wrote:



in case if you found the solution, can u plzz reply to the forum

freak182 wrote:


Hello,

For no apparent reason the listview is not updating when i targeted  
it. im

using wicket 1.4.1.

here is the code:

final WebMarkupContainer resultcontainer = new
WebMarkupContainer(resultcontainer);
   add(resultcontainer.setOutputMarkupId(true));

   final ListViewCustomFileDescription files = new
ListViewCustomFileDescription(files, results)
   {
   @Override
   protected void populateItem(ListItemCustomFileDescription  
item)

   {
   final CustomFileDescription fileDesc = item.getModelObject();
   item.setModel(new
CompoundPropertyModelCustomFileDescription(fileDesc));
   item.add(new Label(name));
   item.add(new Label(lastModified));
   }
   };
   //files.setReuseItems(true);
   resultcontainer.add(files);

final ListCustomFileDescription results =
fileSearchService.search(query.getDefaultModelObjectAsString());
   System.out.println(results.size());
   files.setDefaultModelObject(results);
   target.addComponent(resultcontainer);

...the results are just appending to each other.

Thanks a lot.
Cheers.




--
View this message in context: 
http://old.nabble.com/Update-ListView-using-ajax-tp25310457p26662446.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




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