You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Alec Swan <al...@gmail.com> on 2011/09/12 23:25:58 UTC

Create a stand-alone link and get its URL

Hello,

We use a templating engine which generates parts of our pages.
Templates can be included on any page. We need the engine to be able
to generate a link which will display a report when clicked. I tried
using the following code, but it returns null from
RequestTarget.urlFor(..):

public String getReportLink() {
        return "" + RequestCycle.get().urlFor(new
DownloadCsvRequestTarget(fileName, reportData));
}

Where DownloadCsvRequestTarget implements respond() method to write
reportData our in CSV format.

Thanks,

Alec

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


Re: Create a stand-alone link and get its URL

Posted by Alec Swan <al...@gmail.com>.
Great idea, worked like a charm.

Thanks!

On Tue, Sep 13, 2011 at 8:19 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> create a single metadata key that holds a map<string,object> where
> string is a uuid.
>
> -igor
>
> On Tue, Sep 13, 2011 at 5:40 PM, Alec Swan <al...@gmail.com> wrote:
>> Great idea, thanks.
>>
>> As I was working on passing template information as a part of the link
>> URL I started thinking that it would be nice if I could store this
>> information in session metadata and pass the metadata key as a part of
>> the link URL. However, I am not sure if I can pass metadata key in the
>> URL somehow.
>>
>> Thoughts?
>>
>> Thanks,
>>
>> Alec
>>
>> On Tue, Sep 13, 2011 at 10:44 AM, Igor Vaynberg <ig...@gmail.com> wrote:
>>> add a single link to your page. expose its url as a variable to the
>>> templating engine and append some sort of id to the url to
>>> differentiate which template should be used. since you have to put the
>>> link into markup put it inside an invisible div.
>>>
>>> -igor
>>>
>>> On Tue, Sep 13, 2011 at 8:37 AM, Alec Swan <al...@gmail.com> wrote:
>>>> I don't think this will work because the template could be a method
>>>> invocation, e.g.
>>>>
>>>> <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
>>>> 'Last Name')}">Download</a>
>>>>
>>>> Template-evaluation approach works great for generating HTML reports,
>>>> i.e. the template evaluates to a string that contains raw HTML
>>>> "<table>..</table>" and can be included on any page. So, here is what
>>>> a page containing HTML report looks like:
>>>>
>>>> <div wicket:id="editableLabel">
>>>>  ${var.studentReportWithColumnsHTML('First Name', 'Last Name')}
>>>> </div>
>>>>
>>>> My code runs templating engine on the content of the editableLabel
>>>> before rendering it.
>>>>
>>>> However, the new requirement is to expose the same reports for
>>>> download as CSV files and I would like to continue using the
>>>> templating mechanism and be able to support something like:
>>>>
>>>> <div wicket:id="editableLabel">
>>>>  <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
>>>> 'Last Name')}">Download</a>
>>>> </div>
>>>>
>>>> Thoughts?
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Tue, Sep 13, 2011 at 1:00 AM, Sven Meier <sv...@meiers.net> wrote:
>>>>> Why don't you just use a component for this, e.g. DownloadLink?
>>>>>
>>>>> <a wicket:id="${var.wellKnownWicketId}">Download</a>
>>>>>
>>>>> No stable url involved.
>>>>>
>>>>> Sven
>>>>>
>>>>> On 09/13/2011 04:45 AM, Alec Swan wrote:
>>>>>> Our templating engine is the one that needs to generate the link by
>>>>>> evaluating a template similar to "<a
>>>>>> href='${var.reportLink}'>Download</a>". The engine does not have
>>>>>> access to any Wicket components but can access Thread local
>>>>>> properties, such as RequestCycle.get(). I guess we could add a
>>>>>> behavior to RequestCycle.get().getResponsePage().
>>>>>>
>>>>>> Is this what you are suggesting or there is a more elegant way to
>>>>>> implement this in Wicket?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Alec
>>>>>>
>>>>>> On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>>>> the problem is when you say "build a url to an instance of this
>>>>>>> request target" wicket doesnt hold on to the instance, nor does it
>>>>>>> have any way to recreate it.
>>>>>>>
>>>>>>> what you can do is add a behavior to the page and construct a url to
>>>>>>> that behavior.
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>>>> I don't really need a stable URL. In fact, I would prefer if the link
>>>>>>>> URL was session or page-specific so that it cannot be accessed by
>>>>>>>> anybody unless they first accessed the page that contains the link.
>>>>>>>>
>>>>>>>> I would like to do something along the lines of the code in my
>>>>>>>> original post. In other words, I would like to create a new
>>>>>>>> RequestTarget and get its URL and display that URL to the user.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Alec
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>>>>>> create a resource and register it in shared resources, this will allow
>>>>>>>>> you to create a stable url. the filename and reportdata you will have
>>>>>>>>> to pass on the url.
>>>>>>>>>
>>>>>>>>> -igor
>>>>>>>>>
>>>>>>>>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> We use a templating engine which generates parts of our pages.
>>>>>>>>>> Templates can be included on any page. We need the engine to be able
>>>>>>>>>> to generate a link which will display a report when clicked. I tried
>>>>>>>>>> using the following code, but it returns null from
>>>>>>>>>> RequestTarget.urlFor(..):
>>>>>>>>>>
>>>>>>>>>> public String getReportLink() {
>>>>>>>>>>        return "" + RequestCycle.get().urlFor(new
>>>>>>>>>> DownloadCsvRequestTarget(fileName, reportData));
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> Where DownloadCsvRequestTarget implements respond() method to write
>>>>>>>>>> reportData our in CSV format.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>>
>>>>>>>>>> Alec
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Create a stand-alone link and get its URL

Posted by Igor Vaynberg <ig...@gmail.com>.
create a single metadata key that holds a map<string,object> where
string is a uuid.

-igor

On Tue, Sep 13, 2011 at 5:40 PM, Alec Swan <al...@gmail.com> wrote:
> Great idea, thanks.
>
> As I was working on passing template information as a part of the link
> URL I started thinking that it would be nice if I could store this
> information in session metadata and pass the metadata key as a part of
> the link URL. However, I am not sure if I can pass metadata key in the
> URL somehow.
>
> Thoughts?
>
> Thanks,
>
> Alec
>
> On Tue, Sep 13, 2011 at 10:44 AM, Igor Vaynberg <ig...@gmail.com> wrote:
>> add a single link to your page. expose its url as a variable to the
>> templating engine and append some sort of id to the url to
>> differentiate which template should be used. since you have to put the
>> link into markup put it inside an invisible div.
>>
>> -igor
>>
>> On Tue, Sep 13, 2011 at 8:37 AM, Alec Swan <al...@gmail.com> wrote:
>>> I don't think this will work because the template could be a method
>>> invocation, e.g.
>>>
>>> <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
>>> 'Last Name')}">Download</a>
>>>
>>> Template-evaluation approach works great for generating HTML reports,
>>> i.e. the template evaluates to a string that contains raw HTML
>>> "<table>..</table>" and can be included on any page. So, here is what
>>> a page containing HTML report looks like:
>>>
>>> <div wicket:id="editableLabel">
>>>  ${var.studentReportWithColumnsHTML('First Name', 'Last Name')}
>>> </div>
>>>
>>> My code runs templating engine on the content of the editableLabel
>>> before rendering it.
>>>
>>> However, the new requirement is to expose the same reports for
>>> download as CSV files and I would like to continue using the
>>> templating mechanism and be able to support something like:
>>>
>>> <div wicket:id="editableLabel">
>>>  <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
>>> 'Last Name')}">Download</a>
>>> </div>
>>>
>>> Thoughts?
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> On Tue, Sep 13, 2011 at 1:00 AM, Sven Meier <sv...@meiers.net> wrote:
>>>> Why don't you just use a component for this, e.g. DownloadLink?
>>>>
>>>> <a wicket:id="${var.wellKnownWicketId}">Download</a>
>>>>
>>>> No stable url involved.
>>>>
>>>> Sven
>>>>
>>>> On 09/13/2011 04:45 AM, Alec Swan wrote:
>>>>> Our templating engine is the one that needs to generate the link by
>>>>> evaluating a template similar to "<a
>>>>> href='${var.reportLink}'>Download</a>". The engine does not have
>>>>> access to any Wicket components but can access Thread local
>>>>> properties, such as RequestCycle.get(). I guess we could add a
>>>>> behavior to RequestCycle.get().getResponsePage().
>>>>>
>>>>> Is this what you are suggesting or there is a more elegant way to
>>>>> implement this in Wicket?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>> On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>>> the problem is when you say "build a url to an instance of this
>>>>>> request target" wicket doesnt hold on to the instance, nor does it
>>>>>> have any way to recreate it.
>>>>>>
>>>>>> what you can do is add a behavior to the page and construct a url to
>>>>>> that behavior.
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>>
>>>>>> On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>>> I don't really need a stable URL. In fact, I would prefer if the link
>>>>>>> URL was session or page-specific so that it cannot be accessed by
>>>>>>> anybody unless they first accessed the page that contains the link.
>>>>>>>
>>>>>>> I would like to do something along the lines of the code in my
>>>>>>> original post. In other words, I would like to create a new
>>>>>>> RequestTarget and get its URL and display that URL to the user.
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Alec
>>>>>>>
>>>>>>>
>>>>>>> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>>>>> create a resource and register it in shared resources, this will allow
>>>>>>>> you to create a stable url. the filename and reportdata you will have
>>>>>>>> to pass on the url.
>>>>>>>>
>>>>>>>> -igor
>>>>>>>>
>>>>>>>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>>>>> Hello,
>>>>>>>>>
>>>>>>>>> We use a templating engine which generates parts of our pages.
>>>>>>>>> Templates can be included on any page. We need the engine to be able
>>>>>>>>> to generate a link which will display a report when clicked. I tried
>>>>>>>>> using the following code, but it returns null from
>>>>>>>>> RequestTarget.urlFor(..):
>>>>>>>>>
>>>>>>>>> public String getReportLink() {
>>>>>>>>>        return "" + RequestCycle.get().urlFor(new
>>>>>>>>> DownloadCsvRequestTarget(fileName, reportData));
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> Where DownloadCsvRequestTarget implements respond() method to write
>>>>>>>>> reportData our in CSV format.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Alec
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Create a stand-alone link and get its URL

Posted by Alec Swan <al...@gmail.com>.
Great idea, thanks.

As I was working on passing template information as a part of the link
URL I started thinking that it would be nice if I could store this
information in session metadata and pass the metadata key as a part of
the link URL. However, I am not sure if I can pass metadata key in the
URL somehow.

Thoughts?

Thanks,

Alec

On Tue, Sep 13, 2011 at 10:44 AM, Igor Vaynberg <ig...@gmail.com> wrote:
> add a single link to your page. expose its url as a variable to the
> templating engine and append some sort of id to the url to
> differentiate which template should be used. since you have to put the
> link into markup put it inside an invisible div.
>
> -igor
>
> On Tue, Sep 13, 2011 at 8:37 AM, Alec Swan <al...@gmail.com> wrote:
>> I don't think this will work because the template could be a method
>> invocation, e.g.
>>
>> <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
>> 'Last Name')}">Download</a>
>>
>> Template-evaluation approach works great for generating HTML reports,
>> i.e. the template evaluates to a string that contains raw HTML
>> "<table>..</table>" and can be included on any page. So, here is what
>> a page containing HTML report looks like:
>>
>> <div wicket:id="editableLabel">
>>  ${var.studentReportWithColumnsHTML('First Name', 'Last Name')}
>> </div>
>>
>> My code runs templating engine on the content of the editableLabel
>> before rendering it.
>>
>> However, the new requirement is to expose the same reports for
>> download as CSV files and I would like to continue using the
>> templating mechanism and be able to support something like:
>>
>> <div wicket:id="editableLabel">
>>  <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
>> 'Last Name')}">Download</a>
>> </div>
>>
>> Thoughts?
>>
>> Thanks,
>>
>> Alec
>>
>> On Tue, Sep 13, 2011 at 1:00 AM, Sven Meier <sv...@meiers.net> wrote:
>>> Why don't you just use a component for this, e.g. DownloadLink?
>>>
>>> <a wicket:id="${var.wellKnownWicketId}">Download</a>
>>>
>>> No stable url involved.
>>>
>>> Sven
>>>
>>> On 09/13/2011 04:45 AM, Alec Swan wrote:
>>>> Our templating engine is the one that needs to generate the link by
>>>> evaluating a template similar to "<a
>>>> href='${var.reportLink}'>Download</a>". The engine does not have
>>>> access to any Wicket components but can access Thread local
>>>> properties, such as RequestCycle.get(). I guess we could add a
>>>> behavior to RequestCycle.get().getResponsePage().
>>>>
>>>> Is this what you are suggesting or there is a more elegant way to
>>>> implement this in Wicket?
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>> the problem is when you say "build a url to an instance of this
>>>>> request target" wicket doesnt hold on to the instance, nor does it
>>>>> have any way to recreate it.
>>>>>
>>>>> what you can do is add a behavior to the page and construct a url to
>>>>> that behavior.
>>>>>
>>>>> -igor
>>>>>
>>>>>
>>>>> On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>> I don't really need a stable URL. In fact, I would prefer if the link
>>>>>> URL was session or page-specific so that it cannot be accessed by
>>>>>> anybody unless they first accessed the page that contains the link.
>>>>>>
>>>>>> I would like to do something along the lines of the code in my
>>>>>> original post. In other words, I would like to create a new
>>>>>> RequestTarget and get its URL and display that URL to the user.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Alec
>>>>>>
>>>>>>
>>>>>> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>>>> create a resource and register it in shared resources, this will allow
>>>>>>> you to create a stable url. the filename and reportdata you will have
>>>>>>> to pass on the url.
>>>>>>>
>>>>>>> -igor
>>>>>>>
>>>>>>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> We use a templating engine which generates parts of our pages.
>>>>>>>> Templates can be included on any page. We need the engine to be able
>>>>>>>> to generate a link which will display a report when clicked. I tried
>>>>>>>> using the following code, but it returns null from
>>>>>>>> RequestTarget.urlFor(..):
>>>>>>>>
>>>>>>>> public String getReportLink() {
>>>>>>>>        return "" + RequestCycle.get().urlFor(new
>>>>>>>> DownloadCsvRequestTarget(fileName, reportData));
>>>>>>>> }
>>>>>>>>
>>>>>>>> Where DownloadCsvRequestTarget implements respond() method to write
>>>>>>>> reportData our in CSV format.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> Alec
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Create a stand-alone link and get its URL

