Re: Unit testing for a page

2012-11-29 Thread Martin Grigorov
Hi Anatoly,

You are doing it right.
To be able to verify that the other page is the response this other page
have to be properly rendered, otherwise you would receive InternalErrorPage
instead.
To render it Wicket uses the normal rendering process so you need all
prerequisites ...

You can use tester#startComponentInPage() to test on component level. But
this is not what you need.


On Wed, Nov 28, 2012 at 9:56 PM, Anatoly Kupriyanov kan@gmail.comwrote:

 Hi all,

 I'm trying to implement a unit test for a page. The unit testing means I
 should test one page only.
 Suppose I have a page with a link. When I do

 wicketTester.clickLink(myLink);

 The WicketTester renders another page, the page rendering requires a lot of
 other injected dependencies, and the unit test set-up grows too much
 making  the test fragile. I just want to verify that another page is set as
 a response page.

 Is it possible to do it? What are the best practices for unit testing of a
 wicket application?

 --
 WBR, Anatoly.




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


Re: understanding ajax response

2012-11-29 Thread Martin Grigorov
Hi,

When you use target.prependJavaScript(some JS code) this generates
priority-evaluate.
When you use target.appendJavaScript(some JS code) - evaluate.

The difference is that the priority ones are executed first on the client
side, then the components added with target.add() are replaced and finally
the evaluate scripts are executed.

Your problem is because of this line:
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L135

All client side tasks related to processing an ajax response are put in a
queue and then processed one by one. This is needed because the response
may have header contributions and those should be executed synchronously
(to be able to load their stuff) and because of that an approach with
recursion + self-notification is used.
In your case it seems there are more tasks than what Firefox could handle
in one stack. See https://issues.apache.org/jira/browse/WICKET-4675 for
some more details.


I'll experiment with try/catching the error and call setTimeout. Something
like:


if (this.depth  1000) {
  // to prevent stack overflow (see WICKET-4675)
  this.depth = 0;
  window.setTimeout(run, 1);
} else {
  try { 
this.depth ++;
run();
  } catch (e) {
if (e.message.indexOf('recursion')  -1) {
  this.depth = 0;

  window.setTimeout(run, 1);

}
 else throw e;
}
}

If this works then there is no reason to use 'depth' at all.



On Wed, Nov 28, 2012 at 10:56 PM, saty satya...@gmail.com wrote:

 I receive several of evaluate tags within ajax-response such as below,
 i
 also receive several
 priority-evaluate tags, what are these meant for, reworking an existing
 application so i am not very clear how ajax response works in wicket,  the
 browser craps out parsing one or another of the evaluate tags (too much
 recursion error), is there a way to overcome this parsing.

 I understand that these are being generated by several ajax links in my
 application, my goal is to overcome the browser issue with these, its quite
 annoying that application runs fine on Opera but on Firefox (the browser
 used in my firm) this is a serious problem.

 ajax-response
 .
 .
 .
 evaluate
 -
   /evaluate
 .
 .
 .
 /ajax-response




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/understanding-ajax-response-tp4654310.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




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


Re: Dynamic Components

2012-11-29 Thread Martin Grigorov
On Thu, Nov 29, 2012 at 7:00 AM, Chris Colman
chr...@stepaheadsoftware.comwrote:

 Martin
 
 The approach of adding the Sub/Details Panel to a DummyPage works fine
 for
 basic Panels, but there are a few problems I've hit:
 1. onInitialize() isnt called - Im assuming this is because the Panel
 doesnt go through a normal lifecycle before being rendered back to the
 ART?
 2. None of the Ajax/Links work - they are loading up the DummyPage

 The method I've provided involves calling a static
 addDynamicComponents(this); method from the onInitialise of a base class
 Panel and base class Page. Obviously all pages and panels need to derive
 from these common, application defined, Page and Panel classes - but
 that's no problem and most Wicket apps probably already do this as it's
 an easy way to add styling, behaviour etc., across the entire app
 easily.


You can
use org.apache.wicket.Application#getComponentInitializationListeners to do
the same.
For example check that the component is a Page/Panel and has package name
that is in your namespace.



 This mechanism results in the dynamic components being added within the
 onInitialize method and so the dynamic components' own onInitialize
 methods are called which means you can have nested addition of dynamic
 components to any level your require.

 Because the components are added within the onInitialize method of their
 parent component all the AJAX goodies work as expected :)


 
 Now Im assuming this is all because the Component/Panel on the server
 side
 isnt associated with a real live page?
 
 Following on from a discussion thread that Chris Colman was going on
 about
 IComponentResolvers and those components being second class citizens,
 would
 it be possible to create dynamic components in a Page, and store them
 in a
 non-markup related area of the Page, such that they would go through
 normal
 lifecycle events etc, and AJAX callbacks would work to the Page, but
 they
 wouldnt be associated with the normal markup/component hierarchy?
 
 Based on Chris' comments, it seems like he has the initial stages of a
 workable solution to breaking the Component / Markup hierarchy and
 allowing
 a very flexible way of building applications.  While I dont know what
 else
 Component Queueing was going to add, it seems that such functionality
 would
 provide a way to break the current hierarchy matching requirement.
 
 In my specific case, Im ok if the Components get thrown away on a full
 page
 (re)render, or that if Components were instantiated and not referenced
 in
 the markup, then they could be thrown away.
 
 While this might not suit the core framework for v7.0, could I build
 such
 functionality using the existing v6 APIs (maybe via a custom BasePage/
 Component wrapper) and hooking in to the rendering cycle?
 
 N

 -
 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 http://jweekend.com/


Re: understanding ajax response

2012-11-29 Thread Martin Grigorov
The suggested solution wont work:
https://issues.apache.org/jira/browse/WICKET-4675?focusedCommentId=13506367page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13506367


On Thu, Nov 29, 2012 at 9:19 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 Hi,

 When you use target.prependJavaScript(some JS code) this generates
 priority-evaluate.
 When you use target.appendJavaScript(some JS code) - evaluate.

 The difference is that the priority ones are executed first on the client
 side, then the components added with target.add() are replaced and finally
 the evaluate scripts are executed.

 Your problem is because of this line:

 https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js#L135

 All client side tasks related to processing an ajax response are put in a
 queue and then processed one by one. This is needed because the response
 may have header contributions and those should be executed synchronously
 (to be able to load their stuff) and because of that an approach with
 recursion + self-notification is used.
 In your case it seems there are more tasks than what Firefox could handle
 in one stack. See https://issues.apache.org/jira/browse/WICKET-4675 for
 some more details.


 I'll experiment with try/catching the error and call setTimeout. Something
 like:


 if (this.depth  1000) {

   // to prevent stack overflow (see WICKET-4675)

   this.depth = 0;

   window.setTimeout(run, 1);

 } else {

   try {   
 this.depth ++;

 run();
   } catch (e) {

 if (e.message.indexOf('recursion')  -1) {
   this.depth = 0;


   window.setTimeout(run, 1);

  }
  else throw e;
 }
 }

 If this works then there is no reason to use 'depth' at all.



 On Wed, Nov 28, 2012 at 10:56 PM, saty satya...@gmail.com wrote:

 I receive several of evaluate tags within ajax-response such as
 below, i
 also receive several
 priority-evaluate tags, what are these meant for, reworking an existing
 application so i am not very clear how ajax response works in wicket,  the
 browser craps out parsing one or another of the evaluate tags (too much
 recursion error), is there a way to overcome this parsing.

 I understand that these are being generated by several ajax links in my
 application, my goal is to overcome the browser issue with these, its
 quite
 annoying that application runs fine on Opera but on Firefox (the browser
 used in my firm) this is a serious problem.

 ajax-response
 .
 .
 .
 evaluate
 -
   /evaluate
 .
 .
 .
 /ajax-response




 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/understanding-ajax-response-tp4654310.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




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




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


