Re: [Wicket-user] Re: mountBookmarkablePage and resource paths

2006-01-31 Thread R.J. Lorimer

Gili,

Can't you use the new RequestTargetUrlCodingStrategy to effectively meet 
the needs of the page alias stuff? It's a little more complicated from 
what I've seen, but also more flexible.


Any of the people more familiar with this feature care to comment?

R.J.


Gili wrote:


Should I file a bug report against this? My shared resources have 
been bookmarked by thousands of websites and migrating from Wicket 1.1 
to 1.2 changes their URLs.


Gili

Gili wrote:

Hi,

Any idea why mountBookmarkablePage does not affect resource 
paths? That is, in the old implementation putClassAlias() would 
affect both such that I could refer to:


/WicketServlet/resources/myPageAlias/myImage.jpg

now I have to refer to:

/WicketServlet/resources/com.foo.bar.Page/myImage.jpg

instead which looks rather ugly. Is there an equivalent aliasing 
mechanism for resources?


Thanks,
Gili





---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] How can I separate the java and html?

2006-01-17 Thread R.J. Lorimer
Also, don't forget borders as another way to wrap common layout code 
around differing pages!


Timon Sta mm wrote:

Frank Silbermann schrieb:

Frank Silbermann schrieb:

[...]


It seems reasonable to want to use the same HTML page to mark up many
Wicket page objects sharing the same layout.  Yes, I realize we can
group common HTML in a reusable panel (though we would still need a
trivial HTML file to contain the panel for each Wicket page), and I
realize we can write a single generalized Wicket page and change the
contents of the model.


Timo Stamm schrieb: 

Or you could use inheritance.


If I have a long inheritance chain descended from
wicket.markup.html.WebPage, what is the rule as to which class-name
needs to match the HTML filename?  Would it always be the class which
inherits from wicket.markup.html.WebPage directly?


AFAIK, wicket loads markup for the current class at first. It will 
ascend through the inheritance chain until a markup file is found. If 
the markup contains a wicket:extends tag, the markup enclosed in the 
wicket:extend tag will be included in the markup of the parent class 
(at the location of the wicket:child tag).


I guess it is possible to use more than one wicket:extends tag in an 
inheritance chain, but I have not yet been in a situation where it 
would have been useful. This is absolutely enough for my needs:


- abstract base pages (access check, context objects)
- pages with base markup (navigation types)
- pages with extending markup (forms, lists)


Timo



(Wie kennt man ob man schrieb oder hat geschrieben benuetzen soll?)


Habe ich noch nie verstanden, aber hier sollte es sowieso eher wrote 
sein :)



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log 
files

for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user






---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Wicket Tutorial Posted

2006-01-07 Thread R.J. Lorimer

Johan,
It has been updated.

Thanks,

R.J.

Johan Compagner wrote:
can you alter the first one so that includes the links to the others 
after that?
Because the first one is linked on the home page and is very visible 
so then people can read on!


johan


On 1/6/06, *R.J. Lorimer* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:


Crash,

Thanks for the positive feedback. Since that initial tutorial, I have
posted two subsequent tips:

Reusable Panels: http://www.javalobby.org/java/forums/t60926.html
http://www.javalobby.org/java/forums/t60926.html
Let Components Contribute to the Header Section:
http://www.javalobby.org/java/forums/t61002.html

As usual, feedback is welcome!

R.J. Lorimer

Crash_neo wrote:
 Nice article,
 as a new user I like these kind of tuto's it gives me some grip
on the
 possibilities.
 I am looking forward to he tips etc. your planning to write

 R.J. Lorimer wrote:
 I have posted a quick Tutorial to the Javalobby Tips  Tricks
section
 presenting Wicket 1.1 (actually works with Wicket 1.2 12/29
snapshot
 as well) as a primer to a suite of tips I plan to write regarding
 Wicket:

 http://www.javalobby.org/forums/thread.jspa?threadID=60786

 Comments, feedback, corrections, and suggestions would be
 appreciated. I don't want to omit or state something incorrectly!

 Regards,

 R.J. Lorimer
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]


 ---
 This SF.net email is sponsored by: Splunk Inc. Do you grep through
 log files
 for problems?  Stop!  Download the new AJAX search engine that
makes
 searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
 http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
mailto:Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user



 ---
 This SF.net email is sponsored by: Splunk Inc. Do you grep