Posted by Igor Vaynberg <ig...@gmail.com>.
add a single link to your page. expose its url as a variable to the
templating engine and append some sort of id to the url to
differentiate which template should be used. since you have to put the
link into markup put it inside an invisible div.

-igor

On Tue, Sep 13, 2011 at 8:37 AM, Alec Swan <al...@gmail.com> wrote:
> I don't think this will work because the template could be a method
> invocation, e.g.
>
> <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
> 'Last Name')}">Download</a>
>
> Template-evaluation approach works great for generating HTML reports,
> i.e. the template evaluates to a string that contains raw HTML
> "<table>..</table>" and can be included on any page. So, here is what
> a page containing HTML report looks like:
>
> <div wicket:id="editableLabel">
>  ${var.studentReportWithColumnsHTML('First Name', 'Last Name')}
> </div>
>
> My code runs templating engine on the content of the editableLabel
> before rendering it.
>
> However, the new requirement is to expose the same reports for
> download as CSV files and I would like to continue using the
> templating mechanism and be able to support something like:
>
> <div wicket:id="editableLabel">
>  <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
> 'Last Name')}">Download</a>
> </div>
>
> Thoughts?
>
> Thanks,
>
> Alec
>
> On Tue, Sep 13, 2011 at 1:00 AM, Sven Meier <sv...@meiers.net> wrote:
>> Why don't you just use a component for this, e.g. DownloadLink?
>>
>> <a wicket:id="${var.wellKnownWicketId}">Download</a>
>>
>> No stable url involved.
>>
>> Sven
>>
>> On 09/13/2011 04:45 AM, Alec Swan wrote:
>>> Our templating engine is the one that needs to generate the link by
>>> evaluating a template similar to "<a
>>> href='${var.reportLink}'>Download</a>". The engine does not have
>>> access to any Wicket components but can access Thread local
>>> properties, such as RequestCycle.get(). I guess we could add a
>>> behavior to RequestCycle.get().getResponsePage().
>>>
>>> Is this what you are suggesting or there is a more elegant way to
>>> implement this in Wicket?
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>> the problem is when you say "build a url to an instance of this
>>>> request target" wicket doesnt hold on to the instance, nor does it
>>>> have any way to recreate it.
>>>>
>>>> what you can do is add a behavior to the page and construct a url to
>>>> that behavior.
>>>>
>>>> -igor
>>>>
>>>>
>>>> On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
>>>>> I don't really need a stable URL. In fact, I would prefer if the link
>>>>> URL was session or page-specific so that it cannot be accessed by
>>>>> anybody unless they first accessed the page that contains the link.
>>>>>
>>>>> I would like to do something along the lines of the code in my
>>>>> original post. In other words, I would like to create a new
>>>>> RequestTarget and get its URL and display that URL to the user.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>>
>>>>> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>>> create a resource and register it in shared resources, this will allow
>>>>>> you to create a stable url. the filename and reportdata you will have
>>>>>> to pass on the url.
>>>>>>
>>>>>> -igor
>>>>>>
>>>>>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> We use a templating engine which generates parts of our pages.
>>>>>>> Templates can be included on any page. We need the engine to be able
>>>>>>> to generate a link which will display a report when clicked. I tried
>>>>>>> using the following code, but it returns null from
>>>>>>> RequestTarget.urlFor(..):
>>>>>>>
>>>>>>> public String getReportLink() {
>>>>>>>        return "" + RequestCycle.get().urlFor(new
>>>>>>> DownloadCsvRequestTarget(fileName, reportData));
>>>>>>> }
>>>>>>>
>>>>>>> Where DownloadCsvRequestTarget implements respond() method to write
>>>>>>> reportData our in CSV format.
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Alec
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Create a stand-alone link and get its URL