RE: multiple requests and StalePageException

2012-11-29 Thread Michal Wegrzyn
Problem comes from 3rd party library that does some extra actions along 
applet's 3 requests.
Library actions trigger extra GET requests for a whole page ( for example 
http://server/app/?2 ),
Which are the reason of StalePageException during calling javascript from 
applet.

I must still debug to see what really triggers these GETs. 

Thanks for the help Martin.

Best regards,
Michal Wegrzyn

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Monday, November 26, 2012 14:03
 To: users@wicket.apache.org
 Subject: Re: multiple requests and StalePageException
 
 The renderCount increases only when you use non-Ajax requests, i.e.
 when you re-render the whole page.
 Make sure that executes Wicket behavior via js uses Wicket.Ajax.**
 
 
 On Mon, Nov 26, 2012 at 1:56 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:
 
  Hi group,
 
  In my Wicket application I have an applet. In the background it
  requests servlet and finally executes Wicket behavior via js.
  If one request is performed, then everything works without problems.
 
  Lately I have changed applet and now it can do one or three requests.
  If it performs three requests then StalePageException is thrown,
 which
  causes page refreshed and that is not a desired behavior.
  When I debug difference between render counter and page counter is
  exactly 2, so I think that issue is connected with two extra applet
 requests.
 
  Do I miss something on the Wicket side? If not, what is the best way
  to avoid StalePageException in this case?
 
  Best regards,
  Michal Wegrzyn
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/


RE: How important is detaching models really ?

2012-11-29 Thread Chris Colman
A similar scenario applies when using Wicket with JDO.

You can use simple LDM when dealing with read only model objects.
However, when you deal with model objects that are the subject of
modification in a form you need to use JDO's detach/reattach mechanism
which allows the form elements to keep references to serializable,
detachable (and reattachable) copies of the object(s) being modified.
This means all changes the user makes to the model objects are preserved
across multiple HTTP requests (AJAX or opening new panels in a wizard
style form) but not written to the DB. 

It's important to note (and this applies to any ORM that supports
detach/attach) that the detach/attach cycle for objects being modified
are not the same times as a typical LDM detach/attach (i.e. typically
with the http request cycle). It's also important to note that Wicket
'detach' is not the same as ORM 'detach' although you can perform an ORM
detach inside a wicket detach method.

When setting up an object for modification you load the objects required
by the form and then perform a single detach so the object has a
persistent ID but it no longer attached to the PersistenceManager(JDO)
or Session(Hibernate/JPA). As many http requests can come and go as you
like but until the user clicks OK or Submit on the form there should be
no more ORM detaches or attaches peformed. 

Clicking Ok or Submit in the form performs a reattach and then you
commit your transaction. It is at this point that any
OptimisticVerificationExceptions will be raised if an object the user
was editing was changed by another user or another process so you need
to wrap this 'commit' inside an appropriate try/catch and warn the user
(eg., with a modal form) that an object they were modifying had been
modified by another user.

JDO manages all the detach/attach for you. I just wrap the detach/attach
in a custom IModel.

Back in my day we didn't need Wicket, Tapestry, JSF or WebObjects, or
even Servlets, or for that matter Java! We just coded in plain assembly
language. And before that we had to just type in 1's and 0's. Sometimes
we didn't even have 1's. I once had to code for an entire month,
barefoot, in the dead of winter, using just 0's... but you didn't hear
me complaining.

 -Original Message-
 From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com]
 Sent: Wednesday, 28 November 2012 11:19 PM
 To: users@wicket.apache.org
 Subject: Re: How important is detaching models really ?
 
 On Wed, Nov 28, 2012 at 8:28 AM, Marios Skounakis msc...@gmail.com
 wrote:
  Hi Colin,
 
  I find I am in agreement with your points about lazy loaded parts of
the
  data model and how this can be simplified if you use LDMs.
 
  However, if you use LDMs for edit pages, you need to deal with
 concurrency
  issues yourself. You cannot rely on Hibernate's optimistic
concurrency
  mechanism (version). Because every time your LDM fetches a fresh
 instance
  of the entity, you can never have a StaleObjectException. Dealing
with
  concurrency yourself may be as easy as keeping the version property
in
 addition
  to the Id property in the LDM, and checking against it when
re-attaching
  the model, but this does add some complexity to the application
code.
 
  Any thoughts on this?
 
 From the good old days:
 http://martijndashorst.com/blog/2006/02/13/wicket-goodie-hibernate-
 versioned-form/
 
 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



What is Atmosphere doing wrong so i cant debug the websocket

2012-11-29 Thread MattyDE
Hi Folks,

iam using Wicket 6.2.0 with Wicket-Atmosphere 0.4 and everything works
great, but Iam not able to debug the websocket-transfer in Chrome
Debug-Tools like its explained and working here :
http://blog.kaazing.com/2012/05/09/inspecting-websocket-traffic-with-chrome-developer-tools/

Is there something wrong with the initialization of the WebSocket in
Atmosphere so Chrome cant identify it as a WebSocket?

Iam also want to know, how i could disable the window.info/.console output
on every WebSocket-Pull

Thanks in Advance for any Hints or Help :)

- Matty



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/What-is-Atmosphere-doing-wrong-so-i-cant-debug-the-websocket-tp4654322.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: Authorization without redirect

2012-11-29 Thread Karsten Gaul

Hi Ernesto,

Thanks but this isn't really what I was looking for as it is too simple 
to remove the Modal Window from the DOM tree and see the already 
rendered hidden page without entering a PIN.


I'd use normal Modal Windows for every link to the PIN protected page 
but this wouldn't cover bookmarks. A 
RestartResponseWithInterceptComponentException(Component component) 
would be marvellous which re-renders the current page and injects the 
given component but this is just fantasy. So I'll have to give this 
another thought or two.


Cheers,
Karsten

Am 28.11.2012 13:36, schrieb Ernesto Reinaldo Barreiro:

See

https://cwiki.apache.org/confluence/display/WICKET/Modal+Windows

Opening a modal window on page load (no AJAX involved)

You could use one to block the page till pin is typed.


On Wed, Nov 28, 2012 at 1:29 PM, Karsten Gaul karsten.g...@exedio.comwrote:


Hi everyone,

I'm currently building an application using wicket 1.4.21 and what I'm
trying to achieve is the following:

I have a protected area (stage 1) which requires the user to input his
credentials and I'm using an AuthorizationStrategy for this. This Strategy
throws a RestartResponseAtInterceptPage**Exception in it's
onUnauthorizedInstantiation method. (works as is with a redirect to a Login
Page)

However, within stage 1 I have links to another page (stage 2) which
requires a PIN and I want no redirect to the login page again but just show
a pop-up with an input field. Something like a confirmation dialog which on
close still displays the page the link to stage 2 was rendered in.

Any ideas?

