Re: Things I miss in Wicket

2009-01-16 Thread Erik van Oosten
Yep, I did see that. However, it does not describe the type attribute 
Pills described:


Pills wrote:

3) may be a good improvement, maybe with a new wicket tag
(wicket:component type=com.me.MyCustomComp /). let's see what think
core developpers 


Jan Kriesten wrote

Hi Erik,
  

Can you point to a place where this is documented? Its not on
http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html.



actually, it is there. :)

---8---
Element wicket:component

wicket:component - Creates a Wicket component on the fly. Needs a class
attribute. Though this has been in wicket for a long time, it is still kind of
an unsupported feature, as most of the core developers believe that this may
lead to misuse of the framework. Before heavily relying on this feature, you
might want to contact the user list to discuss alternative strategies. (THIS TAG
IS NOT SUPPORTED BY THE CORE TEAM)
---8---

Since wicket:component has some issues (e.g. HeaderContribution doesn't work) I
build my own DynComponent some time ago (see my blog for details).

Best regards, --- Jan.

  

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Things I miss in Wicket

2009-01-16 Thread Erik van Oosten


Jan Kriesten wrote:

just replace 'type' with 'class' and you're there. Also, any other attribute you
put into the wicket:component tag is looked a setter on the class for, so you
can pass parameters in from you html code.

Best regards, --- Jan.
  

Ouch, that is ugly. Now I understand why it is deprecated.

Erik.


--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten

Please don't turn the logic around.

Caching is only needed because isVisible can be a performance hit.

/If/ you want caching /then/ isVisible should not be called after detach 
as detach is needed to clear the cache.


Regards,
   Erik.


s...@meiers.net wrote:

Ok, IMHO it's a bug that wicket calls isVisible() after detachment.


Thus caching isVisible() is not needed.


Sven
  



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



Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten

Sorry Sven,

You of course meant to say:

/If/ isVisible would no longer be called after detach /then/ it would be 
possible to do the caching yourself (as you can use detach to clear the 
cache).


/If/ you can cache yourself /then/ Wicket does not need to cache the 
result of isVisible.


Although I think that logic is completely correct, I also think it would 
be very convenient to remove the burden of caching the visible flag 
during render from the programmer.


Regards,
   Erik.



s...@meiers.net wrote:

Ok, IMHO it's a bug that wicket calls isVisible() after detachment.


Thus caching isVisible() is not needed.


Sven
  




--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Why you should not override isVisible

2009-01-16 Thread Erik van Oosten

Created an issue:

http://issues.apache.org/jira/browse/WICKET-2025

Regards,
   Erik.


Erik van Oosten wrote:

Martijn,

I just went through the source (1.4-rc1) to trace a detach manually 
and find suspect callers of isVisible. I found none during detach, but 
I did find one call to isVisible /after/ detach. A simple run 
confirmed this.


The call to isVisible /after/ detach can be found in method 
ComponentRequestTarget#respond(RequestCycle). That method initiates a 
detach and then calls page.endComponentRender. This leads to a call to 
Page#checkRendering which calls isVisibleInHierarchy() and from there 
isVisible(). Method checkRendering only does something when the debug 
setting 'componentUseCheck' is enabled (which according to the javadoc 
is true by default).


I vividly remember the pain when I found out that isVisible was called 
/during/ detach. So I am certain the problem existed at some time in 
the past (1.2, 1.3?). I can bang my head against the wall for not 
having documented the problem more thoroughly back then. Anyways, a 
call to isVisible /after/ detach has similar problems to a call during 
detach.


Regards,
   Erik.



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



Why you should not override isVisible

2009-01-15 Thread Erik van Oosten
In the thread Where to process PageParameters I was requested to 
explain why I think you should not override isVisible, but rather should 
call setVisible in onBeforeRender (slide 100 in my presentation 
http://www.grons.nl/~erik/pub/20081112%20Effective%20Wicket.pdf).


There are 2 reasons, but only the second one is really important.

-1- isVisible is called a lot. It is easily called ten times within 1 
request


So if you have anything processor intensive going on, it will be a 
performance hit. Just doing a simple expression is of course no problem.
(For fun, just set a breakpoint in something like 
FeedbackPanel#isVisible and request a page that contains one.)


-2- isVisible can make your model be reloaded multiple times within 1 
request


Consider the following case (pseudo code):

 MyPanel(id, personId) {
super(id, new CompoundPropertyModel(new 
LoadableDetachablePersonModel(personId)));
add( new Label(address) {
@Override
isVisible() {
return getDefaultModel() != null;
}
});
 }


The label uses the property 'address' of a person to see if the label 
should be visible. The person is retrieved by a LoadableDetachableModel 
subclass (LDM) and then wrapped by a CompoundPropertyModel (CPM).


During the render phase, isVisible will delegate getting the address 
property to the CPM and this model delegates it to the LDM. LDM will 
load the person from the database only once (well until it is detached).


At the end of the render phase everything will be detached. But now 
something weird happens. The problem is that isVisible is called during 
the detach phase, on the label /after/ the CPM (and therefore also the 
LDM) are detached. As isVisible retrieves the model from the CPM, and 
therefore from the LDM, it will trigger a reload of the person inside 
the LDM.


Now, as visibility is often (if not almost always) determined by a 
business object (e.g. very often a LDM) I think it makes sense to avoid 
having to think about the situation described above, and just avoid it 
all together.


Note: I observed this behavior in Wicket 1.3 (1.3.3 I think). If it 
works differently now, I would be very glad to withdraw this recommendation.


Regards,
Erik.

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Where to process PageParameters

2009-01-15 Thread Erik van Oosten

Michael,

I answered on another thread.

Regards,
Erik.



Michael Sparer wrote:
 
 Yepp, I also didn't have problems with it as - you're right - I took it at
 face value without thinking about it too much. I thought to avoid problems
 when the traffic of our apps grows and/or explodes I'll do it the save way
 :-) wasn't much effort to change the stuff anyway. 
 
 But now I'd be interested in hearing Erik's opinion about that - he
 obviously must have had problems with it 
 
 Michael
 
-- 
View this message in context: 
http://www.nabble.com/Where-to-process-PageParameters-tp21454742p21475798.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Why you should not override isVisible

2009-01-15 Thread Erik van Oosten

Hi Pierre,

I actually thought they were in English, but I now see that the first 
few are in Dutch. Not sure why I did that. They are not that important, 
so just read on...


Regards,
   Erik.


Pierre Goupil wrote:

Good evening,

I'm sorry to bug you, but I'be read the presentation you're talking 
about in this post and was wondering if you have an english-speaking 
commented one available ?


Nice work !

Regards,

Pierre Goupil




--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Why you should not override isVisible

2009-01-15 Thread Erik van Oosten
Indeed. If this would no longer be the case, overriding isVisible would 
be no problem (though caching would be nice).


Regards,
   Erik.



Martijn Dashorst wrote:

What is strange is that isvisible is being checked during detach (I
seriously doubt that). That shouldn't be happening: *all* components
should be detached regardless of their visibility.

Martijn
  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: skip item in populateItem of ListView

2009-01-15 Thread Erik van Oosten
Perhaps it would be more natural to use RepeatingView (or 
RefreshingView) in such cases.


Regards,
   Erik.


Steve Swinsburg wrote:

Hi all,

I have a situation whereby certain conditions mean I need to skip an 
item that is being rendered in a ListView.
ie inside the populateItem() method I do some processing and if that 
item fails, it shouldn't be rendered so I'd like to skip to the next 
item.


I know I *could* process the list before it reaches the ListView but 
I'd prefer not to iterate over the list twice.


Is there some way of skipping this item or not showing the item (and 
making sure none of its content is output)?



thanks,
Steve



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Twenty Six Wicket Tricks

2008-12-30 Thread Erik van Oosten

Jonathan Locke wrote:

 I've got 13 tricks coded up now and
ideas for a handful more, but if there are any requests out there, please
let me know
  
Perhaps something about handling URLs. Like writing your own url coding 
strategy and how to mount pages with URL that have some variable before 
the fixed parts (like /{language}/products/{productid}).


Regards,
   Erik.


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: [OT] Merb-Rails Merge

2008-12-24 Thread Erik van Oosten

Please, no Ruby bashing here (or no bashing whatsoever).

The Ruby world has many more options besides Rails and Merb. Camping, 
Sinatra, Ramaze, Nitro just to name a few. Its not such a ridiculous 
long list as in the Java world, but hey, Ruby has not been popular for 
that long.

Rails should be a good replacement of PHP, nothing more.
I think you severely underestimate both. (When given to the right people 
of course.)



I hope Java web frameworks never got merged together.
  

Too late :)  Struts merged with Webworks.

But I agree; choice is good.

   Erik.


HHB wrote:

I hope Java web frameworks never got merged together.
Whenever my Rails dudes points toward how many Java has web frameworks and
considering this as a bad thing, I smile.
I smile because they don't have an option, just Rails.
We (Java guys), have request/action frameworks, component-based frameworks,
Java2JavaScript frameworks, Hybrid framework.
DHH is a jerk, but a smart one.
He tries so hard to convince every body on the planet that his Rails is the
ultimate framework.
Rails should be a good replacement of PHP, nothing more.
The funniest thing when I hear Ruby/Rails guys talking about deploying Rails
applications in the enterprise, What a good joke !!
  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Filtering data in DataTable

2008-12-22 Thread Erik van Oosten

Mike,

The phonebook example from wicket-stuff (currently down?) shows how to 
use the wicket-extra filters.


Regards,
   Erik.


Mike wrote:
Is there a way to create filter for numeric types in DataTable column 
that
would allow user to enter/choose value for filter state object and 
choose if
values selected to be shown in DataTable should be bigger, lesser or 
equal
to the entered/chosen value?   



--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Multi-tap operations in Wicket

2008-12-22 Thread Erik van Oosten
Apart from letting you guess what a page map is (a collection of visited 
pages) I think Ernesto gave a very decent response. So lets turn this 
around:


What would you like to know?

Regards,
   Erik.


PS. If that really is /the/ gem of Seam, you're in for a treat with 
Wicket! ;)



HHB wrote:

This effects all the Wicket pages in the application, right?
Seam folks advertise this feature as one of the gems of Seam framework, why
Wicket doesn't shed more light on it?
Common Wicket, no need to be humble this time :)

  

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Multi-tap operations in Wicket

2008-12-22 Thread Erik van Oosten

Glad that is out of the way :)

Wicket and Seam are frequently compared. But I think it is not a 
fair/possible comparison. We might as well compare TestNG with Mockito, 
both are about testing but in an entirely different league.


Seam's goal (as far as my humble knowledge goes) is targeted at 
combining a variety of frameworks (in particular EJB3 and JSF). Focus is 
on managing transactions and passing data around by storing and 
retrieving it from an array of (untyped) contexts. (Please forgive me if 
I am completely wrong.)


Wicket's goal is to provide a natural OO environment to program a html 
user interface. (Reusable UI components anyone?) Passing data around is 
the responsibility of components but is typically done with (fully 
typed) models. There is no need for contexts to keep state as the entire 
components are kept as state. This is done by storing complete page 
component hierarchies to a page map. Usually you have one page map per 
session. Wicket's transaction support is no better or worse then the 
next web framework.


Regards,
   Erik.


HHB wrote:

What I would like to know?
If Wicket supports multi-window/tap (beginning a new (what I can call?) a
conversation)?
Well, yes, it does
http://wicketstuff.org/wicket13doc/org/apache/wicket/settings/IPageSettings.html
Multi-window/tap isn't the gem of Seam, one of them 
:)

We need to do more marketing for wicket guys:ninja:


Erik van Oosten wrote:
  
Apart from letting you guess what a page map is (a collection of visited 
pages) I think Ernesto gave a very decent response. So lets turn this 
around:


What would you like to know?

Regards,
Erik.


PS. If that really is /the/ gem of Seam, you're in for a treat with 
Wicket! ;)



HHB wrote:


This effects all the Wicket pages in the application, right?
Seam folks advertise this feature as one of the gems of Seam framework,
why
Wicket doesn't shed more light on it?
Common Wicket, no need to be humble this time :)

  
  

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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






  


--

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Multi-tap operations in Wicket

2008-12-22 Thread Erik van Oosten
Ah :)  IMHO it should be added. It might be a small thing in the larger 
Wicket picture, but it is a big deal for some applications.


Care to open a issue?

   Erik.


Ernesto Reinaldo Barreiro wrote:

Hi Erik,
Still one question remains...  Should that feature be added to [1]? Or it is
small enough to be discarded...

Best,

Ernesto

[1]-http://wicket.apache.org/features.html

  

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Dynamic Simple (html) Components

2008-12-20 Thread Erik van Oosten

Hi Mito,

Basically you are asking for Label. Label can generate anything you 
want. Look at the source of Label for inspiration if you need more 
customization.1


Also take a look at TextTemplate. There is also a FreeMarker version, I 
think its in wicketq-extra.


Regards,
   Erik.

mito wrote:

So my question is...Can I create dynamic components with Wicket that have no
assoicated html markup?
  



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



Re: Redirect to mounted page programmatically

2008-12-18 Thread Erik van Oosten

Hi Per,

Wicket does not have this feature.

BTW, you do not need a response page instance, just the class is sufficient:
   setResponsePage(Page1.class);

Optionally you can call this as well (since you are talking about 
redirects):

   setRedirect(true);  // or false

Regards,
   Erik.


Newgro wrote:

Hi *,

i would like to redirect to a page mounted in application by calling it from
another page.

Application.init
mountBookmarkablePage(PAGE1_ID, Page1.class);

AnyPage.myMethod
redirectTo(PAGE1_ID)

How could a redirectTo(String mountPoint) method look? The normal
redirection by requestcycle is not working because i firstly need a
responsepage. But how should i get it by a MountPointId? A global registry
is not nice in my eyes.

Would be nice if someone can help me out here.

thanks
Per
  


--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Javascript call to wicket

2008-12-16 Thread Erik van Oosten

Hello Itay,