Posted by Alec Swan <al...@gmail.com>.
I don't think this will work because the template could be a method
invocation, e.g.

<a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
'Last Name')}">Download</a>

Template-evaluation approach works great for generating HTML reports,
i.e. the template evaluates to a string that contains raw HTML
"<table>..</table>" and can be included on any page. So, here is what
a page containing HTML report looks like:

<div wicket:id="editableLabel">
  ${var.studentReportWithColumnsHTML('First Name', 'Last Name')}
</div>

My code runs templating engine on the content of the editableLabel
before rendering it.

However, the new requirement is to expose the same reports for
download as CSV files and I would like to continue using the
templating mechanism and be able to support something like:

<div wicket:id="editableLabel">
  <a wicket:id="${var.getLinkToStudentReportWithColumns('First Name',
'Last Name')}">Download</a>
</div>

Thoughts?

Thanks,

Alec

On Tue, Sep 13, 2011 at 1:00 AM, Sven Meier <sv...@meiers.net> wrote:
> Why don't you just use a component for this, e.g. DownloadLink?
>
> <a wicket:id="${var.wellKnownWicketId}">Download</a>
>
> No stable url involved.
>
> Sven
>
> On 09/13/2011 04:45 AM, Alec Swan wrote:
>> Our templating engine is the one that needs to generate the link by
>> evaluating a template similar to "<a
>> href='${var.reportLink}'>Download</a>". The engine does not have
>> access to any Wicket components but can access Thread local
>> properties, such as RequestCycle.get(). I guess we could add a
>> behavior to RequestCycle.get().getResponsePage().
>>
>> Is this what you are suggesting or there is a more elegant way to
>> implement this in Wicket?
>>
>> Thanks,
>>
>> Alec
>>
>> On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>> the problem is when you say "build a url to an instance of this
>>> request target" wicket doesnt hold on to the instance, nor does it
>>> have any way to recreate it.
>>>
>>> what you can do is add a behavior to the page and construct a url to
>>> that behavior.
>>>
>>> -igor
>>>
>>>
>>> On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
>>>> I don't really need a stable URL. In fact, I would prefer if the link
>>>> URL was session or page-specific so that it cannot be accessed by
>>>> anybody unless they first accessed the page that contains the link.
>>>>
>>>> I would like to do something along the lines of the code in my
>>>> original post. In other words, I would like to create a new
>>>> RequestTarget and get its URL and display that URL to the user.
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>>
>>>> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>>> create a resource and register it in shared resources, this will allow
>>>>> you to create a stable url. the filename and reportdata you will have
>>>>> to pass on the url.
>>>>>
>>>>> -igor
>>>>>
>>>>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>>>>> Hello,
>>>>>>
>>>>>> We use a templating engine which generates parts of our pages.
>>>>>> Templates can be included on any page. We need the engine to be able
>>>>>> to generate a link which will display a report when clicked. I tried
>>>>>> using the following code, but it returns null from
>>>>>> RequestTarget.urlFor(..):
>>>>>>
>>>>>> public String getReportLink() {
>>>>>>        return "" + RequestCycle.get().urlFor(new
>>>>>> DownloadCsvRequestTarget(fileName, reportData));
>>>>>> }
>>>>>>
>>>>>> Where DownloadCsvRequestTarget implements respond() method to write
>>>>>> reportData our in CSV format.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> Alec
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Create a stand-alone link and get its URL