Thanks,
Karsten

--**--**-
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: Authorization without redirect

2012-11-29 Thread Ernesto Reinaldo Barreiro
Hi,

On Thu, Nov 29, 2012 at 1:38 PM, Karsten Gaul karsten.g...@exedio.comwrote:

 Hi Ernesto,

 Thanks but this isn't really what I was looking for as it is too simple to
 remove the Modal Window from the DOM tree and see the already rendered
 hidden page without entering a PIN.

 Don't put the hidden content till pin is provided. This way there is no
way to manipulate client side to access protected content. Once pin is
provided you redirect to same page (and then content is displayed). It is
resposaability of the page to ensure it is protected (with server side
state). Is usser does not provides pin or closes the modal you redirect to
a public page.


 I'd use normal Modal Windows for every link to the PIN protected page but
 this wouldn't cover bookmarks. A 
 **RestartResponseWithInterceptCo**mponentException(Component
 component) would be marvellous which re-renders the current page and
 injects the given component but this is just fantasy. So I'll have to give
 this another thought or two.


With the approach mentioned above you don't have to take care of the
details you mention.

Cheers,
 Karsten

 Am 28.11.2012 13:36, schrieb Ernesto Reinaldo Barreiro:

 See

 https://cwiki.apache.org/**confluence/display/WICKET/**Modal+Windowshttps://cwiki.apache.org/confluence/display/WICKET/Modal+Windows

 Opening a modal window on page load (no AJAX involved)

 You could use one to block the page till pin is typed.


 On Wed, Nov 28, 2012 at 1:29 PM, Karsten Gaul karsten.g...@exedio.com**
 wrote:

  Hi everyone,

 I'm currently building an application using wicket 1.4.21 and what I'm
 trying to achieve is the following:

 I have a protected area (stage 1) which requires the user to input his
 credentials and I'm using an AuthorizationStrategy for this. This
 Strategy
 throws a RestartResponseAtInterceptPageException in it's

 onUnauthorizedInstantiation method. (works as is with a redirect to a
 Login
 Page)

 However, within stage 1 I have links to another page (stage 2) which
 requires a PIN and I want no redirect to the login page again but just
 show
 a pop-up with an input field. Something like a confirmation dialog which
 on
 close still displays the page the link to stage 2 was rendered in.

 Any ideas?

 Thanks,
 Karsten

 --**
 --**-
 To unsubscribe, e-mail: 
 users-unsubscribe@wicket.**apa**che.orghttp://apache.org
 users-unsubscribe@**wicket.apache.orgusers-unsubscr...@wicket.apache.org
 

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





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




-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia


Re: Authorization without redirect

2012-11-29 Thread Ernesto Reinaldo Barreiro
Hi.

On Thu, Nov 29, 2012 at 1:52 PM, Ernesto Reinaldo Barreiro 
reier...@gmail.com wrote:

 Hi,

 On Thu, Nov 29, 2012 at 1:38 PM, Karsten Gaul karsten.g...@exedio.comwrote:

 Hi Ernesto,

 Thanks but this isn't really what I was looking for as it is too simple
 to remove the Modal Window from the DOM tree and see the already rendered
 hidden page without entering a PIN.

 Don't put the hidden content till pin is provided. This way there is no
 way to manipulate client side to access protected content. Once pin is
 provided you redirect to same page (and then content is displayed). It is
 resposaability of the page to ensure it is protected (with server side
 state). Is usser does not provides pin or closes the modal you redirect to
 a public page.


Or use AJAX to repaint the hidden content of the page.

-- 
Regards - Ernesto Reinaldo Barreiro
Antilia Soft
http://antiliasoft.com/ http://antiliasoft.com/antilia


Re: What is Atmosphere doing wrong so i cant debug the websocket

2012-11-29 Thread Nick Pratt
Are you sure  web socket connection was established? Maybe your connection
is long-polling.

N
On Nov 29, 2012 7:36 AM, MattyDE ufer.mar...@gmail.com wrote:

 Hi Folks,

 iam using Wicket 6.2.0 with Wicket-Atmosphere 0.4 and everything works
 great, but Iam not able to debug the websocket-transfer in Chrome
 Debug-Tools like its explained and working here :

 http://blog.kaazing.com/2012/05/09/inspecting-websocket-traffic-with-chrome-developer-tools/

 Is there something wrong with the initialization of the WebSocket in
 Atmosphere so Chrome cant identify it as a WebSocket?

 Iam also want to know, how i could disable the window.info/.console output
 on every WebSocket-Pull

 Thanks in Advance for any Hints or Help :)

 - Matty



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/What-is-Atmosphere-doing-wrong-so-i-cant-debug-the-websocket-tp4654322.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: What is Atmosphere doing wrong so i cant debug the websocket

2012-11-29 Thread MattyDE
How should i test this? I did no special configuration and testing it with
the latest google chrome, which supports WebSockets.

I think the atmosphere implementation tests on clientside which type of
transfer is possible (WebSocket, SSE, Long-Polling etc.)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/What-is-Atmosphere-doing-wrong-so-i-cant-debug-the-websocket-tp4654322p4654327.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: What is Atmosphere doing wrong so i cant debug the websocket

2012-11-29 Thread Martin Grigorov
Atmosphere checks both the client and the server capabilities to decide
which transport to use.
Some web servers do not support WebSocket.


On Thu, Nov 29, 2012 at 2:18 PM, MattyDE ufer.mar...@gmail.com wrote:

 How should i test this? I did no special configuration and testing it with
 the latest google chrome, which supports WebSockets.

 I think the atmosphere implementation tests on clientside which type of
 transfer is possible (WebSocket, SSE, Long-Polling etc.)



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/What-is-Atmosphere-doing-wrong-so-i-cant-debug-the-websocket-tp4654322p4654327.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




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


Re: What is Atmosphere doing wrong so i cant debug the websocket

2012-11-29 Thread Martin Grigorov
7.0.27 added support for WebSockets


On Thu, Nov 29, 2012 at 2:32 PM, MattyDE ufer.mar...@gmail.com wrote:

 Oh okay.. iam Using Tomcat 7.0.12 without any special configuration



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/What-is-Atmosphere-doing-wrong-so-i-cant-debug-the-websocket-tp4654322p4654329.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




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


Re: wicket:link + component images

2012-11-29 Thread Sandor Feher
The problem has nothing to do with html tags nor the wicket handles
resources. It's related to TinyMCE. 
The editor set this for emoticons
src=../../plugins/emotions/img/smiley-.gif
This won't work because the gifs are inside wicket.contrib.tinymce.jar and
they not supposed to be located elsewhere. (Quick hack could be to copy all
the images the path above.)
My solution is to replace src=../../plugins/emotions/img/smiley-.gif
with 
src=wicket.contrib.tinymce.tiny_mce/plugins/emotions/img/smiley-.gif
before add my Label to the page.
I have a feeling that I spent much more time to solve this problem than it
deserved but my app shines a little bit more :).


regards., Sandor



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-link-component-images-tp4654258p4654332.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



events between pages

2012-11-29 Thread Michal Wegrzyn
Hi,

I would like to send event from iframe to parent page which has multiple 
iframes.

Event framework makes it possible to use application or session as sinks, but 
event affects only page from which event was sent.

Why events which have session/application as sinks are not propagated to all 
pages?