through log
 files
 for problems?  Stop!  Download the new AJAX search engine that makes
 searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
 http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
 ___
 Wicket-user mailing list
 Wicket-user@lists.sourceforge.net
mailto:Wicket-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/wicket-user





---
This SF.net email is sponsored by: Splunk Inc. Do you grep through
log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD
SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
mailto:Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Wicket Tutorial Posted

2006-01-05 Thread R.J. Lorimer

Crash,

Thanks for the positive feedback. Since that initial tutorial, I have 
posted two subsequent tips:


Reusable Panels: http://www.javalobby.org/java/forums/t60926.html
Let Components Contribute to the Header Section: 
http://www.javalobby.org/java/forums/t61002.html


As usual, feedback is welcome!

R.J. Lorimer

Crash_neo wrote:

Nice article,
as a new user I like these kind of tuto's it gives me some grip on the 
possibilities.

I am looking forward to he tips etc. your planning to write

R.J. Lorimer wrote:
I have posted a quick Tutorial to the Javalobby Tips  Tricks section 
presenting Wicket 1.1 (actually works with Wicket 1.2 12/29 snapshot 
as well) as a primer to a suite of tips I plan to write regarding 
Wicket:


http://www.javalobby.org/forums/thread.jspa?threadID=60786

Comments, feedback, corrections, and suggestions would be 
appreciated. I don't want to omit or state something incorrectly!


Regards,

R.J. Lorimer
[EMAIL PROTECTED]


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through 
log files

for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log 
files

for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user






---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Wicket Tutorial Posted

2006-01-02 Thread R.J. Lorimer
I have posted a quick Tutorial to the Javalobby Tips  Tricks section 
presenting Wicket 1.1 (actually works with Wicket 1.2 12/29 snapshot as 
well) as a primer to a suite of tips I plan to write regarding Wicket:


http://www.javalobby.org/forums/thread.jspa?threadID=60786

Comments, feedback, corrections, and suggestions would be appreciated. I 
don't want to omit or state something incorrectly!


Regards,

R.J. Lorimer
[EMAIL PROTECTED]


---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Component-Level AJAX Response

2005-12-27 Thread R.J. Lorimer
shh, of course. The response shouldn't just be the panel - it should be 
an entire Page! That makes sense.


Thanks for your help, I'll keep my progress posted here.

Emergence Dinterstage wrote:

On 12/28/05, R.J. Lorimer [EMAIL PROTECTED] wrote:
  

ComponentRequestTarget re-renders components which have already been
rendered during the full page render. We only recently fixed a bug to
allow Panel children to be re-rendered as well. Because you are
re-rendering a Panel that bug should not affect you, but because of
the change I'd still suggest to use cvs head.

  

This may be part of my problem - the component being passed in to the
handler has never been rendered before - part of the advantage of using
an additional click/AJAX is that I don't have to do the extra query
until the user asks for it. I was trying to achieve that by creating a
component that would be rendered for the first time when the AJAX
request was complete.



where is the components markup you try to render?

  

The core problem is that I have never rendered the component before, I
think. Is there a way to achieve this?



In order to render a Component it (the root component; not its
children) must know its associated markup. And the only way to achieve
it is to render the whole page first. To clarify it a little bit more.
You'll find a labels markup somewhere with a panel, border or page
markup file. To render this label the associated markup stream
position is required, which gets assigned during a page render phase.

  

Effectively, I want to send the
HTML result of my component render to the user on an AJAX bind call.



Ok, the response is XML and it has never been rendered before.
Actually it is like a page request which returns XML instead of HTML.
It is not a component re-render, it is whole new request.
Create a new Page, override MarkupContainer.getMarkupType() (see
src/test ... XmlPage) create whatever XML response is required.

  

Perhaps I am missing some of the puzzle for using deferred AJAX calls
using the AjaxHandler. I dug through the contrib-dojo stuff - and the
only one that handles a callback completely is the Validation stuff, and
it simply returns a valid/invalid plain text mime-type result.




---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37alloc_id865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



  



---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


[Wicket-user] Component-Level AJAX Response

2005-12-26 Thread R.J. Lorimer

Hello,

I've been working with the Wicket 1.2 snapshot to try and integrate some 
more complex DOJO Ajax code for my site.