It was just an experiment. I have never actually used it. Its been a 
long time ago too..

If may suggest, please try Firebug Lite to debug it.

Sorry I can't be of more help.

Regards,
Erik.



itayh wrote:

Hi Erik,

I used your solution and it works great for ff, while ie seem to have
problems with it. Have you run it also in ie?

Thanks,
  Itay



Erik van Oosten wrote:
  

I just finished an experiment with something like that. Its still ugly
and very static, but here is my code.

In the HTML header the function you can call from Flash:
function(someValue) {
var inputEl = document.getElementById('anchor8');
inputEl.value = someValue;
eval(inputEl.getAttribute('onclick'));
}

Somewhere in the page:
form wicket:id=ajaxForm style=display: none;input
wicket:id=myField type=hidden value=//form

Note that 'anchor8', the Wicket generated id of the input element, still
needs te be made dynamic. Not sure how yet.


The code:
Form form = new Form(ajaxForm);
add(form);
final HiddenField myField = new HiddenField(myField, new
Model(), String.class);
form.add(myField);
myField.add(new AjaxFormSubmitBehavior(onclick) {
@Override
protected void onError(AjaxRequestTarget target) {
throw new RuntimeException(foutje);  // not sure what
to do here
}

@Override
protected void onSubmit(AjaxRequestTarget target) {
String myValue = (String) myField.getConvertedInput();
processAjaxRequest(target, myValue);
}
});

Improvements are very welcome.

Regards,
Erik.






  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



[jira] Created: (WICKET-1973) Messages lost upon session failover with redirect_to_buffer

2008-12-09 Thread Erik van Oosten (JIRA)
Messages lost upon session failover with redirect_to_buffer
---

 Key: WICKET-1973
 URL: https://issues.apache.org/jira/browse/WICKET-1973
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.4-RC1
Reporter: Erik van Oosten


Using the redirect_to_buffer render strategy, messages in the session get 
cleared after the render.

If the redirected request comes in at another node, the buffer is not found and 
the page is re-rendered. In this case the messages are no longer available.

See the javadoc of WebApplication#popBufferedResponse(String,String).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (WICKET-1974) render_to_buffer does not work for absolute URLs

2008-12-09 Thread Erik van Oosten (JIRA)

 [ 
https://issues.apache.org/jira/browse/WICKET-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Erik van Oosten updated WICKET-1974:


Component/s: (was: wicket-auth-roles)

 render_to_buffer does not work for absolute URLs
 

 Key: WICKET-1974
 URL: https://issues.apache.org/jira/browse/WICKET-1974
 Project: Wicket
  Issue Type: Improvement
  Components: wicket
Affects Versions: 1.4-RC1
Reporter: Erik van Oosten

 After installing a WebRequest instance that makes all URLs absolute, 
 render_to_buffer does not work anymore. The problem is that WicketFilter 
 assumes that all URLs are relative (WebFilter#getRelativePath removes the 
 first char of the URL).
 Proposed fixes:
 -1- in WebApplication#addBufferedResponse remove the leading / from the 
 buffer id when present
 -2- or alternatively, remove the leading / from the URL (when present) in 
 WebRequestCycle, just before addBudderedResponse is called
 Here is the installed AbsoluteServletWebRequest:
 /**
  * WebServletRequest that makes bookmarkable links absolute.
  *
  * @author Erik van Oosten
  */
 public class AbsoluteServletWebRequest extends ServletWebRequest {
 public AbsoluteServletWebRequest(HttpServletRequest servletRequest) {
 super(servletRequest);
 }
 @Override
 public int getDepthRelativeToWicketHandler() {
 return 0;
 }
 @Override
 public String getRelativePathPrefixToWicketHandler() {
 return /;
 }
 @Override
 public String getRelativePathPrefixToContextRoot() {
 return /;
 }
 }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Created: (WICKET-1974) render_to_buffer does not work for absolute URLs

2008-12-09 Thread Erik van Oosten (JIRA)
render_to_buffer does not work for absolute URLs


 Key: WICKET-1974
 URL: https://issues.apache.org/jira/browse/WICKET-1974
 Project: Wicket
  Issue Type: Improvement
  Components: wicket, wicket-auth-roles
Affects Versions: 1.4-RC1
Reporter: Erik van Oosten


After installing a WebRequest instance that makes all URLs absolute, 
render_to_buffer does not work anymore. The problem is that WicketFilter 
assumes that all URLs are relative (WebFilter#getRelativePath removes the first 
char of the URL).

Proposed fixes:
-1- in WebApplication#addBufferedResponse remove the leading / from the 
buffer id when present
-2- or alternatively, remove the leading / from the URL (when present) in 
WebRequestCycle, just before addBudderedResponse is called


Here is the installed AbsoluteServletWebRequest:

/**
 * WebServletRequest that makes bookmarkable links absolute.
 *
 * @author Erik van Oosten
 */
public class AbsoluteServletWebRequest extends ServletWebRequest {

public AbsoluteServletWebRequest(HttpServletRequest servletRequest) {
super(servletRequest);
}

@Override
public int getDepthRelativeToWicketHandler() {
return 0;
}

@Override
public String getRelativePathPrefixToWicketHandler() {
return /;
}

@Override
public String getRelativePathPrefixToContextRoot() {
return /;
}
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Updated: (WICKET-1974) render_to_buffer does not work for absolute URLs

2008-12-09 Thread Erik van Oosten (JIRA)

 [ 
https://issues.apache.org/jira/browse/WICKET-1974?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Erik van Oosten updated WICKET-1974:


Description: 
After installing a WebRequest instance that makes all URLs absolute, 
render_to_buffer does not work anymore. The problem is that WicketFilter 
assumes that all URLs are relative (WebFilter#getRelativePath removes the first 
char of the URL).

Proposed fixes:
-1- in WebApplication#addBufferedResponse remove the leading / from the 
buffer id when present
-2- or alternatively, remove the leading / from the URL (when present) in 
WebRequestCycle, just before addBudderedResponse is called


Here is the installed AbsoluteServletWebRequest:

/**
 * WebServletRequest that makes bookmarkable links absolute.
 * Note: use this only when WickterFilter listens on the root context.
 *
 * @author Erik van Oosten
 */
public class AbsoluteServletWebRequest extends ServletWebRequest {

public AbsoluteServletWebRequest(HttpServletRequest servletRequest) {
super(servletRequest);
}

@Override
public int getDepthRelativeToWicketHandler() {
return 0;
}

@Override
public String getRelativePathPrefixToWicketHandler() {
return /;
}

@Override
public String getRelativePathPrefixToContextRoot() {
return /;
}
}


  was:
After installing a WebRequest instance that makes all URLs absolute, 
render_to_buffer does not work anymore. The problem is that WicketFilter 
assumes that all URLs are relative (WebFilter#getRelativePath removes the first 
char of the URL).

Proposed fixes:
-1- in WebApplication#addBufferedResponse remove the leading / from the 
buffer id when present
-2- or alternatively, remove the leading / from the URL (when present) in 
WebRequestCycle, just before addBudderedResponse is called


Here is the installed AbsoluteServletWebRequest:

/**
 * WebServletRequest that makes bookmarkable links absolute.
 *
 * @author Erik van Oosten
 */
public class AbsoluteServletWebRequest extends ServletWebRequest {

public AbsoluteServletWebRequest(HttpServletRequest servletRequest) {
super(servletRequest);
}

@Override
public int getDepthRelativeToWicketHandler() {
return 0;
}

@Override
public String getRelativePathPrefixToWicketHandler() {
return /;
}

@Override
public String getRelativePathPrefixToContextRoot() {
return /;
}
}



 render_to_buffer does not work for absolute URLs
 

 Key: WICKET-1974
 URL: https://issues.apache.org/jira/browse/WICKET-1974
 Project: Wicket
  Issue Type: Improvement
  Components: wicket
Affects Versions: 1.4-RC1
Reporter: Erik van Oosten

 After installing a WebRequest instance that makes all URLs absolute, 
 render_to_buffer does not work anymore. The problem is that WicketFilter 
 assumes that all URLs are relative (WebFilter#getRelativePath removes the 
 first char of the URL).
 Proposed fixes:
 -1- in WebApplication#addBufferedResponse remove the leading / from the 
 buffer id when present
 -2- or alternatively, remove the leading / from the URL (when present) in 
 WebRequestCycle, just before addBudderedResponse is called
 Here is the installed AbsoluteServletWebRequest:
 /**
  * WebServletRequest that makes bookmarkable links absolute.
  * Note: use this only when WickterFilter listens on the root context.
  *
  * @author Erik van Oosten
  */
 public class AbsoluteServletWebRequest extends ServletWebRequest {
 public AbsoluteServletWebRequest(HttpServletRequest servletRequest) {
 super(servletRequest);
 }
 @Override
 public int getDepthRelativeToWicketHandler() {
 return 0;
 }
 @Override
 public String getRelativePathPrefixToWicketHandler() {
 return /;
 }
 @Override
 public String getRelativePathPrefixToContextRoot() {
 return /;
 }
 }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: LoadableDetachableModel in Listview

2008-12-08 Thread Erik van Oosten

So I guess you're not levering the optimistic locking of Hibernate.

Regards,
Erik.


James Carman wrote:

It would work the same way, since it grabs its stuff up-front.  Behind the
scenes, you use a LDM as the actual model.

On Mon, Dec 8, 2008 at 1:56 PM, Daan van Etten [EMAIL PROTECTED] wrote:

  

Hi James,

How does this work with a Hibernate-managed object? Did you test it with
Hibernate?







--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: resource mapping and dot in url

2008-11-19 Thread Erik van Oosten

Andy,

If I read this correctly, this is not a security precaution, but a don't 
shoot yourself in the foot switch. (Note the 'yourself'.) So if set up 
the right way, you don't need this at all. You certainly don't need it 
for a Wicket site.


You'll have to do some heavy URL rewriting (or Wicket patching) to get 
around this one.


Regards,
   Erik.


ak wrote:

The problem is with security procedures set forth by IIS admin folks. Please
follow this link for more nicer explanation. 
http://forums.iis.net/p/1150133/1872812.aspx


Hope I am making myself clear. Any ideas ?

Thanks,
Andy
  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: RES: FileUploadField usage changed in 1.4 rc-1?

2008-11-19 Thread Erik van Oosten

Yeah, I run into the same thing.

Just pass FileUploadField an empty model: new ModelFileUpload()

Regards,
   Erik.


Bruno Cesar Borges schreef:

Yes, you need to set a Model object into FileUploadField. :-)

Bruno


  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Unable to load Wicket app in hosting provider

2008-11-16 Thread Erik van Oosten
Maybe this helps. I've found that you need to start Tomcat from a 
directory that is writable for the user you are using (no idea why 
though). Besides the application log, you should also check Tomcat's log 
files.


Good luck,
   Erik.

moraleslos wrote:

Hi,

I'm running into an issue where my Wicket-based application will absolutely
not load in the shared hosting environment.  I'm trying out GoDaddy's Java
Web hosting that uses Java 1.5 and Tomcat 5.0.27.  I have this same setup on
my box and deploying my Wicket 1.3.4-based application works 


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Quickstart 1.4-rc1 exception

2008-11-14 Thread Erik van Oosten

Hi,

I want create a quickstart to demonstrate a potential bug in 1.4-rc1. 
However if I choose that release I get the following exception.


[INFO] 


[ERROR] FATAL ERROR
[INFO] 


[INFO] org/apache/commons/lang/StringUtils
[INFO] 


[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
   at 
org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:165)
   at 
org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:594)
   at 
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:241)
   at 
org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)



Is this a known problem? I am doing something wrong?

Maven version was 2.0.8, an upgrade to 2.0.9 did not help.

Regards,
   Erik.


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Quickstart 1.4-rc1 exception

2008-11-14 Thread Erik van Oosten
Tried it with several other Wicket releases 1.3.5 and 1.3.3 (Maven 
2.0.9) but I get the same error.


Regards,
   Erik.


Erik van Oosten wrote:

Hi,

I want create a quickstart to demonstrate a potential bug in 1.4-rc1. 
However if I choose that release I get the following exception.


[INFO] 


[ERROR] FATAL ERROR
[INFO] 


[INFO] org/apache/commons/lang/StringUtils
[INFO] 


[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
   at 
org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:165) 

   at 
org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:594) 

   at 
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:241) 

   at 
org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)



Is this a known problem? I am doing something wrong?

Maven version was 2.0.8, an upgrade to 2.0.9 did not help.

Regards,
   Erik.





--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Quickstart 1.4-rc1 exception

2008-11-14 Thread Erik van Oosten
Sorry, I do not understand your suggestion. I am running in a new shell, 
there are no environment variable like CP set.


The command I execute is:
mvn archetype:create -DarchetypeGroupId=org.apache.wicket 
-DarchetypeArtifactId=wicket-archetype-quickstart 
-DarchetypeVersion=1.4-rc1 -DgroupId=nl.grons -DartifactId=homepagebug


The only classpath I see is in the mvn script:

exec $JAVACMD \
 $MAVEN_OPTS \
 -classpath ${M2_HOME}/boot/classworlds-*.jar \
 -Dclassworlds.conf=${M2_HOME}/bin/m2.conf \
 -Dmaven.home=${M2_HOME}  \
 ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS

So how do I remove wicket-velocity from the classpath?
Why is this related to wicket-velocity at all? Isn't this a package from 
velocity (not wicket-velocity)?


Regards,
Erik.


Martijn Dashorst wrote:

org.apache.velocity.app.VelocityEngine

 remove wicket-velocity from your classpath

On Fri, Nov 14, 2008 at 4:05 PM, Erik van Oosten [EMAIL PROTECTED] wrote:
  

Tried it with several other Wicket releases 1.3.5 and 1.3.3 (Maven 2.0.9)
but I get the same error.

Regards,
  Erik.


Erik van Oosten wrote:


Hi,

I want create a quickstart to demonstrate a potential bug in 1.4-rc1.
However if I choose that release I get the following exception.

[INFO]

