You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Joe Hudson <Jo...@clear2pay.com> on 2009/10/01 03:10:57 UTC

is it possible to somehow create a url to return the contents of a panel

Hi - hopefully I can explain this clearly...

I understand that I can use the AjaxEventBehavior to refresh the contents of any components that I have on the screen or add new components.

I am trying to use a tooltip to display additional details for grid data.  I plan to use a tooltip library which supports retrieving content via an ajax call.  The question is: how (or is it possible at all) can I take a Panel and get a url that would return the contents of that Panel.  I'm probably not explaining this well so, here is an example:

AbstractLink link = createLink(IModel rowModel);

Private AbstractLink createLink(IModel rowModel) {
                // I need to return a URL which would contain the contents of the additional details panel
                // for this particular row in the grid

                // the tooltip library will use the href attribute of this link to dynamically retrieve the contents of the tooltip when displayed
}

Any help or ideas would be greatly appreciated.  Thanks.

Joe

Re: is it possible to somehow create a url to return the contents of a panel

Posted by Pedro Santos <pe...@gmail.com>.
1) I just want to return straight HTML (not contents within the
<ajax-response> node)

return to where? to broser?
target.appendjavascript("document.body.innerHTML = '"+resultHTML);

how I could show a dynamic tooltip with data retrieved using ajax?

target.appendjavascript("Wicket.$('"+myLabelComp.getMarkupId()+"').alt = '"+
myNewTooltip+"'");
( alt or title... any tag attribute you need to change)

On Thu, Oct 1, 2009 at 9:58 AM, Joe Hudson <Jo...@clear2pay.com> wrote:

> So, it is looking like I could do something like this:
>
>        Link<String> link = new AjaxLink<String>(componentId, new
> Model<String>("View Details")) {
>            @Override
>            public void onClick(AjaxRequestTarget target) {
>                        String resultHTML = convertPanelToHTML();  // I
> understand this
>
>                        // how can I override the target response with the
> result HTML?
>            }
>        };
>
> 1) I just want to return straight HTML (not contents within the
> <ajax-response> node)
> 2) I need the link to return the contents directly (not handle the contents
> with the Wicket ajax javascript code)
>
> Is type of behavior possible?  If not, does anyone have any other ideas as
> to how I could show a dynamic tooltip with data retrieved using ajax?  Thank
> you very much.
>
> Joe
>
>
> -----Original Message-----
> From: Pedro Santos [mailto:pedrosans@gmail.com]
> Sent: Thursday, October 01, 2009 8:19 AM
> To: users@wicket.apache.org
> Subject: Re: is it possible to somehow create a url to return the contents
> of a panel
>
> 1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
> for which will trigger the onClick method
> http://wicket.apache.org/docs/1.4/org/apache/wicket/IRequestTarget.html
>
> http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/AbstractAjaxBehavior.html#getCallbackUrl%28%29
>
> 2) I need to attach the URL for the component to a link - not add the
> component directly - is this possible?
> I don't understand. Is possible to do a lot overriding onComponentTag,
> onRender, ....
>
> 3) Given an AjaxRequestTarget, is there any way I can write out the HTML
> response (as opposed to adding components for rendering)?
> you can append javascript to response...
>
> On Thu, Oct 1, 2009 at 9:11 AM, Joe Hudson <Jo...@clear2pay.com>
> wrote:
>
> > Thank you so much for the response, that was very helpful.
> >
> > So, I've got half of the equation figured out but now, I have the issue
> of
> > how to generate a URL that call a component that allows for a straight
> HTML
> > response.
> >
> > Here is the issue now:
> >
> > Component someMadeUpAjaxComponent = ... {
> >        onClick(AjaxRequestTarget target) {
> >                // return the component output
> >        }
> > }
> >
> > 1) Is there a component (the someMadeUpAjaxComponent) that I can get a
> URL
> > for which will trigger the onClick method
> > 2) I need to attach the URL for the component to a link - not add the
> > component directly - is this possible?
> > 3) Given an AjaxRequestTarget, is there any way I can write out the HTML
> > response (as opposed to adding components for rendering)?
> >
> >
> > Because, the result will look something like this:
> > <a href="{the AJAX URL that will respond with the component HTML
> > content}">View Details</a>
> >
> > I will then attach a tooltip to this link which will know that it can
> take
> > the href attribute of the link to obtain the tooltip content.
> >
> > Thank you very much for any help you could offer.
> >
> > Joe
> >
> >
> >
> > -----Original Message-----
> > From: Jeremy Thomerson [mailto:jeremy@wickettraining.com]
> > Sent: Wednesday, September 30, 2009 9:15 PM
> > To: users@wicket.apache.org
> > Subject: Re: is it possible to somehow create a url to return the
> contents
> > of a panel
> >
> > search this list for how to generate emails with wicket.  there are a
> bunch
> > of posts of that sort.  that will teach you how to render a component to
> a
> > string.  this could be used to return the contents.
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
> >
> >
> > On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson <Joe.Hudson@clear2pay.com
> > >wrote:
> >
> > > Hi - hopefully I can explain this clearly...
> > >
> > > I understand that I can use the AjaxEventBehavior to refresh the
> contents
> > > of any components that I have on the screen or add new components.
> > >
> > > I am trying to use a tooltip to display additional details for grid
> data.
> > >  I plan to use a tooltip library which supports retrieving content via
> an
> > > ajax call.  The question is: how (or is it possible at all) can I take
> a
> > > Panel and get a url that would return the contents of that Panel.  I'm
> > > probably not explaining this well so, here is an example:
> > >
> > > AbstractLink link = createLink(IModel rowModel);
> > >
> > > Private AbstractLink createLink(IModel rowModel) {
> > >                // I need to return a URL which would contain the
> contents
> > > of the additional details panel
> > >                // for this particular row in the grid
> > >
> > >                // the tooltip library will use the href attribute of
> this
> > > link to dynamically retrieve the contents of the tooltip when displayed
> > > }
> > >
> > > Any help or ideas would be greatly appreciated.  Thanks.
> > >
> > > Joe
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>
>
> --
> Pedro Henrique Oliveira dos Santos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

