Re: Mount URL to another host?

2008-10-12 Thread Zach Cox

I'm sure calling setResponsePage with a new RedirectPage would work equally
well.


Uwe Schäfer-2 wrote:
> 
> doesn´t this work there?
> 
> class SomethingPage extends WebPage { // mounted accordingly
> public SomethingPage (){
> setResponsePage(new RedirectPage("http://othersite.com";));
> }}
> 
> cu uwe
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19940933.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Mount URL to another host?

2008-10-10 Thread Zach Cox

This seems to work:

public class SomethingPage extends RedirectPage
{
public SomethingPage()
{
super("http://othersite.com";);
}
}

MyApplication.init():
mountBookmarkablePage("something", SomethingPage.class);

Thanks for all the replies!  Wicket community rulz.
-- 
View this message in context: 
http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19922897.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Mount URL to another host?

2008-10-10 Thread Zach Cox

I need the browser to actually redirect the user to http://othersite.com if
they go to http://mysite.com/something, regardless of if they click a link
or type it into the address bar.



igor.vaynberg wrote:
> 
> externallink?
> 
> -igor
> 
> On Fri, Oct 10, 2008 at 9:51 AM, Zach Cox <[EMAIL PROTECTED]> wrote:
>>
>> I feel dumb for even asking this, as there's got to be an easy way, but
>> my
>> brain is blocked today...
>>
>> I need a URL on my site, say http://mysite.com/something to redirect to
>> another site entirely, say http://othersite.com.  Is there some
>> IRequestTargetUrlCodingStrategy that will do this?  Or am I totally on
>> the
>> wrong track by looking there?
>>
>> Thanks,
>> Zach
>> --
>> View this message in context:
>> http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19921980.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19922170.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Mount URL to another host?

2008-10-10 Thread Zach Cox

Yes that is exactly what I need.  I can definitely do the bookmarkable page
approach.  I'm using Tomcat for everything, do you know if I can have Tomcat
do this, maybe something in web.xml?



Jeremy Thomerson-5 wrote:
> 
> I think he means when someone goes to that URL, it needs to redirect
> entirely.  Not just be able to link to another site.
> 
> A couple options:
> Mount a bookmarkable page at that URL and in the constructor throw a new
> RestartResponseAtInterruptPageException with a new RedirectPage as the
> parameters.
> 
> Probably better would be if you have a frontend server like apache or IIS
> -
> to do it there.
> 
> Hope this helps.
> 
> -- 
> Jeremy Thomerson
> http://www.wickettraining.com
> 
> 
> 
> On Fri, Oct 10, 2008 at 11:54 AM, Igor Vaynberg
> <[EMAIL PROTECTED]>wrote:
> 
>> externallink?
>>
>> -igor
>>
>> On Fri, Oct 10, 2008 at 9:51 AM, Zach Cox <[EMAIL PROTECTED]> wrote:
>> >
>> > I feel dumb for even asking this, as there's got to be an easy way, but
>> my
>> > brain is blocked today...
>> >
>> > I need a URL on my site, say http://mysite.com/something to redirect to
>> > another site entirely, say http://othersite.com.  Is there some
>> > IRequestTargetUrlCodingStrategy that will do this?  Or am I totally on
>> the
>> > wrong track by looking there?
>> >
>> > Thanks,
>> > Zach
>> > --
>> > View this message in context:
>> http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19921980.html
>> > Sent from the Wicket - User mailing list archive at Nabble.com.
>> >
>> >
>> > -
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19922244.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]



Mount URL to another host?

2008-10-10 Thread Zach Cox

I feel dumb for even asking this, as there's got to be an easy way, but my
brain is blocked today...

I need a URL on my site, say http://mysite.com/something to redirect to
another site entirely, say http://othersite.com.  Is there some
IRequestTargetUrlCodingStrategy that will do this?  Or am I totally on the
wrong track by looking there?

Thanks,
Zach
-- 
View this message in context: 
http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19921980.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: Bookmarkable RSS feed with parameter using wicketstuff-rome

2008-04-21 Thread Zach Cox

Hi Ryan - that all worked great until I needed to create a link to the feed
from my WebPage.  That page has pagination so once I click off the 1st page
I lose the ID in the URL so the getParameters().getLong("id"); line starts
failing.  Although I'm not sure why using ResourceLink causes the SyndFeed
to be created...