[ERROR] FATAL ERROR
[INFO]

[INFO] org/apache/commons/lang/StringUtils
[INFO]

[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
  at
org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:165)
  at
org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:594)
  at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:241)
  at
org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)


Is this a known problem? I am doing something wrong?

Maven version was 2.0.8, an upgrade to 2.0.9 did not help.

Regards,
  Erik.


  

--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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







  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Quickstart 1.4-rc1 exception

2008-11-14 Thread Erik van Oosten
It appears that my Maven repository (artifactory) is not functional 
anymore. Somehow its empty.

I'll switch to central for a moment.

Sorry for the hassle.

Regards,
   Erik.


Erik van Oosten wrote:
Sorry, I do not understand your suggestion. I am running in a new 
shell, there are no environment variable like CP set.


The command I execute is:
mvn archetype:create -DarchetypeGroupId=org.apache.wicket 
-DarchetypeArtifactId=wicket-archetype-quickstart 
-DarchetypeVersion=1.4-rc1 -DgroupId=nl.grons -DartifactId=homepagebug


The only classpath I see is in the mvn script:

exec $JAVACMD \
 $MAVEN_OPTS \
 -classpath ${M2_HOME}/boot/classworlds-*.jar \
 -Dclassworlds.conf=${M2_HOME}/bin/m2.conf \
 -Dmaven.home=${M2_HOME}  \
 ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS

So how do I remove wicket-velocity from the classpath?
Why is this related to wicket-velocity at all? Isn't this a package 
from velocity (not wicket-velocity)?


Regards,
Erik.


Martijn Dashorst wrote:

org.apache.velocity.app.VelocityEngine

 remove wicket-velocity from your classpath

On Fri, Nov 14, 2008 at 4:05 PM, Erik van Oosten 
[EMAIL PROTECTED] wrote:
 
Tried it with several other Wicket releases 1.3.5 and 1.3.3 (Maven 
2.0.9)

but I get the same error.

Regards,
  Erik.


Erik van Oosten wrote:
   

Hi,

I want create a quickstart to demonstrate a potential bug in 1.4-rc1.
However if I choose that release I get the following exception.

[INFO]
 


[ERROR] FATAL ERROR
[INFO]
 


[INFO] org/apache/commons/lang/StringUtils
[INFO]
 


[INFO] Trace
java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
  at
org.apache.velocity.runtime.resource.ResourceManagerImpl.initialize(ResourceManagerImpl.java:165) 


  at
org.apache.velocity.runtime.RuntimeInstance.initializeResourceManager(RuntimeInstance.java:594) 


  at
org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:241) 


  at
org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)


Is this a known problem? I am doing something wrong?

Maven version was 2.0.8, an upgrade to 2.0.9 did not help.

Regards,
  Erik.


  

--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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







  






--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: IDataProvider Implementation.

2008-11-11 Thread Erik van Oosten
Not a good idea for large objects. A few days back I improved load time 
of a page from more then 40 sec to about 5 sec by replacing new 
Model(object) with a proper LoadableDetachableModel.


Nevertheless, there is no reason to let the LoadableDetachableModel get 
the object if you already have it, just pass the object to the constructor!


E.g. see first ctor below.

public class LoadableMemberModel
   extends LoadableDetachableModelMember {

   @SpringBean
   private MemberService memberService;

   private long memberId;

   //
   // Constructor that has object has direct parameter
   //
   public LoadableMemberModel(Member member) {
   super(member);
   this.memberId = member.getId();
   }
*
*public LoadableMemberModel(long memberId) {
   this.memberId = memberId;
   }

   protected Member load() {
   InjectorHolder.getInjector().inject(this);
   return memberService.getById(memberId);
   }
}



Regards,
   Erik.


Graeme Knight wrote:

Hey Jeremy,

Thanks for the heads up - actually that's what I ended up doing this
morning. Works like a charm!

Cheers, Graeme.


Jeremy Thomerson-5 wrote:
  

In my apps, I bring them all in whenever the first call to iterator or
size
is done, and cache them until detach.  It's a very reasonable pattern. 
Then

in the model method, I basically do new Model(object)


--
Jeremy Thomerson
http://www.wickettraining.com


On Tue, Nov 11, 2008 at 8:03 AM, Graeme Knight [EMAIL PROTECTED]
wrote:



Hi.

From the examples I've seen the IDataProvider implementation of the
iterator
method brings back (for example) a list of keys from the database.

The model method uses something like a LoadableDetachableModel to
populate
a
model for use by the consumer using the list of keys previously
retrieved.

This seems like a lot of database hits to me. Is this simply because of
the
serialization/model mechanism?

It seems to me that the iterator could/should bring back the data in one
hit
and then after use be detached. Is this common?

Many thanks, Graeme.
--
View this message in context:
http://www.nabble.com/IDataProvider-Implementation.-tp20440141p20440141.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


  



  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: wicket prepends unnecessary ../ before href/src html element attributes

2008-11-11 Thread Erik van Oosten

Anirban,

Your resources still start with xxweb. If you want them to be served 
by wicket replace it with xx/web or something like that. If you want 
them to be served by something else (context xxweb?) prepend a /.


Regards,
   Erik.


Alan Romaniusc wrote:

Could it be anything like this?
http://www.nabble.com/Wicket-1.4-m3,-wicket-auth-roles-and-Context-Path-td20249711.html

On Tue, Nov 11, 2008 at 9:51 AM, Anirban Basak [EMAIL PROTECTED] wrote:
  

(replacing proprietary names/texts with xx)



I'm running wicket web app with context 'xx'.



As long I'm mounting pages with mountBookmarkablePage(..) or other URL
encoding strategies (http://www.test-server.com/xx/web/page/partner) or
mentioning /xx/* as the filter pattern, everything is running fine. But I
was told not to append any word after the context
(http://www.test-server.com/xx/). I tried removing URL encoding strategies,
but wicket returning wrong relative urls by prepending unnecessary '../' to
the resource uris like:



link href=xxweb/css/styles.css rel=stylesheet type=text/css /

link rel=stylesheet href=xxweb/css/dhtmlwindow.css type=text/css /

script type=text/javascript src=xxweb/js/dhtmlwindow.js/script

script type=text/javascript src=xxweb/js/partnerpages.js/script



Wicket converting them into:



link href=../xxweb/css/styles.css rel=stylesheet type=text/css /

link rel=stylesheet href=../xxweb/css/dhtmlwindow.css type=text/css
/

script type=text/javascript src=../xxweb/js/dhtmlwindow.js/script

script type=text/javascript src=../xxweb/js/partnerpages.js/script



This makes the browser unable to fetch the resources as

../xxweb/css/styles.css ==
http://www.test-server.com/xxweb/css/styles.css;



Structure of the WAR

xx-snapshot.war

 |-- index.html (incase wicket not running)

 |-- xx-config.xml

 |-- WEB-INF

   |-- web.xml

   |-- lib

   |-- classes

 |-- xxweb

  |-- css

  |-- images

  |-- js





Web.xml

filter

   filter-namewicket.xx/filter-name

   filter-class

 org.apache.wicket.protocol.http.WicketFilter

   /filter-class

   init-param

 param-nameapplicationClassName/param-name

 param-valuecom.xx.xx.xxWebApplication/param-value

   /init-param

 /filter



 filter-mapping

   filter-namewicket.xx/filter-name

   url-pattern/*/url-pattern

   dispatcherREQUEST/dispatcher

   dispatcherINCLUDE/dispatcher

 /filter-mapping



Is this because of any wicket specific restriction or something else?



Anirban











  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Question on PageMap

2008-11-11 Thread Erik van Oosten

I am not sure what the default is set to

Look at the constructors of DiskPageStore.


My end goal is to try and squeeze more performance out of my application.
If that is your goal you are on the wrong track. The disk store is a 
rotating logging based, mostly write-only store. Logging based as new 
content is written sequentially from start to end of the file, rotated 
because when the file is full it starts at byte 0 thereby overwriting 
old pages. It is mostly write-only as only when a user presses the back 
button data may be read back from the page store.


Early removal of data will only mean more disk-head movements making it 
slower instead of faster.


Regards,
   Erik.



David R Robison wrote:
I have been monitoring the size of the pm-null file stored in the Work 
directory from Tomcat. I assume that it is the serialized version of 
the PageMap. I have an application where, if I navigate from page A to 
page B and then back to page A, the pm-null file keeps growing. I 
understand that I can set the maximum number of pages saved in the 
PageMap but I am not sure what the default is set to. Also, if I am 
leaving a page with a form and do not intend to return to that page 
and submit its values, do I even need it in the PageMap? Is there a 
way I can remove my page from the PageMap when I know I am no longer 
going to need its values? My end goal is to try and squeeze more 
performance out of my application. I hope this is understandable... 
any thoughts?





--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/



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



Re: Handling exceptions during render

2008-11-03 Thread Erik van Oosten

It won't. I think you have to dig deeper into the request rendering.

Perhaps that overriding MarkupContainer#renderAll on all your Panels 
that have expected exceptions will help.


But then again, exceptions are intended for controlling the 
non-expected. You should not use exceptions for normal page flow. In 
other words: just make sure that no exceptions are thrown.


Regards,
   Erik.


aditsu wrote:

Ok, but how would that let me render the rest of the page?


Alex Objelean wrote:
  
There are more threads about this issue... 


In order to catch all runtime exception, you have to override default
RequestCycle (newRequestCycle method) in your application class and
override onRuntimeException method.

Example:
[CODE]
@Override
public RequestCycle newRequestCycle(final Request request, final Response
response) {
return new WebRequestCycle(this, (WebRequest) request,  (WebResponse)
response) {
  @Override
  public Page onRuntimeException(final Page page, final
RuntimeException e) {
  //do something
  return null;
}
}
}
[/CODE]


Alex Objelean




  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Browser file download complete callback

2008-11-03 Thread Erik van Oosten
Not sure about the close method, but you could always wrap the 
outputstream and count the number of streamed bytes.


Regards,
   Erik.


bjolletz wrote:

Is it at all possible to get a callback when a user is
finished downloading the bytearray?
  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Handling exceptions during render

2008-11-03 Thread Erik van Oosten

Yeah, I was afraid it would come to that.
Sorry, you've apparently done some more research already...

Another thing I sometimes do is take the Wicket class and put it in the 
web-project's classpath but with my changes (e.g. remove a final). All 
servlet containers will load earlier from the WEB-INF/classes folder 
then from WEB-INF/lib. Its a huge hack, but it works most of the time.


Regards,
Erik.


aditsu wrote:

Well, I'm specifically talking about unexpected runtime exceptions. I don't
want those to destroy the whole page.
They can kill a component, that's ok, but the rest of the page should work.
And yes I want to make sure that no exceptions are thrown, except that's
not so simple when you're dealing with a complex site and lots of pages,
components and models. If I missed any exceptions, I want those to be
handled gracefully rather than redirecting to an error page.

renderAll is ONLY called on the page, all other components go through
renderComponentTagBody to call renderNext, and both renderComponentTagBody
and renderNext are final :(
I tried overriding onComponentTagBody and wrapping the super invocation with
try/catch, but then the markup gets broken because it doesn't close tags
(i.e. advance in the markup stream?) after the exception is thrown in a
child component, and I still get an error page :(
renderComponent(MarkupStream) is final too, it seems that all doors are
closed and locked...


  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Referencing Request in Spring bean definitions

2008-11-03 Thread Erik van Oosten

Creation of custom sessions is described here:
http://cwiki.apache.org/WICKET/newuserguide.html#Newuserguide-CustomSessions

I do think you can create a session through Spring.

Regards,
   Erik.

Ryan O'Hara wrote:

Hello,

Is there anyway to reference Wicket's request object in the Spring 
bean definitions XML?  I'm trying to define a session bean, which has 
two parameters in the contructor - a SwarmWebApplication and a 
Request.  Thanks in advance.


bean id=myApplication
  class=edu.chop.bic.cnv.CnvApplication
/bean

bean id=myRequest
  class=some.request.location
/bean

bean id=mySession
  class=edu.chop.bic.cnv.session.MySession
constructor-arg ref=myApplication/
constructor-arg ref=myRequest/
/bean

Ryan

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



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



Re: Are there any open-source webapplications based on Wicket?

2008-11-02 Thread Erik van Oosten

http://cwiki.apache.org/WICKET/sites-using-wicket.html



So far I have not found a single Wicket-based website or project.

Is there none so far or just hidden somewhere on the net ?




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



Re: Broken pipe

2008-11-02 Thread Erik van Oosten
=0x4082dca8)
0x4082dca8:   2b2290bdac88 2aaa0001
0x4082dcb8:   2aaac62dff00 4082de60
0x4082dcc8:   0080 4082dde0
0x4082dcd8:   2aaac71a8290 4082dd50
0x4082dce8:   2aaac6ace690 4082de60
0x4082dcf8:   066b 0002
0x4082dd08:   00024082e040 008d
0x4082dd18:   008d 2aaac71a8280
0x4082dd28:   2aaac74ed578 00194082dd50

**
Martin

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

  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Broken pipe

2008-11-02 Thread Erik van Oosten

I have:

$ java -version
java version 1.6.0_10-rc
Java(TM) SE Runtime Environment (build 1.6.0_10-rc-b28)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b15, mixed mode)

$ uname -a
Linux server #1 SMP Wed May 28 20:21:05 UTC 2008 x86_64 GNU/Linux

Regards,
   Erik.


Martin Makundi wrote:

What is your exact version, mine is:

java version 1.6.0_10-beta
Java(TM) SE Runtime Environment (build 1.6.0_10-beta-b25)
Java HotSpot(TM) 64-Bit Server VM (build 11.0-b12, mixed mode)

Linux version 2.6.18-xenU (gcc version 4.1.2 20061115 (prerelease)
(Debian 4.1.1-21))

**
Martin


2008/11/3 Erik van Oosten [EMAIL PROTECTED]:
  

My latest application also runs on 64bit (Ubuntu 8.04). The JVM crashed
regularly (in the compiler) until I upgraded to Java 6u10.

Regards,
  Erik.



Martin Makundi wrote:


Hi!

I quite often suffer this exception.. anybody have similar experiences
and know of a workaround? It crashes the jvm..

2008-11-02 18:48:02,819 4[btpool0-4] ERROR TakpServlet  - Faltal
error, servlet service halted.
org.mortbay.jetty.EofException
  at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:657)
  at
