Re: AutoCompleteTextField with position: fixed

2014-12-13 Thread Bertrand Guay-Paquet

Hello,

Your issue seems to be related to css and not to Wicket itself.

From the css spec for position: fixed :
The box's position is calculated according to the 'absolute' model, but 
in addition, the box is fixed with respect to some reference. [...] the 
box is fixed with respect to the viewport and does not move when scrolled.


I'm not trying to be condescending here, especially since I don't fully 
understand your issue, but maybe looking up a tutorial on css 
positioning might give you the answer. I'm not convinced you need any 
javascript to fix this.


Regards,
Bertrand

On 10/12/2014 5:27 AM, pureza wrote:

Hi,

I need to have an AutoCompleteTextField with position: fixed, because it
sits inside a fixed Modal. However, Wicket calculates the position
coordinates based on the top of the document and not the top of the screen,
so the dropdown doesn't show up in the right place when there is a
scrollbar.

To fix this, I tried to add custom JavaScript code to the
AutoCompleteBehavior, by overriding updateAjaxAttributes and adding my own
AjaxCallListener. However, this didn't work because AutoCompleteBehavior
seems to ignore any AjaxCallListener, as reported here:
http://mail-archives.apache.org/mod_mbox/wicket-users/201301.mbox/%3c1358755750041-4655560.p...@n4.nabble.com%3E.

Could you tell me what's the best way of achieving this?

Thank you,

Luis Pureza

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AutoCompleteTextField-with-position-fixed-tp4668713.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



Radios and checkboxes with Bootstrap

2013-12-17 Thread Bertrand Guay-Paquet

Hello,

I'm using Bootstrap for form styling which expects radio choices and 
checkboxes in one of these forms:


label class=radio-inlineinput type=radioAn inline radiolabel

div class=checkbox
labelinput type=checkboxA stacked checkbox/label
/div


Using Wicket's built-in components, the rendered html is in this form:
input type=radio id=alabel for=aRadio label/label

which doesn't work with Bootstrap's stylesheets. I could override the 
appendOptionHtml() methods of RadioChoice and CheckBoxMultipleChoice but 
I was wondering if any better solutions exist to achieve the desired 
markup structure. I'm sure I'm not the only one using Bootstrap so which 
solutions have you used?


Regards,
Bertrand

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



Re: Radios and checkboxes with Bootstrap

2013-12-17 Thread Bertrand Guay-Paquet

Hi,

Ok I'll have a look at RadioGroup + Radio. Radio has a note in its 
javadoc about its stateful nature so I'll need to take care.


@Gabriel: I'm not actually using wicket-boostrap. Just Wicket and 
Bootstrap integrated with other libs in a home-made solution. I think it 
would be best if someone actually using this project opens the ticket 
because I won't be able to test it with my current app. Thanks for your 
message anyway!


Thanks,
Bertrand


On 17/12/2013 3:12 PM, Martin Grigorov wrote:

Hi,

You can use RadioGroup + Radio components instead and have better control
on the markup.

Martin Grigorov
Wicket Training  Consulting


On Tue, Dec 17, 2013 at 7:02 PM, Bertrand Guay-Paquet 
ber...@step.polymtl.ca wrote:


Hello,

I'm using Bootstrap for form styling which expects radio choices and
checkboxes in one of these forms:

label class=radio-inlineinput type=radioAn inline radiolabel

div class=checkbox
labelinput type=checkboxA stacked checkbox/label
/div


Using Wicket's built-in components, the rendered html is in this form:
input type=radio id=alabel for=aRadio label/label

which doesn't work with Bootstrap's stylesheets. I could override the
appendOptionHtml() methods of RadioChoice and CheckBoxMultipleChoice but I
was wondering if any better solutions exist to achieve the desired markup
structure. I'm sure I'm not the only one using Bootstrap so which solutions
have you used?

Regards,
Bertrand

-
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



No page id appended to some stateful pages

2013-08-07 Thread Bertrand Guay-Paquet

Hello,

After investigating why some of my stateful pages had a ?n redirect 
while others did not, I think I found a bug with the stateless page 
checking.


My test case is a page containing only an AjaxFallbackDefaultDataTable, 
but it can be reduced to a page containing a ListView with a single 
stateful child.


Here's my analysis:
This calls page.isPageStateless() to dertermine whether a pageId should 
be added


BookmarkableMapper(AbstractBookmarkableMapper).getPageInfo(IPageRequestHandler) 
line: 440
BookmarkableMapper(AbstractBookmarkableMapper).mapHandler(IRequestHandler) 
line: 387

SystemMapper(CompoundRequestMapper).mapHandler(IRequestHandler) line: 215
RequestCycle.mapUrlFor(IRequestHandler) line: 429
WebPageRenderer.respond(RequestCycle) line: 268
RenderPageRequestHandler.respond(IRequestCycle) line: 165
RequestCycle$HandlerExecutor.respond(IRequestHandler) line: 861
RequestCycle$HandlerExecutor(RequestHandlerStack).execute(IRequestHandler) 
line: 64

RequestCycle.execute(IRequestHandler) line: 261

The problem I see is that AbstractRepeater's onPopulate() is called 
during onBeforeRender() and this is not done when the stateless status 
of the page is first checked. Therefore, no pageId is added unless other 
components not located inside repeaters are also stateful.


The ajax links on my pages without the ?n redirections seem to work 
properly so it's not a big problem for me right now, but I can see how 
this can become a problem.


Should I create a JIRA issue for this?

Regards,
Bertrand


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



Append elements in ajax request

2013-07-19 Thread Bertrand Guay-Paquet

Hello,

I have a catch-all feedback panel which displays feedback messages at 
the top of my web pages. It slides-in the message boxes and adds a 
close link to each one.


It also has an event handler which makes sure it redraws itself each 
time Wicket handles an ajax request:


@Override
public void onEvent(IEvent? a_event) {
// This makes sure the panel always adds itself to the ajax 
response

if (a_event.getPayload() instanceof AjaxRequestTarget) {
((AjaxRequestTarget) a_event.getPayload()).add(this);
}
}

This way, I don't have to add it explicitly to the request target each 
time a component adds a session message.


After each request, the default behavior is to clear all rendered 
feedback messages from the session. My problem is that each time an ajax 
request is made, the currently displayed feedback message list is 
replaced by a new one. This removes any unclosed messages still present 
from the DOM.


How can I tell Wicket ajax to append DOM elements to a parent instead of 
re-rendering the parent and its children? Is there another solution?


Not clearing the messages from the session and displaying them again is 
not an option because the fade-in animation would be repeated.


Regards,
Bertrand

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



Re: getCallbackFunctionBody - Wicket.Ajax.ajax?

2013-07-19 Thread Bertrand Guay-Paquet

Hi,

I use the javascript generated by getCallbackFunction just fine. Here's 
an actual function used as an onclick callback:


function (event) {
var attrs = {u:./103?1-1.IBehaviorListener.0-,i:veil};
var params = {'tourAction': 1};
attrs.ep = params;
Wicket.Ajax.ajax(attrs);
}

The java code that generated it is :
// Collect the extra parameters
CallbackParameter[] parameters = new CallbackParameter[2];
parameters[0] = CallbackParameter.context(event);
parameters[1] = CallbackParameter.resolved(tourAction, 1);

// Generate callback function
CharSequence callbackFunction = getCallbackFunction(parameters);

This definitely does an ajax call. I haven't looked closely at the 
Wicket.Ajax.ajax() code, but it works fine.


Bertrand

On 19/07/2013 9:58 AM, Frank van Lankvelt wrote:

hi all,

in the process of upgrading to wicket 6, I have to do some wicket ajax
calls from custom javascript callbacks.  The AbstractDefaultAjaxBehavior
seems to provide a bunch of tools to help me out.  But I cannot make sense
of the javadoc ( implementation) of #getCallbackFunction:

  * Generates a javascript function that can take parameters and performs an
AJAX call which
  * includes these parameters. The generated code looks like this:
  *
  * pre
  * function(param1, param2) {
  *var attrs = attrsJson;
  *var params = {'param1': param1, 'param2': param2};
  *attrs.ep = jQuery.extend(attrs.ep, params);
  *Wicket.Ajax.ajax(attrs);
  * }
  * /pre

But AFAIK the last line of the generated function Wicket.Ajax.ajax(attrs)
does not do an ajax call.
It just uses jQuery to register event listeners.

So have I missed something, or is this a bug?

thanks, Frank




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



Re: Append elements in ajax request

2013-07-19 Thread Bertrand Guay-Paquet

Hi Dan,


You can render into a hidden div, then use some JavaScript to move them
into view. Something like this which uses jQuery.
response.render(OnDomReadyHeaderItem.forScript($('#hiddenfeedback
div').appendTo($('#visiblefeedback'));));

Great idea! Thanks!

That behavior doesn't seem exactly right though. If a form is
AJAX-submitted twice with the same error, do you really want to show the
error twice?
The feedback panel I'm referring to is used for session messages like 
Your email address was saved. They don't indicate errors with forms; I 
have other fenced feedback panels that do that and I want them to only 
show the most recent messages like you explained.


Some pages which display the session messages also have ajax buttons 
that do minor actions and I don't want those ajax requests to clear the 
catch-all feedback panel.


Thanks again!
Bertrand

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



Re: Append elements in ajax request

2013-07-19 Thread Bertrand Guay-Paquet

Hi Sven,

Yeah I saw that possibility but the problem is that the messages are 
animated when first displayed. I don't want the animation to trigger 
again when repainting the panel. I believe Dan's solution will fill all 
my needs and I'm implementing it now.


Regards,
Bertrand

On 19/07/2013 2:36 PM, Sven Meier wrote:

Hi Bertrand,

use a custom ApplicationSettings#feedbackMessageCleanupFilter that 
keeps your special messages even if they were rendered already.


Sven

On 07/19/2013 06:07 PM, Bertrand Guay-Paquet wrote:

Hi Dan,


You can render into a hidden div, then use some JavaScript to move them
into view. Something like this which uses jQuery.
response.render(OnDomReadyHeaderItem.forScript($('#hiddenfeedback
div').appendTo($('#visiblefeedback'));));

Great idea! Thanks!

That behavior doesn't seem exactly right though. If a form is
AJAX-submitted twice with the same error, do you really want to show 
the

error twice?
The feedback panel I'm referring to is used for session messages like 
Your email address was saved. They don't indicate errors with 
forms; I have other fenced feedback panels that do that and I want 
them to only show the most recent messages like you explained.


Some pages which display the session messages also have ajax buttons 
that do minor actions and I don't want those ajax requests to clear 
the catch-all feedback panel.


Thanks again!
Bertrand

-
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: Javascript confirm with condition before submit

2013-06-21 Thread Bertrand Guay-Paquet

Hi!

Are you on Wicket 6? If so, here's how I do my confirmation popup for an 
ajaxlink (should work for ajaxbutton too):


@Override
protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
String confirmJs = if (!confirm('Please confirm')) return false;
AjaxCallListener listener = new AjaxCallListener();
listener.onPrecondition(confirmJs);
attributes.getAjaxCallListeners().add(listener);
}

Of course, in your case, you need to write more complicated javascript 
to read form values and such. This solution all happens client-side.


You could also do it more server side by preventing default form submit 
behavior for the ajaxbutton. When the user clicks the button, you show a 
panel via ajax which asks for confirmation and that second button really 
sends the form.


Personally, I think I'd go for the first option but it depends on your 
requirements.


Bertrand



On 21/06/2013 11:36 AM, grignette wrote:

Hi !

I have an issue with a confirm Javascript message. I have a form. When the
user fills the form and  when he tries to submit (AjaxButton), I want to
provide confirm message based on the details filled by user. So the confrm
message may or maynot be present always

I tried to use method getOnClickScript of the Ajax Button. The code in the
getOnClickScript is translate in javascript by wicket on the onload of the
page. So my condition IF is always wrong, because the form is not completed
by the user yet.

I tried to add my condition just before my update, in the submit method with
this :

/target.appendJavaScript(confirm('+getString(messageConfirm) + '));/

The message is display just after the update... So to late !

Do you have any idea how I can display this confirm message ?

Thanks for your attention

Gaëlle





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Javascript-confirm-with-condition-before-submit-tp4659672.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: UrlResourceReference for images

2013-06-07 Thread Bertrand Guay-Paquet


What you're saying is that a client requests the url 
http://localhost:8080/app1 and the img src attribute has 
app2/image?item-123 but you want it to be 
http://localhost:8080/app2/image?item-123 instead?


Why does it make a difference? The relative url will be resolved to 
http://localhost:8080/app2/image?item-123 so it's actually the very same 
path. Check out the net tab in Firebug and you'll see it.


When and if the image url changes to another Tomcat instance, Wicket 
will render it in full as required. Just change the UrlResourceReference 
to http://localhost:8081/app2 (the http:// is necessary I believe) to 
see it in action.


On 07/06/2013 7:27 AM, bronius wrote:

Relative is not good because resources are served from different application,
just currently both applications are deployed on same tomcat so they have
urls http://localhost:8080/app1 and http://localhost:8080/app2. When smart
wicket renders image src i get something like this:
app2/image?item=123amp;id=1  so it thinks this is url of my main
application (app1), but its not. When i modify with firebug to use full
http://localhost:8080/app2 it works fine. So only solution is to override
UrlRenderer? That would mean I would have to override also RequestCycle?
Just for such simple case? Maybe there is simpler solution?



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

2013-06-07 Thread Bertrand Guay-Paquet

Try this:

url.getSegments().add();
url.getSegments().add(site2);
url.getSegments().add(image);

Have a look at the code of Url#isAbsolute(). It checks if the first 
segment is empty which is not the case with the code you provided in the 
first email.


This behavior of the segments array is definitely not intuitive... 
Another solution would be this:


url = Url.parse(http://localhost:8080/;);
url.getSegments().add(site2);
url.getSegments().add(image);
url.setQueryParameter(param1, 1);
url.setQueryParameter(param2, 2);

This creates the first empty segment automatically.

On 07/06/2013 10:43 AM, bronius wrote:

Yes that would be great, but src=app2/image?item-123 does not work (image
is not loaded) and after changing it with firebug to
src=http://localhost:8080/app2/image?item-123; works fine. Any ideas why is
that? Any stupid mistake i overlooked? Maybe wicket interprets relative url
as http://localhost:8080/app1/app2/image?item-123 somehow? Maybe because
when i build url I put app2 as segment? (url.getSegments().add(app2);) I
will try different way to construct url later. Thanks for help appreciate it
:)



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

2013-06-06 Thread Bertrand Guay-Paquet

Hello,

See inline.

On 06/06/2013 5:27 PM, bronius wrote:

First of all Url api is extremely hard to work with, very hard to create url
i need, I think there should be some option to simply create it with simple
string. Anyway Url.parse method does not create full url for me (i have
localhost:8080/site1 and localhost:8080/site2, but when url is created i get
only site2 without full address). So I tried it myself like this:
  private Url createUrl(Charset charset) {
 Url url = new Url(charset) {
 private static final long serialVersionUID = 1L;
 @Override
 public String toString(final Charset charset)
 {
 return toString(StringMode.FULL, charset);
 }
 };
 url.setProtocol(http);
 url.setHost(localhost);
 url.setPort(8080);
 url.getSegments().add(site2);
 url.getSegments().add(image);
 url.setQueryParameter(param1, 1);
 url.setQueryParameter(param2, 2);
 return url;
 }
The key here as you probably noticed is StringMode.FULL passed to the 
toString method. The Url class stores separately the protocol, host 
name, port and path (the segments array) of a Url.


Either way, toString is only used to build a resource key name in the 
constructor of UrlResourceReference. The actual url is still used in 
full by UrlResourceReference. However, see below.



Not really nice, but at least Url object returned normal full url that i
needed in toString. However UrlResourceReference still rendered not full url
and thats where i got too pissed off and decided I need some rest :) I'm
just interested if I'm even on the right track? How you would implement it?
And why this simple thing is so complicated? :) I admit I was a bit drunk :)
and don't have that much of experience with wicket, but this part looked
really strange for me. But I suspect I'm missing something. The problem is
probably because both applications have same start (http://localhost:8080)
and wicket is too smart. As image from other random website is shown
successfully.
You are right. In a way, Wicket is too smart. Here is the code of 
interest from org.apache.wicket.request.UrlRenderer:

protected boolean shouldRenderAsFull(final Url url)
{
Url clientUrl = request.getClientUrl();

if (!Strings.isEmpty(url.getProtocol()) 
!url.getProtocol().equals(clientUrl.getProtocol()))
{
return true;
}
if (!Strings.isEmpty(url.getHost())  
!url.getHost().equals(clientUrl.getHost()))

{
return true;
}
if ((url.getPort() != null)  
!url.getPort().equals(clientUrl.getPort()))

{
return true;
}
if (url.isContextAbsolute())
{
// do not relativize urls like /a/b
return true;
}
return false;
}

What I don't understand however is why this relative url is not good for 
you. You talked about serving resources from another server, but I don't 
get it. Either a relative url or an absolute url would both point to the 
same resource when interpreted on the client.


Regards,
Bertrand

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



Re: Injecting proxy services in page.

2013-06-03 Thread Bertrand Guay-Paquet

Hi,

I don't use Spring, so I can't help you specifically. However, there is 
a chapter about integration with Spring in the free wicket guide here:

https://code.google.com/p/wicket-guide/
(chapter 17.2)

On 03/06/2013 9:00 AM, Entropy wrote:

We are doing the annotation based approach described in this link
(https://cwiki.apache.org/WICKET/spring.html).  At least, we think we are.

We get:
[6/3/13 8:26:00:907 EDT] 0023 SystemOut O ERROR [WebContainer : 0]
(RequestCycle.java:1521) - Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:435)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:234)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:735)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:310)
at org.apache.wicket.Session.getPage(Session.java:779)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:458)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
[trimmed for brevity]
Caused by:
*java.io.InvalidClassException: gov.usdoj.afms.umc.services.LogTransService;
could not resolve class [gov.usdoj.afms.umc.services.LogTransService] when
deserializing proxy*at
org.apache.wicket.proxy.LazyInitProxyFactory$ProxyReplacement.readResolve(LazyInitProxyFactory.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[trimmed for brevity]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365)
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:413)
... 39 more

I thought this might be because that particular service is in the parent
page object and annotated there as well, but I moved it to the child class
and saw no change in behavior.  It is a hibernate service and is annotated
in the page like so:

@SpringBean(name=LogTransService)
private LogTransService userTransService;   

The exception happens when I go to the page, do a few things (which involve
submitting and redisplaying the page), and then hit the browser back button.
This, as I understand it, causes wicket to deserialize the page from memory.
But shouldn't it see the @SpringBean and re-inject a new service?

Out app object does this:
addComponentInstantiationListener(new SpringComponentInjector(this,
ctx, true));

Ideas?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Injecting-proxy-services-in-page-tp4659209.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: AttributeModifier with html in the attribute?

2013-06-03 Thread Bertrand Guay-Paquet
I believe AttributeModifier is the appropriate class to use to modify 
tag attributes. Moreover, it is described in the section you refer to.


For reference, ComponentTag#writeOutput() is the method which calls 
Strings.escapeMarkup(value); and escapes your tag value. This is called 
by Component#renderComponentTag().


Unfortunately, there doesn't seem to currently be a way to not escape 
the markup of the tag values. It is possible for labels but not for the 
tag attributes. I can think of 3 options:


1) [unsafe] remove the tag escaping at large
2) modify Wicket to add a flag somewhere to disable tag escaping
3) create your Component subclass which overrides getMarkup() to weave 
in your raw html


Either way, I think this should be added to Wicket because html data- 
attributes seem to gain popularity.


Regards,
Bertrand

