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.
> 
>Products
> 
> 
>Team
> 
>
> 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:
> 
>Products
> 
> 
>Team
> 
>
> 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. 
>>>
>>> ...
>>>>>
>>>   
>> 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;">AjaxLink 1
>>> 
>>> 
>>>    >>
>>>   
>> 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;">AjaxLink 2
>>> ...
>>>
>>> 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
>>>
>>>   
>>>   
>> -
>> 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]



[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-tabpanel&focusedCommentId=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: 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: 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: Nice urls in markup

2008-09-25 Thread Erik van Oosten
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. 


...
   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;">AjaxLink 1



   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;">AjaxLink 2

...

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

  


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



Re: Need help fixing bug #1816

2008-09-23 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: 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: 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 
IModel).


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 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: 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  instead of ,
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-tabpanel&focusedCommentId=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-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-tabpanel&focusedCommentId=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.



[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-tabpanel&focusedCommentId=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<

[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-tabpanel&focusedCommentId=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.sta

[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-tabpanel&focusedCommentId=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.



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-tabpanel&focusedCommentId=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, "]", "]]]>

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 PropertyModel(this,
"text")).add(*new RoleBasedModifier("ADMIN")*);
add(new Label("message", "If you see this message wicket is properly
configured and running!"));
Form form = new Form("form", new
CompoundPropertyModel(this));
form.add(new TextField("text"));
form.add(label);
add(form);
}
class RoleBasedModifier extends AbstractComponentModifier {
protected final Set roles;
public RoleBasedModifier(String... roles) {
this.roles = new HashSet(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: 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: 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: 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: 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: 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: 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: 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  or  tag to your 
markup since no Header Container was
found but components where found which want to write to the  
section.
href="../stylesheets/generic.css" />



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: 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  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: 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: 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
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
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 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-06 Thread Erik van Oosten
Hello Marcelo,

1. No. The flip side of having full control of the HTML is that you need
to write it yourself.

2. In Wicket it is trivial to keep state (read the conversation state)
on the server, local to the dialog/panel you are working with. No
official conversation support is therefore needed.

3. Yes. See WicketTester.

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

Regards,
   Erik.


Marcelo Morales wrote:
> Hello
>
> I've browsed over the wicket documentation and examples. There are a
> couple of things I don't seem able to determine. So I would really
> appreciate your input on this questions.
>
> 1 Can I write a web application without coding any HTML whatsoever?...
> I mean, is there some kind of "html" or "whole page" component which
> renders an entire HTML page?
> 2 Is there a way to work on dialogs (also known as conversations) as
> opposed to sessions?... maybe this question is nonsense and I didn't
> understand the whole page version management mechanism.
> 3 Does it come with some kind of integration testing?
> 4 Is it possible (or feasible) to implement some kind of "page
> hardening"? I am seeking something to protect victims of CSRF attacks
> from other sites. A input name randomizer comes to mind (which would
> make it impossible to selenium test it)
>
> Regads
>
> Marcelo Morales
>
> -
> 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: Remove underline in OrderByBorder link

2008-08-06 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
>>
>>  
>>  .
>>
>> 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: 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 ( 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]



[jira] Commented: (WICKET-1766) Method size() of a data provider is invoked twice.

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

[ 
https://issues.apache.org/jira/browse/WICKET-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619000#action_12619000
 ] 

Erik van Oosten commented on WICKET-1766:
-

Johan, your previous remark is not directly related to the problem. When detach 
is called, the data provider must (well should) clear its size cache.

> Method size() of a data provider is invoked twice.
> --
>
> Key: WICKET-1766
> URL: https://issues.apache.org/jira/browse/WICKET-1766
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 1.3.4
> Environment: Ubuntu
>Reporter: Rik van der Kleij
>Assignee: Igor Vaynberg
>Priority: Minor
> Fix For: 1.3.5
>
>
> Method size() of a data provider is invoked twice during one request. This 
> happens when navigating to a next or latest page in a data table. During 
> debugging I noticed that the onDetach() of AbstractPageableView is invoked an 
> extra time. Implementations of size() normally query the database so it will 
> slow down the performance.

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



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

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]



[jira] Commented: (WICKET-1185) Wrong message / parse error: "Expected close tag for "

2008-07-23 Thread Erik van Oosten (JIRA)

[ 
https://issues.apache.org/jira/browse/WICKET-1185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12615932#action_12615932
 ] 

Erik van Oosten commented on WICKET-1185:
-

This error is also given when you did not attach any child components.

For example, I got a "Expected close tag for " when I 
did not add any form components (the form was invisible, so I thought that 
would be alright). The xtml was valid xml.


> Wrong message / parse error: "Expected close tag for  wicket:id="column0">"
> 
>
> Key: WICKET-1185
> URL: https://issues.apache.org/jira/browse/WICKET-1185
> Project: Wicket
>  Issue Type: Bug
>  Components: wicket
>Affects Versions: 1.3.0-rc1
> Environment: Linux
>Reporter: Johannes Schneider
>Assignee: Juergen Donnerstag
> Fix For: 1.4-M4
>
> Attachments: bug-search.zip
>
>
> I get the message "Expected close tag for ". But 
> the span is closed. So there exists an parse error or the error message is 
> misleading.
> I am not a Wicket expert, so I think I have an error within my code and the 
> error message is not good enough (for me).

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



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

Form form = new Form("form", new 
CompoundPropertyModel(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 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: More on wicket url stratergy

2008-07-02 Thread Erik van Oosten


Yes, I am pretty sure I did this about a month ago.

The funny thing is that we did it this way because this way flash 
(component error messages) are preserved. We wanted to show a succes 
message on the page we forwarded to.


... looking up the code now...

Yep, correct. Though we did not call setRedirect(true) as the code runs 
from a Form#onSubmit callback which always redirects anyway.


Regards,
   Erik.


Igor Vaynberg wrote:

have you tried this eric? setting a page instance does not produce a
bookmarkable url, you would have to
setresponsepage(itemlistpage.class)

-igor

On Wed, Jul 2, 2008 at 6:41 AM, Erik van Oosten <[EMAIL PROTECTED]> wrote:
  

No, not true.

You /can/ do setResponsePage(new ItemListPage(...)), /and/ make it
bookmarkable. The trick is to call setRedirect(true) together with the call
to setResponsePage. Furthermore you need to mount ItemListPage in your
application#init method (see method Application#mount()).

Regards,
  Erik.


David Leangen wrote:


On Tue, 2008-07-01 at 02:50 -0700, Mathias P.W Nilsson wrote:

  

In my itemList class I set the response page like this.
setResponsePage(  new ItemPage( parameters, ItemListPage.this ) );

Now the ItemListPage.this is for back travelling and to get the
background
from the list class. Is it possible to make the itemPage bookmarkable?



Sure, but you can no longer construct the object yourself. You'll need
to do this instead:

 setResponsePage( ItemListPage.class, parameters );


  



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



Re: [PROPOSAL] Use path in URL when target is instance of BookmarkablePageRequestTarget

2008-07-02 Thread Erik van Oosten

Indeed. I would very welcome this capability.

Regards,
   Erik.


David Leangen wrote:

once again, i dont see what this offers over the hybrid strategy.



Maybe you can correct me if I'm wrong here...

The hybrid stategy is only applied when the target is an
IBookmarkablePageRequestTarget. So, for normal bookmarkable pages, there
is no problem, like you say.

The issue only arises when a page is mounted, but is used in a stateful
way (for example it has a form or something). In that case, the target
becomes an IListenerInterfaceRequestTarget. When this is the case, the
hybrid strategy is not used. This is the case that the patch is intended
for.


-dml-

  



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



Re: More on wicket url stratergy

2008-07-02 Thread Erik van Oosten

No, not true.

You /can/ do setResponsePage(new ItemListPage(...)), /and/ make it 
bookmarkable. The trick is to call setRedirect(true) together with the 
call to setResponsePage. Furthermore you need to mount ItemListPage in 
your application#init method (see method Application#mount()).


Regards,
   Erik.


David Leangen wrote:

On Tue, 2008-07-01 at 02:50 -0700, Mathias P.W Nilsson wrote:
  
In my itemList class I set the response page like this. 


setResponsePage(  new ItemPage( parameters, ItemListPage.this ) );

Now the ItemListPage.this is for back travelling and to get the background
from the list class. Is it possible to make the itemPage bookmarkable?



Sure, but you can no longer construct the object yourself. You'll need
to do this instead:

  setResponsePage( ItemListPage.class, parameters );

  



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



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

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

   form.add(new TextField("symbol", new
PropertyModel(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: Wicket Presentation

2008-06-30 Thread Erik van Oosten
Martijn Dashorst wrote:
>> On slideshare, don't forget to allow download of the original file
>> (powerpoint or otherwise).
> Mwah... Only if you want to. There is no obligation to do so.
Of course.

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



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



Re: Exception for MixedParamUrlCodingStrategy

2008-06-30 Thread Erik van Oosten
I've no idea how this could work, or why it doesn't now.
Could you not just include different panels on one page, instead of
forwarding to different pages?

Regards,
Erik.


Mathias P.W Nilsson schreef:
> https://localhost/hairless-web/brand/71/
>
> this is the generated URL.
>
> The BrandInterceptor send request to ItemList. Maybe this isn't the way to
> do this?
>
> public BrandInterceptor( PageParameters parameters ){
>   
>   filters = new LinkedList(); 
>   Long brandId = parameters.getLong( "id" );
>   if ( brandId != null ) { 
>   Brand brand = getBrandDao().getBrand( brandId );
>   filters.add( new BrandFilter( brand ));
>   setResponsePage( new ItemListPage( filters )  );
>   } else{
>   
>   setResponsePage( new Base() );
>   }
>   }
>   

-- 

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



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



Re: Wicket Presentation

2008-06-30 Thread Erik van Oosten
On slideshare, don't forget to allow download of the original file
(powerpoint or otherwise).

Regards,
Erik.


Martijn Dashorst schreef:
> Put them up on slideshare please.
>
> Martijn
>
> On Mon, Jun 30, 2008 at 12:42 PM, Nino Saturnino Martinez Vazquez Wael
> <[EMAIL PROTECTED]> wrote:
>   
>> It's really great to see the different angles we pitch these presentations
>> with.. After the summer I'll hold some presentations too, i'll drop the
>> slides here as well or should we do it on the wiki?
>>
>> egolan74 wrote:
>> 
>>> http://www.nabble.com/file/p18191471/Wicket_Introduction.ppt
>>> Wicket_Introduction.ppt Hi,
>>> I have just finished giving my colleagues at Tikal Knowledge an
>>> introduction
>>> session of Wicket.
>>> It came out great and the responses were very positive.
>>>
>>> I would like to give special thanks to Eelco Hillenius who really helped
>>> me.
>>> Thanks also to this community :)
>>>
>>> Eyal Golan
>>>
>>> -
>>> Eyal Golan
>>> [EMAIL PROTECTED]
>>>
>>> Visit:  http://jvdrums.sourceforge.net/ http://jvdrums.sourceforge.net/
>>> LinkedIn:  http://www.linkedin.com/in/egolan74
>>> href=http://www.linkedin.com/in/egolan74
>>>   
>> --
>> -Wicket for love
>>
>> Nino Martinez Wael
>> Java Specialist @ Jayway DK
>> http://www.jayway.dk
>> +45 2936 7684
>>
>>
>> -
>> 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: Exception for MixedParamUrlCodingStrategy

2008-06-29 Thread Erik van Oosten

Hello Mathias,

Well, that looks quite alright to me.
Could you post the generated URL? Do you have more mounts to the same 
page class?


Regards,
Erik.


Mathias P.W Nilsson wrote:

Hi!
I'm using MixedParamUrlCodingStrategy and I must miss something in how this
is set up properly

I have mounted the page in init in my application class
mount(new MixedParamUrlCodingStrategy("brand", BrandInterceptor.class,new
String[]{"id"}));

When building up the bookmarkable page link I do this in my Root page

Brand brand = (Brand) item.getModelObject();
PageParameters params = new PageParameters();
params.add( "id",  brand.getId().toString() );
Link brandLink = new BookmarkablePageLink( "brandLink"
,BrandInterceptor.class, params );

But it always ends with this error. 


[RequestCycle] Too many path parts, please provide sufficient number of path
parameter names
java.lang.IllegalArgumentException: Too many path parts, please provide
sufficient number of path parameter names
at
org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.decodeParameters(MixedParamUrlCodingStrategy.java:178)

Any pointers on how to solve this?
  




--
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: Home page accepting IndexedParamUrlCodingStrategy

2008-06-27 Thread Erik van Oosten

There are 2 problems in this code:

1. mount specifies that the mount point is given without a leading '/' 
(even though it tolerates it)
2. you can not call mount with "", it will throw an exception  (and 
therefore not with "/" either)


Actually, it would be nice if you could do the latter. As long as the 
target class is the same as the home page class, I should perhaps not be 
prohibited.


I'd say: open a jira issue and attach a patch :)

Regards,
Erik.


Peter Ertl wrote:

pseudo code example:

  mount("/",  ... indexed HomePage.class)
  mount("/foo", FooPage.class)


What should happen with this path:

  url = /foo

-> call HomePage with indexed parameter 'foo' ?

-> call page FooPage.class ?

not having indexed urls for '/' makes sense for me



Am 27.06.2008 um 19:59 schrieb Tauren Mills:


Does anyone have suggestions on how to do this?  Or is it just not
possible to use IndexedParamUrlCodingStrategy without a mount point
(from the root of the site)?

Thanks!
Tauren

On Thu, Jun 26, 2008 at 3:53 PM, Tauren Mills <[EMAIL PROTECTED]> wrote:

Thanks for the suggestion, but I'm unclear on how to mount the home
page on "/".  I guess that is the main problem I'm having.  Before
adding PageParameters to the page, I used this:
  mountBookmarkablePage("/home", HomePage.class);

With that, going to localhost:8080/ would redirect to
localhost:8080/home.  Then I changed it to the following:
  mount(new IndexedParamUrlCodingStrategy("/home", 
HomePage.class));

//mountBookmarkablePage("/home", HomePage.class);

Everything still worked the same (going to site root would redirect to
/home), but it would also accept parameters.  Functions perfectly, but
I need to get rid of the /home mount point.  So I tried this:

  mount(new IndexedParamUrlCodingStrategy("/", HomePage.class));
//mount(new IndexedParamUrlCodingStrategy("/home", 
HomePage.class));

//mountBookmarkablePage("/home", HomePage.class);

Doing so gives a 404 error when I go to the root of the site.  So how
do I mount the home page on "/"?  I tried both "" and "/".

MyWebApplication:

public Class getHomePage() {
  return HomePage.class;
}
protected void init() {
  super.init();
  mount(new IndexedParamUrlCodingStrategy("/", HomePage.class));
//mount(new IndexedParamUrlCodingStrategy("/home", 
HomePage.class));

//mountBookmarkablePage("/home", HomePage.class);
}

Jetty launcher code (for testing):

  WebAppContext context = new WebAppContext();
  context.setServer(server);
  context.setContextPath("/");
  context.setWar("src/webapp");

web.xml:

  
  wicketsite
  
org.apache.wicket.protocol.http.WicketServlet 


  
  applicationFactoryClassName
  
org.apache.wicket.spring.SpringWebApplicationFactory 


  
  1
  
  
  wicketsite
  /*
  

Thanks for the help!
Tauren


On Thu, Jun 26, 2008 at 3:38 PM, David Leangen <[EMAIL PROTECTED]> 
wrote:


IIUC, the home page is automatically mounted on the path where you 
wicket

app is located.

So, if you put your wicket on "/home", then the home page will be 
mounted on

/home.

Guess you'll need to put your home page on "/" to make this work.








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



Re: Home page accepting IndexedParamUrlCodingStrategy

2008-06-27 Thread Erik van Oosten

It is not possible. Unfortunately.

You can write your own IRequestCycleProcessor. See 
WebApplication#newRequestCycleProcessor().


Get hints at: 
http://www.nabble.com/How-to-catch-unknown-(not-mounted)-URLs--td14949092.html#a14956131


Regards,
   Erik.


Tauren Mills wrote:

Does anyone have suggestions on how to do this?  Or is it just not
possible to use IndexedParamUrlCodingStrategy without a mount point
(from the root of the site)?

Thanks!
Tauren

On Thu, Jun 26, 2008 at 3:53 PM, Tauren Mills <[EMAIL PROTECTED]> wrote:
  

Thanks for the suggestion, but I'm unclear on how to mount the home
page on "/".  I guess that is the main problem I'm having.  Before
adding PageParameters to the page, I used this:
   mountBookmarkablePage("/home", HomePage.class);

With that, going to localhost:8080/ would redirect to
localhost:8080/home.  Then I changed it to the following:
   mount(new IndexedParamUrlCodingStrategy("/home", HomePage.class));
//mountBookmarkablePage("/home", HomePage.class);

Everything still worked the same (going to site root would redirect to
/home), but it would also accept parameters.  Functions perfectly, but
I need to get rid of the /home mount point.  So I tried this:

   mount(new IndexedParamUrlCodingStrategy("/", HomePage.class));
//mount(new IndexedParamUrlCodingStrategy("/home", HomePage.class));
//mountBookmarkablePage("/home", HomePage.class);

Doing so gives a 404 error when I go to the root of the site.  So how
do I mount the home page on "/"?  I tried both "" and "/".

MyWebApplication:

public Class getHomePage() {
   return HomePage.class;
}
protected void init() {
   super.init();
   mount(new IndexedParamUrlCodingStrategy("/", HomePage.class));
//mount(new IndexedParamUrlCodingStrategy("/home", HomePage.class));
//mountBookmarkablePage("/home", HomePage.class);
}

Jetty launcher code (for testing):

   WebAppContext context = new WebAppContext();
   context.setServer(server);
   context.setContextPath("/");
   context.setWar("src/webapp");

web.xml:

   
   wicketsite
   
org.apache.wicket.protocol.http.WicketServlet
   
   applicationFactoryClassName
   
org.apache.wicket.spring.SpringWebApplicationFactory
   
   1
   
   
   wicketsite
   /*
   

Thanks for the help!
Tauren


On Thu, Jun 26, 2008 at 3:38 PM, David Leangen <[EMAIL PROTECTED]> wrote:


IIUC, the home page is automatically mounted on the path where you wicket
app is located.

So, if you put your wicket on "/home", then the home page will be mounted on
/home.

Guess you'll need to put your home page on "/" to make this work.


  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of
Tauren Mills
Sent: 27 June 2008 07:30
To: users@wicket.apache.org
Subject: Home page accepting IndexedParamUrlCodingStrategy


How do I go about making my HomePage accept index parameters?  I want
a home page that will accept URLs like:
localhost:8080/us/ca/sacramento

Instead of having a mount point first, for example /home:
localhost:8080/home/us/ca/sacramento

I've tried this in my app:

getHomePage() {
   return HomePage.class;
}
init() {
   mount(new IndexedParamUrlCodingStrategy("/", HomePage.class));
}

This returns in a 404 error for the home page (localhost:8080/).  I
also tried with "" instead of "/" as the mount point, but the same
problem.

If I use this with the /home mount point, everything works perfectly:
mount(new IndexedParamUrlCodingStrategy("/home", HomePage.class));

FYI... I get the PageParameters in HomePage like this (which is
working fine);

  setCountry(pageParams.getString("0",null));
  setState(pageParams.getString("1",null));
  setCity(pageParams.getString("2",null));

Any suggestions?

Thanks,
Tauren

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


  


-
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: PackagedTextTemplate does not load resource from application resource stream locator? - BUG??

2008-06-26 Thread Erik van Oosten
Hi Ritz,

You'd better just open a Jira issue if you want a dev to look at this.

Regards,

Erik.

Ritz123 wrote:
> I did some investigation and seems like there is a bug.
>
> PackagedTextTemplate @line:92 is creating a new ResourceStreamLocator()
> instead of using the one from the application. This is causing resources to
> be not found if you have custom resource stream loader registered with the
> application.
>
> line 92: private static final IResourceStreamLocator streamLocator = new
> ResourceStreamLocator();
>
> Can Wicket dev confirm?
>
>
> Ritz123 wrote:
>   
>> Hi,
>>
>> I am trying to use PackagedTextTemplate to load the template, but seems
>> like its not looking for the resource in the application registered
>> resource stream locator. I get resource not found exception.
>>
>> HeaderContributor.forCss and forJavascript has worked fine and has found
>> resource in the folders for application stream location without any
>> issues.
>>
>>
>> 
>
>   
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: How to send response without HTML code

2008-06-11 Thread Erik van Oosten

Hi Milan,

I think you should throw the exception AbortWithHttpStatusException.

If you change your mind and want to set the HTTP status code, but 
provide content as well, then call something like 
((WebResponse)getResponse).getHttpServletResponse().setStatus(HttpServletResponse.SC_...) 
in the constructor of your page.


Regards,
   Erik.


Milan Křápek schreef:

Thanks for response but this is not th exact thing I want. I need to know the 
name of wicket component, where can I get access to request from user and fill 
the response for him. All I need is some parent class of WebPage. But this 
object must return just http code without any HTML. (I was not able to send 
response from WebPage without having any addititonal HTML file ).

-
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: [ANNOUNCE] Apache Wicket 1.4 Milestone 2 is released

2008-06-03 Thread Erik van Oosten

For those that use SpringBean, starting from m2 you also need the jar
wicket-ioc.

Regards,
Erik.


Frank Bille wrote:
> Help the Apache Wicket team to determine the future of your Wicket based web
> application development. We have released our second milestone release of
> our Java 5 based web framework and are anxious to receive feedback on our
> use of generics. Download Wicket 1.4-m2 now and help us decide whether to
> tone down, remove or increase the application of Java 5 generics to our API.
> We have started the discussion on the user mailing list:
>
> http://www.nabble.com/users%2C-please-give-us-your-opinion%3A-what-is-your-take-on-generics-with-Wicket-td17589984.html
>
> Eager people click here to download the distribution, others can read
> further:
>
> http://www.apache.org/dyn/closer.cgi/wicket/1.4-m2
>
> We thank you for your patience and support.
>
> The Wicket Team
>
> === Apache Wicket ===
>
> Apache Wicket is a component oriented Java web application framework. With
> proper mark-up/logic separation, a POJO data model, and a refreshing lack of
> XML, Apache Wicket makes developing web-apps simple and enjoyable again.
> Swap the boilerplate, complex debugging and brittle code for powerful,
> reusable components written with plain Java and HTML.
>
> You can find out more about Apache Wicket on our website:
>
> http://wicket.apache.org
>
> === This release ===
>
> The Apache Wicket team is proud to announce the availability of the first
> milestone release of our first java 1.5 Wicket version: Apache Wicket
> 1.4-m2. This is the first release with java 1.5 as a minimum. Not everything
> has been converted to java 1.5 yet but we are getting there.
>
> === Migrating from 1.3 ===
>
> If you are coming from Wicket 1.3, you really want to read our migration
> guide, found on the wiki:
>
> http://cwiki.apache.org/WICKET/migrate-14.html
>
> === Downloading the release ===
>
> You can download the release from the official Apache mirror system, and you
> can find it through the following link:
>
> http://www.apache.org/dyn/closer.cgi/wicket/1.4-m2/
>
> For the Maven and Ivy fans out there: update your pom's to the following,
> and everything will be downloaded automatically:
>
>
>org.apache.wicket
>wicket
>1.4-m2
>
>
> Substitute the artifact ID with the projects of your liking to get the other
> projects.
>
> Please note that we don't prescribe a Logging implementation for SLF4J. You
> need to specify yourself which one you prefer. Read more about SLF4J here:
> http://slf4j.org
>
> === Validating the release ===
>
> The release has been signed by Frank Bille, your release manager for today.
> The public key can be found in the KEYS file in the download area. Download
> the KEYS file only from the Apache website.
>
> http://www.apache.org/dist/wicket/1.4-m2/KEYS
>
> Instructions on how to validate the release can be found here:
>
> http://www.apache.org/dev/release-signing.html#check-integrity
>
> === Reporting bugs ===
>
> In case you do encounter a bug, we would appreciate a report in our JIRA:
>
> http://issues.apache.org/jira/browse/WICKET
>
> === The distribution ===
>
> In the distribution you will find a README. The README contains instructions
> on how to build from source yourself. You also find a CHANEGELOG-1.4 which
> contains a list of all things that have been fixed, added and/or removed
> since the first release in the 1.4 branch.
>
>   

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



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



Re: How to access properties files outside of Wicket components?

2008-06-02 Thread Erik van Oosten
Look carefully. Your code sample does:

Thread.currentThread().getContextClassLoader().getResourceAsStream("MyComponent.properties")
 


Which loads it from the default package.
I think you should do:

MyComponent.class.getResourceAsStream("MyComponent.properties")


Which loads it from the package MyComponent is in.

Regards,
Erik.



Michael Mehrle wrote:
> That's what I have been doing, mate ;-)
>
> I'm looking for a solution that allows me to load the properties file
> out of the same folder as my class or WEB-INF. Not working right now and
> I pretty much tried all approaches I could find online.
>
> Wicket does not offer a way to access resource bundles outside of Wicket
> components?
>
> Michael
>
> -Original Message-
> From: Erik van Oosten [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, June 01, 2008 10:32 PM
> To: users@wicket.apache.org
> Subject: Re: How to access properties files outside of Wicket
> components?
>
> You should the other getResource*() methods, those on Class:
> http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAs
> Stream(java.lang.String)
>
> Regards,
> Erik.
>
>
> Michael Mehrle wrote:
>   
>> Right now I had to resort to the solution below, but I would very much
>> like to know the standard way of doing this, as this required me to
>> place my properties file into the src/main/resources folder:
>>
>> static {
>>  try {
>>  
>>
>> 
> properties.load(Thread.currentThread().getContextClassLoader().getResour
>   
>> ceAsStream(
>>  "MyComponent.properties"));
>>  } catch (Exception e) {
>>  LOG.error("Unable to load file
>> MyComponent.properties' - error: {}", e.getMessage(), e);
>>  }
>>  }
>>
>>  public static String getProperty(String key) {
>>  return properties.getProperty(key);
>>  }
>>   
>> 

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



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



Re: getString, Label -> Warn

2008-06-02 Thread Erik van Oosten
Do this instead:

BookmarkablePageLink lien_accueil = new BookmarkablePageLink("accueil", 
HomePage.class);
Label labelLinkAccueil = new Label ("name",new 
ResourceModel("LabelLinkAccueil"));


Regards,
Erik.


Fabien D. wrote:
> Hi everybody,
>
>
> If I use this code :
>
>   BookmarkablePageLink lien_accueil = new 
> BookmarkablePageLink("accueil",
> HomePage.class);
>   Label labelLinkAccueil = new Label 
> ("name",getString("LabelLinkAccueil"));
>   labelLinkAccueil.setEscapeModelStrings(false); 
>   lien_accueil.add(labelLinkAccueil);
>   lien_accueil.setVisible(true);
>   add(lien_accueil);
>
> In my log file, I have this warning :
> (Localizer.java:188) - Tried to retrieve a localized string for a component
> that has not yet been added to the page. This can sometimes lead to an
> invalid or no localized resource returned. Make sure you are not calling
> Component#getString() inside your Component's constructor. Offending
> component: [MarkupContainer [Component id = panelmenu, page = ,
> path = panelmenu.PanelMenu]]
>
>
> Wicket doesn't like to use the constructor of a label and getString()
>
> How cant I resolve this warning and use getString with new Label
>
>
> Thank you in advance
>   

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



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



Re: how to do i18n of javascript file with Wicket?

2008-06-01 Thread Erik van Oosten
We use approach 1. We do not pull messages from Wicket resources, they 
are just static in the file. The link to the correct js file is however 
created by a dynamic component that uses the current Locale.


You could go with approach 2, but to me it  sounds like a lot of work.

Regards,
   Erik.

Quan Zhou wrote:

My application's supposed to support both English,Simpilify
Chinese,Traditional Chinese,and even Vietnamese. The great I18N feature of
Wicket helps me solve many i18n problems.
The only remains is how to do i18n of javascript



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



Re: How to access properties files outside of Wicket components?

2008-06-01 Thread Erik van Oosten

You should the other getResource*() methods, those on Class:
http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String)

Regards,
   Erik.


Michael Mehrle wrote:

Right now I had to resort to the solution below, but I would very much
like to know the standard way of doing this, as this required me to
place my properties file into the src/main/resources folder:

static {
try {

properties.load(Thread.currentThread().getContextClassLoader().getResour
ceAsStream(
"MyComponent.properties"));
} catch (Exception e) {
LOG.error("Unable to load file
MyComponent.properties' - error: {}", e.getMessage(), e);
}
}

public static String getProperty(String key) {
return properties.getProperty(key);
}
  



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



Re: Changing Link string conditionally?

2008-06-01 Thread Erik van Oosten

Michael Allan wrote:

Fearing a span-demic in my code, I came up with this:...
There's probably a more elegant way to code it, though.
  

Neh, that is a very common approach ;)

   Erik.


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



Re: Feedback message related problem--info,debug etc take string arguments which is not very flexible

2008-06-01 Thread Erik van Oosten

Hi, Atul,

That sounds like a reasonable request to me (I am no core member). Its 
best to open a new issue in Wicket's jira, preferably with a patch attached.


Regards,
   Erik.

atul singh wrote:

Hi,
I see that only error() feedback takes a serializabel message. This allows
me to pass any java object as message and implement custom filtering of
messages by components.
but info,debug etc take a string and so do not help me in that kind of
filtering.
Actually what we have is a TabbedWizard thing, a hybrid of TabbedPanel and
Wizard. We have such a requirement to target feedback messages to very
specific feedback components on any of the tabs. This is also not possible
by implementing this logic based on the reporting component. I wanted the
implementation to be generic , just based on info encapsulated in the
message.
Can anyone suggest an alternative?
Can the info(),debug() etc method signatures be changed to have such
flexibility???
Thanks

  



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



Re: tabbed pages not panels

2008-06-01 Thread Erik van Oosten
Tabbed pages are easy to create yourself (a lot easier then tabbed 
panels). Just create a list (ol) with elements (li) with in each a link 
(a). Now attach a Link component to the latter (any link type, but you 
probably are looking for a BookmarkableLink).
Put this all in a Panel you can reuse over different pages. In the 
constructor you accept an argument that will make the panel add a class 
attribute (class="selected") to one of the links.

Add some css and you're done.

Regards,
   Erik.


nazeem wrote:

Does wicket have inbuilt support for tabbed pages ? not tabbed panels. Please
point me to if available
  



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



Re: Changing Link string conditionally?

2008-06-01 Thread Erik van Oosten

The idea is to put a span inside the a, and then attach a Label to the span.

Is that something you can work with?

Regards,
   Erik.


Michael Mehrle wrote:

Okay, this seems so easy, but I'm somehow stuck. How do I change the
string of a Link based on some condition? Do I simply provide a
terminated tag and set the model (i.e. the visible string) in my code?

  



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



Re: Manipulate Component Markup before rendering

2008-05-31 Thread Erik van Oosten
Any component defined within the "script" area seems to be ignored by 
wicket

Weird. That sounds like a bug to me.

Anyway, your solution seems robust enough to me.

Regards,
Erik.


Jürgen Lind wrote:

Hi Erik,

thank you for the suggestion. I tried that already and it did not 
work. Any
component defined within the "script" area seems to be ignored by 
wicket, i.e.
when I define the label in the Java code, I get an error message 
stating that
the component was not declared in the markup file... What I am 
currently using

is the following code:

  protected void onRender(MarkupStream markupStream) {
super.onRender(markupStream);
final MarkupStream associatedMarkupStream = 
getAssociatedMarkupStream(true);

MarkupElement element = associatedMarkupStream.get(2);
getResponse().write(this.replaceParameters(element.toString()));
  }

The problem here is, that I know that the markup element I want is at 
the second

position. However, this is not very robust ;-)

Cheers,

J.


Erik van Oosten wrote:

Hello Jürgen,

You coulld put a  in the markup and add a Label to it. Don't 
forget to call setRenderBodyOnly(true) on the label.


Regards,
   Erik.

Jürgen Lind wrote:

Hi,

I was wondering if there is some way to rewrite the component markup 
before

it is rendered. My setting is as follows:

1. I have a component markup file like this

   
 
   someFunction( "runtime parameter" );
 
   

2. The matching component overrides "onComponentTagBody" and "onRender"

  protected final void onComponentTagBody(final MarkupStream 
markupStream,

  final ComponentTag openTag) {
checkComponentTag(openTag, "textarea");
replaceComponentTagBody(markupStream, openTag, getValue());
  }

  protected void onRender(MarkupStream markupStream) {
super.onRender(markupStream);
super.renderAssociatedMarkup("panel", "Some error");
  }

Now, what I would like to do is to change the value for the "runtime 
parameter"
in the onRender Method and replace it with a value that has been 
given to the

component when the component was constructed.

Is there any way to achieve this?

Regards,

J.



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



Re: Manipulate Component Markup before rendering

2008-05-30 Thread Erik van Oosten

Hello Jürgen,

You coulld put a  in the markup and add a Label to it. Don't 
forget to call setRenderBodyOnly(true) on the label.


Regards,
   Erik.

Jürgen Lind wrote:

Hi,

I was wondering if there is some way to rewrite the component markup 
before

it is rendered. My setting is as follows:

1. I have a component markup file like this

   
 
   someFunction( "runtime parameter" );
 
   

2. The matching component overrides "onComponentTagBody" and "onRender"

  protected final void onComponentTagBody(final MarkupStream 
markupStream,

  final ComponentTag openTag) {
checkComponentTag(openTag, "textarea");
replaceComponentTagBody(markupStream, openTag, getValue());
  }

  protected void onRender(MarkupStream markupStream) {
super.onRender(markupStream);
super.renderAssociatedMarkup("panel", "Some error");
  }

Now, what I would like to do is to change the value for the "runtime 
parameter"
in the onRender Method and replace it with a value that has been given 
to the

component when the component was constructed.

Is there any way to achieve this?

Regards,

J.




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



Re: Can I HTTP Post from static html page to a Wicket page?

2008-05-30 Thread Erik van Oosten
Remove the slashes!

Erik.

AlexTM wrote:
> Hi!
>
> I've tried this:
> mount("/allsearch", new QueryStringUrlCodingStrategy("/allsearch",
> AllSearchPage.class));
>
>   
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Clone a WebPage

2008-05-30 Thread Erik van Oosten
Do you have any overriden isVisible() in which you use the model?

Regards,
Erik.

Mathias P.W Nilsson wrote:
> You are perfectly right. All my LoadableDetachable models are called again.
> Problem is that the cart is a Fragment and it does not get called.
>
>   
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Directions for Stateless Ajax

2008-05-28 Thread Erik van Oosten

Well, under these circumstances: don´t use wicket.
Just write your own javascript and use a servlet.

Regards,
   Erik.

Alan Romaniusc wrote:

Hi,

I have been digging in how to make "stateless" ajax requests in
wicket. My application needs an autocomplete textfield that must work
"all the time", including after session expiration.
I found a solution using a timer to ping the server, but this solution
was rejected :(.

Where/What should I be looking for?

Thx

  



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



Re: Wicket i18n options

2008-05-25 Thread Erik van Oosten
Yes, it surprised me to.

I guess the best way out is to add this to 1.3 as well :)

Erik.


Eelco Hillenius wrote:
> Though it surprises me that there would be anything other than
> generics in 1.4. The deal was very explicitly to only add generics in
> 1.4, and (other) new features would go to 1.5.
>
> Eelco
>
>   

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



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



Re: Wicket i18n options

2008-05-25 Thread Erik van Oosten

Eelco Hillenius wrote:

Excellent! I didn't even know about that new feature (nested tags
nested in wicket:message). Is that really only in 1.4?

Eelco
  
Its in the release notes! Actually, in my current project it is the 
reason for switching to 1.4 But we're having fun with the generics as 
well :)


Regards,
Erik.


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



Re: Wicket i18n options

2008-05-25 Thread Erik van Oosten

Eyal, Uwe, Scott,

I won't stop you!

Actually, when I was more then half way I realized that the wiki might 
have been a better place for this. But by then, it was too late to 
change the language and start over.


Regards,
   Erik.


Scott Swank wrote:

+1

On Sun, May 25, 2008 at 6:44 AM, Eyal Golan <[EMAIL PROTECTED]> wrote:
  

Great stuff !!
Thanks,
Should be put in Wiki.





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



Wicket i18n options

2008-05-25 Thread Erik van Oosten

Hi,

As there was no complete overview of Wicket's i18n options (even Wicket 
in Action only lists a few), I decided to write an article on it.


http://day-to-day-stuff.blogspot.com/2008/05/wicket-internationalization.html

Feedback is welcome!

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: Wicket and inline JavaScript

2008-05-24 Thread Erik van Oosten
I am currently in a project where we do everything with jQuery in the 
frontend, simulating Wicket's AJAX input and using its AJAX output. 
However, I would not advice in doing this until you have a strong grasp 
of Wicket's form and AJAX handling. Having a good jquery programmer 
helps too.


Regards,
   Erik.


On Thu, May 22, 2008 at 3:16 PM, Ned Collyer <[EMAIL PROTECTED]>
wrote:


Hi Edvin,

I am an advocate of JQuery :).  I even won their icon design contest, and
I've been using it for years!  I think it should be used in all projects
that require effects or cool DOM manipulation.

I love the "unobtrusive way" and xhtml strict!

That being said, when it comes to wicket AJAX - just use the wicket ajax
and
be done with it.  No point mucking with something thats already
excellent.
It works and its easy.  Why reimplement that bit - and potentially open
up
bugs that you need to go debug.

For effects and DOM manipulation, you can use JQuery by adding header
contributors.  It is cleaner.. and in many instances easier to debug.  It
makes development quick and painless.

If it wasn't wicket - id suggest using JQuery for ajax.

  


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



Re: Page pooling (for stateless pages)

2008-05-18 Thread Erik van Oosten

Hello,

I think it would probably make more sense to cache the /result/ of 
stateless pages.


Regards,
Erik.


Joel Halbert wrote:

Hi,

I was wondering whether it was possible to implement "pooling" of stateless pages? Possibly using a custom PageMap implementation? 


Although newer JVM's are good at performing GC, pooling is a reasonable 
additional technique to use for achieving that extra bit of scalability.

If anyone has tried to do this, or has any suggestions on the best way forward 
I'd be really interested to know.

Many Thanks,

Joel
  



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



Re: Need Help

2008-05-18 Thread Erik van Oosten
Try to set the compiler version (as described on 
http://wicket.apache.org/quickstart.html). I am not sure this is your 
problem.


Regards,
   Erik.


Depak Shidu wrote:

i try wicket 4.1-m1 maven using mvn archetype:create
-DarchetypeGroupId=org.apache.wicket
-DarchetypeArtifactId=wicket-archetype-quickstart -DarchetypeVersion=1.4-m1
-DgroupId=com.shidu -DartifactId=mywicket from website wicket and have
problem. i soon fix pom with 1.3-SNAPSHOT to 1.4-m1 but now compile error

[INFO] Compilation failure
/home/depak/mywicketsrc/main/java/com/shidu/HomePage.java:[25,8] cannot find
symbol
symbol  : method add(org.apache.wicket.markup.html.basic.Label)

i try remove wicket from repository and redo and not work still

i run hardy with this maven version
Maven version: 2.0.9
Java version: 1.6.0_06
OS name: "linux" version: "2.6.24-17-generic" arch: "i386" Family: "unix"

help?

  



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



Re: Zip files containing ready to deploy wicketstuff examples

2008-05-17 Thread Erik van Oosten

Hi Blackbird,

You can create a quickstart (http://wicket.apache.org/quickstart.html). 
A quickstart is the absolute minimal Wicket application. You'll need 
maven 2 installed.


Regards,
   Erik.


Blackbird schreef:

Hi, are there zip files of each example available at wicketstuff? Some
examples have many files, including configuration files (.properties, .xml)
It would be helpful to see how all these file should be organized ideally
(directory hierarchy).
Sorry if I've missed it.
  



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



Re: Invoulentary session sharing/leakage in Wicket 1.3.x

2008-05-15 Thread Erik van Oosten
Chris,

If you read the thread carefuly you can extract a quick fix. You'll need
it as the core developers argumented against a quick bugfix release.
Just checkout Wicket from SVN and apply the patch (2 lines in the Wicket
filter). Its a pain, but if you can not wait...

Regards,
Erik.


Chris Lintz wrote:
> Guys has this been resolved??  We have been having some customers complain as
> well (some sending screen shots of others peoples data as proof).   Because
> our users click streams are available publically at their control, we had
> thought jsessionids occurring in the click stream were being maliciously
> hijacked. We  plugged that hole disallowing any jsessionid to be part of url
> (via Servlet filter) - yes this of course means JavaScript must be enabled.  
> This involuntary session sharing is still occurring.  We are running release
> 1.3.2.  
>
>   
>
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Quickstart broken for 1.4-m1

2008-05-14 Thread Erik van Oosten

Hi,

If I do:

mvn archetype:create -DarchetypeGroupId=org.apache.wicket 
-DarchetypeArtifactId=wicket-archetype-quickstart 
-DarchetypeVersion=1.4-m1 -DgroupId=nl.grons -DartifactId=i18ntest


as generated by the quickstart page 
(http://wicket.apache.org/quickstart.html), I get Wicket version 
1.3-SNAPSHOT in the pom. Of course that should be 1.4-m1.


Should I create a Jira issue?

Regards,
   Erik.


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



Re: FYI: new wicket site

2008-05-14 Thread Erik van Oosten
It is a combination of 3 words 'er op uit' and literally means 'going 
out'. It has a very active connotation.


Regards,
   Erik.

Gerolf Seitz wrote:

the site looks nice.
i especially like the "advanced dropdown box".

for us non-dutch, does eropuit mean anything in particular?

cheers,
  Gerolf

On Wed, May 14, 2008 at 10:36 AM, lars vonk <[EMAIL PROTECTED]> wrote:

  

Hi all,

A new Wicket site is born! It's a Dutch site on which you can search for
day
trips and such. See: www.eropuit.nl.

Thanks to the user- and dev-group for answering any questions we had
during
the process.

Lars




  



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



Re: Inmethod Grid patch for Wicket 1.4-m1

2008-05-13 Thread Erik van Oosten
Hello Matej, all,

Ah, that is good to hear. The patch makes grid trunk in sync with
wicket-1.4-m1. There might be differences with wicket-1.4 trunk? In any
case, we could not build grid trunk with wicket-1.4-m1 when we retrieved
it (last Friday).

So please Matej, do not apply this patch on your repository :)

Regards,
Erik.


Matej Knopp wrote:
> Grid trunk is 1.4 of course. But it's kept in sync with 1.4 trunk. Why
> would Your patch basically reverses that, why would I want to apply
> it? :)
>
> -Matej
>
> On Tue, May 13, 2008 at 3:31 PM, Johan Compagner <[EMAIL PROTECTED]> wrote:
>   
>> i guess Matej wil gladly apply it for you
>>  Except that Matej then has to branch... i what does he like that... :)
>>
>>  johan
>>
>>
>>  On Tue, May 13, 2008 at 11:02 AM, Erik van Oosten <[EMAIL PROTECTED]>
>>  wrote:
>>
>>
>>
>>  > Hello,
>>  >
>>  > Inmethod Grid does not support Wicket 1.4 currently. Apply the attached
>>  > patch (created by my colleague Job de Noo) to the trunk version to get
>>  > it running again.
>>  >
>>  > Have fun,
>>  >Erik.
>>  >
>>  >
>>  > --
>>  > Erik van Oosten
>>  > http://day-to-day-stuff.blogspot.com/
>>  >
>>  >
>>  >
>>  > -
>>  > 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]



Inmethod Grid patch for Wicket 1.4-m1

2008-05-13 Thread Erik van Oosten
Hello,

Inmethod Grid does not support Wicket 1.4 currently. Apply the attached
patch (created by my colleague Job de Noo) to the trunk version to get
it running again.

Have fun,
Erik.


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


Index: grid-examples/src/test/java/com/inmethod/grid/examples/Start.java
===
--- grid-examples/src/test/java/com/inmethod/grid/examples/Start.java	(revision 3872)
+++ grid-examples/src/test/java/com/inmethod/grid/examples/Start.java	Fri May 09 16:35:59 CEST 2008
@@ -13,7 +13,7 @@
 		// Set some timeout options to make debugging easier.
 		connector.setMaxIdleTime(1000 * 60 * 60);
 		connector.setSoLingerTime(-1);
-		connector.setPort(8080);
+		connector.setPort(8081);
 		server.setConnectors(new Connector[] { connector });
 
 		WebAppContext bb = new WebAppContext();
Index: grid/src/main/java/com/inmethod/grid/treegrid/TreeGrid.java
===
--- grid/src/main/java/com/inmethod/grid/treegrid/TreeGrid.java	(revision 3872)
+++ grid/src/main/java/com/inmethod/grid/treegrid/TreeGrid.java	Fri May 09 16:31:43 CEST 2008
@@ -81,26 +81,27 @@
 		/**
 		 * [EMAIL PROTECTED]
 		 */
-		public void nodeCollapsed(Object node) {
+		public void nodeCollapsed(TreeNode node) {
 		}
 
 		/**
 		 * [EMAIL PROTECTED]
 		 */
-		public void nodeExpanded(Object node) {
+		public void nodeExpanded(TreeNode node) {
 		}
 
 		/**
 		 * [EMAIL PROTECTED]
 		 */
-		public void nodeSelected(Object node) {
+		public void nodeSelected(TreeNode node) {
 			onItemSelectionChanged(new Model((Serializable) node), true);
 		}
 
 		/**
 		 * [EMAIL PROTECTED]
 		 */
-		public void nodeUnselected(Object node) {
+@Override
+public void nodeUnselected(TreeNode node) {
 			onItemSelectionChanged(new Model((Serializable) node), false);
 		}
 	};
@@ -193,7 +194,7 @@
 	 * [EMAIL PROTECTED]
 	 */
 	@Override
-	public boolean isItemSelected(IModel itemModel) {
+	public boolean isItemSelected(IModel itemModel) {
 		return getTreeState().isNodeSelected(itemModel.getObject());
 	}
 
@@ -203,8 +204,8 @@
 	@SuppressWarnings("unchecked")
 	@Override
 	public void resetSelectedItems() {
-		Collection nodes = getTreeState().getSelectedNodes();
-		for (Object node : nodes) {
+		Collection nodes = getTreeState().getSelectedNodes();
+		for (TreeNode node : nodes) {
 			getTreeState().selectNode(node, false);
 		}
 		getTree().invalidateAll();
@@ -244,8 +245,8 @@
 	}
 
 	@Override
-	public void markItemDirty(IModel model) {
-		Object node = model.getObject();
+	public void markItemDirty(IModel model) {
+		TreeNode node = model.getObject();
 		getTree().markNodeDirty(node);
 	}
 
@@ -253,7 +254,7 @@
 	 * [EMAIL PROTECTED]
 	 */
 	@Override
-	public void selectItem(IModel itemModel, boolean selected) {
+	public void selectItem(IModel itemModel, boolean selected) {
 		getTreeState().selectNode(itemModel.getObject(), selected);
 	}
 
Index: grid/src/main/java/com/inmethod/grid/common/AbstractGrid.java
===
--- grid/src/main/java/com/inmethod/grid/common/AbstractGrid.java	(revision 3872)
+++ grid/src/main/java/com/inmethod/grid/common/AbstractGrid.java	Fri May 09 16:33:44 CEST 2008
@@ -6,6 +6,7 @@
 import java.util.List;
 
 import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreeNode;
 
 import org.apache.wicket.Component;
 import org.apache.wicket.MetaDataKey;
@@ -564,7 +565,7 @@
 	 *true if the item should be selected,
 	 *false otherwise.
 	 */
-	public abstract void selectItem(IModel itemModel, boolean selected);
+	public abstract void selectItem(IModel itemModel, boolean selected);
 
 	/**
 	 * Marks all currently displayed items as selected. For [EMAIL PROTECTED] DataGrid}
@@ -587,7 +588,7 @@
 	 * @return true if the item is selected, false
 	 * otherwise
 	 */
-	public abstract boolean isItemSelected(IModel itemModel);
+	public abstract boolean isItemSelected(IModel itemModel);
 
 	/**
 	 * Returns the collection of models of all currently selected items.
@@ -870,7 +871,7 @@
 	 * @param itemModel
 	 *model used to access the item
 	 */
-	public abstract void markItemDirty(IModel model);
+	public abstract void markItemDirty(IModel model);
 
 	private boolean selectToEdit = true;
 
Index: pom.xml
===
--- pom.xml	(revision 3872)
+++ pom.xml	Fri May 09 16:23:22 CEST 2008
@@ -513,7 +513,7 @@
 
 	
 		1.0.0-SNAPSHOT
-		1.4-SNAPSHOT		
+1.4-m1	
 		6.1.4
 	
 

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

Re: Why is it illegal to update hierarchy in onAfterRender?

2008-05-13 Thread Erik van Oosten
Hi Johan,

> AutoAdd can be done in the rendering. They are only there just then.
> And they will be removed by wicket after rendering.
Thanks Johan, those 2 lines explain it for me.
Could you add them to the javadoc of MarkupContainer?

Regards,
 Erik.


Johan Compagner wrote:
> Hmm i am affraid the source for more info is the source..
>
> AutoAdd can be done in the rendering. They are only there just then.
> And they will be removed by wicket after rendering. (at least they
> should)
>
> They are or can be normal components
>
>   
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Why is it illegal to update hierarchy in onAfterRender?

2008-05-12 Thread Erik van Oosten

Johan Compagner wrote:

What you can use is try to add it as auto add..
So create an auto add component, we will remove those for you
  
I tried to find some more on this topic, but both google as the Wicket 
wiki are not very informative. In the javadocs I could only find 
MarkupContainer.html#autoAdd. Unfortunately I am not sure I understand 
the consequences of what that method describes.


Is there a source of more information?

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]



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

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

[ 
https://issues.apache.org/jira/browse/WICKET-1355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12595347#action_12595347
 ] 

Erik van Oosten commented on WICKET-1355:
-

Richard, that change was the whole point of the fix. Apparently there is still 
a problem with the z-index, but reverting this line will not fix the problem of 
this issue.

> 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: Janne Hietamäki
> Fix For: 1.3.4
>
> 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.



Re: South African Wicket Users?

2008-05-08 Thread Erik van Oosten
Actually, since I changed jobs, Finalist no longer uses Wicket but now
JTeam (www.jteam.nl) does :)

Regards,
Erik.

>> Plenty of such companies around in the Netherlands it seems. 
>> Search through the list archives for ideas :-) Topicus, Xebia, 
>> Servoy, Hippo, Finalist to name a few. Good knowledge of 
>> Dutch is probably required, especially if you want to work outside of 'de 
>> randstad'.
>> 
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Why is it illegal to update hierarchy in onAfterRender?

2008-05-06 Thread Erik van Oosten

Hello Johan et all,

Ok, I see the problem. But let me then propose a change to the exception 
text. Something like "can not change hierarchy after render phase has 
started". I'll create a Jira issue if you like.


But why? Well, its one of the things I tried in a long list of attempts 
to do custom Ajax things. More experienced Wicketeers can probably point 
me in more productive directions.


I have this set up where custom javascript uses the result of an Ajax 
response and places it in a modal window (or on other places in the 
page). Why? Well, our html/javascript designer refuses to use the wicket 
ajax libraries but writes everything himself. The only thing he trusts 
is jquery.


So I worked around this by creating my own Ajax behaviors (which is 
pretty easy as you can easily get the URL that should be called from the 
client). I reused AjaxRequestTarget to generate the response. Now 
AjaxRequestTarget wants the component that is rendered to be a part of 
the current page. I therefore add the panel to be rendered to the page, 
even if it is not really used like that in the client code (as with the 
modal window). Therefore, at some moment it needs to be removed again as 
well.


For removal I have 2 cases:
-1- the modal window contains a form, the form might be submitted, so 
the server gets feedback.
-2- the modal window only displays some information or the form is not 
submitted, the server gets no feedback on the close of the modal window


For case -2- (in my earlier attempts) I tried to remove the component in 
onAfterRender. After realizing that this doesn't work, I did it in the 
onBeforeRender when some flag was set (accepting that it can be stored 
in the session for some time).
But I only just realize that this case could be solved a lot better by 
using a Page instead of a Panel to deliver the content for the modal window.


In case -1- however, I need to update the page that initiated the modal 
window. As we're not allowed to keep references between pages (because 
of the disk store's serialization tricks), I add the modal window panel 
to the page (with the form on it), and remove it again within the 
ajax-submit of the form. In the same onSubmit I update some components 
on the page, re-render them (again using AjaxRequestTarget) and pass 
them back to the client.
This works, but when the form is not submitted, the modal window panel 
is never removed from the page. After a couple of such closes, the 
response time of the page easily explodes to half a minute.


Ideally I would use a Page for the model window's content as well. 
However, I see no way to get a reference to the page it was opened from.


Can anyone shine a little light on this? Is it possible to get that page 
reference? How does Wicket's modal window do this?


Regards,
   Erik.



Johan Compagner wrote:

Why do you want to do that?
The problem is if you affect the page then the page version is
affected. So all what is rendered now isnt really the state wat the
page has.
Thats why you get that exception when rendering has started.

On 5/6/08, Erik van Oosten <[EMAIL PROTECTED]> wrote:
  

Hi,

When I try to change the component hierarchy in onAfterRender I get an
exception with the text "can not change hierarchy *during* render
phase". Why is this? Isn't the render phase finished in on*After*Render?

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]



Why is it illegal to update hierarchy in onAfterRender?

2008-05-06 Thread Erik van Oosten
Hi,

When I try to change the component hierarchy in onAfterRender I get an
exception with the text "can not change hierarchy *during* render
phase". Why is this? Isn't the render phase finished in on*After*Render?

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: Invoulentary session sharing/leakage in Wicket 1.3.x

2008-05-05 Thread Erik van Oosten
Isn't this problem serious enough to release 1.3.4?

Regards,
Erik.


Johan Compagner wrote:
> the only thing we found was the finalize block that could be skipped because
> of an exception again in that block
>
> That is fixed in current 1.3.x branch (and 1.4)
>
>   

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



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



Re: [ANNOUNCE] Apache Wicket 1.4-M1

2008-05-04 Thread Erik van Oosten

Hi,

I am correct in the assumption
-1- that the goal for 1.4 is to only introduce generics,
-2- and to keep the rest of the product stable,
-3- and it is therefore safe to use milestone 1 for development,
-4- and perhaps even for production usages?

Regards,
   Erik.



Frank Bille wrote:

The Apache Wicket team is proud to announce the availability of the
first milestone release of our first java 1.5 Wicket version: Apache
Wicket 1.4-m1.


  



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


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



Re: [slf4j-user] Java 5 version of SLF4J?

2008-05-02 Thread Erik van Oosten
Simon Kitching wrote:
> A push is quick, and cleaning up a callstack afterwards is normally done in 
> fixed-time, regardless of what was on the stack. If params are passed in 
> registers, it is even quicker. So IMO, SLF4J's approach is fine from a 
> performance approach. Sorry if my mail wasn't clear on that.
>
> IMO, creating the Object[] is worth avoiding, however, which rules out real 
> varargs implemetations [1]. The cost is not just creating, but also 
> garbage-collection afterwards.
Yes, that is true but negligible as well. Newer JVM's (I believe 
starting from JSE5) will clean up shortly, or unused variables in  fixed 
time as well. Objects can even be created on the call stack!

Regards,
Erik.

___
user mailing list
user@slf4j.org
http://www.slf4j.org/mailman/listinfo/user


Re: [slf4j-user] Java 5 version of SLF4J?

2008-04-25 Thread Erik van Oosten
Hi Simon,

What you describe under [1] is called escape analysis. Under most
circumstances most code and most data is unused. This can be detected,
and some compilers actually do this. As I said, I am not sure the JVM is
capable of doing this. BTW, a runtime compiler such as hotspot has many
more options to do escape analysis then a static compiler.

> That would be seriously smart optimisation though. 
I think you underestimate the cleverness of the JVM people :)

Apart from the potential performance penalty, I still think log5j has a
nicer interface. I would use it if was available for slf4j.

> I think the lack of varargs support is a feature, and good api design.
Well, I certainly do not agree there. But anyway, there are enough other
reasons for not changing the slf4j interface.

Regards,
Erik.



Simon Kitching wrote:
> Hi Erik,
>
> You're right that the correspondence between bytecode and actual machine
> instructions is not direct. And in fact, the machine instructions
> could even vary during a program's run if the JVM is doing dynamic
> optimisation.
>
> But in this specific case,
> (a) Whether the formatting parameters are used or not depends upon the
> current setting of the logging threshold level for that category. There
> is no way the caller can determine that, so AFAICT the params will
> really have to be passed somehow. [1]
> (b) If the params are used, then they are passed as an object array to
> java.util.Formatter so an object array does need to be created at that
> point. *Possibly* a clever runtime optimiser could pass the params in
> registers, and delay creating of the object array until after the
> threshold test is done. That would be seriously smart optimisation
> though. For a start, doing this means changing the way that callers
> invoke the method, so would need to dynamically be patched into every
> callsite, not just optimise the internal implementation of a method. And
> different Logger objects can theoretically have different concrete
> implementations at runtime, so the mechanism used to invoke the call
> would need to vary depending upon the concrete implementation
> referenced. I can't see that being feasable.
>
> [1] Unless the runtime optimiser sees that the first thing the called
> method does is invoke isXXXEnabled, before using any params. When the
> calling site is using a final reference to the logger object, it would
> then be possible to migrate that call up into the calling site, and the
> effect would be like wrapping every call in isXXXEnabled, which would be
> nice. I have no idea whether any existing JVMs do this; it's fairly
> clever work. Hmm.. it would also mean presumably rewriting the called
> method so that the isXXXEnabled does not get called multiple times. But
> that would then break other callers. Ouch, this makes my head hurt  :-) 
>
> I'd be willing to bet that in everything except specialist jvms (and
> maybe there too), the log5j approach has a significant performance
> penalty due to the creation of an object array for each call, and
> therefore manually wrapping in isXXXEnabled is needed.
>
> But
>// standard SLF4J or JCL
>if (log.isDebugEnabled())
>   log.debug(String.format("...", arg1, arg2, arg3, arg4));
> and
>// log5j only
>if (log.isDebugEnabled())
>   log.debug("...", arg1, arg2, arg3, arg4);
> are identical in performance, and not much different aesthetically.
>
> The mere existence of the varargs method, however, is a performance trap
> just waiting for users to fall into, tempting them to omit the
> isDebugEnabled call. A small trap, but nevertheless there. By *not*
> providing a varargs option, the SLF4J/JCL API instead makes it obvious
> that the isDebugEnabled is necessary. I think the lack of varargs
> support is a feature, and good api design.
>
> Regards,
>
> Simon
>   

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


___
user mailing list
user@slf4j.org
http://www.slf4j.org/mailman/listinfo/user


Re: [slf4j-user] Java 5 version of SLF4J?

2008-04-25 Thread Erik van Oosten
Hi Simon,

You should never confuse Java byte code with compiled byte code. I
understand there are a few superfluous byte codes, but in the end the
JVM determines how to compile it to CPU instructions. Unfortunately I am
not aware of what the JVM actually does with unused values. Does it do
escape analysis already?

Regards,
Erik.


Simon Kitching schreef:
> Erik van Oosten schrieb:
>   
>> Christopher,
>>
>> As I wrote already on Feb 17:
>>  There is another aproach, as taken by http://code.google.com/p/log5j/. 
>> It is
>>  a wrapper around log4j. I wish they had made it for SLF4J!
>>
>> I am still waiting for someone to this for SLF4J. It should not be hard. I 
>> did not yet find the time myself :(
>>   
>> 
>
> Sigh. Broken broken broken.
>
> Re the "feature" for determining which category to create a logger for,
> see the documentation for Exception.getStackTrace. There is no guarantee
> that valid info about the callstack is available. So this code will work
> fine under unit testing, then may start emitting messages to the wrong
> categories when run in a high-performance environment. That will be fun
> to debug...
>
> Re the printf-style formatting:
>
>   log.debug("format str", arg0, arg1, arg2);
>
> is exactly equivalent to:
>
>   push "format str" onto stack
>   tmp = new Object[3];
>   tmp[0] = arg0;
>   tmp[1] = arg1;
>   tmp[2] = arg2;
>   push tmp onto stack
>   invoke log.debug
>   (and of course garbage-collect the tmp object later..)
>
> So in practice, for good performance you need
>   if (log.isDebugEnabled())
> around each call anyway. In which case, the printf-style stuff gives no
> performance benefits at all; if something is going to be logged then the
> formatting is nowhere near the bottleneck step.
>
> The SLF4J fake-varargs approach, where the api allows 0,1 or 2 params is
> slightly better, as it avoids the "new Object[]" call. But for best
> performance, isDebugEnabled should be used anyway.
>
> Regards,
> Simon
>
> ___
> user mailing list
> user@slf4j.org
> http://www.slf4j.org/mailman/listinfo/user
>   

-- 

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


___
user mailing list
user@slf4j.org
http://www.slf4j.org/mailman/listinfo/user


Re: [slf4j-user] Java 5 version of SLF4J?

2008-04-24 Thread Erik van Oosten
Christopher,

As I wrote already on Feb 17:
There is another aproach, as taken by http://code.google.com/p/log5j/. 
It is
a wrapper around log4j. I wish they had made it for SLF4J!

I am still waiting for someone to this for SLF4J. It should not be hard. I did 
not yet find the time myself :(

Regards,
Erik.



[EMAIL PROTECTED] wrote:
>
> Ceki,
>
> I do understand your reasoning, and thank you for your quick response.
>
> 
--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/


___
user mailing list
user@slf4j.org
http://www.slf4j.org/mailman/listinfo/user


Just a small warning: Ext-JS changed license to GPL

2008-04-23 Thread Erik van Oosten

Hello,

As you may have heard already: Ext-JS, as of yesterday (version 2.1), no 
longer has the LGPL license, but GPL, making it unusable for commercial 
products.


Just a small warning for those that are using it.

Awaiting the first fork,
   Erik.



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



Re: 1.3, resource locator and properties

2008-04-23 Thread Erik van Oosten

Scott,

I am no core developer, but I think that creating a issue (preferably 
with a patch) would be the fastest way to success.


Regards,
   Erik.


Scott Swank wrote:

Bump.

Do any devs have an opinion on this?  Should I create a jira instead
of asking this on the list?

Here is a quick summary so that no one needs to read through the thread:

1. The ResourceNameIterator encapsulates the
style/variation/localization strategy
2. The ResourceStreamLocator uses it to find html
3. The ComponentStringResourceLocator uses it to find properties
4. The ClassStringResourceLocator delegates to the
ComponentStringResourceLocator to find application properties

This means that all four of the above must be implemented to use a
different strategy.  However, if a custom ResourceNameIterator could
be registered in IResourceSettings then 2, 3 & 4 would not have to be
touched.

Do the devs prefer to keep ResourceNameIterator an internal
implementation or expose it on IResourceSettings and simplify the
creation of atypical resource location?

Thank you,
Scott

  



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



Re: Question about StringResourceLoader

2008-04-23 Thread Erik van Oosten

That is easy. Use getLocalizer.getString("key", City.class, new Model(obj)).

You can not do this in the constructor of your component though. There 
are 2 workaround: 1) create a model (for example by subclassing 
AbstractReadOnlyModel), 2) override the method onBeforeRender in your 
component.


Regards,
   Erik.


Ned Collyer wrote:

Was there any thoughts on this guys?


Ned Collyer wrote:
  

If I have something like

my.example.City.java
my.example.City.properties

And its a non wicket class, possibly coming from another library managing
its own internationalisation.

How can I use this in my panels, and have the same override behaviour as
with Panels and Pages.

I think I would want something like this
StringResourceModel(java.lang.String resourceKey, Component component,
Object myObj) 


where it can use the lookup "my.example.City.properties" and if it cant
find anything there, then look in MyPanel.properties etc.

From reading the javadoc for StringResourceModels its non obvious if this
can be achieved with inbuilt wicket objects.

I can use the IStringResourceLoader and write something myself, or...
perhaps I'm overlooking something.

Can someone shed some light please?




  



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



Re: LoadableDetachableModel and load() method question

2008-04-18 Thread Erik van Oosten

Hi Warren,

It should not be called twice. Not within the same request that is.

Possible causes:
- you have 2 model instances instead of 1
- there is a bug in Wicket

If you are sure it the latter, please provide a quickstart and add it to 
a new Jira issue.


Regards,
   Erik.


Warren wrote:

I have a page that displays a lot of labels and two text field. It is
refreshed thru an AjaxFormSubmitBehavior that just refreshes the same page
with a new item using a LoadableDetachableModel. I need to update the item
displayed and retrieve a new one. I am doing this within the load method.

protected Object load()
{
// Update last Item
// Retrieve next Item
}

Everything works, but load() gets called twice. I understand why that
happens, but I only need it to be called once. I can use a flag to make the
body of load run once, but this does not seem very clean and I can see it
causing problems. Is there a better way to achieve what I am trying to do?

Thanks,

Warren Bell

  



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



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