org.mortbay.jetty.AbstractGenerator$Output.blockForOutput(AbstractGenerator.java:539)
  at
org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGenerator.java:560)
  at
org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.java:828)
  at
org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:617)
  at
org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:578)
  at
org.apache.wicket.protocol.http.BufferedHttpServletResponse.writeTo(BufferedHttpServletResponse.java:552)
  at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:341)
  at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:124)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
  at wicket.quickstart.TakpServlet.service(TakpServlet.java:58)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
  at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
  at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
  at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
  at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
  at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
  at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
  at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
  at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
  at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
  at org.mortbay.jetty.Server.handle(Server.java:285)
  at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
  at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
  at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
  at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Caused by: java.io.IOException: Broken pipe
  at sun.nio.ch.FileDispatcher.write0(Native Method)
  at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
  at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:104)
  at sun.nio.ch.IOUtil.write(IOUtil.java:60)
  at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
  at
org.mortbay.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:165)
  at
org.mortbay.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:192)
  at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:590)
  ... 28 more

#
# An unexpected error has been detected by Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x2b2290b73360, pid=22478, tid=1082333536
#
# Java VM: Java HotSpot(TM) 64-Bit Server VM (11.0-b12 mixed mode
linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x4d3360]
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---  T H R E A D  ---

Current thread (0x2aaabe6da800):  JavaThread CompilerThread1 daemon
[_thre
ad_in_native, id=22489, stack(0x40731000,0x40832000)]

Current CompileTask:
C2:1729
 org.apache.wicket.extensions.yui.calendar.DatePicker.renderHead(Lor
g/apache/wicket/markup/html/IHeaderResponse;)V (706 bytes)

siginfo:si_signo=SIGSEGV: si_errno=0, si_code=1 (SEGV_MAPERR),
si_addr

Re: Wicket and URLs

2008-10-29 Thread Erik van Oosten

Hello S D,

This might interest you:
http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html

Note there are still some limitations. Your milage may vary.

Regards,
   Erik.

S D wrote:

Hi,

I was browsing through examples, it looks very impressive but there's a thing 
that bothers me somewhat. The Basic Label example uses the following URL:

http://wicketstuff.org/wicket13/compref/;jsessionid=F8C6R0F2601C96D1Y3CAD8B69E8779D4?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage

The problem with that is that we'd like to have an appearance of a technology neutral site (or at least not to be blatant about it) but Jsessionid and especially wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage 
destroy that impression completely.


I understand it's possible to remove Jsessionid from URL but what about 
Wicket's contribution to the URL? We'd like to keep our URLs as clean and 
readable as possible.

Thanks




  



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

  


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



Re: Wicket and URLs

2008-10-29 Thread Erik van Oosten
Thanks for clarifying limitation no 2, I had not though of this. Indeed 
in my usecase this is not a problem.

'Limitation' no 1 is quite intentional.

If you don't mind, I've also added this comment to the article.

Regards,
   Erik.


Igor Vaynberg wrote:

while this might work for your usecase this will pretty much break
things. the version number is in the url for a reason.

1) it completely kills the backbutton for that page. since the url
remains the same the browser wont record your actions in the history.
based on what you are trying to do this may or may not be a bad thing.

2) even if you manage to get the back button working this will
completely kill applications that use any kind of panel replacement
because you no longer have the version information in the url. you
have a page with panel A, you click a link and it is swapped with
panel B. go back, click a link on A and you are hosed because wicket
will look for the component you clicked on panel B instead of A.

in all the applications ive written there was at least a moderate
amount of panel replacement going on. one of the applications i worked
on had the majority of its navigation consist of panel replacement. so
i dont think this is a good idea.

-igor

  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



[jira] Commented: (WICKET-1878) ExternalLink should have title field

2008-10-28 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12643227#action_12643227
 ] 

Erik van Oosten commented on WICKET-1878:
-

Proposed solution: Won't fix.

Wicket should stay clean and mean. Adding these kinds of options all over the 
place won't help achive this goal.

Here is a custom component that reaches the comitters goal with a custom 
component.

public abstract class TitledLink extends Link {

public TitledLink(String id, String title) {
this(id, new ModelString(title));
}

public TitledLink(String id, IModelString titleModel) {
super(id);
add(new AttributeModifier(title, true, titleModel));
}

}

 ExternalLink should have title field
 

 Key: WICKET-1878
 URL: https://issues.apache.org/jira/browse/WICKET-1878
 Project: Wicket
  Issue Type: Improvement
  Components: wicket
Affects Versions: 1.3.4, 1.4-M3
Reporter: Steve Swinsburg

 The ExternalLink component should either by default have a title field, or 
 have another constructor that takes the title as a paremeter. Currently this 
 is only achieved by using AttributeAppender and setting the title attribute 
 onto the link.
 eg current:
 ExternalLink emailLink = new ExternalLink(mailToLink,new Model(mailto:; + 
 emailAddress),new Model(emailAddress));
 emailLink.add(new AttributeAppender(title, new Model(emailAddress),  ));
 I propose the following constructor:
 ExternalLink(java.lang.String id, java.lang.String href, java.lang.String 
 label, java.lang.String title) 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: no title in ExternalLink

2008-10-28 Thread Erik van Oosten

Hehe, that's a nice one too.


James Carman wrote:

Perhaps just a helper method somewhere?

public AbstractLink addTitle(AbstractLink link, IModelString titleModel)
{
  link.add(new AttributeModifier(title, true, titleModel));
  return link;
}

  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: generate javascript file together with html page

2008-10-27 Thread Erik van Oosten

Sound like what you need is a DynamicWebResource.

Regards,
   Erik.

Ittay Dror wrote:


Michael Sparer wrote:
  

take a look at headercontributors e.g.
http://chillenious.wordpress.com/2006/05/03/wicket-header-contributions-with-behaviors/




This will only generate the reference to the javascript in the html page.
However, now when the browser tries to request this javascript file, I want
the request to go to the same Page object that created the html, so that it
renders the javascript file.

Assume FooPage.java. A request FooPage.html creates a call to FooPage. It
then contributes FooPage.js to the header and then I want a request to
FooPage.js to go back to FooPage so it creates the javascript file by using
the same hierarchy of components. 


Ittay
  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: generate javascript file together with html page

2008-10-27 Thread Erik van Oosten
I did not use this thing yet, but I believe that you will have to 
provide enough information to the DynamicWebResource so that it can 
generate what ever it needs to generate by itself. In an extreme case 
that could be simply a reference to the containing page, but that sounds 
quite dangerous to me.


Regards,
   Erik.


Ittay Dror wrote:


Erik van Oosten wrote:
  

Sound like what you need is a DynamicWebResource.




yes, sound like this can do it. but can i start a rendering cycle here so
that i get the bytes required at the end?




  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: inmethod / grid website?

2008-10-21 Thread Erik van Oosten

We should really have a FAQ here.

Anyways: you can find the inmethod stuff in wicket-stuff now. There is 
no official release so you'll have to compile the sources yourself or 
grab a recent jar from wicket-stuff's bamboo server.


Regards,
   Erik.


Martin Voigt wrote:

Hi,

this may be the wrong place to ask, but anyways. What happened to the
inmethod/ grid web site?

http://www.inmethod.com/

is showing the tomcat welcome page for some time now. Did it move?

Regards,
Martin


  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Empty PageParametyers when using HybridUrlCodingStrategy

2008-10-17 Thread Erik van Oosten
Please check your setup then. I understand you are using sitemesh. Maybe 
this interferes.


   Erik.

itayh wrote:

In this case the url will contain the parameters. But since I mount it
without the parameters what I get is empty page. I am not sure why I am
getting the empty page when I concat the parameters to the iframe url. I am
not even getting to MyFrame constructor. Any Idea?

  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Pages or components... how do u decide?

2008-10-17 Thread Erik van Oosten

Of topic but important nevertheless:

About the only object you ever want to put in the session IMHO is the 
logged in user and its credentials. Even if you have a very small site 
with only one important model you should not put it in the session. 
There are 2 problems with this approach:


- Technically you get problems because access to the session is not 
thread safe.
- Usability suffers because the user can no longer have multiple tabs 
open in the same site and try out different things.


Well, ok, /sometimes/ you want to prevent the latter to keep things 
simple for the user. A shopping cart is probably the best example.


Regards,
   Erik.


Alex Objelean wrote:

I also like the approach of pushing every functionality in separate
components (Panels), it gives me the flexibility of composing pages with any
combination of this components. For instance, if I have Login functionality,
I create the LoginPanel and LoginPage. This approach allows me to add other
Panels (if needed) to LoginPage.

Regarding storing the primary model to the base page, I would suggest using
a custom session for storing it. This way you can benefit from strongly
typed objects and be able access it anywhere in your application.

Alex
  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: tomcat doesnt work with wicket

2008-10-17 Thread Erik van Oosten

Some more details please.


overseastars wrote:

Hi all

I have this strange problem now. If i use jetty, everything is find. But if
I wanna run wicket application on tomcat in eclipse, it doesnt work. Any
ideas to solve this? Do I need to do sth with tomcat??? I'm a newbie. So
is the question..


  


--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: tomcat doesnt work with wicket

2008-10-17 Thread Erik van Oosten
Actually, there are some weird things with Tomcat. For example 
https://issues.apache.org/jira/browse/WICKET-847.



Piller Sébastien wrote:

tomcat does work fine with wicket, your problem is elsewhere.

look at the logs, at the console, reinstall, test with a simple hello 
world project, ...


but not tomcat neither wicket are responsible

overseastars a écrit :

Hi all

I have this strange problem now. If i use jetty, everything is find. 
But if

I wanna run wicket application on tomcat in eclipse, it doesnt work. Any
ideas to solve this? Do I need to do sth with tomcat??? I'm a 
newbie. So

is the question..


  



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




--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Empty PageParametyers when using HybridUrlCodingStrategy

2008-10-16 Thread Erik van Oosten
I don't understand. Reading the javadoc InlineFrame should set the src 
attribute. If that is not the case, try setting the src attribute with 
something like:


myFrame.add(new AttributeModifier(src, new Model(urlFor(MyFrame.class, 
pageParameters;


Regards,
   Erik.



itayh wrote:

Hi Erik,

You are right, the src AttributeModifier overwrites params values. If I am
not using the src AttributeModifier then the params has values and if I use
it then the params are empty.

But it seem that I must use the src AttributeModifier since I am using
sitemesh decorators to decorate my pages according to the url, so I need to
identify the iframes url from their container url. I need to decorate all my
pages but I don't want to decorate the iframes (no need for headers and
footers there).

The src AttributeModifier is the only way I found how set the iframes url to
what i want. Is there another way?

Thanks alot,
  Itay


  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Empty PageParametyers when using HybridUrlCodingStrategy

2008-10-15 Thread Erik van Oosten

Itayh,

What you do seems alright. Please show us complete code fragments. Both 
the part where you create the InlineFrame component, and the constructor 
of the MyFrame class.


Regards,
   Erik.

itayh schreef:

Any Idea?


itayh wrote:
  

Thx for the quick response.

I cahnged the url mount in my application to 
mount(new IndexedHybridUrlCodingStrategy(/iframe/MyFrame,

MyFrame.class)) ...

My problem is that still when i try to create iframe like:
PageParameters params = new PageParameters();
params.add(url, url) or params.add(0, url)
InlineFrame myFrame = new InlineFrame(MyFrame,
this.getPageMap(),MyFrame.class, params);
myFrame .add(new AttributeModifier(src,
newModel((Serializable)/myapp/iframe/MyFrame)));

The params get empty to the MyFrame constructor.The only situation the
params are not empty is when I do: 
myFrame .add(new AttributeModifier(src,

newModel((Serializable)/myapp/iframe/MyFrame/param_value)));

But then the url is not found since I define in my app:
mount(new IndexedHybridUrlCodingStrategy(/iframe/MyFrame,
MyFrame.class)) ...

The param is runtime value and I can not know it when creating my app.





--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Empty PageParametyers when using HybridUrlCodingStrategy

2008-10-15 Thread Erik van Oosten
That combination is wrong. If you use the IndexedHybridUrlCodingStrategy 
the first parameter is called 0. Secondly the AttributeModifier 
probably overwrites the generated src attribute.


This should work (not tested):

PageParameters params = new PageParameters();
params.put(0, myUrl);// changed to put, just to be sure
InlineFrame myFrame = new InlineFrame(MyFrame, this.getPageMap(), 
MyFrame.class, params);
add(myFrame);

public MyFrame(PageParameters params){
   String url = params.getString(0);  // changed to getString
   doSomething(url);
}

mount(new IndexedHybridUrlCodingStrategy(iframe/MyFrame, MyFrame.class));  // 
removed leading /


Good luck!
   Erik.


itayh wrote:

Creating the InlineFrame component:
PageParameters params = new PageParameters();
params.add(url, myUrl);
InlineFrame myFrame = new InlineFrame(MyFrame, this.getPageMap(),
MyFrame.class, params);
myFrame.add(new AttributeModifier(src, new
Model(/myapp/app/iframe/MyFrame)));
add(myFrame);

Creating MyFrame:
public MyFrame(PageParameters params ){
String url = params.get(url); //the problem is that this params are
empty
doSomething(url);
}

Url mounting:
mount(new IndexedHybridUrlCodingStrategy(/iframe/MyFrame, MyFrame.class));

I tried also for the url mounting:
mount(new HybridUrlCodingStrategy(/iframe/MyFrame, MyFrame.class));

In all cases the params inside the constructor of MyFrame class has no
values in them (size = 0)

Thanks,
  Itay

  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Wicket talk at NL-JUG's J-Fall

2008-10-09 Thread Erik van Oosten
Just to let you know. My talk 'Effective Wicket', targeted at starting 
Wicketeers has been accepted on NL-JUG's J-Fall.


http://www.nljug.org/jfall/

Regards,
   Erik.

--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



Re: Form GET doesn't call onSubmit method

2008-10-02 Thread Erik van Oosten

Hi Eyal,

Let me translate Igor's reponse (which I agree is somewhat short for the 
uninitiated ;)  )


Quickstart is the optimum way to start with Wicket. For more info see 
http://wicket.apache.org/quickstart.html.


A quickstart is an as small as possible Wicket application that 
demonstrates a bug and was created with Quickstart.


Igor's question also indicates he thinks there is a bug. You can file 
the bug by creating an issue in Wicket's bug tracking system at: 
https://issues.apache.org/jira/browse/WICKET. The quickstart should be 
attached to the created issue.


Regards,
   Erik.


eyalbenamram wrote:

Hi
How? what is a quickstart? 
I am using wicket 1.3.4  is it still not fixed there?




igor.vaynberg wrote:
  

create a quickstart and attach it to a jira issue

-igor

On Thu, Oct 2, 2008 at 7:09 AM, eyalbenamram [EMAIL PROTECTED]
wrote:


Hi,
I have a form that overrides the method:

   protected String getMethod() {

  return Form.METHOD_GET;
}

When the form is submitted, the onSubmit method is never called and I
am routed to the home page instead of the location I specified. Any
suggestions??

Thanks, Eyal.
--
View this message in context:
http://www.nabble.com/Form-GET-doesn%27t-call-onSubmit-method-tp19780009p19780009.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


  

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






  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/


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



[jira] Commented: (WICKET-1355) Autocomplete window has wrong position in scrolled context

2008-09-27 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12635118#action_12635118
 ] 