Posted by Sven Meier <sv...@meiers.net>.
Why don't you just use a component for this, e.g. DownloadLink?

<a wicket:id="${var.wellKnownWicketId}">Download</a>

No stable url involved.

Sven

On 09/13/2011 04:45 AM, Alec Swan wrote:
> Our templating engine is the one that needs to generate the link by
> evaluating a template similar to "<a
> href='${var.reportLink}'>Download</a>". The engine does not have
> access to any Wicket components but can access Thread local
> properties, such as RequestCycle.get(). I guess we could add a
> behavior to RequestCycle.get().getResponsePage().
> 
> Is this what you are suggesting or there is a more elegant way to
> implement this in Wicket?
> 
> Thanks,
> 
> Alec
> 
> On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> the problem is when you say "build a url to an instance of this
>> request target" wicket doesnt hold on to the instance, nor does it
>> have any way to recreate it.
>>
>> what you can do is add a behavior to the page and construct a url to
>> that behavior.
>>
>> -igor
>>
>>
>> On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
>>> I don't really need a stable URL. In fact, I would prefer if the link
>>> URL was session or page-specific so that it cannot be accessed by
>>> anybody unless they first accessed the page that contains the link.
>>>
>>> I would like to do something along the lines of the code in my
>>> original post. In other words, I would like to create a new
>>> RequestTarget and get its URL and display that URL to the user.
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>>
>>> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>>> create a resource and register it in shared resources, this will allow
>>>> you to create a stable url. the filename and reportdata you will have
>>>> to pass on the url.
>>>>
>>>> -igor
>>>>
>>>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>>>> Hello,
>>>>>
>>>>> We use a templating engine which generates parts of our pages.
>>>>> Templates can be included on any page. We need the engine to be able
>>>>> to generate a link which will display a report when clicked. I tried
>>>>> using the following code, but it returns null from
>>>>> RequestTarget.urlFor(..):
>>>>>
>>>>> public String getReportLink() {
>>>>>        return "" + RequestCycle.get().urlFor(new
>>>>> DownloadCsvRequestTarget(fileName, reportData));
>>>>> }
>>>>>
>>>>> Where DownloadCsvRequestTarget implements respond() method to write
>>>>> reportData our in CSV format.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Alec
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 


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