My solution to this whole problem involved these classes:
 - MyFeedResource extends FeedResource and creates the SyndFeed using a
particular ID that gets passed in to the constructor
 - MyFeedRequestTarget extends ResourceStreamRequestTarget and creates a new
MyFeedResource using a particular ID, passing its IResourceStream to the
super constructor
 - MyFeedRequestTargetUrlCodingStrategy gets mounted at a nice URL and
handles encoding & decoding a MyFeedRequestTarget and a particular ID
 - MyFeedLink extends Link and creates a link to the feed for a particular
ID (much like BookmarkablePageLink)
 - MyFeedHeaderContributor extends HeaderContributor and creates the
auto-discovery link of the feed for a particular ID that goes in the 
section

What I thought was going to be straightforward blew up into five separate
classes just to get feeds that take a parameter, can be accessed at nice
URLs, and always work in feed readers.  Can you see any way I can simplify
this?

I totally love Wicket and don't want to hate on it, it's made me orders of
magnitude more productive than any other framework has, but every time I
have to use the Resource API I want to put my head through a brick wall. 
That is definitely an area that could use some simplification & refinement
in a future release.

Thanks,
Zach




Ryan Sonnek-2 wrote:
> 
> see responses inline:
> 
> On Mon, Apr 21, 2008 at 1:07 PM, Zach Cox <[EMAIL PROTECTED]> wrote:
> 
>> I would like to have URLs for this feed something like this:
>>
>> http://site.com/feed/1234
>>
>>
> This should be possible by mounting the feed resource with a "nice" url
> from
> within your WebApplication class:
> 
> public class MyApplication extends WebApplication {
>   public void init() {
> mountSharedResource("/view/rss", new ResourceReference("myFeed") {
>   protected FeedResource newResource() {
> return new MyFeedResource();
>   }
> }.getSharedResourceKey());
>   }
> }
> 
> 
> 
> 
> 
> 
> 
> 
>> That way users can add that URL to their feed readers and always get
>> the latest info for object 1234.  All of the wicketstuff-rome examples
>> I've seen seem to create the FeedResource instance once and then make
>> it a shared resource.  I'm currently doing that but the feeds seem to
>> disappear and cannot be read in a feed reader after some time.
> 
> 
> This would be a question for the wicket folks and not a wicketstuff-rome
> issue.  Is there any known limitation for feed resources?
> 
> 
> 
>> Since wicketstuff-rome provides a Resource subclass (FeedResource) and
>> not a WebPage subclass I'm confused as to how to do the following:
>>  - get bookmarkable URLs with a parameter for the feed
> 
> 
> You can grab request params by using the getParameters() method within
> your
> FeedResource
> 
> public class MyFeedResource extends FeedResource {
> 
>   protected SyndFeed getFeed() {
> Long id = getParameters().getLong("id");
>   }
> 
> }
> 
> 
>   - have a new FeedResource created & returned when user accesses that URL
> 
> 
> need to ask the wicket folks why this isn't happening...
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Bookmarkable-RSS-feed-with-parameter-using-wicketstuff-rome-tp16816318p16819657.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]



Bookmarkable RSS feed with parameter using wicketstuff-rome

2008-04-21 Thread Zach Cox
I have a WebPage that takes the ID of an object in the database in the
URL, extracts it from PageParameters, and displays information related
to that object.  I'm also using wicketstuff-rome to create an RSS feed
for information related to that object, so I'll have the autodiscovery
link in the  section and an RSS feed link in the page.

I would like to have URLs for this feed something like this:

http://site.com/feed/1234

That way users can add that URL to their feed readers and always get
the latest info for object 1234.  All of the wicketstuff-rome examples
I've seen seem to create the FeedResource instance once and then make
it a shared resource.  I'm currently doing that but the feeds seem to
disappear and cannot be read in a feed reader after some time.

Since wicketstuff-rome provides a Resource subclass (FeedResource) and
not a WebPage subclass I'm confused as to how to do the following:
 - get bookmarkable URLs with a parameter for the feed
 - have a new FeedResource created & returned when user accesses that URL

I'm sure there's an obvious solution in front of my face but I can't
seem to find it.

Thanks,
Zach

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



Customize TinyMCE init settings

2008-04-20 Thread Zach Cox
I'm using the wicket-contrib-tinymce package and need to configure
some of the settings that go into the init JavaScript:

tinyMCE.init({
//settings from TinyMCESettings.toJavaScript are put here
});

Specifically I need to set the content_css setting to get the same
styles in the editor as on the rest of the site.  Is there any way to
customize what goes into that tinyMCE.init call?  I can't see any way
other than to hack TinyMCESettings to pieces.

Maybe a public void addInitSetting(String) method would be a good
addition to TinyMCESettings?  There are tons of configuration options
(http://wiki.moxiecode.com/index.php/TinyMCE:Configuration) and it
would be nice to be able to easily set any of them.

Thanks,
Zach

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



FileUploadField loses user input when form validation fails

2008-04-20 Thread Zach Cox
We have a large form that contains two FileUploadFields along with
many other text fields.  If validation fails on one of those other
text fields, the form is re-rendered along with feedback messages.
When the form is re-rendered, the file path & name that the user
specified for the FileUploadFields is gone which is extremely annoying
to users as they must specify those files again.

How can I make the user-specified input remain in those
FileUploadFields if the form is re-rendered due to form validation
failure?

Thanks,
Zach

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



FeedbackPanel ul has no class

2008-04-05 Thread Zach Cox
In the latest early access version of Wicket in Action, page 202, it
gives this as the markup that FeedbackPanel produces:


   
  Field 'name' is required.
   


However, in real usage the ul element has no class attribute.  Is this
a bug in Wicket 1.3.2 or am I missing something?

Thanks,
Zach

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



Re: for Google Maps in child pages

2008-03-29 Thread Zach Cox

Seriously?  There's no AttributeModifier I can use to add an onunload
attribute to body element?

If not, is it just a matter of "it hasn't been implemented"?  Or is there
some philosophical reason it isn't available?

Thanks,
Zach



igor.vaynberg wrote:
> 
> body onunload="if (GUnload!='undefined') GUnload();"
> 
> -igor
> 
> 
> On Sat, Mar 29, 2008 at 10:51 AM, Zach Cox <[EMAIL PROTECTED]> wrote:
>> I'm using markup inheritance to reuse a base page template for all
>>  pages on my site.  Some of these pages include Google Maps.  According
>>  to  best practices, the  element of the page needs an onunload
>>  event handler that calls the GUnload() function to eliminate memory
>>  leaks:
>>
>> 
>> http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap
>>
>>  I can't put this on the body element of the base page, since only a
>>  few pages need it.  I tried adding a BodyTagAttributeModifier in the
>>  child page constructor but it did absolutely nothing to the body
>>  element:
>>
>>  add(new BodyTagAttributeModifier("onunload", true, new
>>  Model("GUnload();"), this));
>>
>>  I understand the proper way to call onload Javascript is to use
>>  IHeaderResponse.renderOnLoadJavasript() but there's nothing for
>>  onunload.  Is there any way for a child page to dynamically add an
>>  onunload attribute to the page's body element?
>>
>>  Thanks,
>>  Zach
>>
>>  -
>>  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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%3Cbody-onunload%3D%22GUnload%28%29%22%3E-for-Google-Maps-in-child-pages-tp16372664p16373185.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]



for Google Maps in child pages

2008-03-29 Thread Zach Cox
I'm using markup inheritance to reuse a base page template for all
pages on my site.  Some of these pages include Google Maps.  According
to  best practices, the  element of the page needs an onunload
event handler that calls the GUnload() function to eliminate memory
leaks:

http://code.google.com/apis/maps/documentation/introduction.html#LoadingMap

I can't put this on the body element of the base page, since only a
few pages need it.  I tried adding a BodyTagAttributeModifier in the
child page constructor but it did absolutely nothing to the body
element:

add(new BodyTagAttributeModifier("onunload", true, new
Model("GUnload();"), this));

I understand the proper way to call onload Javascript is to use
IHeaderResponse.renderOnLoadJavasript() but there's nothing for
onunload.  Is there any way for a child page to dynamically add an
onunload attribute to the page's body element?

Thanks,
Zach

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



Re: Generated IDs in deployment vs. development modes

2008-03-22 Thread Zach Cox

I'll add two more approaches to that list:

1) Don't associate a wicket component with any html element whose id you
need

2) Learn to use other attributes besides id (and praise the prototype
developers for their DOM traversal API)

;)

Thanks,
Zach