In short (to give you an idea of what I'm trying to accomplish), I have 
a weblog with entries and comments. When the user clicks on 'View 
Comments', I'd like to use DOJO to pull down the comment list xhtml, 
create a DOM out of it, and then wipe it in using dojo fx.


Here is the interesting part - my comment list already exists as a 
Wicket Panel object - so the Wicket side of the equation is almost 
modularized completely. Here is what I have done, and where I am getting 
stuck - I'll append the source code for the various parts I'm discussing 
below:


I've created a BlogCommentAjaxHandler that effectively adds unique dojo 
functions for each blog entry to the top of the page. One of the 
behaviors of the dojo function is to callback to the server, asking for 
the result of the AJAX (using AjaxHandler.getCallbackUrl()). The custom 
AjaxHandler I wrote overrides 'respond()', and instead of using the 
ResourceStreamRequestTarget, it uses a ComponentRequestTarget with a 
component of my BlogCommentsPanel (the plot thickens!)


I've then registered the AjaxHandler on to the ListItem for my blog 
entry, and associated it with a triggering component (a label to which 
I've added an on-click).


Now, everything works up until the point it performs the callback, at 
which time Component.getPage() on my BlogCommentsPanel throws an 
IllegalStateException because it doesn't have a Page object. What is 
interesting is that ComponentRequestTarget is written to assume that the 
Page may be null, but Component.getPage() (which is final) returns null.


To make testing easier, I have currently made it so that the 
BlogCommentsPanel is passed in to the AjaxHandler - obviously I'd like 
to make it so this component can be built lazily from the user's request 
(deferring the work to the Ajax request itself). That's not reflected in 
the code below!


Any help/thoughts on where to go from here would be greatly appreciated.

Here is a general sketch of my ajax handler:

import wicket.*;
import wicket.markup.html.HtmlHeaderContainer;
import wicket.model.Model;
import wicket.request.target.ComponentRequestTarget;

public class BlogCommentAjaxHandler extends AjaxHandler {

   private Component component;
   private Component elementToRender;
   private Component trigger;
   private String componentId;
   private String htmlId;
  
   public BlogCommentAjaxHandler(Component elemToRender, Component 
trigger) {

   this.trigger = trigger;
   this.elementToRender = elemToRender;
   }

   @Override protected String getImplementationId() {
   return DojoImpl;
   }

   @Override protected void respond() {
   RequestCycle requestCycle = RequestCycle.get();
   // TODO - implement code to use component as request target.
   requestCycle.setRequestTarget(new 
ComponentRequestTarget(elementToRender));

   }

   /**
* The duration of the animation.
*/
   protected int getDuration() {
   return 500;
   }

   protected Component getTrigger() {
   return trigger;
   }

   protected void onBind() {
   Component c = getComponent();
   this.component = (Component) c;
   this.componentId = c.getId();

   // create a unique HTML for the wipe component
   htmlId = this.component.getId() + _ + component.getPath();

   // Add ID to component, and bind effect to trigger
   this.component
   .add(new AttributeModifier(id, true, new Model(htmlId)));
   this.getTrigger().add(
   new AttributeModifier(onclick, true, new Model(comp_ 
+ componentId
   + _expandComments(' + htmlId + ', ' + 
getCallbackUrl() + ',  + getDuration()

   + ); return false;)));

   }

   public final void renderHeadContribution(HtmlHeaderContainer container)

   {
   String wipingVarName = comp_ + componentId + _wiping;
   String s = \t
   + script language=\JavaScript\ type=\text/javascript\\n
   +  wipingVarName + = 0; \n
   + function comp_+ componentId + _expandComments(id, 
componentUrl, duration) { \n

   + if(+ wipingVarName + ==0){\n
   + node = document.getElementById(id);\n
   + wipingVarName + = 1;\n
   + dojo.io.bind({\n
   + url: componentUrl,\n
   + mimetype: \text/xml\,\n
   + load: function(type, data, evt) {\n
   + var dom = dojo.dom.createDocumentFromText(data, mimetype);\n
   + dojo.dom.insertAtIndex(dom, node, 0);\n
   + }});\n
   + dojo.fx.html.wipeIn(dom, duration, function(){
   + dom.style.height='auto';});\n
   + \t\t + }\n
   + \t + }\n
   + \t + /script\n;
   container.getResponse().write(s);

   }
}








---
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for