On 03/06/2013 10:22 AM, Paul Bors wrote:

AttributeModifier?

You might be interested in taking a quick look at (Section 4.2 Modifying
Tag Attributes):
http://wicket.apache.org/learn/books/freeguide.html

~ Thank you,
   Paul Bors

-Original Message-
From: Simon B [mailto:simon.bott...@gmail.com]
Sent: Monday, June 03, 2013 6:28 AM
To: users@wicket.apache.org
Subject: AttributeModifier with html in the attribute?

Hello

I want to add html content in an attribute of an html tag.

This is for a bootstrap tooltip.

What is the best way to do this?  When I simply add html to the attribute
modifier e.g.


it gets converted into



What I'd like is:



What's the best way to achieve this?

Simon



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-with-html-in-th
e-attribute-tp4659206.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 user-specific timezones

2013-05-09 Thread Bertrand Guay-Paquet

Hi!

On 08/05/2013 6:46 PM, Dan Retzlaff wrote:

Hi all,

I'd like to know what conventions you've established for your sites that
deal with users in many time zones.

Do you simply replace the converters (Date, SqlDate, SqlTime, SqlTimestamp)?
I make sure that all the date objects sent to Wicket are of type 
java.util.date (in direct violation of your point #3 below!) and I 
replaced the default Wicket Date converter because I don't like some of 
the formatting choices made for some locales.



Do you avoid MessageFormats in StringResourceModels? (I don't see a way to
configure its MessageFormat.)
I convert my Dates to strings with the proper converter before passing 
them on to string resources.

We currently bypass this stuff and do our formatting with application
utility methods, and adapting input into users' timezones as manual steps,
e.g. with Joda-Time's DateTime#withZoneRetainFields().

I'd like to sweep this stuff under the rug with some application-level
configuration, e.g. of converters. But before I embark, I was hoping to
hear from someone who's already gone on this journey.

And related: maybe you have some golden rules time zone handling to share?
A couple of mine are:
1. Avoid date types in SQL tables because it's hard to correctly compare
to now across timezones.
2. Anything that shifts millis to adjust for timezones is a red flag
(including the aforementioned #withZoneRetainFields() sadly).
3. java.util.Date is evil and you should avoid it whenever possible.
Calendar is marginally better, but Joda-Time is the way to go.
Using converters with applyTimeZoneDifference=true works fine for me 
once the timezone is set in the Session.


I follow these rules to avoid all the fuss:
1-The application's JVM and joda-time default time zones are UTC 
(-Duser.timezone=UTC). Throw an exception in application init if that's 
not the case.

2-MySQL is set to the UTC timezone (default-time-zone=UTC)
3-MySQL jdbc connector: set useLegacyDatetimeCode=false
4-Never store timezone information in database date fields
5-ALWAYS use UTC times EXCEPT when converting to user's time zone for 
display or converting to UTC when handling input. These last 2 actions 
are handled correctly when using converters with 
applyTimeZoneDifference=true.


#5 really implies all the other rules. Considering that my server (or my 
unit tests) could be moved anywhere in any timezone, it makes no sense 
to use any other timezone than UTC internally to me.


Some references I noted when doing research on this:
http://stackoverflow.com/questions/309203/how-to-store-a-java-util-date-into-a-mysql-timestamp-field-in-the-utc-gmt-timezon
http://dev.mysql.com/doc/refman/5.1/en/connector-j-reference-configuration-properties.html
http://www.odi.ch/prog/design/datetime.php
http://bugs.mysql.com/bug.php?id=15604
http://stackoverflow.com/questions/508019/jpa-hibernate-store-date-in-utc-time-zone


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



Re: Handling user-specific timezones

2013-05-09 Thread Bertrand Guay-Paquet


On 09/05/2013 3:30 PM, Dan Retzlaff wrote:

Thanks, Bertrand.

On Thu, May 9, 2013 at 9:47 AM, Bertrand Guay-Paquet ber...@step.polymtl.ca

wrote:

  Do you avoid MessageFormats in StringResourceModels? (I don't see a way to

configure its MessageFormat.)


I convert my Dates to strings with the proper converter before passing
them on to string resources.


If StringResourceModel accounted for the session's timezone (like
wicket-datetime's DateConverter), would you consider using
MessageFormat-based resources? Or is there another advantage to converting
to String in application code? This is an example of what I'd like to make
sensitive to user timezone, but don't see how.
In my case, since I override some of joda-time's date format strings in 
some locales, it would need to provide a way to customize the format 
strings per-locale. If you're fine with the default format strings, I 
guess it would work.



localtime=Your local time is {0,time,medium}
add(new Label(localtime, new StringResourceModel(localtime, null, new
Date(;

Instead I have essentially:
localtime=Your local time is {0}
add(new Label(localtime, new StringResourceModel(localtime, null,
MySession.formatTime(new Date(), DateFormat.MEDIUM;

Using converters with applyTimeZoneDifference=true works fine for me once

the timezone is set in the Session.


Holy smokes, I didn't realize wicket-datetime wasn't on my classpath! The
Joda-based classes there definitely obviate a couple of my classes.

1-The application's JVM and joda-time default time zones are UTC

(-Duser.timezone=UTC). Throw an exception in application init if that's not
the case.
2-MySQL is set to the UTC timezone (default-time-zone=UTC)


That's hardcore to require that in dev environments. We've been allowing
system time in dev, and UTC in CI builds, stage and prod. I'll think about
moving dev over. I can't say we haven't had bugs because of the
inconsistency.
It might be hardcore, but at least it has an early fail so it's easy to 
catch.


For deploying the app in dev, I simply configured the servlet 
container's JVM to use UTC. This might not be an option if you have many 
servlets running I guess. In that case, the app init could set the 
default timezone programatically.


For the unit tests, my base wicket tester classes takes care of settings 
the server timezone.





3-MySQL jdbc connector: set useLegacyDatetimeCode=false


This protects against issues with Calendars in your JPA entities / JDBC
statements, right? We use j.u.Date pretty consistently in entities so I
think this is not relevant to us. That's a good bug to know about, and it's
too bad they can't simply default to the improved behavior.
I re-read some doc about this option and the bug report I linked to and 
it seems that I don't really need this if the client's JVM is using UTC 
and the DB is using UTC too. It's just there in case I access the 
database with a client who's JVM timezone is not UTC.



4-Never store timezone information in database date fields
AFAIK, neither DATETIME nor TIMESTAMP actually stores the timezone, so 
I'm not sure what you're warning against specifically.
MySQL doesn't support it, but other vendors have the TIMESTAMP WITH 
TIME ZONE data type.


Regards,
Bertrand

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



Re: How to refresh a tab

2013-05-08 Thread Bertrand Guay-Paquet

Hi,

Is your javascript running when the page is created and then not when 
you refresh the tab or not at all? How are you adding the javascript to 
the page?


On 08/05/2013 11:18 AM, saty wrote:

Actually target.add(getPanel()); seems to be doing what i need but i have a
problem here and hoping someone would be able to help, i dont have any great
background in java script stuff, we picked up wicket hoping we dont have to
deal with that.

My JavaScript are not firing
such as..
(jQuery(document).ready(function($) { etc.)

so several components (such as multi seelct etc) are not rendered correctly,
how can i overcome this?

Appreciate your help



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-refresh-a-tab-tp4658652p4658653.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: How to refresh a tab

2013-05-08 Thread Bertrand Guay-Paquet
Try it with OnDomReadyHeaderItem or OnLoadHeaderItem nstead of 
JavaScriptHeaderItem


Wicket's ajax implementation makes sure that header items are rendered 
once only.


On 08/05/2013 12:10 PM, saty wrote:

yes, when the panel normally loads the java scripts are added as

renderHead(IHeaderResponse response)

{
.
response.render(JavaScriptHeaderItem.forReference(new
PackageResourceReference(Mypanel.class,custom.js)));
}

and this is working fine.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-refresh-a-tab-tp4658652p4658655.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: How to deal with JPA Entities in a Wicket Model? (Data handling in models)

2013-05-04 Thread Bertrand Guay-Paquet


I understand, that there can be situations when a user actually 
doesn't leave a page the usual way, but if there were a method as 
described, it could at least be helpful for all the preceding 
page-leave-events under normal conditions.


I never use it, but there's javascript's onbeforeunload event. Have a 
look at http://stackoverflow.com/questions/1704533/intercept-page-exit-event


You can add it to a page like so:
add(new AjaxEventBehavior(beforeunload) {
@Override
protected void onEvent(AjaxRequestTarget target) {
// Clear data
}
});


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



Re: What is the wicket recommended approach

2013-05-03 Thread Bertrand Guay-Paquet

Hi,

Have a look at https://code.google.com/p/wicket-guide/ chapter 18.

On 03/05/2013 9:46 AM, saty wrote:

for securing wicket applications, going by no documentation etc available on
WASP/SWARM, i am just curious if there are other things available and
preferred.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/What-is-the-wicket-recommended-approach-tp4658523.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: How to deal with JPA Entities in a Wicket Model? (Data handling in models)

2013-05-03 Thread Bertrand Guay-Paquet

Hi,

On 03/05/2013 9:58 AM, Christian Reiter wrote:

Hi!

I'm wondering what's the recommended way to store a unpersisted object 
while it is edited (I'm using EJBs with JPA as backend).


Let's imagine I want to build a customer editor which should be able 
to handle editing of new (unpersisted) and existing (persisted) 
customers.


If I use a loadable detachable model to load the customer from the 
backed, all unpersisted changes between requests are lost - not really 
desirable. If I use a simple model which stores the entity in 
serialized form my sessions are growing and in addition I've to handle 
entity refreshing if a user navigates back to the page by using the 
browser's back button to prevent the user from saving an old entity 
state.
I don't use JPA anymore, so this is from memory. If you store the JPA 
entity objects directly, you're actually storing the proxy objects 
created by your JPA provider to handle lazy-loading and such. This means 
you're probably serializing the entity manager as well! That would 
explain your session size issue. You can use dto (data transfer objects) 
instead which will not take much room in the session. This means you'll 
have to transfer data between the dto and the entity.


One way or another you must store the edited values between requests if 
the client doesn't send them back as part of a form. If using dto still 
makes your session size too large, you can store the temporary data in 
the database and keep an id pointing to that data in the session.


Best solution I can imagine would be if there would be a callback or 
overridable method which is called when the user navigates to a page 
and another one which is called when the user leaves a page. Those 
methods would be great to prepare and cleanup models. Are there such 
methods?
No method will reliably inform you that a user left a page. His WIFI 
could die, the power could go out, etc. You must clear all expired 
temporary data after some time. If your data is stored in the session, 
that's done automatically for you.


I hope this helps.

Bertrand

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



Re: Localized urls

2013-05-03 Thread Bertrand Guay-Paquet

Has no one ever done this? Any guidelines as to how to implement it?

On 01/05/2013 10:29 AM, Bertrand Guay-Paquet wrote:

Hello,

I'd like to localize the urls generated by my app like so:
/en/account/settings   - AccountSettingsPage, locale EN
/fr/compte/parametres   - AccountSettingsPage, locale FR

I already have urls prefixed with the locale base on the 
LocaleFirstMapper from Wicket examples, but they are all mapped the 
same way after the locale segment, like this:

/en/account/settings
/fr/account/settings

I could think of 2 potential approached to this, but neither seem easy 
to implement...


1- In my LocaleFirstMapper, have one set of localized mappers for 
each locale. I would need to duplicate the built-in mappers (link 
listeners, forms, etc.) manually for the extra sets of mappers.


2-Create a new RequestMapper class based on MountedMapper which allows 
custom dynamic parts in urls, somewhat like the page parameter 
placeholders make a url dynamic.


Any ideas or comments? Has anybody done this before?

Thanks!
Bertrand

-
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



Localized urls

2013-05-01 Thread Bertrand Guay-Paquet

Hello,

I'd like to localize the urls generated by my app like so:
/en/account/settings   - AccountSettingsPage, locale EN
/fr/compte/parametres   - AccountSettingsPage, locale FR

I already have urls prefixed with the locale base on the 
LocaleFirstMapper from Wicket examples, but they are all mapped the same 
way after the locale segment, like this:

/en/account/settings
/fr/account/settings

I could think of 2 potential approached to this, but neither seem easy 
to implement...


1- In my LocaleFirstMapper, have one set of localized mappers for each 
locale. I would need to duplicate the built-in mappers (link listeners, 
forms, etc.) manually for the extra sets of mappers.


2-Create a new RequestMapper class based on MountedMapper which allows 
custom dynamic parts in urls, somewhat like the page parameter 
placeholders make a url dynamic.


Any ideas or comments? Has anybody done this before?

Thanks!
Bertrand

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



Re: Get data from External application.

2013-05-01 Thread Bertrand Guay-Paquet

Hi,

Sure you can!

In BarcodePage, use the PageParameters to extract the code. If the code 
is there, show its associated content.

StringValue codeValue = getPageParameters().get(code);
if (!codeValue.isEmpty())
...

In your app init code, mount your page like this:
mountPage(/activate/#{code}, BarcodePage.class);

On 01/05/2013 12:07 PM, chrome1235 wrote:

Hi,

I want to integrate zxing application (barcode reader) to my web application
for android phones.

When user click an ajax button in a page,
the code will call zxing with a custom url (like:
zxing://scan/?ret=http://mydomain.com/MyApp/{CODE};),
then zxing can post or (get) to a generated url according to my parameters.

Can I handle this url (zxing's post url) at the same page?



Thanks.
Kemal.




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Get-data-from-External-application-tp4658441.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: Get data from External application.

2013-05-01 Thread Bertrand Guay-Paquet

On 01/05/2013 12:13 PM, Bertrand Guay-Paquet wrote:

In your app init code, mount your page like this:
mountPage(/activate/#{code}, BarcodePage.class);


Assuming you want to mount this under the activate path.

I just noticed your example uses the root app mount. I think you might 
run into some problems with mappers if you use a path like /#{code} 
instead. Incoming requests for other pages could be confused with the 
ones for barcodes.


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



Re: How to get rid of -ver-blah-blah-blah.gif versioning ?

2013-05-01 Thread Bertrand Guay-Paquet

The link at the bottom of the given wiki page has:

To disable caching altogether (e.g. for performance comparisons) use

getResourceSettings().setCachingStrategy(NoOpResourceCachingStrategy.INSTANCE)



On 01/05/2013 1:05 PM, smallufo wrote:

Hi
thanks.
But it doesn't mention how to turn off the -ver-blah-blah-blah string.
I just want a general xxx.png , not
xxx-ver-7E49549BCE322EACE0C8F26B4CD553C5.png




2013/5/2 Martin Grigorov mgrigo...@apache.org


Hi,

Check https://cwiki.apache.org/WICKET/caching-in-wicket-15.html


On Wed, May 1, 2013 at 6:36 PM, smallufo small...@gmail.com wrote:


I am upgrading from 1.4 to 6.7
Is the random string appended used for anti-caching or object versioning

?

I try to redeploy and the appended string is identical !?

Now I am stuck by how to get rid of image/resource versioning , and

enable

caching ...
I use general Image ,
or override shouldAddAntiCacheParameter (return false)
But I still cannot get rid of the versioning string...

Anyway to disable that ?

One more question
wicket:linkimg src=xxx.png/wicket:link
How to enable caching and disable versioning string for this img ?
(there is no wicket:id assigned)




--
Martin Grigorov
Wicket Training  Consulting
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



Re: even issue switching from development to deployment mode

2013-05-01 Thread Bertrand Guay-Paquet

Hi,

I believe Wicket uses a minified version of jQuery in deployment. Maybe 
this causes problems with that library?


Otherwise, check all callers to Application#usesDevelopmentConfig() and 
replace them one by one to the deployment value until you get the same 
error.


On 01/05/2013 1:59 PM, saty wrote:

I am using JQuery multi select by Eric Hynds in my current wicket application
in few places.
http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/

This works great in a Wicket application (using ListMultipleChoice) in
wicket development mode,  but when i change wicket mode to deployment
surprisingly the onclose even (close multiselect) does not get fired, the
onchange event (when you select/deselect) continue to work, no issues with
that.

Any thoughts on what might be going on here and how to fix this problem,
within Wicket.

Appreciate your help.

Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/even-issue-switching-from-development-to-deployment-mode-tp4658450.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 6] Any shortcut to get full url ?

2013-05-01 Thread Bertrand Guay-Paquet

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
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Page's Mounted URL

2013-05-01 Thread Bertrand Guay-Paquet

Have a look at RequestUtils#toAbsolutePath().

Also, look at the email on this mailing list preceding yours titled 
[wicket 6] Any shortcut to get full url ? :)


On 02/05/2013 1:06 AM, Colin Rogers wrote:

Wicketeers,

Where I have;

mountPage( path/to/myPage, MyPersonalPage.class );
mountPage( different/path/customPage, AnotherCustomPage.class );

I now have a Page class (i.e. MyPersonalPage) - how can I determine the mountPage String 
(i.e path/to/myPage) ?

I'm sure this should be simple, but I can't find anything. Methods like 
urlFor() only work in relation to the current context/request, as far as I can 
see. You can't override mountPage - as its final - either in order to keep a 
simple store.

Cheers,
Col.



EMAIL DISCLAIMER This email message and its attachments are confidential and 
may also contain copyright or privileged material. If you are not the intended 
recipient, you may not forward the email or disclose or use the information 
contained in it. If you have received this email message in error, please 
advise the sender immediately by replying to this email and delete the message 
and any associated attachments. Any views, opinions, conclusions, advice or 
statements expressed in this email message are those of the individual sender 
and should not be relied upon as the considered view, opinion, conclusions, 
advice or statement of this company except where the sender expressly, and with 
authority, states them to be the considered view, opinion, conclusions, advice 
or statement of this company. Every care is taken but we recommend that you 
scan any attachments for viruses.




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



Re: Session messages

2013-04-30 Thread Bertrand Guay-Paquet

Hi,

This is not the behavior I'm getting. I created a stateless page with this:

add(new FencedFeedbackPanel(feedback));
add(new StatelessLinkVoid(success) {
@Override
public void onClick() {
getSession().info(Success message (without bind()));
setResponsePage(SessionMessagePage.class);
}
});
add(new StatelessLinkVoid(successBind) {
@Override
public void onClick() {
getSession().bind();
getSession().info(Success message (with bind()));
setResponsePage(SessionMessagePage.class);
}
});

The success link does not display a session message in the feedback 
panel if the session is temporary. It does work when the session is 
bound however.


I stepped inside FenceFeedbackPanel#newFeedbackMessagesModel() and 
compared the Session object returned by getSession() there and in the 
success link. They are not the same java object.


On 30/04/2013 7:07 AM, Martin Grigorov wrote:

Hi,

Wicket uses temporary Sessions for stateless application.
Adding a feedback message to such session will live till the end of the
current request. Since the response page is rendered in the same
request/response cycle the feedback messages should be still reachable.



On Mon, Apr 29, 2013 at 11:41 PM, Bertrand Guay-Paquet 
ber...@step.polymtl.ca wrote:


Hello,

When using the Sessions info(), error() and success() methods, and the
session is not bound, the messages are lost. This can happen easily when on
stateless pages. The fix for this is easy: I need to make sure the session
is bound and call Session.bind().

However, I think it would be nice for the Session to get bound
automatically when adding messages to it. Otherwise, the messages are
silently discarded and the cause is not so obvious. What do you think,
should I open an issue for this?

Regards,
Bertrand

--**--**-
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: Session messages

2013-04-30 Thread Bertrand Guay-Paquet
Thanks for your replies. I can confirm the described behavior without 
setResponsePage().


I created issue WICKET-5165 for this.

On 30/04/2013 12:05 PM, Martin Grigorov wrote:

On Tue, Apr 30, 2013 at 5:58 PM, Bas Gooren b...@iswd.nl wrote:


Hi,

Since you are redirecting to another stateless page
(setResponsePage(Class)), the browser is redirected to the new url which
creates a new, temporary session for the second request.

If you don't link to another page (so no setResponsePage call), it will
work, since the response is rendered in the same request cycle as the
request.


Correct!
Wicket needs to make the redirect to change the url in the browser address
bar. And renders the page in the second request ...
So you may be right - org.apache.wicket.Session#addFeedbackMessage() should
bind the session. Or at least write a warning for temporary sessions.



Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 30-4-2013 17:44, schreef Bertrand Guay-Paquet:

  Hi,

This is not the behavior I'm getting. I created a stateless page with
this:

 add(new FencedFeedbackPanel(feedback**));
 add(new StatelessLinkVoid(success) {
 @Override
 public void onClick() {
 getSession().info(Success message (without bind()));
 setResponsePage(**SessionMessagePage.class);
 }
 });
 add(new StatelessLinkVoid(**successBind) {
 @Override
 public void onClick() {
 getSession().bind();
 getSession().info(Success message (with bind()));
 setResponsePage(**SessionMessagePage.class);
 }
 });

The success link does not display a session message in the feedback
panel if the session is temporary. It does work when the session is bound
however.

I stepped inside FenceFeedbackPanel#**newFeedbackMessagesModel() and
compared the Session object returned by getSession() there and in the
success link. They are not the same java object.

On 30/04/2013 7:07 AM, Martin Grigorov wrote:


Hi,

Wicket uses temporary Sessions for stateless application.
Adding a feedback message to such session will live till the end of the
current request. Since the response page is rendered in the same
request/response cycle the feedback messages should be still reachable.



On Mon, Apr 29, 2013 at 11:41 PM, Bertrand Guay-Paquet 
ber...@step.polymtl.ca wrote:

  Hello,

When using the Sessions info(), error() and success() methods, and the
session is not bound, the messages are lost. This can happen easily
when on
stateless pages. The fix for this is easy: I need to make sure the
session
is bound and call Session.bind().

However, I think it would be nice for the Session to get bound
automatically when adding messages to it. Otherwise, the messages are
silently discarded and the cause is not so obvious. What do you think,
should I open an issue for this?

Regards,
Bertrand

--**--**-

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







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



Re: Submit button without form component

2013-04-29 Thread Bertrand Guay-Paquet
Thanks for the suggestion. I dropped the button component and went for a 
straight stateless form. This allows me to still have a single Wicket 
component.


On 27/04/2013 10:06 AM, Martin Grigorov wrote:

Hi,

I haven't tried something like this before and I don't know what exactly
breaks but the simplest solution I see at the moment is to use
StatelessForm.


On Sat, Apr 27, 2013 at 4:01 PM, Bertrand Guay-Paquet 
ber...@step.polymtl.ca wrote:


Hello,

I have action links which I want to transform to POST actions since they
can have side-effects on the database. (See http://stackoverflow.com/**
questions/679013/get-vs-post-**best-practiceshttp://stackoverflow.com/questions/679013/get-vs-post-best-practices)
My understanding is that this is only possible with either javascript or
forms.

I decided (for now) to use forms since they're more accessible and easier
to do while keeping the page stateless. I was hoping to use markup like so:
form action=. method=post
 button wicket:id=doItdo it!/button
/form

Note that there is only a Button component and no Form. Since the form
contains only the button, I'd really like to omit it from the component
hierarchy to keep things simple. Is this possible? I can't get my Buttons
onSubmit() method called... One part of the problem is that the action
attribute gets changed automatically by Wicket to a relative path to the
application context root.

Or is there another better way to achieve POSTing in Wicket?

Regards,
Bertrand

--**--**-
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



Session messages

2013-04-29 Thread Bertrand Guay-Paquet

Hello,

When using the Sessions info(), error() and success() methods, and the 
session is not bound, the messages are lost. This can happen easily when 
on stateless pages. The fix for this is easy: I need to make sure the 
session is bound and call Session.bind().


However, I think it would be nice for the Session to get bound 
automatically when adding messages to it. Otherwise, the messages are 
silently discarded and the cause is not so obvious. What do you think, 
should I open an issue for this?


Regards,
Bertrand

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



Submit button without form component

2013-04-27 Thread Bertrand Guay-Paquet

Hello,

I have action links which I want to transform to POST actions since they 
can have side-effects on the database. (See 
http://stackoverflow.com/questions/679013/get-vs-post-best-practices) My 
understanding is that this is only possible with either javascript or forms.


I decided (for now) to use forms since they're more accessible and 
easier to do while keeping the page stateless. I was hoping to use 
markup like so:

form action=. method=post
button wicket:id=doItdo it!/button
/form

Note that there is only a Button component and no Form. Since the form 
contains only the button, I'd really like to omit it from the component 
hierarchy to keep things simple. Is this possible? I can't get my 
Buttons onSubmit() method called... One part of the problem is that the 
action attribute gets changed automatically by Wicket to a relative 
path to the application context root.


Or is there another better way to achieve POSTing in Wicket?

Regards,
Bertrand

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



Re: Understanding Wicket's Session

2013-04-26 Thread Bertrand Guay-Paquet
This is weird... In both of dhongyt's emails, there isn't any source 
code in the email body. I just noticed that the nabble link does show 
the source code however. Any idea why?


On 26/04/2013 10:16 AM, dhongyt wrote:

Thanks I have fixed the issue.

It was my:


 From my understanding I was getting the Wicket Application's session so
that's why it was shared across users.

So what I did was:


And removed SessionService entirely from the WicketApplication.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Understanding-Wicket-s-Session-tp4658283p4658317.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: Understanding Wicket's Session

2013-04-25 Thread Bertrand Guay-Paquet

Hi,

Overriding newSession to create your custom session implementation is 
the way to go and should work. You can confirm this by breaking on the 
following code somewhere (like a page constructor) :

Session session = Session.get();

You will see that each user gets a different session instance in the 
debugger.


I would guess the problem is with the download bag implementation.

Bertrand

On 25/04/2013 5:45 PM, dhongyt wrote:

I may have the wrong understanding of this and I'm trying to get the correct
understanding.

I have created a SessionService that extends a AuthenticatedWebSession.
In my wicket application I have created a SessionService via the Override
function newSession


I have a download bag in my SessionService and assumed that a different user
that enters my site would have their own download bag since I thought the
newSession would be unique to different user to runs my Wicket Application.

Instead what I see is that two different user will see the same download
bag.
In my download bag I have:


I assumed that the getSession function would get that individual's download
bag, why are two different users seeing the same download bag?




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Understanding-Wicket-s-Session-tp4658283.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: Disabling Individual Checkboxes in CheckGroup

2013-04-22 Thread Bertrand Guay-Paquet

Hi,

I'm not sure this is what you want, but you can subclass the Check 
class and override its onComponentTag method to add disabled=disabled 
to the input tags you want to disable. You can also do it with a 
behavior instead of subclassing.


Remember that if you replace the checkbox html inputs via ajax to 
toggle the disable state of checkboxes, you will likely lose their 
current client-side checked state. Maybe toggling the disabled 
attribute via javascript using the component ids would be better.


On 22/04/2013 12:06 PM, eugenebalt wrote:

How would you disable individual checkboxes in a CheckGroup?

With a CheckBoxMultipleChoice, it's easy: just override isDisabled(int
index) for the particular index you want to disable.

But we are using a CheckGroup, not CheckBoxMultipleChoice, because we need a
grid layout for our set of checkboxes. The CheckGroup components works via a
repeater, such as ListView. We've tried addOrReplace a new ListView, with
some new disabled checkboxes, and it doesn't pick it up until it goes to
render, which doesn't work for us in an Ajax request.

The new disabled checkboxes in the CheckGroup have to be set as part of the
Ajax update. Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Disabling-Individual-Checkboxes-in-CheckGroup-tp4658165.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: a book about Wicket 6.x

2013-04-11 Thread Bertrand Guay-Paquet

Hi,

Check out the new http://code.google.com/p/wicket-guide/

On 11/04/2013 10:52 AM, Yanal Jij wrote:


Hi all,

Any suggestions on books to learn Wicket 6.x , I tried the books on 
the Wicket website they are all about Wicket 1.5 (Wicket in Action and 
Enjoying Web development with Wicket).


Thank you for any help.

Yanal Jij

Software Engineer

Logo_350x134

21515 Ridgetop Circle, Suite 290

Sterling, VA 20166

y...@reverbnetworks.com mailto:y...@reverbnetworks.com

www.reverbnetworks.com http://www.reverbnetworks.com/

**

*Come visit Reverb Networks at LTE Latin America 2013*

*cid:image002.png@01CE1C9A.DC809A40***

/*This electronic mail message and any attached files or documents 
contain information intended for the exclusive use of the party or 
parties to whom it is addressed and may contain information that is 
confidential, proprietary and/or privileged.  If you are not an 
intended recipient, or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that you 
have received this message in error and that any viewing, copying, 
disclosure, distribution, dissemination, forwarding, printing or other 
use of this information is strictly prohibited and may be subject to 
legal restriction or sanction.  Please notify the sender, by 
electronic mail or telephone, of any unintended recipients and destroy 
all copies of this message and the attachments (if any) without making 
any copies thereof./





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



Re: Wicket free guide updated.

2013-04-09 Thread Bertrand Guay-Paquet

Hi Paul,

I asked the same question for v1. Here's the answer:

no, at the moment there is no source for documentation. The main 
document is a LibreOffice odt file. I didn't decide yet how to make it 
available... 


As for contributions, they are welcome! Either send an email or use the 
google code issues.


Regards,
Bertrand

On 09/04/2013 12:33 PM, Paul Szulc wrote:

Hi,

is ths under open source? Are you looking for contributors?


On Mon, Apr 8, 2013 at 11:42 AM, Andrea Del Bene an.delb...@gmail.comwrote:


Hi,

I bother you just to tell that I released an updated version of the guide
with some typo corrections and two small additions.
http://code.google.com/p/**wicket-guide/http://code.google.com/p/wicket-guide/

Bye! :)

--**--**-
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: Proper resource versioning

2013-04-02 Thread Bertrand Guay-Paquet
Thanks for your help Dan. I made all images, css and js wicket resource 
references now. This helps a lot because I also want to prefix my 
website urls with the locale code which is pretty hard to do when some 
paths are context-relative and others are managed by Wicket.


For anyone attempting this change, note that versioned resources can be 
both accessed through the versioned name (with -ver-) added and the 
original file name too. This can help for referencing images with 
relative paths in css.


Regards,
Bertrand

On 28/03/2013 11:39 AM, Dan Retzlaff wrote:

On Thu, Mar 28, 2013 at 7:27 AM, Pointbreak
pointbreak+wicketst...@ml1.netwrote:


I don't think there's anything wrong with serving resources from the
webapp-folder,


I agree, it can work well for some use cases. But if you want better
control over caching, and the ability point all rendered resource
references to a CDN with a little configuration code, then maybe serving
through Wicket gives you more options.

Dan




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



Proper resource versioning

2013-03-27 Thread Bertrand Guay-Paquet

Hello,

I'm trying to figure out the optimal way to deal with caching and out of 
date resources and can't really find which methodology to adopt.


Considering that:
a) css and js files are only accessed from web pages
b) image files are accessed from web pages and from email clients (links 
stored for a long time)

c) image files are referenced from css (e.g. background-image url)
d) font files are accessed from web pages and maybe eventually from 
email clients
e) some css files currently use @import statements to include other 
css files (this could be removed if needed)
f) css, js, fonts and images currently are all located in the webapp 
folder (i.e. I wasn't able to access them with PackageResourceReference)
g) whatever the approach, it needs to be compatible with eventual usage 
of CDN services


Questions:
1- Which files should be versioned?
2- Should they be versioned using Wicket's ResourceReferences?
3- Are there other considerations I haven't thought about?
4- Which successful approaches are in use now by other Wicker users?

Thanks for your insight!

Regards,
Bertrand

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



Re: Proper resource versioning

2013-03-27 Thread Bertrand Guay-Paquet

Hi Dan,

Thanks for sharing this!

On 27/03/2013 6:24 PM, Dan Retzlaff wrote:

Hi, Bertrand. I don't have all your answers, but I can share my experience.

First, when you say you serve files out of webapp folder, do you mean
you're not using any ResourceReference? Just absolute paths from markup? I
think improving that is the first thing to do. You need to process resource
references in Java so you can introduce versions, CDN base URLs, etc.

To answer your question, here's what I use to access my webapp resources:
-ContextImage which uses context-relative urls
-RelativePathPrefixHandler which handles hrefs in the markup and makes 
them context-relative

-UrlResourceReference with, again, context-relative urls


The main caching problem we had was that after upgrades, some clients had
the old CSS cached and the site looked funky for them. So we went through
and made sure all CSS is served through PackageResourceReferences. Wicket's
default versioning strategy then did its magic and that complaint stopped.

With respect to @import, we have many @imports in our source LESS, but by
the time it's being served, the CSS is flat. So versioning that is enough.
It's possible but I think far less likely that this kind of caching problem
will happen for images and fonts. Direct references to these from our
application still go through ResourceReferences just so they can be served
from CDN, but we don't worry about relative-path includes from CSS.

What does LESS mean in the first line of the paragraph above?

Do you do anything special to flatten the css files?

So, to not worry about relative-path includes from CSS, you must make 
the images non-versioned, correct? Do you do this using 
ResourceReferences and IStaticCacheableResource#isCachingEnabled() ?


If you use ResourceRefenrecs, does that mean that all your assets (css, 
js, images,...) are stored along with the java class files (i.e. 
src/main/resources in Maven terms) ?


Thanks again!
Bertrand

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



Re: Free Wicket guide now available!

2013-03-21 Thread Bertrand Guay-Paquet

Thanks a lot for your effort!

Before I start reading whole sections, is the source of the document 
available somewhere? I'd like to correct any typos I may find along the 
way to do my part and I think that a patch would be way more useful than 
sending an email with page numbers and descriptions.


Regards,
Bertrand

On 21/03/2013 11:51 AM, Andrea Del Bene wrote:

Dear Wicketers,

I'm really excited to announce that, after almost two years of work 
(in may spare time), I've finished and published my free guide to Wicket!
You can find it at https://code.google.com/p/wicket-guide/. I've 
chosen to use Google Project because many of us have a gmail account 
that can be used to sign in and leave a feedback (for example opening 
an issue). The document is structured as a step-by-step tutorial and 
is released under Creative Commons license (CC BY-NC-SA 3.0). 
Unfortunately I didn't cover yet the topic of WebSocket, but I think 
that writing a chapter on it will be my very next step :).


Hope you find it helpful!

PS: feel free to contact me via mail. Any feedback is REALLY appreciated!

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




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



Re: Free Wicket guide now available!

2013-03-21 Thread Bertrand Guay-Paquet
That's fine. What is your preferred way to receive such feedback then 
(typos, etc.)? Annotated pdf? I'm not very familiar with the tools 
available for working with pdf files.


By the way, I don't want to rush you or demand the source! I'm just 
asking to help out if possible :)


On 21/03/2013 4:04 PM, Andrea Del Bene wrote:

Hi Bertrand,

no, at the moment there is no source for documentation. The main 
document is a LibreOffice odt file. I didn't decide yet how to make it 
available...

Thanks a lot for your effort!

Before I start reading whole sections, is the source of the document 
available somewhere? I'd like to correct any typos I may find along 
the way to do my part and I think that a patch would be way more 
useful than sending an email with page numbers and descriptions.


Regards,
Bertrand

On 21/03/2013 11:51 AM, Andrea Del Bene wrote:

Dear Wicketers,

I'm really excited to announce that, after almost two years of work 
(in may spare time), I've finished and published my free guide to 
Wicket!
You can find it at https://code.google.com/p/wicket-guide/. I've 
chosen to use Google Project because many of us have a gmail account 
that can be used to sign in and leave a feedback (for example 
opening an issue). The document is structured as a step-by-step 
tutorial and is released under Creative Commons license (CC BY-NC-SA 
3.0). Unfortunately I didn't cover yet the topic of WebSocket, but I 
think that writing a chapter on it will be my very next step :).


Hope you find it helpful!

PS: feel free to contact me via mail. Any feedback is REALLY 
appreciated!


-
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: Eclipse or IntelliJ

2013-02-20 Thread Bertrand Guay-Paquet

Hi William,

This might be your lucky day :)

Here's the fix for that horrible slowness in xml tabs:
From: http://wiki.eclipse.org/Platform_UI/Juno_Performance_Investigation

Ensure you are already running on a package from the Juno SR1 release 
(September 2012)

Invoke Help  Install New Software
Select this repository: http://download.eclipse.org/eclipse/updates/4.2
Expand Juno SR1 Patches and install Eclipse UI Juno SR1 Optimizations

Have a nice day,
Bertrand

p.s. I use Eclipse Juno. Tried Intellij 12 for a week but didn't like 
it... It was a constant battle to get my project working.


On 20/02/2013 9:29 AM, William Speirs wrote:

I've always used Eclipse and am currently using Juno. The Maven support got
much better, but other stupid things seem to have broke. For example,
switching tabs into the XML editor (or pom editor) seems to require
calculating Pi to 10 million digits each time. Actually, I think there is a
memory leak somewhere and its just a GC going off, I should load it in
VisualVM and see. There are other annoying things about Eclipse with
respect to settings, but they can usually be fixed by editing some file
in the .settings directory.

Tried IntelliJ once and it was terribly slow (and looked a bit ugly on
Linux)... maybe I should try 12?

At the end of the day... anything's better than vim/emacs :-)

Bill-


On Wed, Feb 20, 2013 at 8:03 AM, Martin Grigorov mgrigo...@apache.orgwrote:


My main problem with Eclipse was that it mixes the classpaths for main and
test.
If you have separate config files in the test classpath some weird things
may happen.

There is a ticket about this since March 2008:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=224708 and it says we need
someone to help us to implement it.
It strange because Eclipse is OSGi based, i.e. they should have a very good
control over the classloaders.

So I moved to IDEA and I find it much better for my needs.


On Wed, Feb 20, 2013 at 2:52 PM, Richard W. Adams rwada...@up.com wrote:


If you do software development for a living (as opposed to a hobby), one
thing to consider is what tools are used at prospective employers. I work
at a large (40,000+) company where Eclipse is the standard tool. Partly
because it's open source (read free, no budget impact)  has such a
large support community. Plus it meets all our needs.

I've used Eclipse for years (both home  work), and have been satisfied
with it.


**

This email and any attachments may contain information that is
confidential and/or privileged for the sole use of the intended

recipient.

  Any use, review, disclosure, copying, distribution or reliance by

others,

and any forwarding of this email or its contents, without the express
permission of the sender is strictly prohibited by law.  If you are not

the

intended recipient, please contact the sender immediately, delete the
e-mail and destroy all copies.
**




--
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



Re: Eclipse or IntelliJ

2013-02-20 Thread Bertrand Guay-Paquet

I agree it's not fair at all.

My reasoning was that I wanted to evaluate if I'd be more productive 
with Idea and if some Eclipse irritants would be fixed there. In Idea, I 
found a different set of irritants and I couldn't say I was more 
productive. Having already wasted a week trying it out, I couldn't 
justify spending even more time to get to use it productively and buying 
licenses.


On 20/02/2013 11:59 AM, Jochen Mader wrote:

Well, weighting a few years of Eclipse usage vs one week of Idea is
not really a fair comparison.
It took me about 4 months to really get into Idea (short-cuts,
different compile behavior ...).
If you ever really consider switching an IDE don't base your
assumptions on a week of usage.
If there weren't any differences we wouldn't have several major IDEs.

But that's just my two cents ;)

P.S.: Netbeans is also an awesome IDE, it just gets horribly slow with
bigger projects (and that's based on the most recent Release of
Netbeans I tried a week ago).

On Wed, Feb 20, 2013 at 5:48 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

Hi William,

This might be your lucky day :)

Here's the fix for that horrible slowness in xml tabs:
From: http://wiki.eclipse.org/Platform_UI/Juno_Performance_Investigation

Ensure you are already running on a package from the Juno SR1 release
(September 2012)
Invoke Help  Install New Software
Select this repository: http://download.eclipse.org/eclipse/updates/4.2
Expand Juno SR1 Patches and install Eclipse UI Juno SR1 Optimizations

Have a nice day,
Bertrand

p.s. I use Eclipse Juno. Tried Intellij 12 for a week but didn't like it...
It was a constant battle to get my project working.


On 20/02/2013 9:29 AM, William Speirs wrote:

I've always used Eclipse and am currently using Juno. The Maven support
got
much better, but other stupid things seem to have broke. For example,
switching tabs into the XML editor (or pom editor) seems to require
calculating Pi to 10 million digits each time. Actually, I think there is
a
memory leak somewhere and its just a GC going off, I should load it in
VisualVM and see. There are other annoying things about Eclipse with
respect to settings, but they can usually be fixed by editing some file
in the .settings directory.

Tried IntelliJ once and it was terribly slow (and looked a bit ugly on
Linux)... maybe I should try 12?

At the end of the day... anything's better than vim/emacs :-)

Bill-


On Wed, Feb 20, 2013 at 8:03 AM, Martin Grigorov
mgrigo...@apache.orgwrote:


My main problem with Eclipse was that it mixes the classpaths for main
and
test.
If you have separate config files in the test classpath some weird things
may happen.

There is a ticket about this since March 2008:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=224708 and it says we need
someone to help us to implement it.
It strange because Eclipse is OSGi based, i.e. they should have a very
good
control over the classloaders.

So I moved to IDEA and I find it much better for my needs.


On Wed, Feb 20, 2013 at 2:52 PM, Richard W. Adams rwada...@up.com
wrote:


If you do software development for a living (as opposed to a hobby), one
thing to consider is what tools are used at prospective employers. I
work
at a large (40,000+) company where Eclipse is the standard tool. Partly
because it's open source (read free, no budget impact)  has such a
large support community. Plus it meets all our needs.

I've used Eclipse for years (both home  work), and have been satisfied
with it.


**

This email and any attachments may contain information that is
confidential and/or privileged for the sole use of the intended

recipient.

   Any use, review, disclosure, copying, distribution or reliance by

others,

and any forwarding of this email or its contents, without the express
permission of the sender is strictly prohibited by law.  If you are not

the

intended recipient, please contact the sender immediately, delete the
e-mail and destroy all copies.
**



--
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


-
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



wicket-cdi small demo

2013-01-10 Thread Bertrand Guay-Paquet

Hello,

While testing wicket-cdi, I created a small test app available at :
https://github.com/berniegp/test-wicket-cdi/

It mostly follows the article from 
https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/ and it 
runs both in jetty and TomEE. Following my posts on this mailing list 
regarding cdi, I'm making this available for others who want a working 
example.


@RequestScoped, @SessionScoped and @ApplicationScoped all work properly. 
I couldn't get the conversation scope working yet; adding the necessary 
seam-conversation-owb maven dependency causes an exception in TomEE 
when pages are requested. I haven't tried it with Jetty.


Currently, with TomEE 1.5.1 (and therefore OpenWebBeans), there are many 
warnings/info messages of this sort:
org.apache.webbeans.component.creation.AnnotatedTypeBeanCreatorImpl 
defineConstructor
INFO: No suitable constructor found for injection target class : [class 
org.apache.wicket.cdi.DetachEventEmitter]. produce() method does not work


See this thread for more info about those warnings: 
http://openejb.979440.n4.nabble.com/TomEE-CDI-Wicket-no-suitable-constructor-for-injection-tc4660081.html


Regards,
Bertrand

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



Re: wicket-cdi and TomEE

2013-01-03 Thread Bertrand Guay-Paquet

Thanks to you both for you help.

Here's what I did so far:
-Upgraded from TomEE 1.0.0 to 1.5.1 (not sure if that made a change, but 
it was a todo anyway)

-Removing the seam-conversation-weld dependency
-Finally, added the following section to my pom:
dependencyManagement
dependencies
dependency
artifactIdcdi-api/artifactId
groupIdjavax.enterprise/groupId
scopeprovided/scope
/dependency
/dependencies
/dependencyManagement
wicket-cdi includes this dependency as compile but it is provided by 
the Java EE container.


Igor: perhaps you could modify your blog post to include the info about 
changing the scope of cdi-api?


With these changes, I can get @RequestScoped, @SessionScoped and 
@ApplicationScoped working, although with warnings. I get a ton of log 
messages of the following type:
org.apache.webbeans.component.creation.AnnotatedTypeBeanCreatorImpl 
defineConstructor
INFO: No suitable constructor found for injection target class : [class 
org.apache.wicket.cdi.DetachEventEmitter]. produce() method does not work!

I can't understand why I get these or what they mean.

As for the conversion scope, from what I understand I should simply have 
to replace the seam-conversation-weld dependency with 
seam-conversation-owb to run with OpenWebBeans (used by TomEE). However, 
when I do that, all wicket pages throw an exception:
java.lang.NoSuchMethodError: 
org.apache.webbeans.conversation.ConversationManager.getInstance()Lorg/apache/webbeans/conversation/ConversationManager;

org.jboss.seam.conversation.plugins.openwebbeans.OpenWebBeansSeamConversationManager.doActivate(OpenWebBeansSeamConversationManager.java:41)
org.jboss.seam.conversation.plugins.openwebbeans.OpenWebBeansHttpSeamConversationContext.doActivate(OpenWebBeansHttpSeamConversationContext.java:44)
org.jboss.seam.conversation.api.AbstractSeamConversationContext.activate(AbstractSeamConversationContext.java:54)
org.apache.wicket.cdi.CdiContainer.activateConversationalContext(CdiContainer.java:94)
org.apache.wicket.cdi.ConversationPropagator.activateConversationIfNeeded(ConversationPropagator.java:147)
org.apache.wicket.cdi.ConversationPropagator.onRequestHandlerResolved(ConversationPropagator.java:123)
org.apache.wicket.request.cycle.RequestCycleListenerCollection$5.notify(RequestCycleListenerCollection.java:155)

I don't need conversion scope right now, but all these warnings and 
errors worry me.


Kurt, do you get all these errors?

Regards,
Bertrand

On 21/12/2012 2:53 AM, Kurt Sys wrote:

... forgot this one: my full system setup, used jars etc.

http://openejb.979440.n4.nabble.com/tomee-eclipselink-gt-NoClassDefFoundError-ClassNotFoundException-td4658870.html

Kurt

2012/12/20 Igor Vaynberg igor.vaynb...@gmail.com:

looks like you have two jars on the classpath that provide the
javax.enterprise.inject.spi.BeanManager interface. maybe one comes
with wicket-cdi and the other one is included in tomee...

-igor

On Thu, Dec 20, 2012 at 12:54 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

javax.enterprise.inject.spi.BeanManage

-
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



wicket-cdi and TomEE

2012-12-20 Thread Bertrand Guay-Paquet

Hi,

My web application contains EJB stateless beans which I currently access 
in Wicket through JNDI injection with the wicketstuff-javaee-inject project.


With Wicket 6.4.0, I am trying out CDI (@inject) but can't get it to 
work on the TomEE Java EE application server. In my Application class, I 
put:


BeanManager manager = (BeanManager) new 
InitialContext().lookup(java:comp/BeanManager);


This fails with ClassCastException: 
org.apache.webbeans.container.InjectableBeanManager cannot be cast to 
javax.enterprise.inject.spi.BeanManage


So the BeanManager lookup does work, but there is a problem casting it.

From what I understand, TomEE uses OpenWebBeans to provide CDI while 
Wicket is based on Weld. I found this discussion relating to this : 
http://wicket-users.markmail.org/thread/ibec5hnkimampyr7  but it only 
gave me solutions for using wicket-cdi with Tomcat (servlet container) 
and not TomEE (full application server) and its included OWB.


Igor said (in http://wicket-dev.markmail.org/thread/lhwlhqmmyy5zemjg) 
that jboss seam-conversation module has plugins for every cdi 
container. Maybe this is the solution, but I'm not versed enough in CDI 
to understand it!


Thanks for any hint.

Regards,
Bertrand

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



Re: Wicket 6.4.0 Session/URL bug?

2012-12-20 Thread Bertrand Guay-Paquet

I confirm that this fixes my problem too. thanks!

On 19/12/2012 2:55 PM, Sven Meier wrote:
https://github.com/apache/wicket/commit/12ce76d17e2d0576fee8158b7fa7db69770bea52 



Sven

On 12/19/2012 08:31 PM, Chris Colman wrote:

Jira says this has been fixed but I can't, as yet, see any changed on
github master branch that have any core code changes that may have fixed
this.

Are the changes still in progress?

Chris


-Original Message-
From: Jesus Mireles [mailto:toxi...@gmail.com]
Sent: Thursday, 20 December 2012 3:20 AM
To: users@wicket.apache.org
Subject: Re: Wicket 6.4.0 Session/URL bug?

I have uploaded a quickstart and created a new issue:

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

Something interesting, if I dont mount any pages, it works as expected.

I

was only able to recreate when I actually used mountPackage to mount

the

private page.

Thanks,
Jesus M.




On Wed, Dec 19, 2012 at 12:41 AM, Sven Meier s...@meiers.net wrote:


Hi Nick,

WICKET-4920 might be related. Please create a quickstart showing the
problem.

Thanks
Sven


On 12/19/2012 06:39 AM, Chris Colman wrote:


I have seen this exact same issue.

I first saw it after I reported the, possibly related, bug:

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

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

and then was verifying that it was fixed.

I only noticed the bug you describe after I built with a version of
Wicket that included the above fix. I'm not saying this fix caused

the

bug but I never noticed the issue described below until this fix was
implemented.

Regards,
Chris

  -Original Message-

From: Jesus Mireles [mailto:toxi...@gmail.com]
Sent: Wednesday, 19 December 2012 1:52 PM
To: users@wicket.apache.org
Subject: Wicket 6.4.0 Session/URL bug?

I'm seeing some strange behavior with the initial launch of a fresh
session.  I have 3 types of pages which are public, user which is


locked


down with AuthorizeInstantiation(USER)**, and admin which locked

down

with


AuthorizeInstantiation(ADMIN**). My public pages are using


mountPackage


and are mounted to root /, my user are mounted to /home and my

admin

are


/admin.  I'm using AuthenticatedWebApplication.

When I have a clean browser and I hit my application at

localhost:8080/

everything works fine and actually if I hit any public page the


application


works fine and all pages work as expected.  However, if the first

page

is


one of the private pages such as localhost:8080/user/Main or
localhost:8080/admin/Console then i get forwarded to
localhost:8080//Login;**jesssionid=blah.  The extra / gives a 404.

I

can
recreate by clearing my browser and starting a new session.  Again

this

only happens if the first page I hit is one of those private pages
otherwise the forward to the login works as expected and I dont get

a

404.


This only happens with the latest 6.4.0 release.

Any ideas?

Thanks!
Jesus M.


--**--**

-

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-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




-
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 6.4.0 Session/URL bug?

2012-12-19 Thread Bertrand Guay-Paquet

Hi,

I'm trying 6.4.0 now and seeing the same issue.

My use-case is a little bit different though:
1) Without active session, go to stateless page
2) Go to stateful page

The first stateful page loaded is wrong like so:
http://localhost:8080/SERVLET_CONTEXT/SERVLET_CONTEXT;jsessionid=7C9C4B53381D6ADFF82D4DD14CB24630

Notice the repetition of SERVLET_CONTEXT which is not good and the 
appended jsessionid. Navigating to any other page afterwards works fine.


Regards,
Bertrand

On 19/12/2012 11:19 AM, Jesus Mireles wrote:

I have uploaded a quickstart and created a new issue:

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

Something interesting, if I dont mount any pages, it works as expected.  I
was only able to recreate when I actually used mountPackage to mount the
private page.

Thanks,
Jesus M.




On Wed, Dec 19, 2012 at 12:41 AM, Sven Meier s...@meiers.net wrote:


Hi Nick,

WICKET-4920 might be related. Please create a quickstart showing the
problem.

Thanks
Sven


On 12/19/2012 06:39 AM, Chris Colman wrote:


I have seen this exact same issue.

I first saw it after I reported the, possibly related, bug:

https://issues.apache.org/**jira/browse/WICKET-4920https://issues.apache.org/jira/browse/WICKET-4920

and then was verifying that it was fixed.

I only noticed the bug you describe after I built with a version of
Wicket that included the above fix. I'm not saying this fix caused the
bug but I never noticed the issue described below until this fix was
implemented.

Regards,
Chris

  -Original Message-

From: Jesus Mireles [mailto:toxi...@gmail.com]
Sent: Wednesday, 19 December 2012 1:52 PM
To: users@wicket.apache.org
Subject: Wicket 6.4.0 Session/URL bug?

I'm seeing some strange behavior with the initial launch of a fresh
session.  I have 3 types of pages which are public, user which is


locked


down with AuthorizeInstantiation(USER)**, and admin which locked down


with


AuthorizeInstantiation(ADMIN**).  My public pages are using


mountPackage


and are mounted to root /, my user are mounted to /home and my admin


are


/admin.  I'm using AuthenticatedWebApplication.

When I have a clean browser and I hit my application at localhost:8080/
everything works fine and actually if I hit any public page the


application


works fine and all pages work as expected.  However, if the first page


is


one of the private pages such as localhost:8080/user/Main or
localhost:8080/admin/Console then i get forwarded to
localhost:8080//Login;**jesssionid=blah.  The extra / gives a 404.  I
can
recreate by clearing my browser and starting a new session.  Again this
only happens if the first page I hit is one of those private pages
otherwise the forward to the login works as expected and I dont get a


404.


This only happens with the latest 6.4.0 release.

Any ideas?

Thanks!
Jesus M.


--**--**-
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-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: Wicket 6.4.0 Session/URL bug?

2012-12-19 Thread Bertrand Guay-Paquet
To be clear, I don't use wicket's auth module. I suspect that what was 
reported is caused by stateful/stateless pages.


On 19/12/2012 12:51 PM, Bertrand Guay-Paquet wrote:

Hi,

I'm trying 6.4.0 now and seeing the same issue.

My use-case is a little bit different though:
1) Without active session, go to stateless page
2) Go to stateful page

The first stateful page loaded is wrong like so:
http://localhost:8080/SERVLET_CONTEXT/SERVLET_CONTEXT;jsessionid=7C9C4B53381D6ADFF82D4DD14CB24630 



Notice the repetition of SERVLET_CONTEXT which is not good and the 
appended jsessionid. Navigating to any other page afterwards works fine.


Regards,
Bertrand

On 19/12/2012 11:19 AM, Jesus Mireles wrote:

I have uploaded a quickstart and created a new issue:

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

Something interesting, if I dont mount any pages, it works as 
expected.  I

was only able to recreate when I actually used mountPackage to mount the
private page.

Thanks,
Jesus M.




On Wed, Dec 19, 2012 at 12:41 AM, Sven Meier s...@meiers.net wrote:


Hi Nick,

WICKET-4920 might be related. Please create a quickstart showing the
problem.

Thanks
Sven


On 12/19/2012 06:39 AM, Chris Colman wrote:


I have seen this exact same issue.

I first saw it after I reported the, possibly related, bug:

https://issues.apache.org/**jira/browse/WICKET-4920https://issues.apache.org/jira/browse/WICKET-4920 



and then was verifying that it was fixed.

I only noticed the bug you describe after I built with a version of
Wicket that included the above fix. I'm not saying this fix caused the
bug but I never noticed the issue described below until this fix was
implemented.

Regards,
Chris

  -Original Message-

From: Jesus Mireles [mailto:toxi...@gmail.com]
Sent: Wednesday, 19 December 2012 1:52 PM
To: users@wicket.apache.org
Subject: Wicket 6.4.0 Session/URL bug?

I'm seeing some strange behavior with the initial launch of a fresh
session.  I have 3 types of pages which are public, user which is


locked

down with AuthorizeInstantiation(USER)**, and admin which locked 
down



with


AuthorizeInstantiation(ADMIN**). My public pages are using


mountPackage


and are mounted to root /, my user are mounted to /home and my admin


are


/admin.  I'm using AuthenticatedWebApplication.

When I have a clean browser and I hit my application at 
localhost:8080/

everything works fine and actually if I hit any public page the


application

works fine and all pages work as expected.  However, if the first 
page



is


one of the private pages such as localhost:8080/user/Main or
localhost:8080/admin/Console then i get forwarded to
localhost:8080//Login;**jesssionid=blah.  The extra / gives a 404.  I
can
recreate by clearing my browser and starting a new session.  Again 
this

only happens if the first page I hit is one of those private pages
otherwise the forward to the login works as expected and I dont get a


404.


This only happens with the latest 6.4.0 release.

Any ideas?

Thanks!
Jesus M.

--**--**- 

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-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




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



Re: [Announce] WicketStuff 6.0.0 released

2012-09-11 Thread Bertrand Guay-Paquet

Hi,

Thanks for the release! Having just tried it, it seems that WicketStuff 
uses Wicket version 6.0-SNAPSHOT. Is this on purpose?


In wicketstuff-core's pom, there is the following property :

wicket.version6.0-SNAPSHOT/wicket.version

Regards,
Bertrand

On 07/09/2012 4:01 PM, Martijn Dashorst wrote:

WicketStuff Core projects version 6.0.0 have been released and will
shortly be available at Maven Central.

The WicketStuff Core projects were built against Apache Wicket 6.0.0.

The changelog is pretty long, so you can find that at the end of this message.

The projects can be retrieved from Maven like this:

dependency
   groupIdorg.wicketstuff/groupId
   artifactIdwicketstuff-progressbar/artifactId
   version6.0.0/version
/dependency

The release tag is here:
https://github.com/wicketstuff/core/tree/wicketstuff-core-6.0.0

Issues can be reported here: https://github.com/wicketstuff/core/issues

The Project Wiki is available here: https://github.com/wicketstuff/core/wiki

The WicketStuff team!

==

The changelog:


=Tom B (2):
   [InMethod Grid] Ability to add new rows  new column types
**Appendable Changes**  - Added `IAppendableDataSource` - defines
a data source capable of adding new rows  - Added
`AppendableDataProvider` - example IAppendableDataSource
implementation that wraps IDataProvider  - Added
`AddRecordsToolbar` - toolbar with a button for adding new records to
a data grid  - Added `AbstractPageableView#clearCache()` - clears
the query cache to force complete redraw on next render  - Added
`DataGrid#insertRow(T rowData)` - inserts a new row of data into the
end of the current page  - Added `DataGridBody#insertRow(T
rowData)` - inserts a new row of data into the end of the current page
  - Added `DataGridBody#createItem(T rowData)` - returns an item to
be inserted  - Added `DataGridBody#clearCache(T rowData)` - clears
the query cache to force complete redraw on next render
   [InMethod Grid] Added missing Wicket-DateTime dependency for
EditableDateColumn loosened SubmitCancelPanel#getGrid() to
protected for AddDeletePanel

Andrei Costescu (1):
   Manually merged changes from 1.4 branch. Options that should
eveluate to function objects browser side should not escape
unicode characters like =. Also when the input component gets
replaced through AJAX while it is being incremented/decremented,
avoid endless loop.

Bruno Borges (2):
   DSL for Wicket+Scala projects
   fixed package name

Emond Papegaaij (3):
   many compilefixes for upstream wicket 6.0 changes
   make wicket-security work again on wicket 6.0
   ported GMap2 and openlayers to Wicket 6, I'm not in the position
to test this, so it could still be broken

Georg Buschbeck (4):
   updated jquery dependencies
   added js files fixed version typo in LibraryData
   forgot file in previous commit
   Merge remote branch 'upstream/master'

George Armhold (1):
   Fix bug in StringBuilder usage when rendering chbh chart URL
param.  This allows barWidth to be rendered properly.

Igor Vaynberg (1):
   Merge pull request #73 from tfreier/master

Jesse Long (5):
   IXmlPullParser no longer throws ResourceStreamNotFoundException
   Latest packaged version of jquery is 1.7.2
   Add missing jquery-1.6.1.js file
   Generify SecureTabbedPanel like regular TabbedPanel
   Update package name for UrlDecoder and UrlEncoder imports

JoachimRohde (2):
   Fixed compilation issue and a NPE in GMap2. -
wicket.contrib.gmap.api.GClientGeocoder#getCallbackScript could not be
compiled because getCallbackFunction didn't accept strings as
parameters. - In GOverlay a NullPointerException occured when
using the DragEndListener.
   Merge pull request #144 from JoachimRohde/master

Martijn Dashorst (1):
   Release version 6.0.0

Martin Grigorov (14):
   Merge pull request #86 from armhold/master
   Merge pull request #109 from raystorm/Raystorm-Appendable
   Merge pull request #111 from rkaercher/master
   Merge pull request #122 from JoachimRohde/master
   Merge pull request #124 from td-github/master
   Merge pull request #126 from td-github/master
   Merge pull request #132 from jesselong/master
   Merge pull request #133 from pausb/master
   Merge pull request #137 from minman/fix-130
   Merge pull request #139 from wickeria/master
   Merge pull request #142 from svieujot/master
   Merge pull request #141 from JoachimRohde/master
   Merge pull request #147 from wickeria/master
   Merge pull request #149 from pliljenberg/master

Martin Tzvetanov Grigorov (31):
   [inmethod-grid] Fix imports after WICKET-4439
   [inmethod-grid] Update to upstream - JavaScriptPrecondition is removed
   [annotations] Re-enable Annotations module
   [scala] Re-enable scala-extensions module
   [jquery] Re-enable jquery module
 

Re: redirectToInterceptPage and string

2012-08-21 Thread Bertrand Guay-Paquet

Hi,

I don't think there's a direct way to achieve what you want. However, 
you could instead find the page class mapping to the url and use that in 
the exception. I'm not too familiar with it, but have a look at 
Application#getRootRequestMapper() and its mapHandler method. You could 
perhaps use a MockWebRequest with your url to find out which 
IPageClassRequestHandler maps to your page.


Bertrand

On 21/08/2012 1:43 PM, Dan12321 wrote:

Hi,
is possible to redirect page like this:
redirectToInterceptPage(myPage.html) ?

I can do it: redirectToInterceptPage(new MyPage());
But I know only myPage.html and I do not know what Page class it is. So is
it any way how to use string and redirectToInterceptPage?

Thanks.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/redirectToInterceptPage-and-string-tp4651417.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: Add page feedback to every AjaxRequestTarget

2012-08-20 Thread Bertrand Guay-Paquet

Hi,

I haven't used 1.4 much so I'm not sure it exists there. Maybe you could 
add a IRequestCycleListener to your app via getRequestCycleListeners() 
which adds the feedback panel in onRequestHandlerResolved? In that 
method, check if the handler type is an AjaxRequestTarget and add your 
feedback panel to it.


On 20/08/2012 11:45 AM, Alec Swan wrote:

It seems that I cannot access ART from the component that is not
updated by that ART because that component is not rendered during the
lifecycle of that ART.

Here is the problem description:

1. A page is rendered with a feedback panel and a form
2. The form is later submitted via AJAX and does not add any components to ART

How in step 1 can I make sure that feedback panel is updated when form
is submitted in step 2?

Thanks,

Alec

On Mon, Aug 20, 2012 at 9:38 AM, Tibor Blénessy blene...@gmail.com wrote:

You can access current ART associated with request by calling static
AjaxRequestTarget.get()

Tibor

On Mon, Aug 20, 2012 at 5:10 PM, Alec Swan alecs...@gmail.com wrote:

Thoughts, anybody?

On Sun, Aug 19, 2012 at 1:07 PM, Alec Swan alecs...@gmail.com wrote:

The main problem I am facing is that in Wicket 1.4.x I can't figure
out how to access ART from the component that was not added to this
ART, e.g. during ajax form submission.

I tried to add AjaxFormSubmitBehavior to every Form child of the page
but that overrode those form ajax-submit functionality and basically
broke them all. Now I am thinking about adding an onclick behavior
which will add my component to ART to every AjaxSubmitLink child of
the page. But this seems to be pretty ugly.

Thoughts?

Thanks,

Ale

On Fri, Aug 17, 2012 at 4:22 PM, Alec Swan alecs...@gmail.com wrote:

Hello,

Thank you for the link. I used your code to register an
ART.addListener(new AjaxFeedbackPanelUpdater()) when the page is
created, but it does not get called when the form is submitted and
hence it never adds the FeedbackPanel to ART of form submission.

Where should I add this listener?

Thanks,

Alec

On Wed, Aug 15, 2012 at 4:14 PM, procrastinative.developer
procrastinative.develo...@gmail.com wrote:

Hello Alec,
Could you take a look on this:

https://github.com/procrastinativedeveloper/ToolsClasses/blob/master/src/main/java/com/utils/wicket/ajax/AjaxFeedbackPanelUpdater.java



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Add-page-feedback-to-every-AjaxRequestTarget-tp4651257p4651262.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


-
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: Dataview: need a differente css for negative values

2012-08-16 Thread Bertrand Guay-Paquet

Assuming you use a Label for your amounts:

new Label( ... ) {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
if( isNumberPositive() )
tag.append(class, positive_num_css,  );
else
tag.append(class, negative_num_css,  );
}
}

Bertrand

On 16/08/2012 6:20 AM, Delange wrote:

Hi, in my DataView I have a column with amounts.
I want to give the positive ones a green color, and the negative ones a red
color;

How to accomplish that?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Dataview-need-a-differente-css-for-negative-values-tp4651270.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: How to control IMG/CSS URL-Rewriting in mounted pages?

2012-08-16 Thread Bertrand Guay-Paquet

Hi Joachim,

I have never inspected them closely, but I think the classes in play are :
WicketLinkTagHandler
AutoLinkResolver

As for the usefulness of this process, consider panels. Panels can be 
instantiated on any mount path so their links must be adjusted.


Good luck!
Bertrand

On 15/08/2012 5:37 PM, Joachim Schrod wrote:

Well, one answer yet, with an assertion that Wicket does what I
don't want it to do. :-(

So, is it really not possible to exchange bidirectionally HTML
files with an HTML designer who does *not* put all his HTML files
in web root? I thought being able to share files bidirectionally
with HTML designers was one of the major selling points of Wicket?!

I assume nobody has the energy to really look at my issue. Would it
help if I put up a minimal example project for download that shows
my problem? Anybody willing to look then at it?

I don't need a full solution. An hint like class X does the URL
rewriting for images would be most welcome, overwriting that
behavior with appropriate subclassing is something I can well do on
my own.

Best,
Joachim


Joachim Schrod wrote:

Hi,

I'm new to Wicket and write my first application in it. I use
Wicket in Action and online resources as documentation. (I
stumbled already about the 1st few roadblocks owing to changes from
Wicket 1.4 to 1.5. ;-)) So, if there's an easy pointer to answer my
question, don't hesitate to just send it.

My problem: I have a page that's mounted as URL cat/entry. In the
page's HTML there are links to images and CSS files that start with
.., e.g., ../images/bg_blabla.img. These are no Wicket
components, just plain HTML.

When Wicket renders the page, it rewrites the image URLs and
prepends ../, e.g., the image URL now is output as
../../images/bg_blabla.img. I suppose it tries to adept to the
extra path level that I introduced during mount and compensates for it.

How can I stop Wicket from adding this ../ prefix? I searched via
Google and read through Javadocs, but to no avail.

For background: The URL in the HTML file is right... My HTML
designers deliver their design files as cat/entry.html, my mounts
just follow their lead. I would like to change their files as
little as possible, it makes files swapping back to/with them much
easier.

I hope somebody here may help me, thanks in advance.

Joachim




Joachim




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



Re: Add page feedback to every AjaxRequestTarget

2012-08-15 Thread Bertrand Guay-Paquet

Hi Alec,

Have a look at this:
https://cwiki.apache.org/WICKET/migration-to-wicket-15.html#MigrationtoWicket1.5-Defaultajaxevent

I think it does what you need.

On 15/08/2012 3:59 PM, Alec Swan wrote:

Hello,

I have a FeedbackPanel on a page. The page can contain different kinds
of forms depending on the end-user preference. Some of those forms are
submitted via AJAX and may or may not add any components to
AjaxRequestTarget.

How can I add the page's FeedbackPanel to AjaxRequestTarget of the
forms submitted via ajax? I think the solution should involve
page.visitChildren(Form.class, new IVisitorForm()) and somehow
adding page FeedbackPanel to ART in IVisitor#component(Form) method,
but I can't figure out how to do that. Or maybe the code should visit
AjaxSubmitLink children and do something there.

Thanks,

Alec

-
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: Checkbox in DataTable is not reflecting its sts in checkbox

2012-08-14 Thread Bertrand Guay-Paquet

You have 2 choices:

1) put the boolean as a property of your KostenOV and reference it with 
a model (e.g. propertyModel)


2) Use a CheckGroup and multiple checkboxes which use the id of KostenOV 
as their value. Have a look at:

-http://www.wicket-library.com/wicket-examples/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.CheckGroupPage
-http://www.wicket-library.com/wicket-examples/compref/wicket/bookmarkable/org.apache.wicket.examples.compref.CheckGroupPage

I would probably go for option 2.

On 14/08/2012 7:09 AM, Delange wrote:

I agree, but how should the code be? At the end it has to be placed in the
model.
Do you have any suggestion?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Checkbox-in-DataTable-is-not-reflecting-its-sts-in-checkbox-tp4651174p4651225.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: WicketRuntimeException: Submit Button ... is not enabled

2012-08-14 Thread Bertrand Guay-Paquet

No, they are interchangeable.

On 14/08/2012 11:42 AM, eugenebalt wrote:

Thanks a lot. In our case, we have an AjaxButton that maps to a input
type=submit.

Would using the input type Button get rid of this problem?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketRuntimeException-Submit-Button-is-not-enabled-tp4651180p4651231.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: Checkbox in DataTable is not reflecting its sts in checkbox

2012-08-13 Thread Bertrand Guay-Paquet

Hi,

In the constructor of UserActionsPanel, the checkbox is created like so:

add(new CheckBox(select, item.getModel()));

However, I think item.getModel() returns an 
IModelICellPopulatorKostenOV type. This can't work in a CheckBox 
which requires a Boolean model.


On 13/08/2012 8:33 AM, Delange wrote:

Hi, in this program i use a datatable with selections. In the column  beneath
the filtercolum i added a checkbox.
The user must select wich records the program must add to another file (at
the end)

In this example the table is shown correctly, it has a checkbox.
But whatever I do I'll never see any  status change reflecting the checkbox.

(The checkbox is part of the KostenOV record that is shown)

I can'figure out what is wrong. I read a lot of articles but none could
help.

My source is:



package com.vdr.logistiek.gui.kosten.regels.opbouw;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import
org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import
org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.HeadersToolbar;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.NavigationToolbar;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterForm;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilterToolbar;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.FilteredAbstractColumn;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.GoAndClearFilter;
import
org.apache.wicket.extensions.markup.html.repeater.data.table.filter.IFilterStateLocator;
import
org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.CheckBox;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.spring.injection.annot.SpringBean;
  
import com.vdr.logistiek.bo.view.KostenOV;

import com.vdr.logistiek.gui.kosten.header.HeaderPage;
import com.vdr.logistiek.gui.kosten.overzicht.KostenfacturenOverzichtPage;
import com.vdr.logistiek.gui.template.MyFilterColumn;
import com.vdr.logistiek.service.KostenService;
import com.vdr.logistiek.service.view.KostenOVService;
  


public class RegelPage   extends WebPage{
private RegelInput input;
private ListKostenOV kostenOVList = new ArrayListKostenOV();

@SpringBean(name = kostenService) private KostenService kostenService;
@SpringBean(name = kostenOVService) private KostenOVService
kostenOVService;

public RegelPage(){
input = new RegelInput();
setDefaultModel(new CompoundPropertyModelRegelInput(input));
KostenOVProvider kostenOVProvider = new KostenOVProvider();
FilterForm form = new FilterForm(inputForm, kostenOVProvider);

add(form);  

addTable(form, kostenOVProvider);   

form.add(getSaveButton());
form.add(getCancelButton());
form.add(new FeedbackPanel(feedback));  
}

private Form getForm(){
Form form = new Form(inputForm){
private static final long serialVersionUID = 1L;
protected void onSubmit() {
 info(the form was submitted!);
 
 }			

};
return form;
}

private Button getSaveButton(){
Button saveButton = new Button(saveButton){
 public void onSubmit(){
System.out.println(savebutton clicked);
//  PageParameters parameters = new PageParameters();
//  setResponsePage(OverzichtPage.class,parameters);d
for (KostenOV kostenOV:kostenOVList){
System.out.println(kostenOV.isSelect());
}
  

Re: WicketRuntimeException: Submit Button ... is not enabled

2012-08-13 Thread Bertrand Guay-Paquet

Hi,

When a form is submitted, it checks whether the submitting component is 
a Wicket component. If it is (your case), it makes sure that it's 
enabled and visible. I guess this is to prevent users manipulating with 
the form submission process. In any case, if any of the 2 conditions is 
not met, the exception is thrown.


This might or might not be caused by a race condition, but it would most 
likely be caused by disabling buttons (or their parents) in your code.


Bertrand

On 13/08/2012 10:40 AM, eugenebalt wrote:

We have an Ajax button which, when clicked, occasionally produces this
WicketRuntimeException:

  ERROR [WebContainer : 17] (RequestCycle.java:1521) - Submit Button
myPanel:editButton (path=myForm:myPanel:editButton) is not enabled
org.apache.wicket.WicketRuntimeException: Submit Button myPanel:editButton
(path=myForm:myPanel:editButton) is not enabled
 at
org.apache.wicket.markup.html.form.Form$2.component(Form.java:626)
 at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:878)
 at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893)
 at
org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893)
 at
org.apache.wicket.markup.html.form.Form.findSubmittingButton(Form.java:602)
 at
org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:875)
 at sun.reflect.GeneratedMethodAccessor2603.invoke(Unknown Source)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
 at java.lang.reflect.Method.invoke(Method.java:599)
 at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
 at

Is there a race condition of some kind happening here? Thanks



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WicketRuntimeException-Submit-Button-is-not-enabled-tp4651180.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: How is the better way to use repeated forms using ajax?

2012-08-13 Thread Bertrand Guay-Paquet

Hi,

On 13/08/2012 12:13 PM, Roger Palacios wrote:

Hi every all.

This is my first mail in wicket mailing list.

Welcome!


I want to update the groups doing ajax submits. I tried using ListView,
but, I dont know why, when I click 'save' button the changes are reflected
on in the first group panel, if I update any other group and click 'save'
the Group object is not updated.
I'm a little bit confused... What is the first group panel ? Is it the 
first table row? I also don't understand the relation with the other 
page you presented with the filtering.


Could you show the java side of the panel as well? It would help to 
understand the problem.


Bertrand

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



Re: How is the better way to use repeated forms using ajax?

2012-08-13 Thread Bertrand Guay-Paquet
);
 super.onSubmit();
 }

 @Override
 protected void onError(AjaxRequestTarget target, Form? form) {
 throw new UnsupportedOperationException(Not supported
yet.);
 }
 };

 Button saveButton = new Button(guardar, new
ModelString(Guardar)) {
 @Override
 public void onSubmit() {

 Grupo g = (Grupo) cpmGrupo.getObject();

 try {
 DBManager.saveWithLocking(g, false);
 resultModel.setObject(Se ha guardado exitosamente.);
 resultLabel.add(new AttributeModifier(class, new
Model( green)));
 } catch (OptimisticLockException e) {
 resultModel.setObject(El grupo había sido editado
préviamente. Se cargó la información que está en la base de datos.);
 resultLabel.add(new AttributeModifier(class, new
Model( red)));
 } finally {
 g = Grupo.findById(g.getIdGrupo());
 cpmGrupo.setObject(g);
 lvSolicitantes.setList(g.getSolicitanteList());
 }
 super.onSubmit();
 }
 };
 cancelButton.setDefaultFormProcessing(false);

 f.add(cancelButton);
 f.add(saveButton);
 add(f);

 }
}

Thanks!

2012/8/13 Bertrand Guay-Paquet ber...@step.polymtl.ca


Hi,


On 13/08/2012 12:13 PM, Roger Palacios wrote:


Hi every all.

This is my first mail in wicket mailing list.


Welcome!


  I want to update the groups doing ajax submits. I tried using ListView,

but, I dont know why, when I click 'save' button the changes are reflected
on in the first group panel, if I update any other group and click 'save'
the Group object is not updated.


I'm a little bit confused... What is the first group panel ? Is it the
first table row? I also don't understand the relation with the other page
you presented with the filtering.

Could you show the java side of the panel as well? It would help to
understand the problem.

Bertrand

--**--**-
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: Not to validate the Html while rendering in wicket

2012-08-13 Thread Bertrand Guay-Paquet
That's weird. I thought this was disabled by default when Wicket is in 
deployment mode...


On 13/08/2012 3:36 PM, vinitty wrote:

I want to disable the Html validation while rendering in wicket 1.5.7

I am running wicket in deployment mode

Please suggest its  urgent



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Not-to-validate-the-Html-while-rendering-in-wicket-tp4651202.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



Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread Bertrand Guay-Paquet

Hi,

(Using Wicket 6.0-SNAPSHOT, or 1.5.7)

I found a strange behavior when calling Page#isPageStateless(). I have a 
simple label in my personal wicket debug bar which displays stateless 
when a page is stateless. It works like so:


new WebMarkupContainer(statelessMarker) {
@Override
protected void onConfigure() {
super.onConfigure();
setVisible(getPage().isPageStateless());
}
};

This worked great until I got by chance a page which was stateless 
except for ajax links which were children of a repeater. Here is what 
happens then:
1) onConfigure() is called which calls isPageStateless() and determines 
the page is stateless
2) onBeforeRender() is executed which populates the repeaters and adds 
stateful components to the tree

3) Since the page was determined stateless in 1), it stays that way
4) stateful ajax callback links do not work on the page

Therefore, it seems that isPageStateless() should never be called before 
onBeforeRender() is executed or mayhem may ensue. However, after cursory 
inspection of callers of isPageStateless(), it looks like that is not 
always the case so I'm not certain.


Should this be considered a bug? Should an assertion be made in 
isPageStateless() that onBeforeRender() was executed?


Regards,
Bertrand

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



Re: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread Bertrand Guay-Paquet


On 10/08/2012 12:12 PM, vineet semwal wrote:

it might give you wrong result even if you add your component after
adding all the components because  some components foreg. a repeater
like listview/dataview/gridview  add children in onbeforerender so
isPageStateless() can be assumed to work correctly only after
onbeforerender
Yes that's exactly what I wanted to say! The repeaters are only 
populated in their onBeforeRender() which is executed after onConfigure().



that caching part is ok imho   for isPageStateless() ,actually that
cached variable is reset in page#onbeforerender which is the another
reason isPageStateless()  should work correctly after onbeforerender
I hadn't noticed that reset in Page#onBeforeRender() so I had a look 
since it would contradict my observations.


This is the stack trace when my label's onConfigure() is reached :
TmpPage$1.onConfigure() line: 24-- my stateless indicator label; 
calls isPageStateless()

TmpPage$1(Component).configure() line: 1028
TmpPage$1(Component).internalBeforeRender() line: 913
TmpPage$1(Component).beforeRender() line: 990
TmpPage(MarkupContainer).onBeforeRenderChildren() line: 1688
TmpPage(Component).onBeforeRender() line: 3830
TmpPage(Page).onBeforeRender() line: 802--- line 799 already did 
the reset of the cached stateless var

TmpPage(Component).internalBeforeRender() line: 922
TmpPage(Component).beforeRender() line: 990
TmpPage(Component).internalPrepareForRender(boolean) line: 2204
TmpPage(Page).internalPrepareForRender(boolean) line: 247
TmpPage(Component).render() line: 2289
TmpPage(Page).renderPage() line: 1021

This stack trace occurs before the repeating view is populated which 
would render the page stateful and causes the Page to cache that it is 
stateless.


By the way, I did find a workaround to achieve the desired effect so 
that's not why I brought this up here. I'm just concerned that such 
erroneous computations of the page's stateless state might cause other 
bugs down the road.


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



Re: Calling isPageStateless() can mess up the statelessness of a page

2012-08-10 Thread Bertrand Guay-Paquet
This is weird, I never received Martin's email! I managed to see it in 
your first reply Vineet... I also lost a few hours' worth of mailing 
list emails.


Removing the caching in isPageStateless() would indeed make sure that 
the code in WebPageRenderer would not get the wrong value. However, all 
the calls made to isPageStateless() before that point could still get 
the wrong value returned, depending on the page. In that case, it seems 
kind of pointless to rely on isPageStateless() for anything at all 
before rendering (or at least onBeforeRender) occurs.


I had a deeper look at callers of isPageStateless() in Wicket's source 
and found two possible causes of concern: 
WebPageRenderer#respond(RequestCycle) and 
ListenerInterfaceRequestHandler#respond(RequestCycle). I'll need to 
examine in them in more details.


To be continued...

On 10/08/2012 6:33 PM, vineet semwal wrote:

you are right onconfigure is executed once before rendering .

actually isPageStateless() can be broken easily as that variable can
be populated before the page#onbeforerender is completed ie. say if
some component in onbeforerender  uses  ispagestateless() then the
variable will be set prematurely

now i see martin-g is correct the solution is to just remove the
caching but the problem can be that method is used in a lot of places
and can be called many times  foreg. it's used inside urlFor in
Component which means link will at least call this method once in
getUrl and if you have a repeater of 20 links this is 20 X
isPageStateless()  ,it actually depends on how expensive
ispagestateless() itself is and at how many places is it used ..


On Fri, Aug 10, 2012 at 10:53 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

On 10/08/2012 12:12 PM, vineet semwal wrote:

it might give you wrong result even if you add your component after
adding all the components because  some components foreg. a repeater
like listview/dataview/gridview  add children in onbeforerender so
isPageStateless() can be assumed to work correctly only after
onbeforerender

Yes that's exactly what I wanted to say! The repeaters are only populated in
their onBeforeRender() which is executed after onConfigure().



that caching part is ok imho   for isPageStateless() ,actually that
cached variable is reset in page#onbeforerender which is the another
reason isPageStateless()  should work correctly after onbeforerender

I hadn't noticed that reset in Page#onBeforeRender() so I had a look since
it would contradict my observations.

This is the stack trace when my label's onConfigure() is reached :
TmpPage$1.onConfigure() line: 24-- my stateless indicator label; calls
isPageStateless()
TmpPage$1(Component).configure() line: 1028
TmpPage$1(Component).internalBeforeRender() line: 913
TmpPage$1(Component).beforeRender() line: 990
TmpPage(MarkupContainer).onBeforeRenderChildren() line: 1688
TmpPage(Component).onBeforeRender() line: 3830
TmpPage(Page).onBeforeRender() line: 802--- line 799 already did the
reset of the cached stateless var
TmpPage(Component).internalBeforeRender() line: 922
TmpPage(Component).beforeRender() line: 990
TmpPage(Component).internalPrepareForRender(boolean) line: 2204
TmpPage(Page).internalPrepareForRender(boolean) line: 247
TmpPage(Component).render() line: 2289
TmpPage(Page).renderPage() line: 1021

This stack trace occurs before the repeating view is populated which would
render the page stateful and causes the Page to cache that it is stateless.

By the way, I did find a workaround to achieve the desired effect so that's
not why I brought this up here. I'm just concerned that such erroneous
computations of the page's stateless state might cause other bugs down the
road.


-
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 to display a grid with empty cells

2012-08-08 Thread Bertrand Guay-Paquet

Hi,

I haven't used the GridView directly so I can't help you with it 
specifically. However, have you considered modifying your provider to 
always return 9 records with some having an empty placeholder? It's 
definitely a hack, but it may be worth a try.


Bertrand

On 08/08/2012 10:56 PM, Alec Swan wrote:

Hello,

I am using Wicket 1.4.17 and need to display a 3x3 table with all of
its cells, some of which may not have a model and hence blank. So, if
my DataProvider returns 0 elements than I want all 9 cells to be shown
as blank.

I started using GridView and overrode its populateEmptyItem() method
to display empty cells. However, contrary to its JavaDoc Add
component to an Item for which there is no model anymore and is shown
in a cell this method is not being called unless a row has at least
one item (see GrdiView#addItems()).

What would the easiest way to accomplish what I need without copying
the entire code from GridView class? Any other component that can do
that?

Thanks,

Alec

-
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: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form

2012-08-07 Thread Bertrand Guay-Paquet



The cancel link should just set an empty model object to the form.

What if I'm editing an existing entity that's coming from a database (not
creating a new one) and I want to display the original values after
clicking Cancel? I assume I have to reload the entity and set it as the
model object again?
Yes. You also have to add the form to the ajax target for it to be 
re-rendered with the original values.



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



Re: [1.5] AjaxFormComponentUpdatingBehavior and Cancel AjaxButton to reset form

2012-08-06 Thread Bertrand Guay-Paquet

Hi,

form.clearInput() only clears the raw input (what is received in the 
current request) of the form components. That is, it doesn't modify the 
underlying models. With setDefaultFormProcessing(false), this means that 
your FormComponent models are not updated at all.


The AjaxFormComponentUpdatingBehavior should only be triggered when 
input changes on the text fields. It plays no part otherwise when 
clicking a button.


As a sidenote, why do you use a Button? This component causes the form 
to be submitted but apparently you don't need the values for this 
action. A link would save a bit of processing and transfer.


Bertrand

On 06/08/2012 12:33 PM, heapifyman wrote:

Hello,

I've been struggling for a while now with a problem that a Cancel
AjaxButton (with setDefaultFormProcessing(false)) calling form.clearInput()
would not reset my form to original values.
The problem seems to be that I have AjaxFormComponentUpdatingBehavior
(onchange event) for validation added to a few Textfields of the form.
Am I right, that the behaviour updates the model and thus the Cancel button
cannot restore the original value?

And if that really is the problem, is there a best practice how to combine
the two functionalities?

Thanks in advance.




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



Re: Paste Behaviour

2012-08-06 Thread Bertrand Guay-Paquet

Hi,

How about:

Attach a ajax onclick behavior to your TextAreas. This behavior opens 
the modalwindow and registers an onclose callback. In the callback:
-update the model of the text area according to which textblock the user 
chose

-add the TextArea to the ajax request for a refresh.

On 06/08/2012 8:58 AM, saschisch87 wrote:

Hi, I´m trying to accomplish the following Behaviour.

I have a tree of Textareas. each one of them is modifiable. When you click
into one of them you can open a modal window where you can choose from
predefined textblocks. on confirmation of the selected block it should be
pasted where the cursor was in the last selected window.

I´ve tried to do some javascript to accomplish that and it works like:
(Pseudocode) take text from
document.forms[formName].elements[insertName].value

and put it into
document.forms[formName].elements[inputName];

The problem is that I can´t figure out how to execute the js on an event or
even avoid js and get the info directly in wicket.

Any Suggestions?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Paste-Behaviour-tp4651016.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: Need suggestion on minimizing session usage in wicket web application

2012-08-03 Thread Bertrand Guay-Paquet
Do you use Wicket 6? If so, the latest snapshot includes an enhanced 
page view in the page inspector of the Wicket debug bar. This page view 
can be filtered to show only stateful components and behaviors.


If you're on Wicket 1.5, check out 
https://issues.apache.org/jira/browse/WICKET-4244. 
stateful_page_inspector.patch has the version I submitted for 1.5 in 
November. You can have a look at the screenshots in the issue to see 
what it does.



On 03/08/2012 10:44 AM, kshitiz wrote:

Ya..that worked...and for each component...I think statelessChecker is there.
But I am not able to figure out how to use it for a component? I read you
post
http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html
http://apache-wicket.1842946.n4.nabble.com/Why-is-stateless-from-making-my-page-stateful-td3662059.html
But not able to get...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650987.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: Need suggestion on minimizing session usage in wicket web application

2012-08-02 Thread Bertrand Guay-Paquet

Hi,

You can read the following email thread for insight:
http://wicket-users.markmail.org/thread/6qqc4pxt77mulpmt

Also have a look at this:
http://www.small-improvements.com/blog/technical/tuning-wicket-session-size

These links talk about session size in general, not only about stateless 
components.


On 02/08/2012 9:25 AM, kshitiz wrote:

Hi,

I need some suggestions. In my wicket application (in development phase), I
have used normal forms and links. While going through the concept of
stateless pages and forms, I am confused about converting the forms and
components to stateless. Will it really minimize session usage in the
system. I need to minimize it as i wont be having much server space
initially.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956.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: Need suggestion on minimizing session usage in wicket web application

2012-08-02 Thread Bertrand Guay-Paquet
I would say it depends. Generally, it should help to use detachable 
models, but for very small objects (like static strings), it's won't 
give a big gain. Besides memory gains, detachable models also reload 
their data each request which ensures non-stale objects.



On 02/08/2012 11:28 AM, kshitiz wrote:

Thanks for the links. One thing that I want to ask that do yo think we should
use LoadableDetachable models to minimize session usage? Like for every
thing examples labels, links, dropdowns, etc.



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Need-suggestion-on-minimizing-session-usage-in-wicket-web-application-tp4650956p4650963.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: ComponentNotFoundException when replace a fragment

2012-08-01 Thread Bertrand Guay-Paquet

Hi Alex,

I tried your code and stripped it down as much as possible and couldn't 
find anything wrong with it. My guess is that Wicket ajax does not 
remove timers from replaced components in ajax responses. Therefore, the 
javascript timeout function is still executed on the client even if its 
related component is removed from the page.


Please file a JIRA issue. I suggest using the simpler version below as a 
quickstart:


HomePage.html
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;

html xmlns:wicket=http://wicket.apache.org;
body
a href=# wicket:id=removeReplace the panel with attached time 
behavior/abr

span wicket:id=fragmentsWMC/span
/body
/html

HomePage.java
import org.apache.log4j.Logger;
import org.apache.wicket.Component;
import org.apache.wicket.util.time.Duration;
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;

public class HomePage extends WebPage {
private static final Logger LOGGER = Logger.getLogger(HomePage.class);
private static final String TIMER_COMPONENT_ID = fragments;

public HomePage() {
Component fragment = new WebMarkupContainer(TIMER_COMPONENT_ID);
fragment.add(new AbstractAjaxTimerBehavior(Duration.seconds(2)) {
@Override
protected void onTimer(AjaxRequestTarget target) {
LOGGER.error(Timeout);
}
});
add(fragment.setOutputMarkupId(true));

add(new AjaxLink(remove) {
@Override
public void onClick(AjaxRequestTarget target) {
Component fragment = new 
WebMarkupContainer(TIMER_COMPONENT_ID);

HomePage.this.replace(fragment);
target.add(fragment);
}
});
}
}

Bertrand


On 01/08/2012 3:34 AM, Alex66955 wrote:

TestParent.java


TestParent.html


TestChild.java


TestChild.html


Output:




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ComponentNotFoundException-when-replace-a-fragment-with-ajax-tp4650898p4650909.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: ComponentNotFoundException when replace a fragment

2012-08-01 Thread Bertrand Guay-Paquet

On 01/08/2012 9:58 AM, Martin Grigorov wrote:


No.
The timer is fired but the precondition prevents the Ajax call.
The precondition checks that the component (html element) on which is
attached the timer behavior is still in the DOM document.
Hmm... I don't quite know what to say! In my tests, the timer is still 
fired event after its attached component is replaced.


Here is the sequence of requests captured in Firebug:

Ajax Request 1 (timer callback):
http://localhost:8080/?2-1.IBehaviorListener.0-fragments_=1343829988777
ajax-response
evaluateWicket.timerHandle_fragments3 = 
setTimeout('Wicket.Ajax.ajax({\u\:\./.?2-1.IBehaviorListener.0-fragments\,\c\:\fragments3\});', 
2000)/evaluate

/ajax-response

Ajax Request 2 (click ajax link to replace the component fragments):
http://localhost:8080/?2-1.IBehaviorListener.0-remove_=1343829990235
ajax-response
componentid=fragments3span wicket:id=fragments 
id=fragments3WMC/span/component

/ajax-response

Ajax Request 3 (timer callback):
http://localhost:8080/?2-1.IBehaviorListener.0-fragments_=1343829990803
Throws exception:
org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find 
behavior with id '0' on component 
'org.apache.wicket.markup.html.WebMarkupContainer:fragments' in page 
'[Page class = com.mycompany.HomePage, id = 2, render count = 1]'. 
Perhaps the behavior did not properly implement getStatelessHint() and 
returned 'true' to indicate that it is stateless instead of returning 
'false' to indicate that it is stateful.


(this is a different exception than reported by Alex, but it looks like 
the same symptom)


IMHO, the AjaxTimerBehavior should have been removed during the request 
#2 since the replacement component does not have it attached.


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



Re: ComponentNotFoundException when replace a fragment

2012-08-01 Thread Bertrand Guay-Paquet
Yes I was using -beta3 since this is what Alex used. I just tried it 
with -SNAPSHOT (commit b89909c1fa99ae6973c3fb0738a966eb23c27e73) and I 
get the same exception.


You say that:

The precondition checks that the component (html element) on which is
attached the timer behavior is still in the DOM document.


In this case, the component id is still in the DOM (it was replaced by 
another one by the same id). The problem is that on the java side, the 
component is different and does not have a timer behavior attached, 
hence the callback fails.


On 01/08/2012 10:14 AM, Martin Grigorov wrote:

Do you use -beta3 ?
There was a bug which is fixed in -SNAPSHOT. That's why I know how it works ;-)

On Wed, Aug 1, 2012 at 5:12 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

On 01/08/2012 9:58 AM, Martin Grigorov wrote:


No.
The timer is fired but the precondition prevents the Ajax call.
The precondition checks that the component (html element) on which is
attached the timer behavior is still in the DOM document.

Hmm... I don't quite know what to say! In my tests, the timer is still fired
event after its attached component is replaced.

Here is the sequence of requests captured in Firebug:

Ajax Request 1 (timer callback):
http://localhost:8080/?2-1.IBehaviorListener.0-fragments_=1343829988777
ajax-response
evaluateWicket.timerHandle_fragments3 =
setTimeout('Wicket.Ajax.ajax({\u\:\./.?2-1.IBehaviorListener.0-fragments\,\c\:\fragments3\});',
2000)/evaluate
/ajax-response

Ajax Request 2 (click ajax link to replace the component fragments):
http://localhost:8080/?2-1.IBehaviorListener.0-remove_=1343829990235
ajax-response
componentid=fragments3span wicket:id=fragments
id=fragments3WMC/span/component
/ajax-response

Ajax Request 3 (timer callback):
http://localhost:8080/?2-1.IBehaviorListener.0-fragments_=1343829990803
Throws exception:
org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior
with id '0' on component
'org.apache.wicket.markup.html.WebMarkupContainer:fragments' in page '[Page
class = com.mycompany.HomePage, id = 2, render count = 1]'. Perhaps the
behavior did not properly implement getStatelessHint() and returned 'true'
to indicate that it is stateless instead of returning 'false' to indicate
that it is stateful.

(this is a different exception than reported by Alex, but it looks like the
same symptom)

IMHO, the AjaxTimerBehavior should have been removed during the request #2
since the replacement component does not have it attached.


-
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: ComponentNotFoundException when replace a fragment

2012-08-01 Thread Bertrand Guay-Paquet

Would this work if done on the client?

New code when ajax response is received :
replacedDOMElement = ...;
$replacedDOMElement  = $(replacedDOMElement);
for each js timers:
$component = $(timer.component);
if( $replacedDOMElement.is($component) ||
$replacedDOMElement.find($component ).length ) {

cancelTimer(timer);
}

On 01/08/2012 10:37 AM, Martin Grigorov wrote:

I see.
I'm not sure how Wicket can detect this situation ...

A workaround would require some coding from the developer - when he
replaces the component he has to call additionally:
timerBehavior.stop(target).
This will clear the scheduled timeout in the browser.

On Wed, Aug 1, 2012 at 5:31 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

Yes I was using -beta3 since this is what Alex used. I just tried it with
-SNAPSHOT (commit b89909c1fa99ae6973c3fb0738a966eb23c27e73) and I get the
same exception.

You say that:


The precondition checks that the component (html element) on which is
attached the timer behavior is still in the DOM document.


In this case, the component id is still in the DOM (it was replaced by
another one by the same id). The problem is that on the java side, the
component is different and does not have a timer behavior attached, hence
the callback fails.


On 01/08/2012 10:14 AM, Martin Grigorov wrote:

Do you use -beta3 ?
There was a bug which is fixed in -SNAPSHOT. That's why I know how it
works ;-)

On Wed, Aug 1, 2012 at 5:12 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca wrote:

On 01/08/2012 9:58 AM, Martin Grigorov wrote:


No.
The timer is fired but the precondition prevents the Ajax call.
The precondition checks that the component (html element) on which is
attached the timer behavior is still in the DOM document.

Hmm... I don't quite know what to say! In my tests, the timer is still
fired
event after its attached component is replaced.

Here is the sequence of requests captured in Firebug:

Ajax Request 1 (timer callback):
http://localhost:8080/?2-1.IBehaviorListener.0-fragments_=1343829988777
ajax-response
evaluateWicket.timerHandle_fragments3 =

setTimeout('Wicket.Ajax.ajax({\u\:\./.?2-1.IBehaviorListener.0-fragments\,\c\:\fragments3\});',
2000)/evaluate
/ajax-response

Ajax Request 2 (click ajax link to replace the component fragments):
http://localhost:8080/?2-1.IBehaviorListener.0-remove_=1343829990235
ajax-response
componentid=fragments3span wicket:id=fragments
id=fragments3WMC/span/component
/ajax-response

Ajax Request 3 (timer callback):
http://localhost:8080/?2-1.IBehaviorListener.0-fragments_=1343829990803
Throws exception:
org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find
behavior
with id '0' on component
'org.apache.wicket.markup.html.WebMarkupContainer:fragments' in page
'[Page
class = com.mycompany.HomePage, id = 2, render count = 1]'. Perhaps the
behavior did not properly implement getStatelessHint() and returned
'true'
to indicate that it is stateless instead of returning 'false' to indicate
that it is stateful.

(this is a different exception than reported by Alex, but it looks like
the
same symptom)

IMHO, the AjaxTimerBehavior should have been removed during the request
#2
since the replacement component does not have it attached.


-
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: ComponentNotFoundException when replace a fragment

2012-08-01 Thread Bertrand Guay-Paquet

Filed WICKET-4689.

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



Re: ComponentNotFoundException when replace a fragment

2012-07-31 Thread Bertrand Guay-Paquet

Hi Alex,

Your stack trace did not show up on the mailing list. Please also show a 
snippet showing what throws the exception.


Bertrand

On 31/07/2012 10:44 AM, Alex66955 wrote:

Hey,

I have some issues when I replace a fragment in an ajax calback function.
There is a parent class and a child class. The parent create an
AbstractAjaxTimerBehavior and call in it the fragment with the child class.
In the child class there is also an AbstractAjaxTimerBehavior to process
some data to show. When I replace in the parent class ajax callback function
the fragment, I get the follow exception ComponentNotFoundException.

I think the child ajax request search for the right component, but the
component is replaced. How can I tell wicket that the component is no more
valid or something else.

My stack trace:






Best regards

Alex




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ComponentNotFoundException-when-replace-a-fragment-tp4650898.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: ComponentNotFoundException when replace a fragment

2012-07-31 Thread Bertrand Guay-Paquet
With the stack trace, I can only see that the listener (the object 
responsible for handling a request) 
componentmainContentFragmens:eagrPanel is not found in the current page.


Perhaps someone else can answer with only this but I would need code 
snippets showing how you manipulate your component tree.


On 31/07/2012 12:12 PM, Alex66955 wrote:

Sorry.
In the wicket user forum the stack trace is shown (perhaps the RAW-TAG).

I use wicket 6.0.0-beta3

trace:
Last cause: Could not find component 'mainContentFragmens:eagrPanel' on page
'class com.vipco.spracherweiterung.CurrentDisplayPage

org.apache.wicket.core.request.handler.ComponentNotFoundException: Could not
find component 'mainContentFragmens:eagrPanel' on page 'class
com.vipco.spracherweiterung.CurrentDisplayPage
  at
org.apache.wicket.core.request.handler.PageAndComponentProvider.getComponent(PageAndComponentProvider.java:182)
  at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.getComponent(ListenerInterfaceRequestHandler.java:90)
  at
org.apache.wicket.core.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:231)
  at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:814)
  at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:253)
  at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:210)
  at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:281)
  at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:188)
  at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:245)
  at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326)
  at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479)
  at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
  at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520)
  at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
  at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:940)
  at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)
  at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
  at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874)
  at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
  at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
  at org.eclipse.jetty.server.Server.handle(Server.java:349)
  at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
  at
org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904)
  at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565)
  at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217)
  at
org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:50)
  at
org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:245)
  at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
  at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
  at java.lang.Thread.run(Thread.java:722)



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ComponentNotFoundException-when-replace-a-fragment-with-ajax-tp4650898p4650902.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: I think it's time for a new book.... Igor and Co ?

2012-07-26 Thread Bertrand Guay-Paquet



Seeing how the previous book authors became less active after writing
a book I think this is not a very good idea... :-/
Is this because the books didn't sell well enough? I don't know the 
authors personally and I don't know much about the publishing world so 
it could very well be another reason altogether.

Here is what I suggest: create a page in Wiki that lists the more
interesting topics. Then we (the people who know more about Wicket
internals) will try to fill the gaps by creating a separate Wiki page
for each topic, slowly, one at a time, without the pressure of the
publishers, etc. This way hopefully the community can help too by
keeping them up-to-date.
This seems to me like a good approach. Perhaps a good starting point 
would be the table of contents of Wicket in Action.


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



Re: I think it's time for a new book.... Igor and Co ?

2012-07-24 Thread Bertrand Guay-Paquet

Hi Martin (and other devs),

Must a Jira issue accompany each pull request? Also, is it ok to use a 
feature branch (based on the snapshot branch) for the pull request?


Bertrand

On 23/07/2012 3:15 AM, Martin Grigorov wrote:

Hi,

You can create tickets in our Jira with attached patches if you don't
know how to use GitHub or you don't want to use it.

If you want to try GitHub:
1) create an account at GitHub (https://github.com/)
2) go to https://github.com/apache/wicket and click the Fork button
3) clone the fork locally: git clone
https://github.com/MY_ACCOUNT/wicket.git (replace MY_ACCIUNT with your
real username.)
4) make your improvements in the code
5) git commit
6) git push
7) go to https://github.com/MY_ACCOUNT/wicket and press the Pull
Request button

That's it.

On Mon, Jul 23, 2012 at 12:27 AM, Paul Bors p...@bors.ws wrote:

I second improving the current code documentation as I recently migrated a
mid-size project to Wicket 1.5.7 from 1.3.7 and I've notice myself having to
dig into the framework implementation more often than normal because of the
weak or at times wrong JavaDocs.

I won't mind submitting small patches if someone would point the way. Last I
asked I was told to submit a push via git hub. Is there a wiki page on how
to submit such code changes patches to a wicket branch?

At the same time I do feel that a book explaining the inner works of Wicket
will also benefit everyone to better understand the framework faster and be
able to contribute as needed. I remember couple of years ago when I first
started working with Wicket and how lost I was until after I read two books
on the subject just to learn how to use it.

That's my 2 cents :)

~ Thank you,
   p...@bors.ws

-Original Message-
From: snekse [mailto:sne...@gmail.com]
Sent: Sunday, July 22, 2012 2:23 PM
To: users@wicket.apache.org
Subject: Re: I think it's time for a new book Igor and Co ?

Putting in my 2 cents.

I'd rather see more people put in time and effort to submit patches for
documentation that would reduce the need to dig into the guts of Wicket.

Now that I'm more familiar with Wicket, I'll try to start doing this.  I
hope others will too.
On Jul 22, 2012 10:55 AM, Michael Mosmann mich...@mosmann.de wrote:


I would put the bell on the cat .. but maybe someone would join..

Mm:)
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
gesendet.



Igor Vaynberg igor.vaynb...@gmail.com schrieb:

lol. my thoughts exactly :)

-igor

On Sun, Jul 22, 2012 at 12:53 PM, Josh Kamau joshnet2...@gmail.com
wrote:

Who will bell http://en.wikipedia.org/wiki/Belling_the_cat; the cat ?

On Sun, Jul 22, 2012 at 12:51 PM, Michael Mosmann
mich...@mosmann.de
wrote:


Had the same idea...
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
gesendet.



mlabs mlabs@gmail.com schrieb:

The title would be ... 'Wicket Internals' ...
Dive DEEPER into the parts other programmers never reach
The inner workings of response cycles... what really happens ...
Oh and esp the Ajax stuff... jQuery integration ... etc...

TIA



--
View this message in context:


http://apache-wicket.1842946.n4.nabble.com/I-think-it-s-time-for-a-new
-book-Igor-and-Co-tp4650687.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







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



Re: How can wicket Page form model be accessed from child panel

2012-07-19 Thread Bertrand Guay-Paquet

On 19/07/2012 3:26 AM, jam.ntk wrote:

you are right that the LoginUserModel gets null. Now can you please suggest
how and where should I reload the LoginUserModel?
From my previous email: You need to reload it in the 
LoadableDetachableModel.load() method.

If in the panel, I try to call this.scmodel.getObject() in the validate()
method I still get the old LoginUser Object. When the control goes back to
page form submit, the LoginUser newUser = getModelObject(); returns the
updated object.
In the form processing process, the models are only updated after 
successful validation. You need to use FormComponent#getConvertedInput 
to get the input for validation. See the javadoc for Form for more info.



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



Re: How can wicket Page form model be accessed from child panel

2012-07-19 Thread Bertrand Guay-Paquet
Why do you have a validate() method in your panel if it isn't part of 
the form?


When you get to the form's onSubmit() method, all the models used in the 
form components have already been updated. This occurs after all the 
validators of the form and its components are executed. Therefore, if 
you use the same model in the form and in the panel, the panel will also 
see the new model object set by the form component *but only after all 
form validation occurs*. http://stackoverflow.com/a/4641827/1030527 has 
a good writeup of the form processing flow.


On 19/07/2012 9:31 AM, jam.ntk wrote:

ok, I need to check the form attribute value in the vaildate() method of
panel. If thats the case then  i guess i cannot get the updated model in the
validate method.

So the workaround for me is to use getters of components (TextField,
DropDownChoice etc) from webpage in the panel validate method. However as
per you suggested I see blank value for #getConvertedInput() to these
components. Sorry if these are basic questions, but i am learning wicket.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608p4650625.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: How can wicket Page form model be accessed from child panel

2012-07-19 Thread Bertrand Guay-Paquet
Ah now I'm starting to understand. The Wicket way as I understand it 
is to validate in the form submit and its components. Your validator 
however will need a reference to the current value of those checkboxes. 
I'm guessing the checkboxes are not part of the form in your case, 
otherwise this is very easy (just access the form component of the 
form). If they are not part of the form, you should share a model 
between each checkbox and the form validator to control the activation 
of the validation.


On 19/07/2012 2:12 PM, jam.ntk wrote:

I have two fields on the webpage which needs be validated for not being blank
if user has selected few checkboxes which are part of the panel. So I
thought of to have a validate method in the panel. Are you suggesting that
instead of validating in the panel I validate in the form submit of webpage?

Please suggest

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608p4650632.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: How can wicket Page form model be accessed from child panel

2012-07-18 Thread Bertrand Guay-Paquet

Hi,

The transient object in LoginUserModel is null because it was set to 
null in LoadableDetachableModel.detach(). You need to reload it in the 
LoadableDetachableModel.load() method.


For form submit examples, see 
http://www.wicket-library.com/wicket-examples/forminput/


I think the answer is yes to your last question, but I'm not sure I 
understand it.


Bertrand

On 18/07/2012 4:07 PM, jam.ntk wrote:

Here is the hierarchy

Parent WebPage contains Panel. Webpage has a form

add(this.form = new Form(form, new CompoundPropertyModelLoginUser(new
LoginUserModel(user))) {

@Override protected void onSubmit() { .

Now on webpage form submit, in the Panel I need to get the updated LoginUser
from form updates. I tried to pass LoginUserModel (which is
LoadableDetachableModel) to the panel constructor, the transient object
LoginUser  is there during Panel initialization, *however on submit when in
the Panel, the transientobject is null in LoginUserModel* why is it null? I
have passed to the Panel constructor like PagePanel(, final
IModelLoginUser  smodel).

Also there are memeber fields which represents propertyfields like :
private String email;

this.form.add(dataContainer = new WebMarkupContainer(dataContainer));
dataContainer.add(new DropDownChoiceData(data, Data.selectAll(), new
ChoiceRendererData(name, id)).setNullValid(true));

would the updated value of dropdown be also available in Panel as part of
Model being passed to constructor. Please provide directions/examples.
Thanks in advance

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-can-wicket-Page-form-model-be-accessed-from-child-panel-tp4650608.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: setResponsePage swallows my session feedback messages

2012-07-04 Thread Bertrand Guay-Paquet

Hi Martin,

Following Andrea's comments from issue Wicket-4637, I modified the 
NonResettingRestartException to fix the error I reported.


Here's the modified version:
public class NonResettingRestartException extends ReplaceHandlerException {

public NonResettingRestartException(final Class? extends Page 
pageClass,

final PageParameters params, final RequestCycle cycle) {
super(createRequestHandler(pageClass, params), true);

Response response = cycle.getResponse();
if (response instanceof IMetaDataBufferingWebResponse) {
WebResponse originalResponse = (WebResponse) cycle
.getOriginalResponse();
if (originalResponse != response) {
IMetaDataBufferingWebResponse bufferingWebResponse = 
(IMetaDataBufferingWebResponse) response;

bufferingWebResponse.writeMetaData(originalResponse);
}
}
}

private static IRequestHandler createRequestHandler(
Class? extends Page pageClass, PageParameters params) {
return new RenderPageRequestHandler(new PageProvider(pageClass, 
params));

}
}

Bertrand

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



Re: setResponsePage swallows my session feedback messages

2012-07-03 Thread Bertrand Guay-Paquet

Hi,

Issues WICKET-4636 and WICKET-4637 were created.

Bertrand

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



Re: [Announce] WicketStuff 1.5.7 is released

2012-07-03 Thread Bertrand Guay-Paquet

Good stuff!

Is there a way to see which issues where fixed between 2 releases with 
github? In Jira it's straightforward, but I haven't been able to figure 
this out yet for github...


I found out how to compare the source tree between 2 tags, but not the 
list of issues.
For the source, it's 
https://github.com/wicketstuff/core/compare/wicketstuff-core-1.5.5...wicketstuff-core-1.5.7


On 03/07/2012 4:00 PM, Martin Grigorov wrote:

Hello,

With a bit of delay WicketStuff core projects have been released
against Wicket 1.5.7.
The previous release was 1.5.5 and there is no such for 1.5.6
Due to a missing Git tag for 1.5.5 I wasn't able to build a release
notes but this will be fixed for the next release!

The projects can be retrieved from Maven like this:

dependency
   groupIdorg.wicketstuff/groupId
   artifactIdwicketstuff-progressbar/artifactId
   version1.5.7/version
/dependency

The release tag is here:
https://github.com/wicketstuff/core/tree/wicketstuff-core-1.5.7

Issues can be reported here: https://github.com/wicketstuff/core/issues

The Project Wiki is available here: https://github.com/wicketstuff/core/wiki

The WicketStuff team!

-
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: setResponsePage swallows my session feedback messages

2012-07-02 Thread Bertrand Guay-Paquet

Hi Martin,

Thanks for your answer and code. Indeed, in my case, option 2 is most 
desirable because the session message is set in a completely different 
place than where the redirect is done.


NonResettingRestartException works great when thrown from a page 
constructor. However, when thrown from a link or form handler, a list 
concurrent modification exception occurs.


This email is rather long so I divided it in 2 parts.

Part 1 - NonResettingRestartException problem
=

The list is the actions list of the BufferedWebResponse with the 
following stack trace:

BufferedWebResponse.addCookie(Cookie) line: 421
HeaderBufferingWebResponse.addCookie(Cookie) line: 72
BufferedWebResponse$AddCookieAction.invoke(WebResponse) line: 240
BufferedWebResponse.writeMetaData(WebResponse) line: 75
HeaderBufferingWebResponse.writeMetaData(WebResponse) line: 205
NonResettingRestartException.init(ClassPage, PageParameters, 
RequestCycle) line: 28

LinkPage$4.onClick() line: 38

Analysis:
1) HeaderBufferingWebResponse delegates #writeMetaData() to its 
bufferedResponse (a BufferedWebResponse instance).
2) BufferedWebResponse iterates its action list with the single 
AddCookieAction and invoke()s it
3) BufferedWebResponse$AddCookieAction.invoke does 
response.addCookie(cookie)
4) The addCookie is executed with this==BufferedWebResponse from 2) 
which modifies the action list illegally


I created a set of test pages to test the different ways to redirect to 
a page from a page constructor, a link handler and a form submit 
handler. They all set a cookie and a session message to validate the 
behaviors. I will gladly share this if desired.


In conclusion, with Wicket 1.5.7, NonResettingRestartException works in 
a page constructor, but setResponsePage must be used in a link or form 
handler.


So there is a workable alternative, but the difference in behavior 
depending on where the exception is thrown is not so good. And maybe 
other code paths are at risk of triggering this exception.


Part 2 - Cookie problem with Jetty
==
A heads up for anybody using redirects, cookies and Jetty 7.5.0, 7.5.4, 
7.6.4 or 8.1.4 (so I guess all versions essentially).


Normally, throwing a RestartResponseException throws away anything added 
to the response before that point. This is not always the case for 
cookies when using Jetty! If a cookie is set before the exception is 
thrown AND it already exists on the client (with any value), Jetty will 
erroneously think the new value is set on the client.


Here is what happens: when a cookie already exists, CookieUtils#save() 
updates its value instead of creating a new one. However, Jetty's 
CookieCutter class caches the client's parsed cookies across requests 
(server-side) so the cached copy is updated with the new value. 
Afterwards, Jetty does not check properly whether the cookies sent by 
the client match the cached values so the cookie is considered modified 
with the new phantom value until a new session is created.


This bug had me scratching my head for a while when testing the 
different ways to redirect clients! This does not happen with Tomcat 7.0.27


This definitely seems like a bug in Jetty but I don't have time to file 
it and follow up since I'm only using Jetty for quickstarts. I can give 
more info on request.



On 01/07/2012 10:36 AM, Martin Grigorov wrote:

Hi,

Here is my later response.

I see two ways to solve this:

1) Use setResponsePage(pageInstance) as I described in my previous response:

setMyCookie();
PageB pageB = new PageB();
pageB.info(some text);
setResponsePage(pageB);

This way the feedback is associated with a component (pageB) and wont
be rendered when PageA is rendered.
The drawback is that this way you will get a url like 'wicket/page?42'
instead of the nice looking one (e.g. /customers/12)

2) the second way is to use non-resetting RestartResponsePage
I've rolled this out several months ago for our app:

public class NonResettingRestartException extends ReplaceHandlerException {

 public NonResettingRestartException(final Class? extends Page?
pageClass, final PageParameters params, final RequestCycle cycle) {
 super(createRequestHandler(pageClass, params), true);

 Response response = cycle.getResponse();
 if (response instanceof IMetaDataBufferingWebResponse) {
 IMetaDataBufferingWebResponse bufferingWebResponse =
(IMetaDataBufferingWebResponse) response;
 bufferingWebResponse.writeMetaData((WebResponse)
cycle.getOriginalResponse());
 }
 }

 private static IRequestHandler createRequestHandler(Class?
extends Page?  pageClass, PageParameters params) {
 return new RenderPageRequestHandler(new
PageProvider(pageClass, params));
 }
}

and use it:
setMyCookie();
throw new NonResettingRestartException(PageB.class, params);

I guess you will prefer option 2)


I'll also file a ticket as you suggested regarding 

Re: setResponsePage swallows my session feedback messages

2012-06-29 Thread Bertrand Guay-Paquet

Hi Ian,

Thanks for your reply. By the way, I forgot to mention I'm using Wicket 
1.5.7.


The (pseudo) code I wrote in my previous email is in Page2's 
constructor. I tried both approaches and here are the results:

setResponsePage in page constructor:
-Cookie not set === Cookie SET with patch from WICKET-4358
-Session message not displayed on Page1

setResponsePage in form onSubmit:
-Cookie set
-Session message displayed on Page1

So you were right.

However, I really need to redirect from a page constructor because Page2 
is a callback url for an OAuth provider (Facebook in this case). It's 
actually Facebook who redirects to Page1 and they don't allow query 
parameters in the callback url so I can't use a link listener as a 
workaround.


Bertrand

On 29/06/2012 4:21 AM, Ian Marshall wrote:

Hello Bertrand,

Where is your Page2 code fragment called? Is in the page constructor, in a
page component onSubmit() method, or somewhere else?

My guess is that your code fragment is called in the page constructor. If
this is so, then:

   ·  I might expect the differences in behaviour you experience between
setResponsePage(WebPage.class) and using a RestartResponseException (as
always, I am open to contradiction).
   ·  If possible, can you move your code to a component onSubmit() method
(of Page2 or the previous page, if any)?

Regards,

Ian



Bertrand Guay-Paquet wrote

Hi,

I have 2 pages, each with a feedback panel. Page2 does the following:
setACookie();
Session.get().info(blah);
setResponsePage(Page1.class);

The problem I have is that blah is never displayed in the feedback
panel of Page1. I stepped in the request processing code and found that
setResponsePage() actually renders the full current page before throwing
that away and issuing a 302 redirect. During this first (unused)
rendering of Page2, its feedback panel consumes all the session
messages. After the client follows the 302 and requests Page1, there are
no more session messages to display.

Instead of setResponsePage, I can use a RestartResponseException to
redirect to Page1 and the session messages will then be displayed on
Page1 because Page2 is never rendered. However this has the important
downside of also throwing away all header information (e.g. cookies like
setACookie() above).

Is there a way to both set a cookie and display the session message on
the response page?

Bonus!
I'm also wondering why, when setResponsePage() is used, the current page
is still rendered. I can think of 3 reasons why this should be avoided:
1-Performance; it's wasteful to render components to discard them right
away

2-Components hierarchy; even if setResponsePage() is used in a page
constructor (e.g. when redirecting depending on page parameters), since
the page is rendered, all of its components or some substitutes must be
added to the page. Otherwise Wicket will throw a missing component
exception in dev mode.

3-My use case; feedback messages registered in the session can be
swallowed by a feedback panel in the thrown away page rendering.

Of course, I definitely don't have the complete picture and am just now
making some sense of how Wicket handles redirects and responses.

Regards,
Bertrand

-
To unsubscribe, e-mail: users-unsubscribe@.apache
For additional commands, e-mail: users-help@.apache


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650278.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: setResponsePage swallows my session feedback messages

2012-06-29 Thread Bertrand Guay-Paquet

Hi Ian,

I'm sorry, I don't understand. Perhaps some parts of your message didn't 
make it to the mailing list? (see If you use and and then one of).


On 29/06/2012 9:39 AM, Ian Marshall wrote:

Hi Bertrand,

If you use

and then one of

in your Page2 constructor you should be able to pass (your cookie?) data to
your Page1, and you will see by trial and error whether your flash message
makes it to Page1 or not.

Regards,

Ian


Bertrand Guay-Paquet wrote

Hi Ian,

Thanks for your reply. By the way, I forgot to mention I'm using Wicket
1.5.7.

The (pseudo) code I wrote in my previous email is in Page2's
constructor. I tried both approaches and here are the results:
setResponsePage in page constructor:
-Cookie not set=== Cookie SET with patch from WICKET-4358
-Session message not displayed on Page1

setResponsePage in form onSubmit:
-Cookie set
-Session message displayed on Page1

So you were right.

However, I really need to redirect from a page constructor because Page2
is a callback url for an OAuth provider (Facebook in this case). It's
actually Facebook who redirects to Page1 and they don't allow query
parameters in the callback url so I can't use a link listener as a
workaround.

Bertrand

On 29/06/2012 4:21 AM, Ian Marshall wrote:

Hello Bertrand,

Where is your Page2 code fragment called? Is in the page constructor, in
a
page component onSubmit() method, or somewhere else?

My guess is that your code fragment is called in the page constructor. If
this is so, then:

·  I might expect the differences in behaviour you experience between
setResponsePage(WebPage.class) and using a RestartResponseException (as
always, I am open to contradiction).
·  If possible, can you move your code to a component onSubmit()
method
(of Page2 or the previous page, if any)?

Regards,

Ian



Bertrand Guay-Paquet wrote

Hi,

I have 2 pages, each with a feedback panel. Page2 does the following:
setACookie();
Session.get().info(blah);
setResponsePage(Page1.class);

The problem I have is that blah is never displayed in the feedback
panel of Page1. I stepped in the request processing code and found that
setResponsePage() actually renders the full current page before throwing
that away and issuing a 302 redirect. During this first (unused)
rendering of Page2, its feedback panel consumes all the session
messages. After the client follows the 302 and requests Page1, there are
no more session messages to display.

Instead of setResponsePage, I can use a RestartResponseException to
redirect to Page1 and the session messages will then be displayed on
Page1 because Page2 is never rendered. However this has the important
downside of also throwing away all header information (e.g. cookies like
setACookie() above).

Is there a way to both set a cookie and display the session message on
the response page?

Bonus!
I'm also wondering why, when setResponsePage() is used, the current page
is still rendered. I can think of 3 reasons why this should be avoided:
1-Performance; it's wasteful to render components to discard them right
away

2-Components hierarchy; even if setResponsePage() is used in a page
constructor (e.g. when redirecting depending on page parameters), since
the page is rendered, all of its components or some substitutes must be
added to the page. Otherwise Wicket will throw a missing component
exception in dev mode.

3-My use case; feedback messages registered in the session can be
swallowed by a feedback panel in the thrown away page rendering.

Of course, I definitely don't have the complete picture and am just now
making some sense of how Wicket handles redirects and responses.

Regards,
Bertrand

-
To unsubscribe, e-mail: users-unsubscribe@.apache
For additional commands, e-mail: users-help@.apache


--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650278.html
Sent from the Users forum mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscribe@.apache
For additional commands, e-mail: users-help@.apache



-
To unsubscribe, e-mail: users-unsubscribe@.apache
For additional commands, e-mail: users-help@.apache


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650284.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

Re: setResponsePage swallows my session feedback messages

2012-06-29 Thread Bertrand Guay-Paquet

Hi Martin,

This doesn't seem to fix the issue. The flash messages are not carried 
over to Page1 and the cookie is not set in the 302 to Page1.


I did it like this:

private boolean doRedirect;

Page2(Parameters) {
if( whatever ) {
doRedirect = true;
}
}

@Override
protected void onBeforeRender() {
  if(doRedirect) {
setACookie();
Session.get().info(blah);
setResponsePage(Page1.class);
  }
}

I know the cookie setting bit is fixed in WICKET-4358, so I'm not too 
worried about that. It's really the session flash messages that I can't 
figure out how to keep after redirect.


I guess I'll wait for the more detailed answer :)

Bertrand

On 29/06/2012 9:35 AM, Martin Grigorov wrote:

Hi Bertrand,

I'll write a more detailed answer to your mail later.
Until then you can try to workaround it by calling 'setResponsePage()'
in #onBeforeRender() instead.

On Fri, Jun 29, 2012 at 4:21 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca  wrote:

Hi Ian,

Thanks for your reply. By the way, I forgot to mention I'm using Wicket
1.5.7.

The (pseudo) code I wrote in my previous email is in Page2's constructor. I
tried both approaches and here are the results:
setResponsePage in page constructor:
-Cookie not set=== Cookie SET with patch from WICKET-4358
-Session message not displayed on Page1

setResponsePage in form onSubmit:
-Cookie set
-Session message displayed on Page1

So you were right.

However, I really need to redirect from a page constructor because Page2 is
a callback url for an OAuth provider (Facebook in this case). It's actually
Facebook who redirects to Page1 and they don't allow query parameters in the
callback url so I can't use a link listener as a workaround.

Bertrand


On 29/06/2012 4:21 AM, Ian Marshall wrote:

Hello Bertrand,

Where is your Page2 code fragment called? Is in the page constructor, in a
page component onSubmit() method, or somewhere else?

My guess is that your code fragment is called in the page constructor. If
this is so, then:

   ·  I might expect the differences in behaviour you experience between
setResponsePage(WebPage.class) and using a RestartResponseException (as
always, I am open to contradiction).
   ·  If possible, can you move your code to a component onSubmit() method
(of Page2 or the previous page, if any)?

Regards,

Ian



Bertrand Guay-Paquet wrote

Hi,

I have 2 pages, each with a feedback panel. Page2 does the following:
setACookie();
Session.get().info(blah);
setResponsePage(Page1.class);

The problem I have is that blah is never displayed in the feedback
panel of Page1. I stepped in the request processing code and found that
setResponsePage() actually renders the full current page before throwing
that away and issuing a 302 redirect. During this first (unused)
rendering of Page2, its feedback panel consumes all the session
messages. After the client follows the 302 and requests Page1, there are
no more session messages to display.

Instead of setResponsePage, I can use a RestartResponseException to
redirect to Page1 and the session messages will then be displayed on
Page1 because Page2 is never rendered. However this has the important
downside of also throwing away all header information (e.g. cookies like
setACookie() above).

Is there a way to both set a cookie and display the session message on
the response page?

Bonus!
I'm also wondering why, when setResponsePage() is used, the current page
is still rendered. I can think of 3 reasons why this should be avoided:
1-Performance; it's wasteful to render components to discard them right
away

2-Components hierarchy; even if setResponsePage() is used in a page
constructor (e.g. when redirecting depending on page parameters), since
the page is rendered, all of its components or some substitutes must be
added to the page. Otherwise Wicket will throw a missing component
exception in dev mode.

3-My use case; feedback messages registered in the session can be
swallowed by a feedback panel in the thrown away page rendering.

Of course, I definitely don't have the complete picture and am just now
making some sense of how Wicket handles redirects and responses.

Regards,
Bertrand

-
To unsubscribe, e-mail: users-unsubscribe@.apache
For additional commands, e-mail: users-help@.apache


--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/setResponsePage-swallows-my-session-feedback-messages-tp4650274p4650278.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: setResponsePage swallows my session feedback messages

2012-06-29 Thread Bertrand Guay-Paquet
Ok now I understand! What you suggest is more or less what I mentioned 
in the first email. RestartResponseException does indeed halt rendering 
of Page2 which causes the flash message to be displayed on Page1.


I guess I could find a way to pass as page parameters of Page1 the 
cookie and set it there, but that's a bit of a hassle. In my case, the 
actual cookie setting code is far removed from Page2's constructor; I 
simplified the code a lot in my original email.


p.s. Hmm I guess this thread shows that I should have chosen meaningful 
names for my page classes! Even I need to concentrate to make sure I 
don't mess it up...


On 29/06/2012 10:02 AM, Ian Marshall wrote:

Sorry,

raw HTML tag content did not make it to the E-mail

I meant:

If you use

   Session.get().info(blah);

and then one of

   throw new RestartResponseException(Page1.class, PageParameters params);
   throw new RestartResponseException(new Page1(...));

in your Page2 constructor you should be able to pass (your cookie?) data to
your Page1, and you will see by trial and error whether your flash message
makes it to Page1 or not (but without your cookies).

You're better off listening to Martin G: he knows what he is talking about
;)



Bertrand Guay-Paquet wrote

Hi Ian,

I'm sorry, I don't understand. Perhaps some parts of your message didn't
make it to the mailing list? (see If you use and and then one of).

On 29/06/2012 9:39 AM, Ian Marshall wrote:

Hi Bertrand,

If you use

and then one of

in your Page2 constructor you should be able to pass (your cookie?) data
to
your Page1, and you will see by trial and error whether your flash
message
makes it to Page1 or not.

Regards,

Ian


Bertrand Guay-Paquet wrote

Hi Ian,

Thanks for your reply. By the way, I forgot to mention I'm using Wicket
1.5.7.

The (pseudo) code I wrote in my previous email is in Page2's
constructor. I tried both approaches and here are the results:
setResponsePage in page constructor:
-Cookie not set=== Cookie SET with patch from WICKET-4358
-Session message not displayed on Page1

setResponsePage in form onSubmit:
-Cookie set
-Session message displayed on Page1

So you were right.

However, I really need to redirect from a page constructor because Page2
is a callback url for an OAuth provider (Facebook in this case). It's
actually Facebook who redirects to Page1 and they don't allow query
parameters in the callback url so I can't use a link listener as a
workaround.

Bertrand

On 29/06/2012 4:21 AM, Ian Marshall wrote:

Hello Bertrand,

Where is your Page2 code fragment called? Is in the page constructor,
in
a
page component onSubmit() method, or somewhere else?

My guess is that your code fragment is called in the page constructor.
If
this is so, then:

 ·  I might expect the differences in behaviour you experience
between
setResponsePage(WebPage.class) and using a RestartResponseException (as
always, I am open to contradiction).
 ·  If possible, can you move your code to a component onSubmit()
method
(of Page2 or the previous page, if any)?

Regards,

Ian



Bertrand Guay-Paquet wrote

Hi,

I have 2 pages, each with a feedback panel. Page2 does the following:
setACookie();
Session.get().info(blah);
setResponsePage(Page1.class);

The problem I have is that blah is never displayed in the feedback
panel of Page1. I stepped in the request processing code and found
that
setResponsePage() actually renders the full current page before
throwing
that away and issuing a 302 redirect. During this first (unused)
rendering of Page2, its feedback panel consumes all the session
messages. After the client follows the 302 and requests Page1, there
are
no more session messages to display.

Instead of setResponsePage, I can use a RestartResponseException to
redirect to Page1 and the session messages will then be displayed on
Page1 because Page2 is never rendered. However this has the important
downside of also throwing away all header information (e.g. cookies
like
setACookie() above).

Is there a way to both set a cookie and display the session message on
the response page?

Bonus!
I'm also wondering why, when setResponsePage() is used, the current
page
is still rendered. I can think of 3 reasons why this should be
avoided:
1-Performance; it's wasteful to render components to discard them
right
away

2-Components hierarchy; even if setResponsePage() is used in a page
constructor (e.g. when redirecting depending on page parameters),
since
the page is rendered, all of its components or some substitutes must
be
added to the page. Otherwise Wicket will throw a missing component
exception in dev mode.

3-My use case; feedback messages registered in the session can be
swallowed by a feedback panel in the thrown away page rendering.

Of course, I definitely don't have the complete picture and am just
now
making some sense of how Wicket handles redirects and responses.

Regards,
Bertrand

setResponsePage swallows my session feedback messages

2012-06-28 Thread Bertrand Guay-Paquet

Hi,

I have 2 pages, each with a feedback panel. Page2 does the following:
setACookie();
Session.get().info(blah);
setResponsePage(Page1.class);

The problem I have is that blah is never displayed in the feedback 
panel of Page1. I stepped in the request processing code and found that 
setResponsePage() actually renders the full current page before throwing 
that away and issuing a 302 redirect. During this first (unused) 
rendering of Page2, its feedback panel consumes all the session 
messages. After the client follows the 302 and requests Page1, there are 
no more session messages to display.


Instead of setResponsePage, I can use a RestartResponseException to 
redirect to Page1 and the session messages will then be displayed on 
Page1 because Page2 is never rendered. However this has the important 
downside of also throwing away all header information (e.g. cookies like 
setACookie() above).


Is there a way to both set a cookie and display the session message on 
the response page?


Bonus!
I'm also wondering why, when setResponsePage() is used, the current page 
is still rendered. I can think of 3 reasons why this should be avoided:

1-Performance; it's wasteful to render components to discard them right away

2-Components hierarchy; even if setResponsePage() is used in a page 
constructor (e.g. when redirecting depending on page parameters), since 
the page is rendered, all of its components or some substitutes must be 
added to the page. Otherwise Wicket will throw a missing component 
exception in dev mode.


3-My use case; feedback messages registered in the session can be 
swallowed by a feedback panel in the thrown away page rendering.


Of course, I definitely don't have the complete picture and am just now 
making some sense of how Wicket handles redirects and responses.


Regards,
Bertrand

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



Re: Data in session and debugger

2012-04-15 Thread Bertrand Guay-Paquet

Hi,

Is the ResultClass Serializable (members + itself implement 
Serializable)? If not, you should see stack traces in the logs each time 
a page is rendered.


On 14/04/2012 2:47 PM, Andre Schütz wrote:

Hi,

I tried the debugBar in my WebPage and could analyze the session
size and the data of the Inspector.

When I stored some data in the session, the debugBar stopped working.
I says Page:unknown and could no longer display the size of the session.

Let me explain my program. I have two WebPage classes. Page1 and Page2.

Page1: Search box and submit button -  stores the search result in a session
variable (ResultClass).
Page2: show the result in a listing

When I stop storing the ResultClass in the session, the debugBar works
fine. With storing the ResultClass in the session, the debugBar does no
longer display the session size and Page information.

The ResultClass is Serializable.

Any idea why the debugBar does not work when I store the result in
the session?

Thanks,
Andre



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



Re: Same versioned link opens different pages on different machines

2012-04-12 Thread Bertrand Guay-Paquet
I don't know much about HybridUrlCodingStrategy since I use Wicket 1.5, 
but based on what you observed (.x changes on every render), I would say 
the x is the page version.


I re-read your emails and if I understand correctly, both product 379 
and 123 use the same page class. If that is the case, I don't think 
WICKET-4488 is the same problem. That issue concerns rendering a 
different *Page* class because of a page version id. In your case, the 
MyPage page class is the single page involved in both the wrong and 
right pages you see rendered.


I suggest putting a break point or logging code in your page's 
constructor to check 1) if a new page is created or an old version is 
displayed and 2) if the page parameters are properly decoded.


On 12/04/2012 12:32 PM, Alec Swan wrote:

but because of the existence of a page with pageId 0 in the page
store user sees page1, not page2 as user2 intended

So, what is the page id in ../mp/oid/123.9 url?


On Thu, Apr 12, 2012 at 9:58 AM, Igor Vaynbergigor.vaynb...@gmail.com  wrote:

On Thu, Apr 12, 2012 at 8:55 AM, Martin Grigorovmgrigo...@apache.org  wrote:

On Thu, Apr 12, 2012 at 6:43 PM, Igor Vaynbergigor.vaynb...@gmail.com  wrote:

On Thu, Apr 12, 2012 at 8:22 AM, Alec Swanalecs...@gmail.com  wrote:

Igor,

The link I click ends with /mp/oid/123.9, where 123 is a product id.
However, when the page is rendered its URL changes to end with
/mp/oid/123.x where x is different every time. Moreover, the page is
displaying the wrong product 379!

So, it's not the wrong version of the page, but the wrong product that
worries me.

Can you explain this?

i never once said the word version in my response :) i was, in fact,
talking about page ids. i dont think the old hybrid url coding
strategy checks the page id in its url against the mount. so in your
session page 9 can be something entirely different. i believe this is
what was fixed by WICKET-4488.

Not exactly.
4488 fixes the problem when user1 has opened page1?0. Then user2 sends
a url page2?0 to user1.
user1 opens this url but because of the existence of a page with
pageId 0 in the page store user sees page1, not page2 as user2
intended.

After 4488 Wicket will load page with id == 0 then it will check its
class against the class of the mountPoint and ignore the stored page
if they don't match. And will create a completely new instance of
mountPoint and show it to user1. I.e. a new instance of page2

I hope I described it clearly.

i think thats *exactly* what i said...




-igor



Thanks,

Alec

On Wed, Apr 11, 2012 at 4:08 PM, Bertrand Guay-Paquet
ber...@step.polymtl.ca  wrote:

Hi,

A ticket regarding this was created and resolved in 1.5 (WICKET-4488). From
the work log:
There was code for this situation but it didn't cover the case 100%.
Now if a request to page2?0 is made and the type of the found page with id=0
is not Page2 then a new instance of Page2 is instantiated.




On 11/04/2012 5:56 PM, Igor Vaynberg wrote:

page 5 in your session can be completely different then page 5 in
user's session.

non-bookmarkable urls cannot be emailed...thats kind of the point.

-igor

On Wed, Apr 11, 2012 at 2:37 PM, Alec Swanalecs...@gmail.comwrote:

Hello,

I received a link from a customer to a versioned page (.version at the
end of the URL). However, when I click on the link I see a completely
different page.

We are using Wicket 1.4.17 and the page is mounted  as:

mount(new HybridUrlCodingStrategy(mp, MyPage.class));

Why is this happening and how can I fix this?

Thanks,

Alec

-
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




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

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


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

Re: Same versioned link opens different pages on different machines

2012-04-12 Thread Bertrand Guay-Paquet

you simply need to check what page class is mounted, and if the page
retrieved by id is not of that class then dont render it but redirect
to the bookmarkable url instead.

-igor
Both pages actually use the same MyPage.java class in this case. The 
only difference is the page parameter encoded in the URL which 
presumably drives a model.


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



  1   2   >