Re: Create a stand-alone link and get its URL

Posted by Alec Swan <al...@gmail.com>.
Our templating engine is the one that needs to generate the link by
evaluating a template similar to "<a
href='${var.reportLink}'>Download</a>". The engine does not have
access to any Wicket components but can access Thread local
properties, such as RequestCycle.get(). I guess we could add a
behavior to RequestCycle.get().getResponsePage().

Is this what you are suggesting or there is a more elegant way to
implement this in Wicket?

Thanks,

Alec

On Mon, Sep 12, 2011 at 5:27 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> the problem is when you say "build a url to an instance of this
> request target" wicket doesnt hold on to the instance, nor does it
> have any way to recreate it.
>
> what you can do is add a behavior to the page and construct a url to
> that behavior.
>
> -igor
>
>
> On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
>> I don't really need a stable URL. In fact, I would prefer if the link
>> URL was session or page-specific so that it cannot be accessed by
>> anybody unless they first accessed the page that contains the link.
>>
>> I would like to do something along the lines of the code in my
>> original post. In other words, I would like to create a new
>> RequestTarget and get its URL and display that URL to the user.
>>
>> Thanks,
>>
>> Alec
>>
>>
>> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>>> create a resource and register it in shared resources, this will allow
>>> you to create a stable url. the filename and reportdata you will have
>>> to pass on the url.
>>>
>>> -igor
>>>
>>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>>> Hello,
>>>>
>>>> We use a templating engine which generates parts of our pages.
>>>> Templates can be included on any page. We need the engine to be able
>>>> to generate a link which will display a report when clicked. I tried
>>>> using the following code, but it returns null from
>>>> RequestTarget.urlFor(..):
>>>>
>>>> public String getReportLink() {
>>>>        return "" + RequestCycle.get().urlFor(new
>>>> DownloadCsvRequestTarget(fileName, reportData));
>>>> }
>>>>
>>>> Where DownloadCsvRequestTarget implements respond() method to write
>>>> reportData our in CSV format.
>>>>
>>>> Thanks,
>>>>
>>>> Alec
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: ajax and URLs