Is it possible to workaround it?

Best regards,
Michal Wegrzyn


Re: events between pages

2012-11-29 Thread Martin Grigorov
On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn michal.wegr...@onior.comwrote:

 Hi,

 I would like to send event from iframe to parent page which has multiple
 iframes.

 Event framework makes it possible to use application or session as sinks,
 but event affects only page from which event was sent.

 Why events which have session/application as sinks are not propagated to
 all pages?


Define all pages.
For application that could mean all pages for all users ever used so far.
For session this means all pages in the history of this user (the data
store).



 Is it possible to workaround it?


You can get any page by its id: session.getPageManager().getPage(pageId)
and use it as a sink.



 Best regards,
 Michal Wegrzyn




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


Re: Dynamic Components

2012-11-29 Thread Nick Pratt
This works great! Many thanks.

I made a small addition to allow the markupId to be passed in via a new
constructor - this is for the case where a JS component/lib creates new
elements and inserts them into a specific place in the DOM - I pass the new
ID back via an Ajax call, and then let the helper deal with hooking up the
Wicket component.


Thanks again

Nick


On Wed, Nov 28, 2012 at 5:34 PM, Bas Gooren b...@iswd.nl wrote:

 Hi,

 We've written the following class to dynamically add components to a page
 and then render them in an ajax request:

 http://pastebin.com/p4cSNsUw

 The rendered component is in the current page, not in a dummy page, so
 everything works as expected.
 The only thing that doesn't work is a full re-render, since that requires
 a hook in the page markup, which does not exist (hence dynamic
 components). To circumvent that, the dynamic components are automatically
 removed on a full page re-render.

 Have a look at the code, maybe it helps you. It's rather simple when you
 think about it.
 onInitialize() and ajax calls in the dynamically injected components work
 as expected for us.

 We use it in our (wicket 1.5) cms to dynamically inject editors and popups.

 Met vriendelijke groet,
 Kind regards,

 Bas Gooren

 Op 28-11-2012 21:00, schreef Nick Pratt:

 Martin

 The approach of adding the Sub/Details Panel to a DummyPage works fine for
 basic Panels, but there are a few problems I've hit:
 1. onInitialize() isnt called - Im assuming this is because the Panel
 doesnt go through a normal lifecycle before being rendered back to the
 ART?
 2. None of the Ajax/Links work - they are loading up the DummyPage

 Now Im assuming this is all because the Component/Panel on the server side
 isnt associated with a real live page?

 Following on from a discussion thread that Chris Colman was going on about
 IComponentResolvers and those components being second class citizens,
 would
 it be possible to create dynamic components in a Page, and store them in a
 non-markup related area of the Page, such that they would go through
 normal
 lifecycle events etc, and AJAX callbacks would work to the Page, but they
 wouldnt be associated with the normal markup/component hierarchy?

 Based on Chris' comments, it seems like he has the initial stages of a
 workable solution to breaking the Component / Markup hierarchy and
 allowing
 a very flexible way of building applications.  While I dont know what else
 Component Queueing was going to add, it seems that such functionality
 would
 provide a way to break the current hierarchy matching requirement.

 In my specific case, Im ok if the Components get thrown away on a full
 page
 (re)render, or that if Components were instantiated and not referenced in
 the markup, then they could be thrown away.

 While this might not suit the core framework for v7.0, could I build such
 functionality using the existing v6 APIs (maybe via a custom BasePage/
 Component wrapper) and hooking in to the rendering cycle?

 N





Re: What is Atmosphere doing wrong so i cant debug the websocket

2012-11-29 Thread Nick Pratt
Its likely your web server capabilities / configuration


On Thu, Nov 29, 2012 at 8:18 AM, MattyDE ufer.mar...@gmail.com wrote:

 How should i test this? I did no special configuration and testing it with
 the latest google chrome, which supports WebSockets.

 I think the atmosphere implementation tests on clientside which type of
 transfer is possible (WebSocket, SSE, Long-Polling etc.)



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/What-is-Atmosphere-doing-wrong-so-i-cant-debug-the-websocket-tp4654322p4654327.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: events between pages

2012-11-29 Thread Michal Wegrzyn
Thanks Martin.

What is the pageId parameter in getPageManager().getPage(pageId)?
Component id or page version id (present in url)?


For session I would expect all most recent versions of visited pages for a 
current user.
For application the same but for all users.

Best regards,
Michal Wegrzyn

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 15:01
 To: users@wicket.apache.org
 Subject: Re: events between pages
 
 On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:
 
  Hi,
 
  I would like to send event from iframe to parent page which has
  multiple iframes.
 
  Event framework makes it possible to use application or session as
  sinks, but event affects only page from which event was sent.
 
  Why events which have session/application as sinks are not propagated
  to all pages?
 
 
 Define all pages.
 For application that could mean all pages for all users ever used so
 far.
 For session this means all pages in the history of this user (the data
 store).
 
 
 
  Is it possible to workaround it?
 
 
 You can get any page by its id:
 session.getPageManager().getPage(pageId)
 and use it as a sink.
 
 
 
  Best regards,
  Michal Wegrzyn
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/


Re: events between pages

2012-11-29 Thread Martin Grigorov
On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn michal.wegr...@onior.comwrote:

 Thanks Martin.

 What is the pageId parameter in getPageManager().getPage(pageId)?
 Component id or page version id (present in url)?


The id from the url.
See Page#getPageReference()




 For session I would expect all most recent versions of visited pages for a
 current user.


Define recent :-)
One, two, ... more ?


 For application the same but for all users.


If a random user can manipulate the pages of the other users would be a
security issue, and rude :-)




 Best regards,
 Michal Wegrzyn

  -Original Message-
  From: Martin Grigorov [mailto:mgrigo...@apache.org]
  Sent: Thursday, November 29, 2012 15:01
  To: users@wicket.apache.org
  Subject: Re: events between pages
 
  On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
  michal.wegr...@onior.comwrote:
 
   Hi,
  
   I would like to send event from iframe to parent page which has
   multiple iframes.
  
   Event framework makes it possible to use application or session as
   sinks, but event affects only page from which event was sent.
  
   Why events which have session/application as sinks are not propagated
   to all pages?
  
 
  Define all pages.
  For application that could mean all pages for all users ever used so
  far.
  For session this means all pages in the history of this user (the data
  store).
 
 
  
   Is it possible to workaround it?
  
 
  You can get any page by its id:
  session.getPageManager().getPage(pageId)
  and use it as a sink.
 
 
  
   Best regards,
   Michal Wegrzyn
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development
  http://jWeekend.com http://jweekend.com/




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


RE: events between pages

2012-11-29 Thread Michal Wegrzyn
Recent = one.
It would be security issue only if event API has some holes :)
Anyway it would be quite handy to send for example some info events to all 
logged users.

Best regards,
Michal Wegrzyn

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 15:16
 To: users@wicket.apache.org
 Subject: Re: events between pages
 
 On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:
 
  Thanks Martin.
 
  What is the pageId parameter in getPageManager().getPage(pageId)?
  Component id or page version id (present in url)?
 
 
 The id from the url.
 See Page#getPageReference()
 
 
 
 
  For session I would expect all most recent versions of visited pages
  for a current user.
 
 
 Define recent :-)
 One, two, ... more ?
 
 
  For application the same but for all users.
 
 
 If a random user can manipulate the pages of the other users would be a
 security issue, and rude :-)
 
 
 
 
  Best regards,
  Michal Wegrzyn
 
   -Original Message-
   From: Martin Grigorov [mailto:mgrigo...@apache.org]
   Sent: Thursday, November 29, 2012 15:01
   To: users@wicket.apache.org
   Subject: Re: events between pages
  
   On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
   michal.wegr...@onior.comwrote:
  