Erik van Oosten commented on WICKET-1355:
-

Okay. I'll try. I'll be a JAOO so it has to wait till Thursday though.

 Autocomplete window has wrong position in scrolled context
 --

 Key: WICKET-1355
 URL: https://issues.apache.org/jira/browse/WICKET-1355
 Project: Wicket
  Issue Type: Bug
  Components: wicket-extensions
Affects Versions: 1.3.1
Reporter: Erik van Oosten
Assignee: Igor Vaynberg
 Fix For: 1.3.5

 Attachments: wicket-autocomplete.js


 When the autocompleted field is located in a scrolled div, the drop-down 
 window is positioned too far down.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (WICKET-1746) gecko: ajax javascript reference rendering problem

2008-09-26 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-1746?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12634772#action_12634772
 ] 

Erik van Oosten commented on WICKET-1746:
-

As a workaround, add the following behavior to your page (javascript based on 
wicket 1.3.4):

private static class WicketAjaxRelativePathFixBehaviour extends AbstractBehavior
{
private static final long serialVersionUID = 1L;

@Override
public void renderHead(IHeaderResponse response)
{
String script = if (Wicket  Wicket.Ajax  
Wicket.Ajax.Request) {+
Wicket.Ajax.Request.prototype.doGet = 
function() { + 
   if (this.precondition()) { + 
   this.transport = 
Wicket.Ajax.getTransport(); + 
   var url = this.createUrl(); + 
   this.log(\GET\, url); + 
   
Wicket.Ajax.invokePreCallHandlers(); + 
   var t = this.transport; + 
   if (t != null) { + 
   t.open(\GET\, url, 
this.async); + 
   t.onreadystatechange = 
this.stateChangeCallback.bind(this); + 
   /*set a special flag to 
allow server distinguish between ajax and non-ajax requests*/ + 
   
t.setRequestHeader(\Wicket-Ajax\, \true\); + 
   
t.setRequestHeader(\Wicket-FocusedElementId\, Wicket.Focus.lastFocusId || 
\\); + 
   
t.setRequestHeader(\Accept\, \text/xml\); + 
   t.send(null); + 
   return true; + 
   } else { + 
   this.failure(); + 
   return false; + 
   } + 
   } else { + 
   Wicket.Log.info(\Ajax GET 
stopped because of precondition check, url:\ + this.url); + 
   this.done(); + 
   return true; + 
   } + 
}};
response.renderOnDomReadyJavascript(script);
}
}


 gecko: ajax javascript reference rendering problem
 --

 Key: WICKET-1746
 URL: https://issues.apache.org/jira/browse/WICKET-1746
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.4-M2
Reporter: Jan Loose
Assignee: Matej Knopp
 Fix For: 1.3.5, 1.4-M4


 Hi,
 i tried render the javascript as:
 public void renderHead(IHeaderResponse response) {
   response.renderJavascriptReference(contextPath + js/test.js);
 }
 The test.js is in webapp/js/test.js (out of classpath). All works greatly in 
 Opera but in FF (gecko) is there a problem in wicket-ajax.js (the code is 
 form trunk version): 
 836: if (Wicket.Browser.isGecko()) {
 837: var href = document.location.href;
 838: var lastIndexOf = href.lastIndexOf('/');
 839: if (lastIndexOf  0)
 840: {
 841: url = href.substring(0,lastIndexOf+1) + url;
 842:}
 843:}
 Why is there this fix/workaround? This works only for relative path but for 
 absolute is this code broken.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: Nice urls in markup

2008-09-26 Thread Erik van Oosten
Liz,
 The href-Element of my Ajax-Fallbacklinks show a pretty URLs now, but the 
 fallback links don't work anymore, if JavaScript is disabled.
   
That is the intention, the fallback links only work when havascript is
enabled.

I think you should mount your pages like this:
mount(new HybridUrlCodingStrategy(home/project, ProjectPage.class));
mount(new HybridUrlCodingStrategy(home/team, TeamPage.class));

Regards,
Erik.


Liz Huber wrote:
 First of all: Thanks a lot for trying to help me, Erik!

 The href-Element of my Ajax-Fallbacklinks show a pretty URLs now, but the 
 fallback links don't work anymore, if JavaScript is disabled.
 ul
lia href=home id=navMail__itema onclick=var 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
  
 function() {return Wicket.$('navMail__itema') != null;}.bind(this));return 
 !wcall;spanProducts/span/a/li
 /ul
 ul
lia href=home id=navMail__itemb onclick=var 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
  
 function() {return Wicket.$('navMail__itemb') != null;}.bind(this));return 
 !wcall;spanTeam/span/a/li
 /ul

 The thing I'd like to do is to mount a different, meaningful URLs for each 
 Ajax-Fallbacklink. This URL should be shown in markup and within the 
 address line of the browser. And of course, the link should work 
 afterwards:
 ul
lia href=home/products id=navMail__itema onclick=var 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
  
 function() {return Wicket.$('navMail__itema') != null;}.bind(this));return 
 !wcall;spanProducts/span/a/li
 /ul
 ul
lia href=home/team id=navMail__itemb onclick=var 
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
  
 function() {return Wicket.$('navMail__itemb') != null;}.bind(this));return 
 !wcall;spanTeam/span/a/li
 /ul

 I've been wondering, if it is even possible to do that. Could anyone try to 
 help, please?

 Thanks,
 Liz




   
 - Original Message -
 From: Erik van Oosten
 Sent: 25/09/08 02:39 pm
 To: users@wicket.apache.org
 Subject: Re: Nice urls in markup

 Use a HybridUrlCodingStrategy to mount your pages. This will make ajax 
 request link to a similar URL as the page your are mounting (it adds a 
 number).

 Regards,
 Erik.

 Liz Huber wrote:
 
 I'm trying to beautify all wicket urls of my application by mounting 
   
 the 
 
 pages to meaningful paths. 
 Thereby the urls become pretty in the browser's address line.

 But within the rendered markup links and images still have non formated 
 wicket urls. 
 So I mounted the images as shared resources and successfully tricked by 
 overwriting methode onComponentTag():

 @Override
 protected void onComponentTag(ComponentTag tag) 
 {
 super.onComponentTag(tag);
 tag.put(src, urlFor(getImageResourceReference()).toString()); 
 }
 
 The same way I proceeded concerning links: I mounted the referenced 
   
 page 
 
 and overwrote methode onComponentTag():

 @Override
 protected void onComponentTag(ComponentTag tag) {
 super.onComponentTag(tag);
 if (clazz != null) {
 tag.put(href, urlFor(clazz, null)); //where clazz = 
 Class.forName(getDefaultModelObjectAsString());
 } else {
 tag.remove(href);
 }
 }

 This works pretty well and the urls in markup look like the mountpaths. 
   
 But 
 
 one problem is still remaining. I created a list containing ajax 
   
 fallback 
 
 links. In markup they contain a href attribute, which is probably 
   
 used, 
 
 when java script is deactivated. 

 ...ul
lia 

   
 href=?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::ILinkListener::
  
 
 id=navMail__itema onclick=var 

   
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:0:navMail_item::IBehaviorListener:0:',null,null,
  
 
 function() {return Wicket.$('navMail__itema') != 
   
 null;}.bind(this));return 
 
 !wcall;spanAjaxLink 1/span/a/li
 /ul
 ul
lia 

   
 href=?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::ILinkListener::
  
 
 id=navMail__itemb onclick=var 

   
 wcall=wicketAjaxGet('?wicket:interface=:0:panelMiddleNavigation:navMail:1:navMail_item::IBehaviorListener:0:',null,null,
  
 
 function() {return Wicket.$('navMail__itemb') != 
   
 null;}.bind(this));return 
 
 !wcall;spanAjaxLink 2/span/a/li
 /ul...

 I'd like to formate this url as well but I don't know how. I've already 
 tried to mount Pages with parameters and to overwrite the href in the 
 onComponentTag() methode. But it didn't help!
 Could you please give me a clue!

 Thanks,
 Liz

Re: isVisible Problem

2008-09-25 Thread Erik van Oosten
Overriding isVisible can be quite evil. The problem is that it is called 
also in the detach phase. When isVisible depends on the model, your 
model is often reloaded!


There are 2 solutions:
- within method isVisible cache the result, clear the cache in the onDetach.
- (recommended) don't override isVisible but do:

@Override void onBeforeRender() {
 setVisible(.);
}
@Override boolean callOnBeforeRenderIfNotVisible() {
 return true;
}

Regards,
   Erik.

Markus Haspl wrote:

hi,

i have a WebPage with a lot of Panels on it. Each Panel overrides the
isVisible() method because not every Panel should be displayed on the page.
The Problem is: the constructor of each Panel (also which aren't visible) is
called and i have a lot of load on the server. So i tried to make a init()
method (add's all components to the panel) wich is only called when
isVisible==true, but then i get the errors that it couldn't find the
components on panelXX.

thanks
markus

  


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



Re: Empty PageParametyers when using HybridUrlCodingStrategy

2008-09-25 Thread Erik van Oosten
You should use one of the other HybridUrlCoding strategies. E.g. the 
IndexedHybridUrlCodingStrategy.


If you need an MixedParamHybridUrlCodingStrategy, I can mail it to the list.

Regards,
   Erik.

itayh wrote:

Hi,

I am using HybridUrlCodingStrategy for my url's (I need that the mount point
will preserved even after invoking listener interfaces).

I am creating IFrames using InlineFrame class. 
In order that the url of the IFrame will be what I want I do:

PageParameters params = new PageParameters();
params.add(url, url);
InlineFrame myFrame = new InlineFrame(MyFrame, this.getPageMap(),
MyFrame.class, params);
myFrame .add(new AttributeModifier(src, new
Model((Serializable)/myapp/iframe/MyFrame)));

In my Application I have:
mount(new HybridUrlCodingStrategy(/iframe/MyFrame, MyFrame.class));

The thing is that in MyFrame class the PageParameters are empty.
I am not  sure how to use
HybridUrlCodingStrategy.PAGE_PARAMETERS_META_DATA_KEY and where, or maybe I
don't need to set src directly and there is another way to do it?

Anyone?

Thanks
  


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



Re: Need help fixing bug #1816

2008-09-24 Thread Erik van Oosten

Hello Gili,

It is maybe best if you checkout the code from svn and modify the code 
yourself. When you're satisfied with the changes, you can attach a patch 
to the issue. Issues with patches are more likely to be solved then others.


Regards,
Erik.


cowwoc schreef:

Hi,

I spent a few hours tracking down the cause of
https://issues.apache.org/jira/browse/WICKET-1816 but now I need someone
from the Wicket team to help me fix it.

Can someone please fix the lines of code I mention in the report and then
send me back a patched version for testing?

To be clear: this bug affects *all* platforms. Tomcat fails silently, which
is even worse.

Gili
  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/

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



Re: Transactions..... again!

2008-09-19 Thread Erik van Oosten

Ryan,

Here is how I do this with Spring: 
http://day-to-day-stuff.blogspot.com/2008/08/java-transaction-boundary-tricks.html

Its not as pretty as Salve's @Transactional but just as effective.

Regards,
Erik.


Ryan wrote:

Aside from these ideas, has anyone used a different method for starting
transactions inside of wicket when needed?

  



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



Re: Localized string retrieved with a warning message

2008-09-18 Thread Erik van Oosten


Are you sure that message is coming from this code? This code looks 
quite alright to me (though you could replace StringResourceModel(x, 
this, null) with ResourceModel(x), and change the parameter type to 
IModelString).


Regards,
   Erik.


Azzeddine Daddah wrote:

Thanks Michael,

I did but the warnings are still displayed.

private void addLinks() {
addLink(home, new StringResourceModel(navigationbar.menu.home,
this, null), HomePage.class);
addLink(numberPool, new
StringResourceModel(navigationbar.menu.numberpool, this, null),
NumberPoolPage.class);
addLink(numberPoolLog, new
StringResourceModel(navigationbar.menu.numberpoollog, this, null),
NumberPoolLogPage.class);
addLink(defragment, new
StringResourceModel(navigationbar.menu.defragment, this, null),
DefragmentPage.class);
addLink(search, new
StringResourceModel(navigationbar.menu.search, this, null),
SearchPage.class);
}

private void addLink(String id, StringResourceModel model, final Class?
extends Page pageClass) {
BookmarkablePageLink link = new BookmarkablePageLink(id, pageClass);
link.add(new AttributeModifier(class, true, new
AbstractReadOnlyModel() {
private static final long serialVersionUID = 1L;

@Override
public Object getObject() {
String currentPageName = pageClass.getName();
String parentPageName  = getPage().getClass().getName();
return StringUtils.equals(currentPageName, parentPageName) ?
current_page_item : AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
}

}));
link.add(new Label(title, model));
add(link);
}

Gr. Azzeddine

  



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



Re: error handling and redirect (was: how to logout and redirect)

2008-09-18 Thread Erik van Oosten
It mainly depends on whether you would like to allow a refresh, and how 
sensitive you are to nice URLs. The key difference is that the user will 
see that he/she lands on another URL when you called setRedirect(true). 
After that a refresh will reload the error page. With redirect set to 
false, the user can try the original URL again.


Regards,
   Erik.

m_salman wrote:

Thanks for your reply.

Since I don't have much understanding of these things -- I am a kicking and
screaming web GUI developer, can you please tell me if I should use the
redirect command for my error handling code.

Really appreciate your help.



jwcarman wrote:
  

The setRedirect(true) call tells Wicket to use the Servlet API to
issue a redirect to go to the response page as opposed to just
streaming it back as the response to the current request.





  



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



Re: Wicket, HTML or XHTML ?

2008-09-11 Thread Erik van Oosten
For Wicket the doctype is not needed, so do what you like. Just remember
to keep it in XML syntax. There is only one ceavat: you should always
write div wicket:id=.../div instead of div wicket:id=.../,
Wicket ignores the XML definition that specifies that these should be
treated as semantically equivalent.

Regards,
Erik.


[EMAIL PROTECTED] wrote:
 Hello,
 As a Wicket beginner, I was wondering if there are any contra-indication 
 to generate some HTML 4.01 Strict instead of any XHTML 1.0 version 
 (transitionnal or strict) ? 
 I tried to simply add an HTML 4.01 strict doctype to my html files, and it 
 seems to work fine (thought in development mode I have in the source the 
 xmlns:wicket in the body tag and all of the Wicket XHTML tags - going to 
 deployement mode an they disappear)
 Is there anything I must take care of ? Wicket use a namespace server-side 
 so... ?
 Best regards,
 P. Goiffon
   

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



[jira] Commented: (WICKET-1349) Wicket Ajax response generates a ^ character in the javascript code

2008-09-09 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12629479#action_12629479
 ] 