Posted by Igor Vaynberg <ig...@gmail.com>.
ive done some work on it here, maybe its of some use to you:

https://github.com/ivaynberg/wicket/tree/ajax-history

-igor

On Tue, Sep 13, 2011 at 12:11 AM, Martin Grigorov <mg...@apache.org> wrote:
> Wicket doesn't support Ajax back/forward button out of the box for now.
> You'll have to do it by yourself.
>
> On Tue, Sep 13, 2011 at 3:45 AM, Alexander Gubin <ag...@greatergood.net> wrote:
>> Sorry, if this question had been answered before,
>>
>> I am writing and AJAX app and looking into way to modify browser location
>> bar, when clicking on Ajax links. Currently I have two pages with a bunch on
>> panels, and when I hit back button I would like to go to previous panel, not
>> page.
>>
>> I see the recommended way for Ajax apps it to use hash #, a.k.a. anchor.
>> Does Wicket natively support anchor setting and parsing? Or do I need to use
>> history.js with/or JQuery plugins?
>>
>> Sincerely,
>>
>> Alexander
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: ajax and URLs

Posted by Martin Grigorov <mg...@apache.org>.
Wicket doesn't support Ajax back/forward button out of the box for now.
You'll have to do it by yourself.

On Tue, Sep 13, 2011 at 3:45 AM, Alexander Gubin <ag...@greatergood.net> wrote:
> Sorry, if this question had been answered before,
>
> I am writing and AJAX app and looking into way to modify browser location
> bar, when clicking on Ajax links. Currently I have two pages with a bunch on
> panels, and when I hit back button I would like to go to previous panel, not
> page.
>
> I see the recommended way for Ajax apps it to use hash #, a.k.a. anchor.
> Does Wicket natively support anchor setting and parsing? Or do I need to use
> history.js with/or JQuery plugins?
>
> Sincerely,
>
> Alexander
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