Hi,
   
I would like to send event from iframe to parent page which has
multiple iframes.
   
Event framework makes it possible to use application or session
 as
sinks, but event affects only page from which event was sent.
   
Why events which have session/application as sinks are not
propagated to all pages?
   
  
   Define all pages.
   For application that could mean all pages for all users ever used
 so
   far.
   For session this means all pages in the history of this user (the
   data store).
  
  
   
Is it possible to workaround it?
   
  
   You can get any page by its id:
   session.getPageManager().getPage(pageId)
   and use it as a sink.
  
  
   
Best regards,
Michal Wegrzyn
   
  
  
  
   --
   Martin Grigorov
   jWeekend
   Training, Consulting, Development
   http://jWeekend.com http://jweekend.com/
 
 
 
 
 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com http://jweekend.com/


Re: events between pages

2012-11-29 Thread Martin Grigorov
You can do this.
You can use either wicket-atmosphere or wicket-native-websocket to push
data to the clients.


On Thu, Nov 29, 2012 at 3:36 PM, Michal Wegrzyn michal.wegr...@onior.comwrote:

 Recent = one.
 It would be security issue only if event API has some holes :)
 Anyway it would be quite handy to send for example some info events to all
 logged users.

 Best regards,
 Michal Wegrzyn

  -Original Message-
  From: Martin Grigorov [mailto:mgrigo...@apache.org]
  Sent: Thursday, November 29, 2012 15:16
  To: users@wicket.apache.org
  Subject: Re: events between pages
 
  On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn
  michal.wegr...@onior.comwrote:
 
   Thanks Martin.
  
   What is the pageId parameter in getPageManager().getPage(pageId)?
   Component id or page version id (present in url)?
  
 
  The id from the url.
  See Page#getPageReference()
 
 
  
  
   For session I would expect all most recent versions of visited pages
   for a current user.
  
 
  Define recent :-)
  One, two, ... more ?
 
 
   For application the same but for all users.
  
 
  If a random user can manipulate the pages of the other users would be a
  security issue, and rude :-)
 
 
 
  
   Best regards,
   Michal Wegrzyn
  
-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Thursday, November 29, 2012 15:01
To: users@wicket.apache.org
Subject: Re: events between pages
   
On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
michal.wegr...@onior.comwrote:
   
 Hi,

 I would like to send event from iframe to parent page which has
 multiple iframes.

 Event framework makes it possible to use application or session
  as
 sinks, but event affects only page from which event was sent.

 Why events which have session/application as sinks are not
 propagated to all pages?

   
Define all pages.
For application that could mean all pages for all users ever used
  so
far.
For session this means all pages in the history of this user (the
data store).
   
   

 Is it possible to workaround it?

   
You can get any page by its id:
session.getPageManager().getPage(pageId)
and use it as a sink.
   
   

 Best regards,
 Michal Wegrzyn

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




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


RE: events between pages

2012-11-29 Thread Michal Wegrzyn

 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 15:43
 To: users@wicket.apache.org
 Subject: Re: events between pages
 
 You can do this.
 You can use either wicket-atmosphere or wicket-native-websocket to push
 data to the clients.
 

But only with Wicket =6.0.0.

Is it hard to affect also all recent (at least for current user) pages for 
events in Wicket?
That would be a nice feature.

 
 On Thu, Nov 29, 2012 at 3:36 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:
 
  Recent = one.
  It would be security issue only if event API has some holes :) Anyway
  it would be quite handy to send for example some info events to all
  logged users.
 
  Best regards,
  Michal Wegrzyn
 
   -Original Message-
   From: Martin Grigorov [mailto:mgrigo...@apache.org]
   Sent: Thursday, November 29, 2012 15:16
   To: users@wicket.apache.org
   Subject: Re: events between pages
  
   On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn
   michal.wegr...@onior.comwrote:
  
Thanks Martin.
   
What is the pageId parameter in getPageManager().getPage(pageId)?
Component id or page version id (present in url)?
   
  
   The id from the url.
   See Page#getPageReference()
  
  
   
   
For session I would expect all most recent versions of visited
pages for a current user.
   
  
   Define recent :-)
   One, two, ... more ?
  
  
For application the same but for all users.
   
  
   If a random user can manipulate the pages of the other users would
   be a security issue, and rude :-)
  
  
  
   
Best regards,
Michal Wegrzyn
   
 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 15:01
 To: users@wicket.apache.org
 Subject: Re: events between pages

 On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:

  Hi,
 
  I would like to send event from iframe to parent page which
  has multiple iframes.
 
  Event framework makes it possible to use application or
  session
   as
  sinks, but event affects only page from which event was sent.
 
  Why events which have session/application as sinks are not
  propagated to all pages?
 

 Define all pages.
 For application that could mean all pages for all users ever
 used
   so
 far.
 For session this means all pages in the history of this user
 (the data store).


 
  Is it possible to workaround it?
 

 You can get any page by its id:
 session.getPageManager().getPage(pageId)
 and use it as a sink.


 
  Best regards,
  Michal Wegrzyn
 



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


Re: events between pages

2012-11-29 Thread Martin Grigorov
On Thu, Nov 29, 2012 at 4:28 PM, Michal Wegrzyn michal.wegr...@onior.comwrote:


  -Original Message-
  From: Martin Grigorov [mailto:mgrigo...@apache.org]
  Sent: Thursday, November 29, 2012 15:43
  To: users@wicket.apache.org
  Subject: Re: events between pages
 
  You can do this.
  You can use either wicket-atmosphere or wicket-native-websocket to push
  data to the clients.
 

 But only with Wicket =6.0.0.

 Is it hard to affect also all recent (at least for current user) pages
 for events in Wicket?
 That would be a nice feature.


New features go only in 6.x anyway.

You can keep a list of created WebSession objects, all last used pages are
kept as attribute in the Session object.



 
  On Thu, Nov 29, 2012 at 3:36 PM, Michal Wegrzyn
  michal.wegr...@onior.comwrote:
 
   Recent = one.
   It would be security issue only if event API has some holes :) Anyway
   it would be quite handy to send for example some info events to all
   logged users.
  
   Best regards,
   Michal Wegrzyn
  
-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Thursday, November 29, 2012 15:16
To: users@wicket.apache.org
Subject: Re: events between pages
   
On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn
michal.wegr...@onior.comwrote:
   
 Thanks Martin.

 What is the pageId parameter in getPageManager().getPage(pageId)?
 Component id or page version id (present in url)?

   
The id from the url.
See Page#getPageReference()
   
   


 For session I would expect all most recent versions of visited
 pages for a current user.

   
Define recent :-)
One, two, ... more ?
   
   
 For application the same but for all users.

   