Erik van Oosten commented on WICKET-1349:
-

Note, the code above will also require changes in the ajax code. The ajax code 
currently only retrieves the first text node for every type of response, with 
the escaping from above it should get all text nodes and concatenate them (like 
a XPath query would do). Actually, you should *always* get all text nodes as 
most XML DOM parsers (if not, all) do not guarantee that they put all 
consecutive text in a single text node.

The fix above is not complete, it should also give back another encoding string 
(method getEncodingName()).

 Wicket Ajax response generates a ^ character in the javascript code
 -

 Key: WICKET-1349
 URL: https://issues.apache.org/jira/browse/WICKET-1349
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.1
 Environment: IE6 and IE7
Reporter: Wen Tong Allan
Assignee: Igor Vaynberg

 I have a page that uses AjaxFallbackDefaultDataTable (using 
 SortableDataProvider ). The markup contains user-define javascript that I 
 added. When I try to do some action (delete row) with the table, the page 
 doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it 
 displays:
 ERROR: Error while parsing response: Object required
 INFO: Invoking post-call handler(s)...
 INFO: invoking failure handler(s)...
 I also noticed that the user-define javascript that was returned by the ajax 
 debugger was appended by ^. (See javascript below):
 // enable disable button.
 function setButtonState() {
 var formObj = 
 eval(document.getElementsByName(contactListForm)[0]^);
 var state = anyChecked(formObj);
 
 document.getElementsByName(deleteContactsButton)[0]^.disabled = !state;
 
 document.getElementsByName(newContactGroupButton)[0]^.disabled = !state;
 document.getElementsByName(newEventButton)[0]^.disabled 
 = !state;
 }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Commented: (WICKET-847) setResponsePage redirects to wrong url

2008-09-04 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12628320#action_12628320
 ] 

Erik van Oosten commented on WICKET-847:


I got bitten by this as well (with 1.4-m3).

The failing combination is: Tomcat and IE (6 or 7).

Firefox correctly interprets the ./ as  so its okay to use Firefox + Tomcat.
Jetty converts ./ to , so its okay to use any borwser on Jetty.

My patch is:

In BookmarkablePageRequestTarget:
public void respond(RequestCycle requestCycle)
{
if (pageClassRef != null  pageClassRef.get() != null)
{
if (requestCycle.isRedirect())
{
IRequestCycleProcessor processor = 
requestCycle.getProcessor();
String redirectUrl = 
processor.getRequestCodingStrategy()
.encode(requestCycle, this)
.toString();
// START OF PATCH
if (redirectUrl.startsWith(./)) {
redirectUrl = redirectUrl.substring(2);
}
// END OF PATCH
requestCycle.getResponse().redirect(redirectUrl);
}
else
{
// Let the page render itself
getPage(requestCycle).renderPage();
}
}
}


And in RedirectRequestTarget:
public void respond(RequestCycle requestCycle)
{
Response response = requestCycle.getResponse();
response.reset();
if (redirectUrl.startsWith(/))
{
RequestContext rc = RequestContext.get();
if (rc.isPortletRequest()  
((PortletRequestContext)rc).isEmbedded())
{
response.redirect(redirectUrl);
}
else
{
String location = RequestCycle.get()
.getRequest()
.getRelativePathPrefixToContextRoot() +
this.redirectUrl.substring(1);
// START OF PATCH
if (location.startsWith(./)) {
location = location.substring(2);
}
// END OF PATCH
response.redirect(location);
}
}
else if (redirectUrl.startsWith(http://;) || 
redirectUrl.startsWith(https://;))
{
response.redirect(redirectUrl);
}
else
{
response.redirect(RequestCycle.get()
.getRequest()
.getRelativePathPrefixToWicketHandler() +
redirectUrl);
}
}


 setResponsePage redirects to wrong url
 --

 Key: WICKET-847
 URL: https://issues.apache.org/jira/browse/WICKET-847
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.0-beta2
Reporter: Andrew Klochkov
Assignee: Alastair Maw
 Fix For: 1.3.5

 Attachments: wicket-quickstart.tar.gz


 When I do setResponsePage(MyHomePage.class) IE tries to show me 
 my.site.com/./ url and gets 404 response. 
 Firefox just shows my.site.com without any troubles. I'm using wicket 
 1.3-beta2 and WicketFilter mapped to /*. 
 It's being reproduced under tomcat only, jetty works fine. My tomcat version 
 is 5.5.17. 
 Quickstart project which reproduces the bug is attached.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



[jira] Issue Comment Edited: (WICKET-847) setResponsePage redirects to wrong url

2008-09-04 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12628320#action_12628320
 ] 

erikvanoosten edited comment on WICKET-847 at 9/4/08 5:03 AM:


I got bitten by this as well (with 1.4-m3).

The failing combination is: Tomcat and IE (6 or 7).

Firefox correctly interprets the ./ as  so its okay to use Firefox + Tomcat.
Jetty converts ./ to , so its okay to use any borwser on Jetty.

My workaround was to patch these two Wicket core files (I can confirm it works):

BookmarkablePageRequestTarget:
---8--
public void respond(RequestCycle requestCycle)
{
if (pageClassRef != null  pageClassRef.get() != null)
{
if (requestCycle.isRedirect())
{
IRequestCycleProcessor processor = 
requestCycle.getProcessor();
String redirectUrl = 
processor.getRequestCodingStrategy()
.encode(requestCycle, this)
.toString();
// START OF PATCH
if (redirectUrl.startsWith(./)) {
redirectUrl = redirectUrl.substring(2);
}
// END OF PATCH
requestCycle.getResponse().redirect(redirectUrl);
}
else
{
// Let the page render itself
getPage(requestCycle).renderPage();
}
}
}
---8--


RedirectRequestTarget:
---8--
public void respond(RequestCycle requestCycle)
{
Response response = requestCycle.getResponse();
response.reset();
if (redirectUrl.startsWith(/))
{
RequestContext rc = RequestContext.get();
if (rc.isPortletRequest()  
((PortletRequestContext)rc).isEmbedded())
{
response.redirect(redirectUrl);
}
else
{
String location = RequestCycle.get()
.getRequest()
.getRelativePathPrefixToContextRoot() +
this.redirectUrl.substring(1);
// START OF PATCH
if (location.startsWith(./)) {
location = location.substring(2);
}
// END OF PATCH
response.redirect(location);
}
}
else if (redirectUrl.startsWith(http://;) || 
redirectUrl.startsWith(https://;))
{
response.redirect(redirectUrl);
}
else
{
response.redirect(RequestCycle.get()
.getRequest()
.getRelativePathPrefixToWicketHandler() +
redirectUrl);
}
}
---8--


  was (Author: erikvanoosten):
I got bitten by this as well (with 1.4-m3).

The failing combination is: Tomcat and IE (6 or 7).

Firefox correctly interprets the ./ as  so its okay to use Firefox + Tomcat.
Jetty converts ./ to , so its okay to use any borwser on Jetty.

My patch is:

In BookmarkablePageRequestTarget:
public void respond(RequestCycle requestCycle)
{
if (pageClassRef != null  pageClassRef.get() != null)
{
if (requestCycle.isRedirect())
{
IRequestCycleProcessor processor = 
requestCycle.getProcessor();
String redirectUrl = 
processor.getRequestCodingStrategy()
.encode(requestCycle, this)
.toString();
// START OF PATCH
if (redirectUrl.startsWith(./)) {
redirectUrl = redirectUrl.substring(2);
}
// END OF PATCH
requestCycle.getResponse().redirect(redirectUrl);
}
else
{
// Let the page render itself
getPage(requestCycle).renderPage();
}
}
}


And in RedirectRequestTarget:
public void respond(RequestCycle requestCycle)
{
Response response = requestCycle.getResponse();
response.reset();
if (redirectUrl.startsWith(/))
{
 

[jira] Issue Comment Edited: (WICKET-847) setResponsePage redirects to wrong url

2008-09-04 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12628320#action_12628320
 ] 

erikvanoosten edited comment on WICKET-847 at 9/4/08 5:03 AM:


I got bitten by this as well (with 1.4-m3).

The failing combination is: Tomcat and IE (6 or 7).

Firefox correctly interprets the ./ as  so its okay to use Firefox + Tomcat.
Jetty converts ./ to , so its okay to use any borwser on Jetty.

My workaround was to patch these two Wicket core files (I can confirm it works 
when redirecting to the home page):

BookmarkablePageRequestTarget:
---8--
public void respond(RequestCycle requestCycle)
{
if (pageClassRef != null  pageClassRef.get() != null)
{
if (requestCycle.isRedirect())
{
IRequestCycleProcessor processor = 
requestCycle.getProcessor();
String redirectUrl = 
processor.getRequestCodingStrategy()
.encode(requestCycle, this)
.toString();
// START OF PATCH
if (redirectUrl.startsWith(./)) {
redirectUrl = redirectUrl.substring(2);
}
// END OF PATCH
requestCycle.getResponse().redirect(redirectUrl);
}
else
{
// Let the page render itself
getPage(requestCycle).renderPage();
}
}
}
---8--


RedirectRequestTarget:
---8--
public void respond(RequestCycle requestCycle)
{
Response response = requestCycle.getResponse();
response.reset();
if (redirectUrl.startsWith(/))
{
RequestContext rc = RequestContext.get();
if (rc.isPortletRequest()  
((PortletRequestContext)rc).isEmbedded())
{
response.redirect(redirectUrl);
}
else
{
String location = RequestCycle.get()
.getRequest()
.getRelativePathPrefixToContextRoot() +
this.redirectUrl.substring(1);
// START OF PATCH
if (location.startsWith(./)) {
location = location.substring(2);
}
// END OF PATCH
response.redirect(location);
}
}
else if (redirectUrl.startsWith(http://;) || 
redirectUrl.startsWith(https://;))
{
response.redirect(redirectUrl);
}
else
{
response.redirect(RequestCycle.get()
.getRequest()
.getRelativePathPrefixToWicketHandler() +
redirectUrl);
}
}
---8--


  was (Author: erikvanoosten):
I got bitten by this as well (with 1.4-m3).

The failing combination is: Tomcat and IE (6 or 7).

Firefox correctly interprets the ./ as  so its okay to use Firefox + Tomcat.
Jetty converts ./ to , so its okay to use any borwser on Jetty.

My workaround was to patch these two Wicket core files (I can confirm it works):

BookmarkablePageRequestTarget:
---8--
public void respond(RequestCycle requestCycle)
{
if (pageClassRef != null  pageClassRef.get() != null)
{
if (requestCycle.isRedirect())
{
IRequestCycleProcessor processor = 
requestCycle.getProcessor();
String redirectUrl = 
processor.getRequestCodingStrategy()
.encode(requestCycle, this)
.toString();
// START OF PATCH
if (redirectUrl.startsWith(./)) {
redirectUrl = redirectUrl.substring(2);
}
// END OF PATCH
requestCycle.getResponse().redirect(redirectUrl);
}
else
{
// Let the page render itself
getPage(requestCycle).renderPage();
}
}
}
---8--


RedirectRequestTarget:
---8--
public void 

[jira] Commented: (WICKET-1449) './' appended to URL causes HTTP 404 in Internet Explorer (using root context)

2008-09-04 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-1449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12628321#action_12628321
 ] 

Erik van Oosten commented on WICKET-1449:
-

Duplicate of WICKET-847.

I would rate this issue as a blocker as well.

 './' appended to URL causes HTTP 404 in Internet Explorer (using root context)
 --

 Key: WICKET-1449
 URL: https://issues.apache.org/jira/browse/WICKET-1449
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.2
 Environment: Wicket 1.3.2 
 JBoss 4.0/Jetty 6.1.7 
 JDK 1.6.0_03
Reporter: Will Hoover
Assignee: Alastair Maw
 Fix For: 1.3.5

   Original Estimate: 72h
  Remaining Estimate: 72h

 SYNOPSIS:
 1) Web application is using the root context (/)
 1) form.add(new Button(mybutton));
 2) Button is clicked on any WebPage that is NOT MOUNTED
 ISSUE:
 WebRequestCodingStrategy.encode appends './' to the URL. The page is 
 redirected to http://www.mysite.com/./; It works fine in Firefox and Opera, 
 but in IE an HTTP 404 ('.' page is not found) is rendered. 
 Mounting the home page to something like '/home' solved the problem ('./' is 
 not appended, but this causes a redirect every time a use hits the page).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: Assert that all models are detached at the end of the request?

2008-08-31 Thread Erik van Oosten

Eelco is on http://chillenious.wordpress.com.
The link you mentioned http://day-to-day-stuff.blogspot.com/ is from 
your's truly.


Regards,
Erik.

Kaspar Fischer wrote:

Matijn, thank you for your hint.

I searched on your blog, http://martijndashorst.com/blog/, and Eelco's,
http://day-to-day-stuff.blogspot.com/, but must have searched for the 
wrong

thing (transient, entity, SerializableChecker)...





--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/


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



[jira] Commented: (WICKET-1349) Wicket Ajax response generates a ^ character in the javascript code

2008-08-25 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-1349?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12625300#action_12625300
 ] 

Erik van Oosten commented on WICKET-1349:
-

We are using AjaxRequestTarget while at the client side we use jquery only and 
therefore also have problems with the '^' in the raw stream.

By replacing the AjaxRequestTarget#encode method with the following, you get 
proper XML escaping.

/**
 * Encodes a string so it is safe to use inside CDATA blocks
 *
 * @param str
 * @return encoded string
 */
protected String encode(String str)
{
if (str == null)
{
return null;
}

return Strings.replaceAll(str, ], ]]]![CDATA[).toString();
}


 Wicket Ajax response generates a ^ character in the javascript code
 -

 Key: WICKET-1349
 URL: https://issues.apache.org/jira/browse/WICKET-1349
 Project: Wicket
  Issue Type: Bug
  Components: wicket
Affects Versions: 1.3.1
 Environment: IE6 and IE7
Reporter: Wen Tong Allan
Assignee: Igor Vaynberg

 I have a page that uses AjaxFallbackDefaultDataTable (using 
 SortableDataProvider ). The markup contains user-define javascript that I 
 added. When I try to do some action (delete row) with the table, the page 
 doesn't refresh in IE6 and IE7. I checked the Wicket Ajax Debugger and it 
 displays:
 ERROR: Error while parsing response: Object required
 INFO: Invoking post-call handler(s)...
 INFO: invoking failure handler(s)...
 I also noticed that the user-define javascript that was returned by the ajax 
 debugger was appended by ^. (See javascript below):
 // enable disable button.
 function setButtonState() {
 var formObj = 
 eval(document.getElementsByName(contactListForm)[0]^);
 var state = anyChecked(formObj);
 
 document.getElementsByName(deleteContactsButton)[0]^.disabled = !state;
 
 document.getElementsByName(newContactGroupButton)[0]^.disabled = !state;
 document.getElementsByName(newEventButton)[0]^.disabled 
 = !state;
 }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: Changing components before rendering

2008-08-24 Thread Erik van Oosten

There is.

As you noticed you can change any property you like /before/ the render 
phase.


Another way to put metadata on components is annotations. This is for 
example used for security type of things. You can intercept the creation 
and rendering of each component in Wicket (in your application's init 
call getSecuritySettings().setAuthorizationStrategy(...)). The strategy 
object you pass here can analyze the annotation on the component and 
(dis)allow creation, rendering and enabled state (what enabled means is 
up to the component). Wicket-auth-roles and wicket-auth-roles-example 
are a good showcase.


Regards,
   Erik.


tetsuo wrote:

Hi,

What I'm trying to do is to change components properties (visible/hidden,
editable/read-only, etc.) depending on some external context (authorization,
model state, etc.), but I don't want to have to change their properties on
events. Instead, I'd like to modularize these kinds of modifications and add
it to components.