RE: is it possible to somehow create a url to return the contents of a panel

Posted by Joe Hudson <Jo...@clear2pay.com>.
So, it is looking like I could do something like this:

        Link<String> link = new AjaxLink<String>(componentId, new Model<String>("View Details")) {
            @Override
            public void onClick(AjaxRequestTarget target) {
			String resultHTML = convertPanelToHTML();  // I understand this

			// how can I override the target response with the result HTML?
            }
        };

1) I just want to return straight HTML (not contents within the <ajax-response> node)
2) I need the link to return the contents directly (not handle the contents with the Wicket ajax javascript code)

Is type of behavior possible?  If not, does anyone have any other ideas as to how I could show a dynamic tooltip with data retrieved using ajax?  Thank you very much.

Joe


-----Original Message-----
From: Pedro Santos [mailto:pedrosans@gmail.com] 
Sent: Thursday, October 01, 2009 8:19 AM
To: users@wicket.apache.org
Subject: Re: is it possible to somehow create a url to return the contents of a panel

1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
for which will trigger the onClick method
http://wicket.apache.org/docs/1.4/org/apache/wicket/IRequestTarget.html
http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/AbstractAjaxBehavior.html#getCallbackUrl%28%29

2) I need to attach the URL for the component to a link - not add the
component directly - is this possible?
I don't understand. Is possible to do a lot overriding onComponentTag,
onRender, ....

3) Given an AjaxRequestTarget, is there any way I can write out the HTML
response (as opposed to adding components for rendering)?
you can append javascript to response...

On Thu, Oct 1, 2009 at 9:11 AM, Joe Hudson <Jo...@clear2pay.com> wrote:

> Thank you so much for the response, that was very helpful.
>
> So, I've got half of the equation figured out but now, I have the issue of
> how to generate a URL that call a component that allows for a straight HTML
> response.
>
> Here is the issue now:
>
> Component someMadeUpAjaxComponent = ... {
>        onClick(AjaxRequestTarget target) {
>                // return the component output
>        }
> }
>
> 1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
> for which will trigger the onClick method
> 2) I need to attach the URL for the component to a link - not add the
> component directly - is this possible?
> 3) Given an AjaxRequestTarget, is there any way I can write out the HTML
> response (as opposed to adding components for rendering)?
>
>
> Because, the result will look something like this:
> <a href="{the AJAX URL that will respond with the component HTML
> content}">View Details</a>
>
> I will then attach a tooltip to this link which will know that it can take
> the href attribute of the link to obtain the tooltip content.
>
> Thank you very much for any help you could offer.
>
> Joe
>
>
>
> -----Original Message-----
> From: Jeremy Thomerson [mailto:jeremy@wickettraining.com]
> Sent: Wednesday, September 30, 2009 9:15 PM
> To: users@wicket.apache.org
> Subject: Re: is it possible to somehow create a url to return the contents
> of a panel
>
> search this list for how to generate emails with wicket.  there are a bunch
> of posts of that sort.  that will teach you how to render a component to a
> string.  this could be used to return the contents.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson <Joe.Hudson@clear2pay.com
> >wrote:
>
> > Hi - hopefully I can explain this clearly...
> >
> > I understand that I can use the AjaxEventBehavior to refresh the contents
> > of any components that I have on the screen or add new components.
> >
> > I am trying to use a tooltip to display additional details for grid data.
> >  I plan to use a tooltip library which supports retrieving content via an
> > ajax call.  The question is: how (or is it possible at all) can I take a
> > Panel and get a url that would return the contents of that Panel.  I'm
> > probably not explaining this well so, here is an example:
> >
> > AbstractLink link = createLink(IModel rowModel);
> >
> > Private AbstractLink createLink(IModel rowModel) {
> >                // I need to return a URL which would contain the contents
> > of the additional details panel
> >                // for this particular row in the grid
> >
> >                // the tooltip library will use the href attribute of this
> > link to dynamically retrieve the contents of the tooltip when displayed
> > }
> >
> > Any help or ideas would be greatly appreciated.  Thanks.
> >
> > Joe
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

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


Re: is it possible to somehow create a url to return the contents of a panel

Posted by Pedro Santos <pe...@gmail.com>.
1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
for which will trigger the onClick method
http://wicket.apache.org/docs/1.4/org/apache/wicket/IRequestTarget.html
http://wicket.apache.org/docs/1.4/org/apache/wicket/behavior/AbstractAjaxBehavior.html#getCallbackUrl%28%29

2) I need to attach the URL for the component to a link - not add the
component directly - is this possible?
I don't understand. Is possible to do a lot overriding onComponentTag,
onRender, ....

3) Given an AjaxRequestTarget, is there any way I can write out the HTML
response (as opposed to adding components for rendering)?
you can append javascript to response...

On Thu, Oct 1, 2009 at 9:11 AM, Joe Hudson <Jo...@clear2pay.com> wrote:

> Thank you so much for the response, that was very helpful.
>
> So, I've got half of the equation figured out but now, I have the issue of
> how to generate a URL that call a component that allows for a straight HTML
> response.
>
> Here is the issue now:
>
> Component someMadeUpAjaxComponent = ... {
>        onClick(AjaxRequestTarget target) {
>                // return the component output
>        }
> }
>
> 1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL
> for which will trigger the onClick method
> 2) I need to attach the URL for the component to a link - not add the
> component directly - is this possible?
> 3) Given an AjaxRequestTarget, is there any way I can write out the HTML
> response (as opposed to adding components for rendering)?
>
>
> Because, the result will look something like this:
> <a href="{the AJAX URL that will respond with the component HTML
> content}">View Details</a>
>
> I will then attach a tooltip to this link which will know that it can take
> the href attribute of the link to obtain the tooltip content.
>
> Thank you very much for any help you could offer.
>
> Joe
>
>
>
> -----Original Message-----
> From: Jeremy Thomerson [mailto:jeremy@wickettraining.com]
> Sent: Wednesday, September 30, 2009 9:15 PM
> To: users@wicket.apache.org
> Subject: Re: is it possible to somehow create a url to return the contents
> of a panel
>
> search this list for how to generate emails with wicket.  there are a bunch
> of posts of that sort.  that will teach you how to render a component to a
> string.  this could be used to return the contents.
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson <Joe.Hudson@clear2pay.com
> >wrote:
>
> > Hi - hopefully I can explain this clearly...
> >
> > I understand that I can use the AjaxEventBehavior to refresh the contents
> > of any components that I have on the screen or add new components.
> >
> > I am trying to use a tooltip to display additional details for grid data.
> >  I plan to use a tooltip library which supports retrieving content via an
> > ajax call.  The question is: how (or is it possible at all) can I take a
> > Panel and get a url that would return the contents of that Panel.  I'm
> > probably not explaining this well so, here is an example:
> >
> > AbstractLink link = createLink(IModel rowModel);
> >
> > Private AbstractLink createLink(IModel rowModel) {
> >                // I need to return a URL which would contain the contents
> > of the additional details panel
> >                // for this particular row in the grid
> >
> >                // the tooltip library will use the href attribute of this
> > link to dynamically retrieve the contents of the tooltip when displayed
> > }
> >
> > Any help or ideas would be greatly appreciated.  Thanks.
> >
> > Joe
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Pedro Henrique Oliveira dos Santos