If a random user can manipulate the pages of the other users would
be a security issue, and rude :-)
   
   
   

 Best regards,
 Michal Wegrzyn

  -Original Message-
  From: Martin Grigorov [mailto:mgrigo...@apache.org]
  Sent: Thursday, November 29, 2012 15:01
  To: users@wicket.apache.org
  Subject: Re: events between pages
 
  On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
  michal.wegr...@onior.comwrote:
 
   Hi,
  
   I would like to send event from iframe to parent page which
   has multiple iframes.
  
   Event framework makes it possible to use application or
   session
as
   sinks, but event affects only page from which event was sent.
  
   Why events which have session/application as sinks are not
   propagated to all pages?
  
 
  Define all pages.
  For application that could mean all pages for all users ever
  used
so
  far.
  For session this means all pages in the history of this user
  (the data store).
 
 
  
   Is it possible to workaround it?
  
 
  You can get any page by its id:
  session.getPageManager().getPage(pageId)
  and use it as a sink.
 
 
  
   Best regards,
   Michal Wegrzyn
  
 
 
 
  --
  Martin Grigorov
  jWeekend
  Training, Consulting, Development http://jWeekend.com
  http://jweekend.com/

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




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


RE: events between pages

2012-11-29 Thread Michal Wegrzyn


 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 16:33
 To: users@wicket.apache.org
 Subject: Re: events between pages
 
 On Thu, Nov 29, 2012 at 4:28 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:
 
 
   -Original Message-
   From: Martin Grigorov [mailto:mgrigo...@apache.org]
   Sent: Thursday, November 29, 2012 15:43
   To: users@wicket.apache.org
   Subject: Re: events between pages
  
   You can do this.
   You can use either wicket-atmosphere or wicket-native-websocket to
   push data to the clients.
  
 
  But only with Wicket =6.0.0.
 
  Is it hard to affect also all recent (at least for current user)
  pages for events in Wicket?
  That would be a nice feature.
 
 
 New features go only in 6.x anyway.
 
 You can keep a list of created WebSession objects, all last used pages
 are kept as attribute in the Session object.
 

Shall I add then new feature request for 6.x? :)

 
 
  
   On Thu, Nov 29, 2012 at 3:36 PM, Michal Wegrzyn
   michal.wegr...@onior.comwrote:
  
Recent = one.
It would be security issue only if event API has some holes :)
Anyway it would be quite handy to send for example some info
events to all logged users.
   
Best regards,
Michal Wegrzyn
   
 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 15:16
 To: users@wicket.apache.org
 Subject: Re: events between pages

 On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:

  Thanks Martin.
 
  What is the pageId parameter in
 getPageManager().getPage(pageId)?
  Component id or page version id (present in url)?
 

 The id from the url.
 See Page#getPageReference()


 
 
  For session I would expect all most recent versions of
 visited
  pages for a current user.
 

 Define recent :-)
 One, two, ... more ?


  For application the same but for all users.
 

 If a random user can manipulate the pages of the other users
 would be a security issue, and rude :-)



 
  Best regards,
  Michal Wegrzyn
 
   -Original Message-
   From: Martin Grigorov [mailto:mgrigo...@apache.org]
   Sent: Thursday, November 29, 2012 15:01
   To: users@wicket.apache.org
   Subject: Re: events between pages
  
   On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
   michal.wegr...@onior.comwrote:
  
Hi,
   
I would like to send event from iframe to parent page
which has multiple iframes.
   
Event framework makes it possible to use application or
session
 as
sinks, but event affects only page from which event was
 sent.
   
Why events which have session/application as sinks are
 not
propagated to all pages?
   
  
   Define all pages.
   For application that could mean all pages for all users
 ever
   used
 so
   far.
   For session this means all pages in the history of this
 user
   (the data store).
  
  
   
Is it possible to workaround it?
   
  
   You can get any page by its id:
   session.getPageManager().getPage(pageId)
   and use it as a sink.
  
  
   
Best regards,
Michal Wegrzyn
   
  
  
  
   --
   Martin Grigorov
   jWeekend
   Training, Consulting, Development http://jWeekend.com
   http://jweekend.com/
 



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


Re: events between pages

2012-11-29 Thread Martin Grigorov
On Thu, Nov 29, 2012 at 4:50 PM, Michal Wegrzyn michal.wegr...@onior.comwrote:



  -Original Message-
  From: Martin Grigorov [mailto:mgrigo...@apache.org]
  Sent: Thursday, November 29, 2012 16:33
  To: users@wicket.apache.org
  Subject: Re: events between pages
 
  On Thu, Nov 29, 2012 at 4:28 PM, Michal Wegrzyn
  michal.wegr...@onior.comwrote:
 
  
-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Thursday, November 29, 2012 15:43
To: users@wicket.apache.org
Subject: Re: events between pages
   
You can do this.
You can use either wicket-atmosphere or wicket-native-websocket to
push data to the clients.
   
  
   But only with Wicket =6.0.0.
  
   Is it hard to affect also all recent (at least for current user)
   pages for events in Wicket?
   That would be a nice feature.
  
 
  New features go only in 6.x anyway.
 
  You can keep a list of created WebSession objects, all last used pages
  are kept as attribute in the Session object.
 

 Shall I add then new feature request for 6.x? :)


I lost you.
Wicket 6.x provides these features - Atmosphere/WebSocket. What feature
request exactly ?

You cannot initiate push from the server to the browsers with normal HTTP.
You need either WebSocket/SSE/Long-Polling/Streaming/Flash


 
  
   
On Thu, Nov 29, 2012 at 3:36 PM, Michal Wegrzyn
michal.wegr...@onior.comwrote:
   
 Recent = one.
 It would be security issue only if event API has some holes :)
 Anyway it would be quite handy to send for example some info
 events to all logged users.

 Best regards,
 Michal Wegrzyn

  -Original Message-
  From: Martin Grigorov [mailto:mgrigo...@apache.org]
  Sent: Thursday, November 29, 2012 15:16
  To: users@wicket.apache.org
  Subject: Re: events between pages
 
  On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn
  michal.wegr...@onior.comwrote:
 
   Thanks Martin.
  
   What is the pageId parameter in
  getPageManager().getPage(pageId)?
   Component id or page version id (present in url)?
  
 
  The id from the url.
  See Page#getPageReference()
 
 
  
  
   For session I would expect all most recent versions of
  visited
   pages for a current user.
  
 
  Define recent :-)
  One, two, ... more ?
 
 
   For application the same but for all users.
  
 
  If a random user can manipulate the pages of the other users
  would be a security issue, and rude :-)
 
 
 
  
   Best regards,
   Michal Wegrzyn
  
-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org]
Sent: Thursday, November 29, 2012 15:01
To: users@wicket.apache.org
Subject: Re: events between pages
   
On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
michal.wegr...@onior.comwrote:
   
 Hi,

 I would like to send event from iframe to parent page
 which has multiple iframes.

 Event framework makes it possible to use application or
 session
  as
 sinks, but event affects only page from which event was
  sent.

 Why events which have session/application as sinks are
  not
 propagated to all pages?

   
Define all pages.
For application that could mean all pages for all users
  ever
used
  so
far.
For session this means all pages in the history of this
  user
(the data store).
   
   

 Is it possible to workaround it?

   
You can get any page by its id:
session.getPageManager().getPage(pageId)
and use it as a sink.
   
   

 Best regards,
 Michal Wegrzyn

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

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




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


RE: events between pages