ajax and URLs

Posted by Alexander Gubin <ag...@greatergood.net>.
Sorry, if this question had been answered before,

I am writing and AJAX app and looking into way to modify browser 
location bar, when clicking on Ajax links. Currently I have two pages 
with a bunch on panels, and when I hit back button I would like to go to 
previous panel, not page.

I see the recommended way for Ajax apps it to use hash #, a.k.a. anchor. 
Does Wicket natively support anchor setting and parsing? Or do I need to 
use history.js with/or JQuery plugins?

Sincerely,

Alexander

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


Re: Create a stand-alone link and get its URL

Posted by Igor Vaynberg <ig...@gmail.com>.
the problem is when you say "build a url to an instance of this
request target" wicket doesnt hold on to the instance, nor does it
have any way to recreate it.

what you can do is add a behavior to the page and construct a url to
that behavior.

-igor


On Mon, Sep 12, 2011 at 4:16 PM, Alec Swan <al...@gmail.com> wrote:
> I don't really need a stable URL. In fact, I would prefer if the link
> URL was session or page-specific so that it cannot be accessed by
> anybody unless they first accessed the page that contains the link.
>
> I would like to do something along the lines of the code in my
> original post. In other words, I would like to create a new
> RequestTarget and get its URL and display that URL to the user.
>
> Thanks,
>
> Alec
>
>
> On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
>> create a resource and register it in shared resources, this will allow
>> you to create a stable url. the filename and reportdata you will have
>> to pass on the url.
>>
>> -igor
>>
>> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>>> Hello,
>>>
>>> We use a templating engine which generates parts of our pages.
>>> Templates can be included on any page. We need the engine to be able
>>> to generate a link which will display a report when clicked. I tried
>>> using the following code, but it returns null from
>>> RequestTarget.urlFor(..):
>>>
>>> public String getReportLink() {
>>>        return "" + RequestCycle.get().urlFor(new
>>> DownloadCsvRequestTarget(fileName, reportData));
>>> }
>>>
>>> Where DownloadCsvRequestTarget implements respond() method to write
>>> reportData our in CSV format.
>>>
>>> Thanks,
>>>
>>> Alec
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Create a stand-alone link and get its URL