I tried to do this with IBehavior implementations, but it didn't work
straight forward, because you can't modify some properties while rendering
the component (wicket throws an exception).

What I did for this to work was to add an IBehavior to the Page, which
iterates over the component tree, modifying what is needed. To be able to
add modifications to components themselves, I created another interface
(IComponentModifier), which must be added as an IBehavior (implementations
must implement both interfaces). This is because that was the only way I've
found to add some sort of metadata to components. The IBehavior
implementation would be 'NoOp' in most cases. The code is as follows:


public interface IComponentModifier {
void modify(Component component);
}
public abstract class AbstractComponentModifier extends AbstractBehavior
implements IComponentModifier {
public abstract void modify(Component component);
}
public class ChildrenModifier extends AbstractBehavior {
final String[] roles;
public ChildrenModifier(String... roles) {
this.roles = Arrays.copyOf(roles, roles.length);
}
@Override
public void beforeRender(Component component) {
super.beforeRender(component);
processChild(component);
}
private void processChild(Component component) {
for (IBehavior b : component.getBehaviors())
if (b instanceof IComponentModifier)
((IComponentModifier) b).modify(component);
if (component instanceof MarkupContainer)
for (Component child : IteratorIterable.get(((MarkupContainer)
component).iterator()))
processChild(child);
}
}

public class HomePage extends WebPage {
String text = blablabla;
private final Component label;
public HomePage(final PageParameters parameters) {
*add(new ChildrenModifier());*

label = new Label(hidden, new PropertyModelString(this,
text)).add(*new RoleBasedModifier(ADMIN)*);
add(new Label(message, If you see this message wicket is properly
configured and running!));
FormHomePage form = new FormHomePage(form, new
CompoundPropertyModelHomePage(this));
form.add(new TextFieldString(text));
form.add(label);
add(form);
}
class RoleBasedModifier extends AbstractComponentModifier {
protected final SetString roles;
public RoleBasedModifier(String... roles) {
this.roles = new HashSetString(Arrays.asList(roles));
}
@Override
public void modify(Component component) {
for (String role : roles)
if (((WebRequest)
getRequest()).getHttpServletRequest().isUserInRole(role))
component.setVisibilityAllowed(true);
component.setVisibilityAllowed(false);
}
}
}

Is there another (better) approach?

Tetsuo

  



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



Re: Custom PageMap

2008-08-21 Thread Erik van Oosten

 The data is not serializable and is needed in several pages as a part
of one
transaction

- Not serializable:
Well that is a hick up. This of course also means that you can not do
clustering. I would put the data directly in the HTTP session, or in
your own sub class of Wicket's WebSession. I think the page map is no
longer available (though perhaps that depends on the page store you select).

- Part of one transaction.
Do you really mean like JTA transaction? Or are you talking about a
conversation (which was what I assumed).
Having multiple requests in one (JTA) transaction is not very common. I
guess if this is the case a reference to the transaction is part of your
non-serializable data.
If you did mean conversation/wizard kind of data, then the earlier
advice holds.

Good luck,
Erik.


John Patterson wrote:
 The data is not serializable and is needed in several pages as a part of one
 transaction


 Erik van Oosten wrote:
   
 John, if you keep your conversation data in the component (as a java 
 field), and you work with listeners in that component (e.g. with a 
 Link), that data is available in the listener (e.g. Link's onClick 
 callback method).

 While coding the component you should not worry about where that data is 
 stored between requests. Of course you can influence this by choosing a 
 page store during application initialization. The default however, is 
 mostly the best choice.

 Regards,
  Erik.



 John Patterson wrote:
 
 Hi, I need to store some kind of multi-request transaction data somewhere
 and
 I guess that the PageMap is a better place than the session.  I don't see
 much talk of custom page maps on the list.  Are they still a recommended
 way
 to store things for a browser window?

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



 

   

-- 

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: I have some Wicket based opportunities/jobs if you're interested.

2008-08-21 Thread Erik van Oosten
Cristi Manole wrote:
 Please share more details like when the project is planned to start, how
 many hours per day, etc.
   

But not on this list please.

Regards,
Erik.



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



Re: Severe log: no Header Container was found but components..

2008-08-20 Thread Erik van Oosten

Hi Serkan,

I have this log all the time as well. I have no idea what it is suppose 
to tell you as the message is clearly not applicable and my application 
runs fine.

Anyway, if you run in production mode, the log message is gone.

Regards,
Erik.


Serkan Camurcuoglu wrote:

Hi all,
I need to change the direction of the html file to rtl if the logged 
in user's locale is arabic. I followed the method in this previous 
message 
http://www.nabble.com/How-can-I-switch-page-direction-(LTR-RTL)--td13747743.html#a14025235 
. It works fine, but I'm constantly getting the following log:


SEVERE: You probably forgot to add a body or header tag to your 
markup since no Header Container was
found but components where found which want to write to the head 
section.
link rel=stylesheet type=text/css 
href=../stylesheets/generic.css /

script type=text/javascript src=../javascript/util.js/script

because I have

add(HeaderContributor.forCss(stylesheets/generic.css));
add(HeaderContributor.forJavaScript(javascript/util.js));


in my page code, right after I add the html markup container. Actually 
this log does not seem to cause any error, but I really would like to 
get rid of it. Does anybody have any idea?


Best regards,

SerkanC




--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/

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



Re: Order of pageparameters for bookmarkablepagelink?

2008-08-20 Thread Erik van Oosten

Hi Nino,

It all depends on the url encoder you use. There are several. See 
section 14.2.2 of Wicket in Action, or browse starting from the javadoc 
of WebApplication#mount(IRequestTargetUrlCodingStrategy)[1]. The default 
I believe is to use BookmarkablePageRequestTargetUrlCodingStrategy, but 
with the given method you can mount others.


Regards,
   Erik.

[1] 
http://www.ddpoker.com/javadoc/wicket/1.4-m2/org/apache/wicket/protocol/http/WebApplication.html#mount(org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy)



Nino Saturnino Martinez Vazquez Wael wrote:
So It seems that you cannot control the order of page parameters for 
bookmarkablepagelinks can this be true?


What I mean are that I would like to have and url something like this 
(and remain stable that way):


mydom.com/mypage/cache/true/product/id  , something like that it'll 
not work for me if parameters are switched like so : 
mydom.com/mypage/product/id/cache/true



I instantiate my links like so:

pageparameters.add(cache, true);
pageparameters.add(cache,true);

   BookmarkablePageLink link = new 
BookmarkablePageLink(linkId, cls,pageparameters);




--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/

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



Re: url after form submit with redirect

2008-08-20 Thread Erik van Oosten

Miro,

In Nabble, please do not edit your message after you've send it. That 
way you're message appears twice.


Wicket will always use the mount path of the page you are forwarding to, 
that is, if you called setResponsePage. You can also look into mounting 
with a HybrodUrlEncoder.


Regards,
   Erik.


miro wrote:

After submit a form with redirect set to true , the wicket generates  its own
url and not the mountpath.
Is there a way to avoid this ? 
  



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



Re: Wicket merchandise?

2008-08-20 Thread Erik van Oosten

I want the mug! Perhaps the t-shirt too.


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



Re: Custom PageMap

2008-08-20 Thread Erik van Oosten
John, if you keep your conversation data in the component (as a java 
field), and you work with listeners in that component (e.g. with a 
Link), that data is available in the listener (e.g. Link's onClick 
callback method).


While coding the component you should not worry about where that data is 
stored between requests. Of course you can influence this by choosing a 
page store during application initialization. The default however, is 
mostly the best choice.


Regards,
Erik.



John Patterson wrote:

Hi, I need to store some kind of multi-request transaction data somewhere and
I guess that the PageMap is a better place than the session.  I don't see
much talk of custom page maps on the list.  Are they still a recommended way
to store things for a browser window?

John
  



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



Re: ResourceModel vs. getLocalizer

2008-08-19 Thread Erik van Oosten
There is a big difference, the model variant will evaluate during the
render phase. You can not use localization in the constructor of your
component, you can however safely construct a ResourceModel (but not
call getObject on it).

In general, I would use localizer when you need direct access to a
message from code. This should be rare though, most message can be
placed with the wicket:message element.

Regards,
Erik.


Timo Rantalaiho wrote:
 On Mon, 18 Aug 2008, lesterburlap wrote:
   
 new ResourceModel(my.resource.key).getObject().toString();
 or
 getLocalizer().getString(my.resource.key, MyComponent.this);
 

 Isn't the latter same as 

   Component.getString(my.resource.key);

 ?

 And ResourceModel can typically be used directly as the 
 model of the Label displaying the String

   add(new Label(foo, new ResourceModel(my.resource.key)));

   
 I've been using getLocalizer almost everywhere, and only using ResourceModel
 when I'm trying to get a property string during Component construction (to
 avoid those getLocalizer warnings).  But I'm not really sure if my reasoning
 is good...
 

 I wouldn't think that there is any difference. If you are 
 worried about performance, try profiling the application.

 Best wishes,
 Timo
   

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Pretty URLs depending on a Page's state (not params)

2008-08-13 Thread Erik van Oosten

Hi,

You can suppress the version number in the URL. Doing so will make the 
encoder always take the last version of the page (or create a new one 
when it is not present).


More details: 
http://www.nabble.com/More-on-wicket-url-stratergy-td18212748.html#a18273996


Regards,
   Erik.


pixologe wrote:

Martijn Dashorst wrote:
  

mount your page with hybridurlcodingstrategy




thanks for pointing this out... i've seen this one before, but somehow
completely  misunderstood how it is supposed to work :-/

still, it is not exactly what i had in mind, since it attaches a version
number to every url and AFAIK having the very same content accessible
through different URLs is something our beloved search engine sees as a
reason to decrease a page's rating...