2012-11-29 Thread Michal Wegrzyn


 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 16:57
 To: users@wicket.apache.org
 Subject: Re: events between pages
 
 On Thu, Nov 29, 2012 at 4:50 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:
 
 
 
   -Original Message-
   From: Martin Grigorov [mailto:mgrigo...@apache.org]
   Sent: Thursday, November 29, 2012 16:33
   To: users@wicket.apache.org
   Subject: Re: events between pages
  
   On Thu, Nov 29, 2012 at 4:28 PM, Michal Wegrzyn
   michal.wegr...@onior.comwrote:
  
   
 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 15:43
 To: users@wicket.apache.org
 Subject: Re: events between pages

 You can do this.
 You can use either wicket-atmosphere or wicket-native-websocket
 to push data to the clients.

   
But only with Wicket =6.0.0.
   
Is it hard to affect also all recent (at least for current
user) pages for events in Wicket?
That would be a nice feature.
   
  
   New features go only in 6.x anyway.
  
   You can keep a list of created WebSession objects, all last used
   pages are kept as attribute in the Session object.
  
 
  Shall I add then new feature request for 6.x? :)
 
 
 I lost you.
 Wicket 6.x provides these features - Atmosphere/WebSocket. What feature
 request exactly ?
 
 You cannot initiate push from the server to the browsers with normal
 HTTP.
 You need either WebSocket/SSE/Long-Polling/Streaming/Flash
 

Sorry, I was not clear enough.
Feature would be to trigger wicket events on all user pages and not only on the 
current page.

 
  
   

 On Thu, Nov 29, 2012 at 3:36 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:

  Recent = one.
  It would be security issue only if event API has some holes
 :)
  Anyway it would be quite handy to send for example some info
  events to all logged users.
 
  Best regards,
  Michal Wegrzyn
 
   -Original Message-
   From: Martin Grigorov [mailto:mgrigo...@apache.org]
   Sent: Thursday, November 29, 2012 15:16
   To: users@wicket.apache.org
   Subject: Re: events between pages
  
   On Thu, Nov 29, 2012 at 3:11 PM, Michal Wegrzyn
   michal.wegr...@onior.comwrote:
  
Thanks Martin.
   
What is the pageId parameter in
   getPageManager().getPage(pageId)?
Component id or page version id (present in url)?
   
  
   The id from the url.
   See Page#getPageReference()
  
  
   
   
For session I would expect all most recent versions of
   visited
pages for a current user.
   
  
   Define recent :-)
   One, two, ... more ?
  
  
For application the same but for all users.
   
  
   If a random user can manipulate the pages of the other
 users
   would be a security issue, and rude :-)
  
  
  
   
Best regards,
Michal Wegrzyn
   
 -Original Message-
 From: Martin Grigorov [mailto:mgrigo...@apache.org]
 Sent: Thursday, November 29, 2012 15:01
 To: users@wicket.apache.org
 Subject: Re: events between pages

 On Thu, Nov 29, 2012 at 2:56 PM, Michal Wegrzyn
 michal.wegr...@onior.comwrote:

  Hi,
 
  I would like to send event from iframe to parent
  page which has multiple iframes.
 
  Event framework makes it possible to use application
  or session
   as
  sinks, but event affects only page from which event
  was
   sent.
 
  Why events which have session/application as sinks
 are
   not
  propagated to all pages?
 

 Define all pages.
 For application that could mean all pages for all users
   ever
 used
   so
 far.
 For session this means all pages in the history of this
   user
 (the data store).


 
  Is it possible to workaround it?
 

 You can get any page by its id:
 session.getPageManager().getPage(pageId)
 and use it as a sink.


 
  Best regards,
  Michal Wegrzyn
 



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



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

Re: understanding ajax response

2012-11-29 Thread saty
Most of these are coming from using 
IndicatingAjaxLink link = new IndicatingAjaxLink(link)
That launches a model window.
The data grid i have , many rows (hence every cell on that row) have a AJAX
link that opens a model window to show more details.
I don't have anything else that is adding java script calls on this page, do
you see anything can can be done here (instead) to overcome the issue.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/understanding-ajax-response-tp4654310p4654342.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: Unit testing for a page

2012-11-29 Thread Eric Jablow
On Wed, Nov 28, 2012 at 3:56 PM, Anatoly Kupriyanov kan@gmail.com wrote:
 wicketTester.clickLink(myLink);

 The WicketTester renders another page, the page rendering requires a lot of
 other injected dependencies, and the unit test set-up grows too much
 making  the test fragile. I just want to verify that another page is set as
 a response page.

 Is it possible to do it? What are the best practices for unit testing of a
 wicket application?

This is actually a good point to improve your application and its tests.
Use dependency injection to organize your application, say through
wicket-guice or wicket-cdi. Use an alternative test Guice module to
build your pages with while testing. So, when you reach the second
test page, it gets built with low-cost data,

Respectfully,
Eric Jablow

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



Validators in Wicket 6

2012-11-29 Thread Hobbes00uk
I'm hoping someone can help me with my understanding. I've been updating my
website to Wicket 6. In doing that the DateConverter I was applying to a
field has started throwing a class cast exception.

After some work, I made the problem go away, by checking the class parameter
in the over-ridden getConverter(Class type) method and only returning the
DateConverter for a date object - as it's shown in the DateTextField class.
All fine.

My confusion is that the class cast exception happens at the point where
Wicket is forming the error message. At that point it passes the name of the
field's label (birth date in this case) to the DateConverter's toString
method (which naturally expects a Date object) and hence the class cast
exception.

I just don't understand why it would do that? Why is the field label being
sent to the field's converter?

If I've misread what is happening then I apologize - I'm not an experienced
java coder but I have checked and rechecked this because I just couldn't
believe what I was seeing. And while I've made the problem go away, I'm
concerned I've achieved that with a profound lack of understanding as to why
it is happening. 




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validators-in-Wicket-6-tp4654349.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: Validators in Wicket 6

2012-11-29 Thread Sven Meier
checking the class parameter in the over-ridden getConverter(Class 
type) method

and only returning the DateConverter for a date object

Yes, you have to check the type parameter, as other types than the 
component's model type might need a converter.
With WICKET-4608 all variables in error messages are now properly 
converted by the formComponent.

This is why getConverter() is called more often.

Sven

On 11/29/2012 06:46 PM, Hobbes00uk wrote:

I'm hoping someone can help me with my understanding. I've been updating my
website to Wicket 6. In doing that the DateConverter I was applying to a
field has started throwing a class cast exception.

After some work, I made the problem go away, by checking the class parameter
in the over-ridden getConverter(Class type) method and only returning the
DateConverter for a date object - as it's shown in the DateTextField class.
All fine.

My confusion is that the class cast exception happens at the point where
Wicket is forming the error message. At that point it passes the name of the
field's label (birth date in this case) to the DateConverter's toString
method (which naturally expects a Date object) and hence the class cast
exception.

I just don't understand why it would do that? Why is the field label being
sent to the field's converter?

If I've misread what is happening then I apologize - I'm not an experienced
java coder but I have checked and rechecked this because I just couldn't
believe what I was seeing. And while I've made the problem go away, I'm
concerned I've achieved that with a profound lack of understanding as to why
it is happening.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Validators-in-Wicket-6-tp4654349.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: Unit testing for a page