Posted by Alec Swan <al...@gmail.com>.
I don't really need a stable URL. In fact, I would prefer if the link
URL was session or page-specific so that it cannot be accessed by
anybody unless they first accessed the page that contains the link.

I would like to do something along the lines of the code in my
original post. In other words, I would like to create a new
RequestTarget and get its URL and display that URL to the user.

Thanks,

Alec


On Mon, Sep 12, 2011 at 4:14 PM, Igor Vaynberg <ig...@gmail.com> wrote:
> create a resource and register it in shared resources, this will allow
> you to create a stable url. the filename and reportdata you will have
> to pass on the url.
>
> -igor
>
> On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
>> Hello,
>>
>> We use a templating engine which generates parts of our pages.
>> Templates can be included on any page. We need the engine to be able
>> to generate a link which will display a report when clicked. I tried
>> using the following code, but it returns null from
>> RequestTarget.urlFor(..):
>>
>> public String getReportLink() {
>>        return "" + RequestCycle.get().urlFor(new
>> DownloadCsvRequestTarget(fileName, reportData));
>> }
>>
>> Where DownloadCsvRequestTarget implements respond() method to write
>> reportData our in CSV format.
>>
>> Thanks,
>>
>> Alec
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Create a stand-alone link and get its URL

Posted by Igor Vaynberg <ig...@gmail.com>.
create a resource and register it in shared resources, this will allow
you to create a stable url. the filename and reportdata you will have
to pass on the url.

-igor

On Mon, Sep 12, 2011 at 2:25 PM, Alec Swan <al...@gmail.com> wrote:
> Hello,
>
> We use a templating engine which generates parts of our pages.
> Templates can be included on any page. We need the engine to be able
> to generate a link which will display a report when clicked. I tried
> using the following code, but it returns null from
> RequestTarget.urlFor(..):
>
> public String getReportLink() {
>        return "" + RequestCycle.get().urlFor(new
> DownloadCsvRequestTarget(fileName, reportData));
> }
>
> Where DownloadCsvRequestTarget implements respond() method to write
> reportData our in CSV format.
>
> Thanks,
>
> Alec
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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