But as I thought about it, I realized that it is just not possible to save a
page state without passing an identifier in the url... this would destroy
support for conflictless multiple browser windows within a session.

Thus, I will either have to go for one of the mentioned solutions.

Thanks for your input, it was very helpful :)




  



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



Re: Remove underline in OrderByBorder link

2008-08-07 Thread Erik van Oosten
I think his problem is how to set add the class attribute. In addition,
he probably want another class for each sort direction.

 Erik.

[EMAIL PROTECTED] wrote:
 td.mycss a { text-decoration: none;}

 -Igor


 On 8/6/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   
 Erik:

 Thx, I agree.but how do I set the CSS for the link in the border and
 have that CSS changed when the sort changes?   By default the link has a
 void CSS while the Border CSS manages the sort changes, and I am not sure
 how to manage the link CSS.  The OrderByBorder hieracharchy is:

 Border (with CSS modifier)
   --link (void CSS modifier)

 Which renders as
td class=myCSS(either asc, desc, or normal)
  a class=
  .

 I haven't found an easy way to get to and manager the link part.

 If you have any ideas, let me know.

 Thx again,

 Joe C

 
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Questions about wicket features

2008-08-07 Thread Erik van Oosten

Arthur Ahiceh wrote:
 4. Yes. See mailing list for earlier answers. There are more hardening 
 options such as encrypting urls.
   

 Even encrypting the urls Wicket is vulnerable to CSRF because the key used
 to encrypt is shared by all users of application. Wicket is an extensible
 framework where you to add some new functionallity easily but it doesn't
 provide any secure solution by default to protect you against CSRF attacks!
Correct indeed. Also note, I did not use the word 'easily' :)

Regards,
Erik.

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Questions about wicket features

2008-08-07 Thread Erik van Oosten
Arthur Ahiceh wrote:
 ok! you have not used the word easily but only saying There are more
 hardening options such as encrypting urls it only seems that encrypting
 urls  the problem is solved and it is not the case! The user has to
 implement a custom security factory, one different than provided by Wicket
 (SunJceCrypt), to resolve CSRF.
   
Come on, I did not (intend to) suggest that URL encryption solves CSRF
attacks. It is *another* hardening strategy.

Erik.


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



Re: Questions about wicket features

2008-08-07 Thread Erik van Oosten
Arthur Ahiceh write:
 Erik, if you did not mean that I feel it, I understood that. ;-)

 Arthur
   
Okay, thanks. (I didn't.)


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



Re: Questions about wicket features

2008-08-07 Thread Erik van Oosten

Johan Compagner wrote:
 ...Which is pretty random. Only if all users would go over the same path
 always to the same page then the id could be guessed.
   
Actually, I do not think that is completely far fetched. In my banking
applications I mostly follow the same path. In some applications there
may be a high change that the guessed path is correct.
Then again, it is easily fixed by starting at a random page version number.

In addition, many Wicket applications use bookmarkable pages. Easily
avoided if you're worried about CSRF of course.

Regards,
Erik.

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Questions about wicket features

2008-08-07 Thread Erik van Oosten
I was talking about the case where you are silly enough to code an
action in the constructor of a bookmarkable page. (Really, I have seen
it happen.)

Regards,
Erik.


Martijn Dashorst wrote:
 but all actions on bookmarkable pages have session relative urls,
 which makes guessing the correct URL still problematic.

 Martijn

   
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Remove underline in OrderByBorder link

2008-08-06 Thread Erik van Oosten

Best approach IMHO would be through css.

Regards,
   Erik.


[EMAIL PROTECTED] wrote:

I was wondering if there was an easy way to remove the underline for the
link in the OrderByBorder component.

More generally, can someone point me in the right direction to change the
style and behavior for the link (a tag) in the OrderByBorder?  I am trying
to:

1.  remove the underline
2.  add a sort icon for asc and desc sorts

I have started down the path of extending the OrderByBorder, but am not sure
if this is the best approach.   Any guidance would be great.

Thx,

Joe C

  



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



Re: HybridURLs

2008-08-01 Thread Erik van Oosten
 what i now want to add is to pass additional state

You can not do this with a BookmarkablePageLink. The trick is to create
a Link with in the onClick something like:

// note the variant that accepts a Class argument does not work:
setResponsePage(new Page(), pageParameters)
// the redirect will change the URL to whatever is mounted for the
linked to page
setRedirect(true)

Regards,
Erik.


Uwe Schäfer schreef:
 Martijn Dashorst schrieb:

 you have to encode the necessary state yourself into the page
 parameters. There is no way for Wicket to be able how to serialize the
 state in the URL in some magic way.

 kind of misunderstanding here. i dont want or need the additional
 state bookmarkable.
 all i want is to link to a stateful page and have some parameters set.

 like /foo/document/21.wicket-0

 this is - in fact - what wicket does internally, when navigating on
 the page. it is just that i do not see a possibility to create links
 like that from pagelink or bookmarkablepagelink.

 just to be sure that i make myself clear (i´m not that fluent in
 english), i´ll describe the scenario in detail:

 - i have a list/detail page setup.
 - the list should link to detail-page using a bookmarkable link.
 - if this link is triggered from another session or after timeout, it
 should be possible to show the document according to the given
 parameters.

 (all fine till here with bookmarkablelink  hybridUrlStrategy only)

 - what i now want to add is to pass additional state (from the List
 page) to the detail page, that can safely be lost when using the
 bookmark from outside the session. think of back to my search or smth.

 i was thinking this should be possible, because wicket does this
 already when using a simple link on the detail page, for instance.

 thanks uwe


-- 

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Asynchronous Components

2008-07-23 Thread Erik van Oosten

Hi Sebastian,

If you intend to use Wicket's default detachable models to get data from 
those services, they will be called sequentially. So those are out.  I 
see 2 options:


- In the panel constructor get the data in parallel threads through 
standard java 5 constructs (dump all your Callables in a ExecutorService 
and when that is done call get() on the returned Futures). When you have 
the data continue as normal. This approach is a bit easier then the next 
option, but only works with stateless pages (unless you known the data 
is not going to change soon anyway).


- Write your own model (extend LoadableDetachableModel) that in the 
constructor will start a new thread to get the data (put a Callable in 
an ExecutorService and store the Future). Method load() should block 
until the thread is done (simply call get() on the Future). The base 
class will clear the data upon detach. Unfortunately, there is no 
onAttach() method that Wicket calls when the model data is needed again. 
To remedy this, you could call an onAttach() method yourself from 
onBeforeRender() in the component that uses the model. The onAttach 
method should do nothing when the data is already there, or a Future is 
already present (which means the data is already being retrieved).


(I assume you have read a book on concurrency. If not you should, for 
example Java Threads.)


Regards,
   Erik.


Sebastian wrote:

Hi,

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


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


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


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


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


Thanks for any hints and thoughts in advance,

Seb


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




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



Re: Asynchronous Components

2008-07-23 Thread Erik van Oosten

O, I forgot, be aware that Wicket does not really tolerate pages that take
too long to render. Make sure that the page rendering does not take more
then 60 seconds in total. (Luckily the Future#get method accepts a timeout
argument.)


Erik van Oosten wrote:
 
 ...dump all your Callables in a ExecutorService 
 and when that is done call get() on the returned Futures...
 

Regards,
 Erik.

-- 
View this message in context: 
http://www.nabble.com/Asynchronous-Components-tp18598968p18607531.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Why isn't the bookmarkable url kept when appending ?wicket:interface=:n:myPage::ILinkListener:: etc?

2008-07-22 Thread Erik van Oosten
Perhaps my non versioned HybridUrlEncoding strategy is something for you:

http://www.nabble.com/More-on-wicket-url-stratergy-td18212748.html#a18273996

Regards,
Erik.


Edvin Syse wrote:
 The client can't live with the url's created by
 HybridUrlEncodingStrategy. They are dead set on that arguments in the
 url should be appended with ?, not dot. Conventionally, dots does not
 denote arguments, and I must agree that he has a point.

 I think everyone would agree that keeping the bookmarkable part of the
 url adds value, so I must ask - is there a technical or otherwise good
 reason not to include it? As long as the current behaviour is the
 default for bookmarkable pages, it will degrade the user experience
 for everyone using it, and it seems this could be easily fixed..

 -- Edvin
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Running a huge wicket site(1m + users)

2008-07-16 Thread Erik van Oosten


IMHO whether state at the client helps hugely depends on the amount of 
pages the user works with.


If the user hardly ever leaves that one single page, keeping state on 
the client will help performance, provided the server does not need to 
keep a copy of (all) that state. The latter deviates from the main 
Wicket philosophy as I perceive it, but it is certainly possible in a 
clean way. (In my current project we do this in a few places *.) If you 
want to go this way, you'd better have a very Javascript capable person 
in the team.


If your user is constantly requesting quite different pages, the Wicket 
model is probably a better match (possibly using stateless pages 
wherever possible).


Regards,
   Erik.



* Before you ask: we use JQuery to get content from a URL which maps to 
a stateless Wicket page that serves HTML fragments. For more simple 
things (e.g. validate an access code) we use a couple of servlets.



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



Re: Running a huge wicket site(1m + users)

2008-07-15 Thread Erik van Oosten
Nino Saturnino Martinez Vazquez Wael wrote:
* Clustering(simple web server clustering with apache
  http/loadbalancer/tomcat)
  o Would Jetty be better?
Terracotta?


--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: More on wicket url stratergy

2008-07-04 Thread Erik van Oosten

Ok, here is my code. Perhaps the way I (ab)use HybridUrlCodingStrategy
is what made the URLs change.

In the ctor of ChangePasswordPage:

FormPasswordObject form = new FormPasswordObject(form, new 
CompoundPropertyModelPasswordObject(passwordObject)) {
  protected void onSubmit() {
try {
  getSession().authenticateMemberByCredentials(me.getEmail(), 
passwordObject.getPassword(), true);
  ... update password ...
  info(getLocalizer().getString(form.info.password.changed, this));
  setResponsePage(new AccountPage());
} catch (AuthenticationFailure authenticationFailure) {
  error(getLocalizer().getString(form.error.wrongpassword, this));
}
  }
};

and in Application#init():

mount(new NonVersionedHybridUrlCodingStrategy(settings/account, 
AccountPage.class));
mount(new NonVersionedHybridUrlCodingStrategy(settings/account/password, 
ChangePasswordPage.class));

NonVersionedHybridUrlCodingStrategy looks like this:

/**
 * Variant of Wicket's HybridUrlCodingStrategy.
 * Use this URL coding strategy in the frontend for non versioned pages
 * (call setVersioned(false) in the constructor) that have some kind of
 * feedback (e.g. a form submit).
 */
private static class NonVersionedHybridUrlCodingStrategy extends 
HybridUrlCodingStrategy {

public NonVersionedHybridUrlCodingStrategy(String mountPath, Class? 
extends Page pageClass) {
super(mountPath, pageClass);
}

@Override
protected String addPageInfo(String url, PageInfo pageInfo) {
// Do not add the version number as super.addPageInfo would do.
return url;
}
}


Regards,
 Erik.



Mathias P.W Nilsson wrote:
 Can you please elaborate. 

 I have this Link in my List class
 Link itemLink = new Link( itemLink, listItem.getModel() ){
   @Override
   public void onClick() {
 PageParameters parameters = new PageParameters();
 parameters.add( ItemId, ((Item)getModelObject()).getId().toString());
 ItemPage itemPage = new  ItemPage( parameters, ItemListPage.this );
 itemPage.setRedirect( true );
 setResponsePage( itemPage  );
   }
 };
 This will produce url like wicket:interface=:2

 In My application class I have tried a number of mounting but without
 success. Any more pointers?
 I use the reference for the ItemListPage to go back from ItemPage to
 ItemListPage plus I use the same background as in the ItemListPage.

 If a google spider where to index this it would not be successful so I need
 a way to get this to be bookmarkable.
   

-- 

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: generics

2008-07-02 Thread Erik van Oosten

In my current project I have:
10 Forms that use a CompoundPropertymodel and
5 Forms that have no model.

IMHO both Form forms :) should be easy to work with.

Regards,
   Erik.


Eelco Hillenius wrote:

thats my point. you work on fields of one object, true, but it does
not necessarily have to be the form's modelobject unless you use a
compound property model. eg

   FormVoid form = new FormVoid(form)
   {
   protected void onSubmit() { value = dosomethingwith(symbol); }
   };
   add(form);

   form.add(new TextFieldString(symbol, new
PropertyModelString(this, symbol)));

where [value] and [symbol] are clearly fields on the container that
parents the form. inside onsubmit i can just as easily access the
object directly without it being the model object of the form. now if
we factor out the form into a static inner or a top level class, just
like the link discussion, it becomes valuable to have the model.



Yeah, you're right actually. I realize now that I rarely use Form's
model directly. And I actually do the special stuff in the buttons
anyway.

Eelco


  



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/

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



Re: generics

2008-07-02 Thread Erik van Oosten

In my current project we try to do everything by BookmarkablePageLinks.

Count:
- 1 Link with an abstractreadonlymodel
- 14 Links without model
- 13 bookmarkablepagelinks without model
- 2 ajaxfallbacklinks without model

in addition we have 4 many used subclasses of bookmarkablepagelink that 
do not have a model.


Maybe not representative, but with 1 link with a model out of 30+ lead 
me to think that Link without generics is just fine. For Forms I would 
like to keep generics.


Regards,
   Erik.


Igor Vaynberg wrote:

the question here is: do most people use the model in the Link or not?

when you use compound property model in conjunction with form
components you never call getmodel/object() on those either. what now?
not generify form components? i dont think a strict criteria will
work.

some components fall into a gray area which needs to be discussed and
generified on case by case basis. when i was generifying wicket my
primary usecase is to use Link with a model so i went that way. start
a discussion/vote and see where that goes in a different thread. i
will be happy to go with what the majority thinks in this particular
case.

-igor

  



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



<    1   2   3   4   5   6   7   8   9   10   >