2012-11-29 Thread Anatoly Kupriyanov
On 29 November 2012 08:03, Martin Grigorov mgrigo...@apache.org wrote:

 Hi Anatoly,

 You are doing it right.
 To be able to verify that the other page is the response this other page
 have to be properly rendered, otherwise you would receive InternalErrorPage
 instead.
 To render it Wicket uses the normal rendering process so you need all
 prerequisites ...

Yes, exactly. I've tried to mock/spy RequestCycle object to verify
setResponsePage calls, however no success, too many dependencies.


 You can use tester#startComponentInPage() to test on component level. But
 this is not what you need.

Not sure how could it help me. My aim is to verify that a link on a page
follows to another page if some conditions are met. startComponent doesn't
deal with pages, and also assumes use of clickLink. What's a difference?

-- 
WBR, Anatoly.


Re: Unit testing for a page

2012-11-29 Thread Anatoly Kupriyanov
On 29 November 2012 16:55, Eric Jablow erjab...@gmail.com wrote:

  wicketTester.clickLink(myLink);
 
  The WicketTester renders another page, the page rendering requires a lot
 of
  other injected dependencies, and the unit test set-up grows too much
  making  the test fragile. I just want to verify that another page is set
 as
  a response page.
 
  Is it possible to do it? What are the best practices for unit testing of
 a
  wicket application?

 This is actually a good point to improve your application and its tests.
 Use dependency injection to organize your application, say through
 wicket-guice or wicket-cdi. Use an alternative test Guice module to
 build your pages with while testing. So, when you reach the second
 test page, it gets built with low-cost data,

It contradicts with the idea of unit tests: test only a small unit,
bringing minimum dependencies. Otherwise a change in one page would break a
lot of other tests. It is significant especially for web-applications,
because usually pages have a lot links between them.
It makes a test run longer, which would cause performance problems for
large test suite.

-- 
WBR, Anatoly.


RE: Dynamic Components

2012-11-29 Thread Chris Colman
 Martin
 
 The approach of adding the Sub/Details Panel to a DummyPage works
fine
 for
 basic Panels, but there are a few problems I've hit:
 1. onInitialize() isnt called - Im assuming this is because the
Panel
 doesnt go through a normal lifecycle before being rendered back to
the
 ART?
 2. None of the Ajax/Links work - they are loading up the DummyPage

 The method I've provided involves calling a static
 addDynamicComponents(this); method from the onInitialise of a base
class
 Panel and base class Page. Obviously all pages and panels need to
derive
 from these common, application defined, Page and Panel classes - but
 that's no problem and most Wicket apps probably already do this as
it's
 an easy way to add styling, behaviour etc., across the entire app
 easily.


You can
use org.apache.wicket.Application#getComponentInitializationListeners
to do
the same.
For example check that the component is a Page/Panel and has package
name
that is in your namespace.

Thanks Martin, I wasn't aware of that particular listener mechanism.




 This mechanism results in the dynamic components being added within
the
 onInitialize method and so the dynamic components' own onInitialize
 methods are called which means you can have nested addition of
dynamic
 components to any level your require.

 Because the components are added within the onInitialize method of
their
 parent component all the AJAX goodies work as expected :)


 
 Now Im assuming this is all because the Component/Panel on the
server
 side
 isnt associated with a real live page?
 
 Following on from a discussion thread that Chris Colman was going on
 about
 IComponentResolvers and those components being second class
citizens,
 would
 it be possible to create dynamic components in a Page, and store
them
 in a
 non-markup related area of the Page, such that they would go through
 normal
 lifecycle events etc, and AJAX callbacks would work to the Page, but
 they
 wouldnt be associated with the normal markup/component hierarchy?
 
 Based on Chris' comments, it seems like he has the initial stages of
a
 workable solution to breaking the Component / Markup hierarchy and
 allowing
 a very flexible way of building applications.  While I dont know
what
 else
 Component Queueing was going to add, it seems that such
functionality
 would
 provide a way to break the current hierarchy matching requirement.
 
 In my specific case, Im ok if the Components get thrown away on a
full
 page
 (re)render, or that if Components were instantiated and not
referenced
 in
 the markup, then they could be thrown away.
 
 While this might not suit the core framework for v7.0, could I build
 such
 functionality using the existing v6 APIs (maybe via a custom
BasePage/
 Component wrapper) and hooking in to the rendering cycle?
 
 N

 -
 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 http://jweekend.com/

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



Pages, Panels, and Dependency Injection

2012-11-29 Thread William Speirs
I'm having trouble understanding how to inject components into a page so
that the page will be easy to unit test later. Say I have a page that
contains two panels. I can easily use constructor injection to inject these
panels into the page:

class MyPage extends WebPage {
@Inject
public MyPage(PanelA a, PanelB b) { ... }
}

The problem is that all Panels require an id during construction.[1] How do
I supply the id to my Panels? I could simply construct every PanelA with an
id of panela and every PanelB with an id of panel, but that doesn't
seem very flexible. What do other people do in this situation? The hope
would be to pass mocked panels into the page during unit testing,
the separately test each panel.

What if instead of a panel it was a button where the onSubmit method must
be specified by overriding the method. How does one go about injecting such
a component so that it's still easy to test later in unit tests?

All thoughts and/or best practices are greatly welcomed. For reference I'm
using Guice as my dependency injection framework and
GuiceWebApplicationFactory to inject components into pages.

Thanks...

Bill-

[1]
http://ci.apache.org/projects/wicket/apidocs/6.0.x/org/apache/wicket/markup/html/panel/Panel.html


select2 integration -Duplicate(selected) value are appear in drop down box

2012-11-29 Thread Madasamy mcruncher
we are using select2 version 2.0  in our application.
Select2MultiChoice field are using for select a multiple value. here we set
the
maximumselectionsize is 20. and set minimuminputlength is 1.when we
give input in that field the relevant value are appear in drop down box
correctly,
if selection count reach  15 or 16, hence we give input in that field the
duplicated
(selected) value are appear in the drop down box.

but i could not recreate this problem in Myquickstart.

the sample code is

Select2MultiChoiceFoo fooField = new
Select2MultiChoiceFoo(message,
  new PropertyModelCollectionFoo(this, foo), new
FooProvider);
fooField.getSettings().setMinimumInputLength(1);
fooField.getSettings().setMaximumSelectionSize(20);
fooField.setRequired(true);
return fooField;


Re: select2 integration -Duplicate(selected) value are appear in drop down box

2012-11-29 Thread Thomas Götz
Can you please post your FooProvider implementation?

   -Tom

On 30.11.2012, at 05:31, Madasamy mcruncher madas...@mcruncher.com wrote:

 we are using select2 version 2.0  in our application.
 Select2MultiChoice field are using for select a multiple value. here we set
 the
 maximumselectionsize is 20. and set minimuminputlength is 1.when we
 give input in that field the relevant value are appear in drop down box
 correctly,
 if selection count reach  15 or 16, hence we give input in that field the
 duplicated
 (selected) value are appear in the drop down box.
 
 but i could not recreate this problem in Myquickstart.
 
 the sample code is
 
Select2MultiChoiceFoo fooField = new
 Select2MultiChoiceFoo(message,
  new PropertyModelCollectionFoo(this, foo), new
 FooProvider);
fooField.getSettings().setMinimumInputLength(1);
fooField.getSettings().setMaximumSelectionSize(20);
fooField.setRequired(true);
return fooField;


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