igor.vaynberg wrote:
> 
> there are plenty of threads about this on the list if you are
> interested. the gist of the thing is that wicket changes id so that it
> can guarantee their uniquness since components are self contained and
> isolated. there are a two basic ways to deal with this: call
> setmarkupid(string) for components you want to control the id for, or
> get the id with getmarkupid() and pass that to js code.
> 
> -igor
> 
> 
> On Sat, Mar 22, 2008 at 5:13 PM, Zach Cox <[EMAIL PROTECTED]> wrote:
>> I've been running our app in development mode for quite a while now
>>  and noticed that Wicket likes to append digits to the end of id
>>  attributes specified in the html templates.  I just switched to
>>  deployment mode and now Wicket is completely changing the id
>>  attributes.  I'm using Prototype to do some JavaScript stuff, and
>>  while I could work around this id-changing in development mode, my
>>  entire app is broken in deployment mode.
>>
>>  Is there any way to tell Wicket to use the development mode
>>  id-changing behavior in deployment mode?  Better yet, is there a way
>>  to tell Wicket to leave the id attributes specified in html templates
>>  alone altogether?
>>
>>  Thanks,
>>  Zach
>>
>>  -
>>  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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Generated-IDs-in-deployment-vs.-development-modes-tp16229462p16229975.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]



Generated IDs in deployment vs. development modes

2008-03-22 Thread Zach Cox
I've been running our app in development mode for quite a while now
and noticed that Wicket likes to append digits to the end of id
attributes specified in the html templates.  I just switched to
deployment mode and now Wicket is completely changing the id
attributes.  I'm using Prototype to do some JavaScript stuff, and
while I could work around this id-changing in development mode, my
entire app is broken in deployment mode.

Is there any way to tell Wicket to use the development mode
id-changing behavior in deployment mode?  Better yet, is there a way
to tell Wicket to leave the id attributes specified in html templates
alone altogether?

Thanks,
Zach

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



Pagination Problems

2008-03-16 Thread Zach Cox
In our application we have three basic pages:
 - search page
 - results page
 - details page

Search page has a form with all of the search criteria.  On submit,
the search is saved to the database and response page is set to the
results page, with the ID of the search as a page parameter.

The results page gets the ID page parameter, gets the search object
from the database, and uses a GridView to display results from an
IDataProvider.  We use pagination as there can be many hundreds of
results.  A small overview of each item is displayed on results page,
and it links to that item's details page.  So far, all of this works
perfectly.

The pagination links on results pages work fine, until I go to an
item's details page then hit Back in the browser to get back to
results page.  After I hit Back, all of the pagination links are
broken.  Clicking any of them takes me back to first page of results.

We're using both PagingNavigationIncrementLink to generate next &
previous links, as well as PagingNavigation to generate links to
specific pages of results.  All of those links, after viewing details
page and hitting Back, take me to first page of results, no matter
which page I'm currently on.

I'm sure I'm just not understanding something about the "state" that
Wicket stores on the server, but does anyone know why the pagination
links don't work after viewing the details page and then hitting Back?

Thanks,
Zach

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



Re: wicket-contrib-tinymce

2008-03-04 Thread Zach Cox

Found it:
http://wicketstuff.org/maven/repository/org/wicketstuff/wicket-contrib-tinymce/1.3-SNAPSHOT/

Also see this in svn for examples on using Wicket TinyMCE:
https://wicket-stuff.svn.sourceforge.net/svnroot/wicket-stuff/trunk/wicket-contrib-tinymce-examples/

Thanks,
Zach



Zach Cox wrote:
> 
> Is there a version of wicket-contrib-tinymce floating around somewhere
> that is compatible with Wicket 1.3.1?
> 
> Thanks,
> Zach
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/wicket-contrib-tinymce-tp15819972p15827810.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]



wicket-contrib-tinymce

2008-03-03 Thread Zach Cox
Is there a version of wicket-contrib-tinymce floating around somewhere
that is compatible with Wicket 1.3.1?

Thanks,
Zach

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



Exposing a web service from a Wicket app

2008-01-30 Thread Zach Cox
We're creating a web app using Wicket and would like to expose several
simple features via a RESTful web service.  So basically, several URLs
would return XML or JSON formatted data instead of HTML.

Is there an easy way to do this in Wicket to provide a very simple web
service, or should we just look into something separate like Jersey
(https://jersey.dev.java.net/)?

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