RE: is it possible to somehow create a url to return the contents of a panel

Posted by Joe Hudson <Jo...@clear2pay.com>.
Thank you so much for the response, that was very helpful.

So, I've got half of the equation figured out but now, I have the issue of how to generate a URL that call a component that allows for a straight HTML response.

Here is the issue now:

Component someMadeUpAjaxComponent = ... {
	onClick(AjaxRequestTarget target) {
		// return the component output 
	}
}

1) Is there a component (the someMadeUpAjaxComponent) that I can get a URL for which will trigger the onClick method
2) I need to attach the URL for the component to a link - not add the component directly - is this possible?
3) Given an AjaxRequestTarget, is there any way I can write out the HTML response (as opposed to adding components for rendering)?


Because, the result will look something like this:
<a href="{the AJAX URL that will respond with the component HTML content}">View Details</a>

I will then attach a tooltip to this link which will know that it can take the href attribute of the link to obtain the tooltip content.

Thank you very much for any help you could offer.

Joe



-----Original Message-----
From: Jeremy Thomerson [mailto:jeremy@wickettraining.com] 
Sent: Wednesday, September 30, 2009 9:15 PM
To: users@wicket.apache.org
Subject: Re: is it possible to somehow create a url to return the contents of a panel

search this list for how to generate emails with wicket.  there are a bunch
of posts of that sort.  that will teach you how to render a component to a
string.  this could be used to return the contents.

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



On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson <Jo...@clear2pay.com>wrote:

> Hi - hopefully I can explain this clearly...
>
> I understand that I can use the AjaxEventBehavior to refresh the contents
> of any components that I have on the screen or add new components.
>
> I am trying to use a tooltip to display additional details for grid data.
>  I plan to use a tooltip library which supports retrieving content via an
> ajax call.  The question is: how (or is it possible at all) can I take a
> Panel and get a url that would return the contents of that Panel.  I'm
> probably not explaining this well so, here is an example:
>
> AbstractLink link = createLink(IModel rowModel);
>
> Private AbstractLink createLink(IModel rowModel) {
>                // I need to return a URL which would contain the contents
> of the additional details panel
>                // for this particular row in the grid
>
>                // the tooltip library will use the href attribute of this
> link to dynamically retrieve the contents of the tooltip when displayed
> }
>
> Any help or ideas would be greatly appreciated.  Thanks.
>
> Joe
>

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


Re: is it possible to somehow create a url to return the contents of a panel

Posted by Jeremy Thomerson <je...@wickettraining.com>.
search this list for how to generate emails with wicket.  there are a bunch
of posts of that sort.  that will teach you how to render a component to a
string.  this could be used to return the contents.

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



On Wed, Sep 30, 2009 at 8:10 PM, Joe Hudson <Jo...@clear2pay.com>wrote:

> Hi - hopefully I can explain this clearly...
>
> I understand that I can use the AjaxEventBehavior to refresh the contents
> of any components that I have on the screen or add new components.
>
> I am trying to use a tooltip to display additional details for grid data.
>  I plan to use a tooltip library which supports retrieving content via an
> ajax call.  The question is: how (or is it possible at all) can I take a
> Panel and get a url that would return the contents of that Panel.  I'm
> probably not explaining this well so, here is an example:
>
> AbstractLink link = createLink(IModel rowModel);
>
> Private AbstractLink createLink(IModel rowModel) {
>                // I need to return a URL which would contain the contents
> of the additional details panel
>                // for this particular row in the grid
>
>                // the tooltip library will use the href attribute of this
> link to dynamically retrieve the contents of the tooltip when displayed
> }
>
> Any help or ideas would be greatly appreciated.  Thanks.
>
> Joe
>