Re: how does DownloadLink lock the page?

2022-03-22 Thread Sven Meier

Hi Lucio,

only the *page instance* containing the DownloadLink is locked by the 
download.


Each user gets his own page instances, and these do not affect each other.

Best regards
Sven


On 22.03.22 18:00, Lucio Crusca wrote:

The API docs here

https://nightlies.apache.org/wicket/apidocs/9.x/org/apache/wicket/markup/html/link/DownloadLink.html 



state that DownloadLink locks the page. I assume it means the user who 
is downloading something cannot access the webapp until the download 
has finished.


But what about other users? Does that notice about other threads also 
being blocked mean that even other users won't be able to access that 
page? Or even the whole webapp?


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



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



how does DownloadLink lock the page?

2022-03-22 Thread Lucio Crusca

The API docs here

https://nightlies.apache.org/wicket/apidocs/9.x/org/apache/wicket/markup/html/link/DownloadLink.html

state that DownloadLink locks the page. I assume it means the user who 
is downloading something cannot access the webapp until the download has 
finished.


But what about other users? Does that notice about other threads also 
being blocked mean that even other users won't be able to access that 
page? Or even the whole webapp?


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



Re: DownloadLink ContentDisposition

2019-09-19 Thread e . spyrop . w
I thought so, but on the other hand, the problem gets solved without much
hassle.
I have created the pull request.

Thank you,
Elias


"Sven Meier"  wrote on 18/09/2019 07:55:08 μμ:

> "Sven Meier" 
> 18/09/2019 07:55 μμ
>
> Please respond to
> users@wicket.apache.org
>
> To
>
> users@wicket.apache.org
>
> cc
>
> Subject
>
> Re: DownloadLink ContentDisposition
>
> Hi,
>
> IMHO "download" sort of implies that the file is downloaded and not
> shown inline.
>
> But feel free to create a pull request to make that configurable.
>
> Have fun
> Sven
>
>
> On 18.09.19 17:09, e.spyro...@teamconcepts.gr wrote:
> > Hi all,
> >
> > I have a quick question (I hope)
> >
> > I wanted to display a PDF file from the file system directly in the
> > browser.
> > The first solution I used was based on the article "AJAX update and
file
> > download in one blow" from the wiki, changing the ContentDisposition to
> > INLINE, in the onRequest() method of the AJAXDownload.
> >
> > AJAX was too much for my task, so I dug further and discovered that
> > ContentDisposition is also set in the onClick() method of DownloadLink.
> > So I just brutally copied DownloadLink to a new class, and changed
> > ContentDisposition from ATTACHMENT to INLINE.
> >
> > But, this left me wondering: Is there any reason why ContentDisposition
is
> > not user controllable in DownloadLink, just like cacheDuration ?
> >
> > Thanks,
> >
> > Elias
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


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



Re: DownloadLink ContentDisposition

2019-09-18 Thread Sven Meier

Hi,

IMHO "download" sort of implies that the file is downloaded and not 
shown inline.


But feel free to create a pull request to make that configurable.

Have fun
Sven


On 18.09.19 17:09, e.spyro...@teamconcepts.gr wrote:

Hi all,

I have a quick question (I hope)

I wanted to display a PDF file from the file system directly in the
browser.
The first solution I used was based on the article "AJAX update and file
download in one blow" from the wiki, changing the ContentDisposition to
INLINE, in the onRequest() method of the AJAXDownload.

AJAX was too much for my task, so I dug further and discovered that
ContentDisposition is also set in the onClick() method of DownloadLink.
So I just brutally copied DownloadLink to a new class, and changed
ContentDisposition from ATTACHMENT to INLINE.

But, this left me wondering: Is there any reason why ContentDisposition is
not user controllable in DownloadLink, just like cacheDuration ?

Thanks,

Elias




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



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



DownloadLink ContentDisposition

2019-09-18 Thread e . spyrop . w


Hi all,

I have a quick question (I hope)

I wanted to display a PDF file from the file system directly in the
browser.
The first solution I used was based on the article "AJAX update and file
download in one blow" from the wiki, changing the ContentDisposition to
INLINE, in the onRequest() method of the AJAXDownload.

AJAX was too much for my task, so I dug further and discovered that
ContentDisposition is also set in the onClick() method of DownloadLink.
So I just brutally copied DownloadLink to a new class, and changed
ContentDisposition from ATTACHMENT to INLINE.

But, this left me wondering: Is there any reason why ContentDisposition is
not user controllable in DownloadLink, just like cacheDuration ?

Thanks,

Elias




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



Re: Input Stream DownloadLink

2016-01-06 Thread Martin Spielmann
Thanks a lot for the feedback,

i'll try to improve things according to these hints. Maybe i'm able to do some 
performance measurements also. If the outcome is something useful i'll share 
the results again.

Best regards,
Martin



On Wednesday, January 06, 2016 08:45:25 AM Martin Grigorov wrote:
> Hi,
> 
> Thanks for sharing your component with us!
> 
> In the "about" section you use LoadableDetachableModel that returns
> InputStream. For single use this would work fine, but if you try to use
> this model second time in the same request then it may fail depending on
> the type of the InputStream because you may need to reset it. I cannot
> imagine now a use case where you will need to use it second time in the
> same request but I also see no reason to use LDM. Using
> AbstractReadOnlyModel looks better to me.
> 
> Apart from that I think you can use "new ResourceLink(String, IResource)"
> for the same kind of tasks. E.g. with ByteArrayResource that either accepts
> its byte[] as constructor parameter or loads it dynamically by overriding
> #getData().
> 
> Happy New Year!
> 
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
> 
> On Wed, Jan 6, 2016 at 12:16 AM, Martin Spielmann <
> 
> martin.spielm...@pingunaut.com> wrote:
> > Hello all,
> > 
> > I just published a small version of a download link which enables you to
> > serve
> > any data coming from an InputStream for download.
> > 
> > https://github.com/pingunaut/wicket-stream-download-example
> > 
> > I used that one in multiple projects now, so I thought it could be
> > interesting
> > for other people too.
> > Just wanted to hear, if there any need for this one out there before
> > spending
> > more effort for docs and error handling.
> > 
> > Happy new year!
> > 
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org

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



Re: Input Stream DownloadLink

2016-01-05 Thread Martin Grigorov
Hi,

Thanks for sharing your component with us!

In the "about" section you use LoadableDetachableModel that returns
InputStream. For single use this would work fine, but if you try to use
this model second time in the same request then it may fail depending on
the type of the InputStream because you may need to reset it. I cannot
imagine now a use case where you will need to use it second time in the
same request but I also see no reason to use LDM. Using
AbstractReadOnlyModel looks better to me.

Apart from that I think you can use "new ResourceLink(String, IResource)"
for the same kind of tasks. E.g. with ByteArrayResource that either accepts
its byte[] as constructor parameter or loads it dynamically by overriding
#getData().

Happy New Year!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 6, 2016 at 12:16 AM, Martin Spielmann <
martin.spielm...@pingunaut.com> wrote:

> Hello all,
>
> I just published a small version of a download link which enables you to
> serve
> any data coming from an InputStream for download.
>
> https://github.com/pingunaut/wicket-stream-download-example
>
> I used that one in multiple projects now, so I thought it could be
> interesting
> for other people too.
> Just wanted to hear, if there any need for this one out there before
> spending
> more effort for docs and error handling.
>
> Happy new year!
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Input Stream DownloadLink

2016-01-05 Thread Štefan Šimík
Hi Martin,
I found it very useful and really appreciate you contribution.
I think it is definitely worth of effort, if something very similar does
not already exist in wicket distribution.
In that case, it would be great source of inspiration for new pull-request
into wicket.

Simple, short and clean description. I like that :)
Good work Martin

On Wed, Jan 6, 2016 at 12:16 AM, Martin Spielmann <
martin.spielm...@pingunaut.com> wrote:

> Hello all,
>
> I just published a small version of a download link which enables you to
> serve
> any data coming from an InputStream for download.
>
> https://github.com/pingunaut/wicket-stream-download-example
>
> I used that one in multiple projects now, so I thought it could be
> interesting
> for other people too.
> Just wanted to hear, if there any need for this one out there before
> spending
> more effort for docs and error handling.
>
> Happy new year!
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Input Stream DownloadLink

2016-01-05 Thread Martin Spielmann
Hello all,

I just published a small version of a download link which enables you to serve 
any data coming from an InputStream for download.

https://github.com/pingunaut/wicket-stream-download-example

I used that one in multiple projects now, so I thought it could be interesting 
for other people too. 
Just wanted to hear, if there any need for this one out there before spending 
more effort for docs and error handling.

Happy new year!


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



Re: DownloadLink in a separate thread?

2014-09-29 Thread Martin Grigorov
Hi,

Yes. Using ResourceLink will produce a url to IResource and thus avoid
locking the page instance.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Sep 29, 2014 at 4:01 AM, trlt  wrote:

> Never mind. I found my solution by using AbstractResource and ResourceLink
> instead of DownloadLink for nonblocking operation.
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-in-a-separate-thread-tp4667743p4667749.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DownloadLink in a separate thread?

2014-09-28 Thread trlt
Never mind. I found my solution by using AbstractResource and ResourceLink
instead of DownloadLink for nonblocking operation.   


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-in-a-separate-thread-tp4667743p4667749.html
Sent from the Users forum mailing list archive at Nabble.com.

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



DownloadLink in a separate thread?

2014-09-28 Thread trlt
Just checking to see if I'm doing this right:

When users click on a "download" link on my Wicket application, I want to be
zip all the files in a directory on the fly and return the user one big
*.zip file.  

This is working as expected, but since the number of and size of files can
be quite big, this can take a while to process.  Is "DownloadLink" the right
wicket component to implement this?  Does it make sense to run this in a
separate thread?  

Any help is appreciated!





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-in-a-separate-thread-tp4667743.html
Sent from the Users forum mailing list archive at Nabble.com.

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



RE: DownloadLink and ProgressBar

2013-11-20 Thread Paul Bors
I would be wrong to show a 0% - 100% status bar.

You might want to switch back to an indeterminate progress bar and do what
Apple does during OS X install, show a label letting the user of your
estimate such as "Approximately 5 minutes remaining" or "Less than a minute
remaning".

~ Thank you,
  Paul Bors

-Original Message-
From: seyaw [mailto:seidy...@gmail.com] 
Sent: Monday, November 18, 2013 2:25 PM
To: users@wicket.apache.org
Subject: RE: DownloadLink and ProgressBar

Yes Paul, getting the progress of the file generation is one of my challenge
right now. The file generation is, in my case is not linear. For example,
the time it takes for different procedures is depend on the project size.
Currently, I just make a rough estimation so that the user at least can see
the file generation is in progress. 



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp46
62451p4662504.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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



RE: DownloadLink and ProgressBar

2013-11-18 Thread seyaw
Yes Paul, getting the progress of the file generation is one of my challenge
right now. The file generation is, in my case is not linear. For example,
the time it takes for different procedures is depend on the project size.
Currently, I just make a rough estimation so that the user at least can see
the file generation is in progress. 



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662504.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: DownloadLink and ProgressBar

2013-11-18 Thread Ernesto Reinaldo Barreiro
What do you mean? How to compute how much has been generated? Or how to
pass this info to the client? Or something else?


On Mon, Nov 18, 2013 at 8:00 PM, Paul Bors  wrote:

> How do you track the progress of your file generation in order to show the
> status bar?
>
> ~ Thank you,
>   Paul Bors
>
> -Original Message-
> From: seyaw [mailto:seidy...@gmail.com]
> Sent: Monday, November 18, 2013 3:52 AM
> To: users@wicket.apache.org
> Subject: Re: DownloadLink and ProgressBar
>
> Hi Ernesto,
> A working example might be helpful.
> Thank you
>
>
>
> --
> View this message in context:
>
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp46
> 62451p4662485.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


RE: DownloadLink and ProgressBar

2013-11-18 Thread Paul Bors
How do you track the progress of your file generation in order to show the
status bar?

~ Thank you,
  Paul Bors

-Original Message-
From: seyaw [mailto:seidy...@gmail.com] 
Sent: Monday, November 18, 2013 3:52 AM
To: users@wicket.apache.org
Subject: Re: DownloadLink and ProgressBar

Hi Ernesto,
A working example might be helpful.
Thank you



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp46
62451p4662485.html
Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: DownloadLink and ProgressBar

2013-11-18 Thread Ernesto Reinaldo Barreiro
Thanks for the pointer!


On Mon, Nov 18, 2013 at 10:54 AM, Martin Grigorov wrote:

> I think
>
> https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/progressbar-parent
> has
> such examples
>
>
> On Mon, Nov 18, 2013 at 10:52 AM, seyaw  wrote:
>
> > Hi Ernesto,
> > A working example might be helpful.
> > Thank you
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662485.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro


Re: DownloadLink and ProgressBar

2013-11-18 Thread Martin Grigorov
I think
https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/progressbar-parent
has
such examples


On Mon, Nov 18, 2013 at 10:52 AM, seyaw  wrote:

> Hi Ernesto,
> A working example might be helpful.
> Thank you
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662485.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DownloadLink and ProgressBar

2013-11-18 Thread seyaw
Hi Ernesto,
A working example might be helpful.
Thank you



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662485.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: DownloadLink and ProgressBar

2013-11-18 Thread Martin Grigorov
I didn't read the question correctly.
It indeed talks about showing progress for the generation process, not the
download.


On Mon, Nov 18, 2013 at 10:39 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Martin,
>
> Thanks for your comments.
>
> On Mon, Nov 18, 2013 at 9:10 AM, Martin Grigorov  >wrote:
>
> > Hi,
> >
> > I haven't seen a web application that shows progress bar for download.
> > The browser itself shows such information - Google Chrome in the
> > bottom-left corner, Firefox in its download window/manager.
> >
>
> I'm not talking of a progress bar for download. I'm talking of showing a
> progress bar for file generation (a file that takes too long to generate).
> Once file is generated download will be triggered.  I have implemented a
> similar use case several times before.
>
>
> > > 1-Replace the download link by an AJAX link.
> > > 2-Launch file generation on a background thread. Pass a class to this
> > > thread that serves as context fro passing information from generating
> > > thread with web threads (keeping a reference to thisi context on the
> > page).
> > > 3-Make a progress panel visible + an AJAX timer that pols the server
> for
> > > progress.
> > >
> >
> > Point 3) won't work if the file download is from a resource linked to the
> > page. And it is thru DownloadLink.
> > In this case the ajax timer won't be able to reach the page at all.
> >
>
> ? Not following you. Page and thread generating the file will share a
> context the file generating thread will use to update WEB threads about
> status of generation (e.g. progress info). All the AJAX timer will do is
> poll the page and ask for this information. Once file is generated timer
> will disable itself and trigger download (or display a new panel with
> download link). Again I have implemented something similar more than once
> in my life.
>
>
> >
> > The app should use a mounted/shared resource.
> > see wicket-extensions' UploadProgressBar and/or follow the progress of
> > https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/262 for example.
> > Both
> > are related to *upload*, not download.
> >
>
> Yes I know the limitation of serving resources from pages. Maybe one
> variation of this is that the timer just points to the mounted resource in
> order to trigger the actual download. That is not more difficult to achieve
> that downloading from page.
>
> Shall I build a small mini app illustrating this? Maybe it can be useful to
> other users?
>
> --
> Regards - Ernesto Reinaldo Barreiro
>


Re: DownloadLink and ProgressBar

2013-11-18 Thread Ernesto Reinaldo Barreiro
Martin,

Thanks for your comments.

On Mon, Nov 18, 2013 at 9:10 AM, Martin Grigorov wrote:

> Hi,
>
> I haven't seen a web application that shows progress bar for download.
> The browser itself shows such information - Google Chrome in the
> bottom-left corner, Firefox in its download window/manager.
>

I'm not talking of a progress bar for download. I'm talking of showing a
progress bar for file generation (a file that takes too long to generate).
Once file is generated download will be triggered.  I have implemented a
similar use case several times before.


> > 1-Replace the download link by an AJAX link.
> > 2-Launch file generation on a background thread. Pass a class to this
> > thread that serves as context fro passing information from generating
> > thread with web threads (keeping a reference to thisi context on the
> page).
> > 3-Make a progress panel visible + an AJAX timer that pols the server for
> > progress.
> >
>
> Point 3) won't work if the file download is from a resource linked to the
> page. And it is thru DownloadLink.
> In this case the ajax timer won't be able to reach the page at all.
>

? Not following you. Page and thread generating the file will share a
context the file generating thread will use to update WEB threads about
status of generation (e.g. progress info). All the AJAX timer will do is
poll the page and ask for this information. Once file is generated timer
will disable itself and trigger download (or display a new panel with
download link). Again I have implemented something similar more than once
in my life.


>
> The app should use a mounted/shared resource.
> see wicket-extensions' UploadProgressBar and/or follow the progress of
> https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/262 for example.
> Both
> are related to *upload*, not download.
>

Yes I know the limitation of serving resources from pages. Maybe one
variation of this is that the timer just points to the mounted resource in
order to trigger the actual download. That is not more difficult to achieve
that downloading from page.

Shall I build a small mini app illustrating this? Maybe it can be useful to
other users?

-- 
Regards - Ernesto Reinaldo Barreiro


Re: DownloadLink and ProgressBar

2013-11-18 Thread Martin Grigorov
Hi,

I haven't seen a web application that shows progress bar for download.
The browser itself shows such information - Google Chrome in the
bottom-left corner, Firefox in its download window/manager.


On Sat, Nov 16, 2013 at 11:40 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
>
> 1-Replace the download link by an AJAX link.
> 2-Launch file generation on a background thread. Pass a class to this
> thread that serves as context fro passing information from generating
> thread with web threads (keeping a reference to thisi context on the page).
> 3-Make a progress panel visible + an AJAX timer that pols the server for
> progress.
>

Point 3) won't work if the file download is from a resource linked to the
page. And it is thru DownloadLink.
In this case the ajax timer won't be able to reach the page at all.

The app should use a mounted/shared resource.
see wicket-extensions' UploadProgressBar and/or follow the progress of
https://github.com/l0rdn1kk0n/wicket-bootstrap/issues/262 for example. Both
are related to *upload*, not download.


> 4-Once file is generated replace progress panel with a download link (or
> use trick in [1] to trigger file dowmload)
>
> References
>
> 1-
>
> https://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow
>
>
> On Sat, Nov 16, 2013 at 10:29 AM, seyaw  wrote:
>
> > Hi All,
> > I have a wicket DownloadLink where I generate file dynamically and
> download
> > it. It works.
> > The process of dynamic File generation might take some time and like to
> > show
> > ProgressBar which show how much the generation has progressed. How Can I
> do
> > that.
> >
> > I am using wicket 1.5.8
> > Thank you very much.
> >
> >  add(new DownloadLink("export", new LoadableDetachableModel()
> > {
> > private static final long serialVersionUID =
> > 840863954694163375L;
> >
> > @Override
> > protected File load()
> > {
> > File exportTempDir = getGeneratedFile();
> > }
> > }
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451.html
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>


Re: DownloadLink and ProgressBar

2013-11-17 Thread Ernesto Reinaldo Barreiro
Create a class that implements Runnable. Find how to launch a runnable
(e.g. using a thread pool). Keep a reference to this runnable and use some
property of it to track progress. Use an AJAX timer to pol for this value.


On Sun, Nov 17, 2013 at 10:14 AM, seyaw  wrote:

> Dear Ernesto
> Thank you very much for your help. Your comments were very helpful.
> I solve the problem as you suggested with little modification
> 1. follow the reference you mention [1]
> 2. add AjaxLink that will generate a file
>
>  add(new AjaxLink("download")
> {
> @Override
> public void onClick(final AjaxRequestTarget target)
> {
>
> bar.start(target);
>
> new Thread()
> {
> public void run()
> {
> generateFile
> }.
> 3. add a progressbar (from wicketstuff) and on its onFinsh method, trigger
> the file download
>
>  Progress = new ProgressBar("progress", new ProgressionModel()
> {
>
> protected Progression getProgression()
> {
> return new Progression(progress);
> }
> })
> {
>
> protected void onFinished(AjaxRequestTarget target)
> {
> download.initiate(target, fileName);
> }
> progress.add(download)
> add(progress)
>
> My only problem now is I have to guess the progress of file genaration , to
> be dispalyed on the progress bar
>
> thank you very much
>
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662463.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: DownloadLink and ProgressBar

2013-11-17 Thread seyaw
Dear Ernesto
Thank you very much for your help. Your comments were very helpful.
I solve the problem as you suggested with little modification
1. follow the reference you mention [1]
2. add AjaxLink that will generate a file

 add(new AjaxLink("download")
{
@Override
public void onClick(final AjaxRequestTarget target)
{

bar.start(target);

new Thread()
{
public void run()
{
generateFile
}.
3. add a progressbar (from wicketstuff) and on its onFinsh method, trigger
the file download

 Progress = new ProgressBar("progress", new ProgressionModel()
{

protected Progression getProgression()
{
return new Progression(progress);
}
})
{

protected void onFinished(AjaxRequestTarget target)
{
download.initiate(target, fileName);
}
progress.add(download)
add(progress)

My only problem now is I have to guess the progress of file genaration , to
be dispalyed on the progress bar

thank you very much




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662463.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: DownloadLink and ProgressBar

2013-11-17 Thread Ernesto Reinaldo Barreiro
Do you want me to build a little example for this?


On Sat, Nov 16, 2013 at 7:59 PM, seyaw  wrote:

> Thank you Ernesto for your prompt response.
> 1. is okay.
> Then for 2. I suppose I start the thread from the onclick method of the
> ajax
> link. Can you explain a bit how to start the file genaration with a thread?
> and for 3. how to pol the server for the progress?
>
> Thank you very much
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662460.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: DownloadLink and ProgressBar

2013-11-16 Thread seyaw
Thank you Ernesto for your prompt response.
1. is okay. 
Then for 2. I suppose I start the thread from the onclick method of the ajax
link. Can you explain a bit how to start the file genaration with a thread?
and for 3. how to pol the server for the progress?

Thank you very much



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451p4662460.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: DownloadLink and ProgressBar

2013-11-16 Thread Ernesto Reinaldo Barreiro
Hi,


1-Replace the download link by an AJAX link.
2-Launch file generation on a background thread. Pass a class to this
thread that serves as context fro passing information from generating
thread with web threads (keeping a reference to thisi context on the page).
3-Make a progress panel visible + an AJAX timer that pols the server for
progress.
4-Once file is generated replace progress panel with a download link (or
use trick in [1] to trigger file dowmload)

References

1-
https://cwiki.apache.org/confluence/display/WICKET/AJAX+update+and+file+download+in+one+blow


On Sat, Nov 16, 2013 at 10:29 AM, seyaw  wrote:

> Hi All,
> I have a wicket DownloadLink where I generate file dynamically and download
> it. It works.
> The process of dynamic File generation might take some time and like to
> show
> ProgressBar which show how much the generation has progressed. How Can I do
> that.
>
> I am using wicket 1.5.8
> Thank you very much.
>
>  add(new DownloadLink("export", new LoadableDetachableModel()
> {
> private static final long serialVersionUID =
> 840863954694163375L;
>
> @Override
> protected File load()
> {
> File exportTempDir = getGeneratedFile();
> }
> }
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


DownloadLink and ProgressBar

2013-11-16 Thread seyaw
Hi All,
I have a wicket DownloadLink where I generate file dynamically and download
it. It works.
The process of dynamic File generation might take some time and like to show
ProgressBar which show how much the generation has progressed. How Can I do
that.

I am using wicket 1.5.8
Thank you very much. 

 add(new DownloadLink("export", new LoadableDetachableModel()
{
private static final long serialVersionUID =
840863954694163375L;

@Override
protected File load()
{
File exportTempDir = getGeneratedFile();
}
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-and-ProgressBar-tp4662451.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: DownloadLink

2012-12-05 Thread Altuğ Bilgin Altıntaş
Thanks




On Wed, Dec 5, 2012 at 11:46 AM, Martin Grigorov wrote:

> s/handler/target/
>
>
> On Wed, Dec 5, 2012 at 10:44 AM, Altuğ Bilgin Altıntaş  >wrote:
>
> > Our Wicket version is 1.4.x
> >
> >
> >
> >
> > On Wed, Dec 5, 2012 at 11:42 AM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > See
> > >
> > >
> > >
> >
> https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
> > >
> > > On Wed, Dec 5, 2012 at 10:38 AM, Altuğ Bilgin Altıntaş <
> alt...@gmail.com
> > > >wrote:
> > >
> > > > Hi;
> > > >
> > > > Is it possible to trigger form submit before DownloadLink execution.
> > > >
> > > > We need to get some values from the form in order to process pdf.
> > > >
> > > > Any suggestions ?
> > > >
> > > > Thanks.
> > > >
> > >
> > >
> > >
> > > --
> > > Regards - Ernesto Reinaldo Barreiro
> > > Antilia Soft
> > > http://antiliasoft.com/ <http://antiliasoft.com/antilia>
> > >
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>


Re: DownloadLink

2012-12-05 Thread Martin Grigorov
s/handler/target/


On Wed, Dec 5, 2012 at 10:44 AM, Altuğ Bilgin Altıntaş wrote:

> Our Wicket version is 1.4.x
>
>
>
>
> On Wed, Dec 5, 2012 at 11:42 AM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
> > Hi,
> >
> > See
> >
> >
> >
> https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
> >
> > On Wed, Dec 5, 2012 at 10:38 AM, Altuğ Bilgin Altıntaş  > >wrote:
> >
> > > Hi;
> > >
> > > Is it possible to trigger form submit before DownloadLink execution.
> > >
> > > We need to get some values from the form in order to process pdf.
> > >
> > > Any suggestions ?
> > >
> > > Thanks.
> > >
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> > Antilia Soft
> > http://antiliasoft.com/ <http://antiliasoft.com/antilia>
> >
>



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


Re: DownloadLink

2012-12-05 Thread Altuğ Bilgin Altıntaş
Our Wicket version is 1.4.x




On Wed, Dec 5, 2012 at 11:42 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Hi,
>
> See
>
>
> https://cwiki.apache.org/WICKET/ajax-update-and-file-download-in-one-blow.html
>
> On Wed, Dec 5, 2012 at 10:38 AM, Altuğ Bilgin Altıntaş  >wrote:
>
> > Hi;
> >
> > Is it possible to trigger form submit before DownloadLink execution.
> >
> > We need to get some values from the form in order to process pdf.
> >
> > Any suggestions ?
> >
> > Thanks.
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
> Antilia Soft
> http://antiliasoft.com/ <http://antiliasoft.com/antilia>
>


Re: DownloadLink

2012-12-05 Thread Martin Grigorov
Hi,

See the code in DownloadLink. It just schedules an additional request
handler.
You can do the same in your #onSubmit() method.


On Wed, Dec 5, 2012 at 10:38 AM, Altuğ Bilgin Altıntaş wrote:

> Hi;
>
> Is it possible to trigger form submit before DownloadLink execution.
>
> We need to get some values from the form in order to process pdf.
>
> Any suggestions ?
>
> Thanks.
>



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


DownloadLink

2012-12-05 Thread Altuğ Bilgin Altıntaş
Hi;

Is it possible to trigger form submit before DownloadLink execution.

We need to get some values from the form in order to process pdf.

Any suggestions ?

Thanks.


Re: DownloadLink

2012-10-15 Thread Michael Jaruska

Ok, so this is my code (works, irrelevant striped):

public class PageIndex extends PageBase{
...
...
...
  final Integer fileDbIdTmp = (Integer) oneResult.get("fileId");
  final byte[] bytes = new String("content of the created file for 
download").getBytes();
  ResourceLink downloadLink = new ResourceLink("downloadLink", new 
AbstractResource()
  {
private Integer fileDbId = fileDbIdTmp;
@Override
protected ResourceResponse newResourceResponse(Attributes attributes)
{
  ResourceResponse r = new ResourceResponse();
  r.setFileName("mypdf.pdf");
  r.setContentType("application/pdf");
  r.setContentDisposition(ContentDisposition.ATTACHMENT);
  r.setContentLength(bytes.length);
  r.setWriteCallback(new WriteCallback()
  {
@Override
public void writeData(Attributes attributes)
{
  //here, the data for .pdf should be loaded on-demand from DB with 
some appropriate model...
  MyDAOObject myDBData = new MyDAOObject(fileDbIdTmp);//just pseudo-code
  attributes.getResponse().write(myDBData.loadData());
}
      });
  return r;
}
  });
panelEvent.add(downloadLink);
this.add(panelEvent);
...
...
...
}

Now I would like construct LoadableDetachableModel (using this model for 
loading strings for same panels) or something similar
so I can construct data from DB based on some id (I have DB id of the element - 
in this case .pdf file stored in DB).

After consult doc:
http://wicket.apache.org/apidocs/1.5/org/apache/wicket/markup/html/link/ResourceLink.html
I can't see where to put model, or where to hook model into ResourceLink.

In my code in writeData() there is line for loading data but I think this is 
ugly solution...


Any help appreciated.

MJ


On 15.10.2012 8:06, Michael Jaruska wrote:

Yes, thank you, this example helps.


On 15.10.2012 3:42, Dan Retzlaff wrote:

This should get you going:
new ResourceLink("pdf", new AbstractResource() {
@Override
protected ResourceResponse newResourceResponse(Attributes attributes) {
final byte[] pdfBytes = getPdfBytes();
ResourceResponse r = new ResourceResponse();
r.setFileName("yourpdf.pdf");
r.setContentType("application/pdf");
r.setContentDisposition(ContentDisposition.ATTACHMENT);
r.setContentLength(pdfBytes.length);
r.setWriteCallback(new WriteCallback() {
@Override
public void writeData(Attributes attributes) throws IOException {
attributes.getResponse().write(pdfBytes);
}
});
return r;
}
}
On Sun, Oct 14, 2012 at 8:14 PM, Michael Jaruska
wrote:


Is there more complex example? Do you build link with DownloadLink or
ResourceLink? -I suppouse you use ResourceLink. And yes, I would like to
build response data at the link click moment, no temp file if possible
(in fact I have data as byte[] from database).



On 14.10.2012 21:59, Dan Retzlaff wrote:


I usually wrap a custom AbstractResource instance in a ResourceReference,
and put that into the ResourceLink. AbstractResource#**
newResourceResponse()
is called when the link is clicked. You can query for the bytes there, and
write them to the response in your ResourceResponse's WriteCallback. For a
download, the relevant setters are:

ResourceResponse response = new ResourceResponse();
response.setFileName(...);
response.setContentType(...);
response.setContentLength(...)**;
response.**setContentDisposition(**ContentDisposition.ATTACHMENT)**;
response.setWriteCallback(new WriteCallback() {...});

On Sun, Oct 14, 2012 at 7:45 PM, Michael Jaruska
**wrote:

  Dan, thank you for links and points.


The true is that I have data in database so I would like streaming them.
Is the right
way put them in temp file first and then send it into browser with
DownloadLink?

After some googling I noticed that ResourceLink should be like
DownloadLink but for me
better - it's for streamed data. But can't find any example for wicket
1.5
:-(

MJ



On 14.10.2012 21:00, Dan Retzlaff wrote:

  Michael, check out the DownloadLink example here:

http://www.wicket-library.com/wicket-examples/linkomatic/home<http://www.wicket-library.com/**wicket-examples/linkomatic/**home>
<http://www.wicket-**library.com/wicket-examples/**linkomatic/home<http://www.wicket-library.com/wicket-examples/linkomatic/home>





Also check out the code for DownloadLink itself, and you'll see
1. Your IModel must return a File, but yours returns bytes.
2. The download is initiated in DownloadLink#onClick, which you have
blocked with your subclass.

Hope that helps,
Dan

On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
wrote:

   Hi,



what to add into onClick() in DownloadLink if I need return to client
generated .pdf
stream as a .pdf file?

My code:

IModel pdfStreamModel = new AbstractReadOnlyModel()
{
   public Object getObject()
   {
   return getPdfStreamBytes();
   }
};
DownloadLin

Re: DownloadLink

2012-10-14 Thread Michael Jaruska

Yes, thank you, this example helps.


On 15.10.2012 3:42, Dan Retzlaff wrote:

This should get you going:
new ResourceLink("pdf", new AbstractResource() {
@Override
protected ResourceResponse newResourceResponse(Attributes attributes) {
final byte[] pdfBytes = getPdfBytes();
ResourceResponse r = new ResourceResponse();
r.setFileName("yourpdf.pdf");
r.setContentType("application/pdf");
r.setContentDisposition(ContentDisposition.ATTACHMENT);
r.setContentLength(pdfBytes.length);
r.setWriteCallback(new WriteCallback() {
@Override
public void writeData(Attributes attributes) throws IOException {
attributes.getResponse().write(pdfBytes);
}
});
return r;
}
}
On Sun, Oct 14, 2012 at 8:14 PM, Michael Jaruska
wrote:


Is there more complex example? Do you build link with DownloadLink or
ResourceLink? -I suppouse you use ResourceLink. And yes, I would like to
build response data at the link click moment, no temp file if possible
(in fact I have data as byte[] from database).



On 14.10.2012 21:59, Dan Retzlaff wrote:


I usually wrap a custom AbstractResource instance in a ResourceReference,
and put that into the ResourceLink. AbstractResource#**
newResourceResponse()
is called when the link is clicked. You can query for the bytes there, and
write them to the response in your ResourceResponse's WriteCallback. For a
download, the relevant setters are:

ResourceResponse response = new ResourceResponse();
response.setFileName(...);
response.setContentType(...);
response.setContentLength(...)**;
response.**setContentDisposition(**ContentDisposition.ATTACHMENT)**;
response.setWriteCallback(new WriteCallback() {...});

On Sun, Oct 14, 2012 at 7:45 PM, Michael Jaruska
**wrote:

  Dan, thank you for links and points.


The true is that I have data in database so I would like streaming them.
Is the right
way put them in temp file first and then send it into browser with
DownloadLink?

After some googling I noticed that ResourceLink should be like
DownloadLink but for me
better - it's for streamed data. But can't find any example for wicket
1.5
:-(

MJ



On 14.10.2012 21:00, Dan Retzlaff wrote:

  Michael, check out the DownloadLink example here:

http://www.wicket-library.com/wicket-examples/linkomatic/home<http://www.wicket-library.com/**wicket-examples/linkomatic/**home>
<http://www.wicket-**library.com/wicket-examples/**linkomatic/home<http://www.wicket-library.com/wicket-examples/linkomatic/home>





Also check out the code for DownloadLink itself, and you'll see
1. Your IModel must return a File, but yours returns bytes.
2. The download is initiated in DownloadLink#onClick, which you have
blocked with your subclass.

Hope that helps,
Dan

On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
wrote:

   Hi,



what to add into onClick() in DownloadLink if I need return to client
generated .pdf
stream as a .pdf file?

My code:

IModel pdfStreamModel = new AbstractReadOnlyModel()
{
   public Object getObject()
   {
   return getPdfStreamBytes();
   }
};
DownloadLink downloadLink = new DownloadLink("downloadLink",
pdfStreamModel, getPdfDocumentName())
{
   public void onClick()
   {
   System.out.println("clicking works");
   }
};

Model works, DownloadLink is added into my markup. But I can't find any
example how to deal
code into onClick() in DownloadLink in a way it will return my
generated
.pdf stream in model.

Thank folks,

MJ

--**--**--**
--**-
To unsubscribe, e-mail: users-unsubscribe@wicket.apa**che.org<
http://apache.org**>
http://wicket.apache.org><
users-unsubscribe@**wicket.apache.org








For additional commands, e-mail: users-h...@wicket.apache.org





  --**

--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.org<http://apache.org>




For additional commands, e-mail: users-h...@wicket.apache.org






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






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



Re: DownloadLink

2012-10-14 Thread Dan Retzlaff
This should get you going:
new ResourceLink("pdf", new AbstractResource() {
@Override
protected ResourceResponse newResourceResponse(Attributes attributes) {
final byte[] pdfBytes = getPdfBytes();
ResourceResponse r = new ResourceResponse();
r.setFileName("yourpdf.pdf");
r.setContentType("application/pdf");
r.setContentDisposition(ContentDisposition.ATTACHMENT);
r.setContentLength(pdfBytes.length);
r.setWriteCallback(new WriteCallback() {
@Override
public void writeData(Attributes attributes) throws IOException {
attributes.getResponse().write(pdfBytes);
}
});
return r;
}
}
On Sun, Oct 14, 2012 at 8:14 PM, Michael Jaruska
wrote:

> Is there more complex example? Do you build link with DownloadLink or
> ResourceLink? -I suppouse you use ResourceLink. And yes, I would like to
> build response data at the link click moment, no temp file if possible
> (in fact I have data as byte[] from database).
>
>
>
> On 14.10.2012 21:59, Dan Retzlaff wrote:
>
>> I usually wrap a custom AbstractResource instance in a ResourceReference,
>> and put that into the ResourceLink. AbstractResource#**
>> newResourceResponse()
>> is called when the link is clicked. You can query for the bytes there, and
>> write them to the response in your ResourceResponse's WriteCallback. For a
>> download, the relevant setters are:
>>
>> ResourceResponse response = new ResourceResponse();
>> response.setFileName(...);
>> response.setContentType(...);
>> response.setContentLength(...)**;
>> response.**setContentDisposition(**ContentDisposition.ATTACHMENT)**;
>> response.setWriteCallback(new WriteCallback() {...});
>>
>> On Sun, Oct 14, 2012 at 7:45 PM, Michael Jaruska
>> **wrote:
>>
>>  Dan, thank you for links and points.
>>>
>>> The true is that I have data in database so I would like streaming them.
>>> Is the right
>>> way put them in temp file first and then send it into browser with
>>> DownloadLink?
>>>
>>> After some googling I noticed that ResourceLink should be like
>>> DownloadLink but for me
>>> better - it's for streamed data. But can't find any example for wicket
>>> 1.5
>>> :-(
>>>
>>> MJ
>>>
>>>
>>>
>>> On 14.10.2012 21:00, Dan Retzlaff wrote:
>>>
>>>  Michael, check out the DownloadLink example here:
>>>> http://www.wicket-library.com/wicket-examples/linkomatic/home<http://www.wicket-library.com/**wicket-examples/linkomatic/**home>
>>>> <http://www.wicket-**library.com/wicket-examples/**linkomatic/home<http://www.wicket-library.com/wicket-examples/linkomatic/home>
>>>> >
>>>>
>>>>
>>>> Also check out the code for DownloadLink itself, and you'll see
>>>> 1. Your IModel must return a File, but yours returns bytes.
>>>> 2. The download is initiated in DownloadLink#onClick, which you have
>>>> blocked with your subclass.
>>>>
>>>> Hope that helps,
>>>> Dan
>>>>
>>>> On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
>>>> wrote:
>>>>
>>>>   Hi,
>>>>
>>>>>
>>>>> what to add into onClick() in DownloadLink if I need return to client
>>>>> generated .pdf
>>>>> stream as a .pdf file?
>>>>>
>>>>> My code:
>>>>>
>>>>> IModel pdfStreamModel = new AbstractReadOnlyModel()
>>>>> {
>>>>>   public Object getObject()
>>>>>   {
>>>>>   return getPdfStreamBytes();
>>>>>   }
>>>>> };
>>>>> DownloadLink downloadLink = new DownloadLink("downloadLink",
>>>>> pdfStreamModel, getPdfDocumentName())
>>>>> {
>>>>>   public void onClick()
>>>>>   {
>>>>>   System.out.println("clicking works");
>>>>>   }
>>>>> };
>>>>>
>>>>> Model works, DownloadLink is added into my markup. But I can't find any
>>>>> example how to deal
>>>>> code into onClick() in DownloadLink in a way it will return my
>>>>> generated
>>>>> .pdf stream in model.
>>>>>
>>>>> Thank folks,
>>>>>
>>>>> MJ
>>>>>
>>>>> --**--**--**
>>>>> --**-
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apa**che.org<
>>>>> http://apache.org**>
>>>>> http://wicket.apache.org><
>>>>> users-unsubscribe@**wicket.apache.org
>>>>> >
>>>>>
>>>>>
>>>>>>
>>>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>  --**
>>> --**-
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>> 
>>> >
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DownloadLink

2012-10-14 Thread Michael Jaruska

Is there more complex example? Do you build link with DownloadLink or
ResourceLink? -I suppouse you use ResourceLink. And yes, I would like to
build response data at the link click moment, no temp file if possible
(in fact I have data as byte[] from database).


On 14.10.2012 21:59, Dan Retzlaff wrote:

I usually wrap a custom AbstractResource instance in a ResourceReference,
and put that into the ResourceLink. AbstractResource#newResourceResponse()
is called when the link is clicked. You can query for the bytes there, and
write them to the response in your ResourceResponse's WriteCallback. For a
download, the relevant setters are:

ResourceResponse response = new ResourceResponse();
response.setFileName(...);
response.setContentType(...);
response.setContentLength(...);
response.setContentDisposition(ContentDisposition.ATTACHMENT);
response.setWriteCallback(new WriteCallback() {...});

On Sun, Oct 14, 2012 at 7:45 PM, Michael Jaruska
wrote:


Dan, thank you for links and points.

The true is that I have data in database so I would like streaming them.
Is the right
way put them in temp file first and then send it into browser with
DownloadLink?

After some googling I noticed that ResourceLink should be like
DownloadLink but for me
better - it's for streamed data. But can't find any example for wicket 1.5
:-(

MJ



On 14.10.2012 21:00, Dan Retzlaff wrote:


Michael, check out the DownloadLink example here:
http://www.wicket-library.com/**wicket-examples/linkomatic/**home<http://www.wicket-library.com/wicket-examples/linkomatic/home>

Also check out the code for DownloadLink itself, and you'll see
1. Your IModel must return a File, but yours returns bytes.
2. The download is initiated in DownloadLink#onClick, which you have
blocked with your subclass.

Hope that helps,
Dan

On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
**wrote:

  Hi,


what to add into onClick() in DownloadLink if I need return to client
generated .pdf
stream as a .pdf file?

My code:

IModel pdfStreamModel = new AbstractReadOnlyModel()
{
  public Object getObject()
  {
  return getPdfStreamBytes();
  }
};
DownloadLink downloadLink = new DownloadLink("downloadLink",
pdfStreamModel, getPdfDocumentName())
{
  public void onClick()
  {
  System.out.println("clicking works");
  }
};

Model works, DownloadLink is added into my markup. But I can't find any
example how to deal
code into onClick() in DownloadLink in a way it will return my generated
.pdf stream in model.

Thank folks,

MJ

--**
--**-
To unsubscribe, e-mail: 
users-unsubscribe@wicket.**apa**che.org<http://apache.org>





For additional commands, e-mail: users-h...@wicket.apache.org






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






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



Re: DownloadLink

2012-10-14 Thread Dan Retzlaff
I usually wrap a custom AbstractResource instance in a ResourceReference,
and put that into the ResourceLink. AbstractResource#newResourceResponse()
is called when the link is clicked. You can query for the bytes there, and
write them to the response in your ResourceResponse's WriteCallback. For a
download, the relevant setters are:

ResourceResponse response = new ResourceResponse();
response.setFileName(...);
response.setContentType(...);
response.setContentLength(...);
response.setContentDisposition(ContentDisposition.ATTACHMENT);
response.setWriteCallback(new WriteCallback() {...});

On Sun, Oct 14, 2012 at 7:45 PM, Michael Jaruska
wrote:

> Dan, thank you for links and points.
>
> The true is that I have data in database so I would like streaming them.
> Is the right
> way put them in temp file first and then send it into browser with
> DownloadLink?
>
> After some googling I noticed that ResourceLink should be like
> DownloadLink but for me
> better - it's for streamed data. But can't find any example for wicket 1.5
> :-(
>
> MJ
>
>
>
> On 14.10.2012 21:00, Dan Retzlaff wrote:
>
>> Michael, check out the DownloadLink example here:
>> http://www.wicket-library.com/**wicket-examples/linkomatic/**home<http://www.wicket-library.com/wicket-examples/linkomatic/home>
>>
>> Also check out the code for DownloadLink itself, and you'll see
>> 1. Your IModel must return a File, but yours returns bytes.
>> 2. The download is initiated in DownloadLink#onClick, which you have
>> blocked with your subclass.
>>
>> Hope that helps,
>> Dan
>>
>> On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
>> **wrote:
>>
>>  Hi,
>>>
>>> what to add into onClick() in DownloadLink if I need return to client
>>> generated .pdf
>>> stream as a .pdf file?
>>>
>>> My code:
>>>
>>> IModel pdfStreamModel = new AbstractReadOnlyModel()
>>> {
>>>  public Object getObject()
>>>  {
>>>  return getPdfStreamBytes();
>>>  }
>>> };
>>> DownloadLink downloadLink = new DownloadLink("downloadLink",
>>> pdfStreamModel, getPdfDocumentName())
>>> {
>>>  public void onClick()
>>>  {
>>>  System.out.println("clicking works");
>>>  }
>>> };
>>>
>>> Model works, DownloadLink is added into my markup. But I can't find any
>>> example how to deal
>>> code into onClick() in DownloadLink in a way it will return my generated
>>> .pdf stream in model.
>>>
>>> Thank folks,
>>>
>>> MJ
>>>
>>> --**
>>> --**-
>>> To unsubscribe, e-mail: 
>>> users-unsubscribe@wicket.**apa**che.org<http://apache.org>
>>> 
>>> >
>>>
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>>
>>>
>>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DownloadLink

2012-10-14 Thread Michael Jaruska

Dan, thank you for links and points.

The true is that I have data in database so I would like streaming them. Is the 
right
way put them in temp file first and then send it into browser with DownloadLink?

After some googling I noticed that ResourceLink should be like DownloadLink but 
for me
better - it's for streamed data. But can't find any example for wicket 1.5 :-(

MJ


On 14.10.2012 21:00, Dan Retzlaff wrote:

Michael, check out the DownloadLink example here:
http://www.wicket-library.com/wicket-examples/linkomatic/home

Also check out the code for DownloadLink itself, and you'll see
1. Your IModel must return a File, but yours returns bytes.
2. The download is initiated in DownloadLink#onClick, which you have
blocked with your subclass.

Hope that helps,
Dan

On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
wrote:


Hi,

what to add into onClick() in DownloadLink if I need return to client
generated .pdf
stream as a .pdf file?

My code:

IModel pdfStreamModel = new AbstractReadOnlyModel()
{
 public Object getObject()
 {
 return getPdfStreamBytes();
 }
};
DownloadLink downloadLink = new DownloadLink("downloadLink",
pdfStreamModel, getPdfDocumentName())
{
 public void onClick()
 {
 System.out.println("clicking works");
 }
};

Model works, DownloadLink is added into my markup. But I can't find any
example how to deal
code into onClick() in DownloadLink in a way it will return my generated
.pdf stream in model.

Thank folks,

MJ

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






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



Re: DownloadLink

2012-10-14 Thread Dan Retzlaff
Michael, check out the DownloadLink example here:
http://www.wicket-library.com/wicket-examples/linkomatic/home

Also check out the code for DownloadLink itself, and you'll see
1. Your IModel must return a File, but yours returns bytes.
2. The download is initiated in DownloadLink#onClick, which you have
blocked with your subclass.

Hope that helps,
Dan

On Sun, Oct 14, 2012 at 5:09 PM, Michael Jaruska
wrote:

> Hi,
>
> what to add into onClick() in DownloadLink if I need return to client
> generated .pdf
> stream as a .pdf file?
>
> My code:
>
> IModel pdfStreamModel = new AbstractReadOnlyModel()
> {
> public Object getObject()
> {
> return getPdfStreamBytes();
>     }
> };
> DownloadLink downloadLink = new DownloadLink("downloadLink",
> pdfStreamModel, getPdfDocumentName())
> {
> public void onClick()
> {
>     System.out.println("clicking works");
> }
> };
>
> Model works, DownloadLink is added into my markup. But I can't find any
> example how to deal
> code into onClick() in DownloadLink in a way it will return my generated
> .pdf stream in model.
>
> Thank folks,
>
> MJ
>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


DownloadLink

2012-10-14 Thread Michael Jaruska

Hi,

what to add into onClick() in DownloadLink if I need return to client generated 
.pdf
stream as a .pdf file?

My code:

IModel pdfStreamModel = new AbstractReadOnlyModel()
{
public Object getObject()
{
return getPdfStreamBytes();
}
};
DownloadLink downloadLink = new DownloadLink("downloadLink", pdfStreamModel, 
getPdfDocumentName())
{
public void onClick()
{
System.out.println("clicking works");
    }
};

Model works, DownloadLink is added into my markup. But I can't find any example 
how to deal
code into onClick() in DownloadLink in a way it will return my generated .pdf 
stream in model.

Thank folks,

MJ

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



Re: How to avoid keeping files on the server with DownloadLink

2011-08-17 Thread eugenebalt
Never mind, I found out -- override "protected void setHeaders(WebResponse
response) " in ByteArrayResource.

OK, thanks, it's almost done, but there's still one issue.

It's working fine, but when I click the link the FIRST time, I get the
Open/Save As and when I click Open, Excel opens MyApp[1].xls.

Then when I click the SECOND time, I also get Open/Save As, and when I click
Open this time, Excel gives me this:

"MyApp[1].xls is locked for editing. Open Read-Only or Notify"

This never happened with the DownloadLink. With the DownloadLink, every
click was a valid Excel file open. Now, it looks like the local isn't being
released for some reason.

I have to either cancel or click Read-Only, and then on the next open it's
fine again. Very strange...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-avoid-keeping-files-on-the-server-with-DownloadLink-tp3750767p3751200.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to avoid keeping files on the server with DownloadLink

2011-08-17 Thread eugenebalt
How do I set this header on a ResourceLink? (I know I can do it on a
WebResponse, but I'm not dealing with that here.)

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-avoid-keeping-files-on-the-server-with-DownloadLink-tp3750767p3751171.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to avoid keeping files on the server with DownloadLink

2011-08-17 Thread Martin Grigorov
header: Content-Disposition

On Wed, Aug 17, 2011 at 10:35 PM, eugenebalt  wrote:
> So the question is, how do we force the Save As dialog box, rather than
> immediately auto-transmit.
>
> I know the DownloadLink does it, but is there a way to accomplish it with a
> ResourceLink? Thanks.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/How-to-avoid-keeping-files-on-the-server-with-DownloadLink-tp3750767p3750998.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



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

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



Re: How to avoid keeping files on the server with DownloadLink

2011-08-17 Thread eugenebalt
So the question is, how do we force the Save As dialog box, rather than
immediately auto-transmit. 

I know the DownloadLink does it, but is there a way to accomplish it with a
ResourceLink? Thanks.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-avoid-keeping-files-on-the-server-with-DownloadLink-tp3750767p3750998.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to avoid keeping files on the server with DownloadLink

2011-08-17 Thread eugenebalt
Thanks,

I was able to convert a DownloadLink to a ResourceLink (backed by a byte[]),
BUT that changed the behavior of the link.

Previously, all clicks on the DownloadLink would result in a Open / Save As
dialog box. This is what we want. The file type is MS Excel, and it was
offering to open or save the file.

Now, with the ResourceLink, it's a little different:

1) The Excel file opens immediately inside of IE, no prompts
2) If, from another browser/session, the link is clicked by another user,
there's an Excel error, "A document with the name 'localhost' is already
open"

The code:

ByteArrayResource bar = new ByteArrayResource("application/vnd.ms-excel",
generateExcelBytes()); //returns byte[]
ResourceLink exportLink = new ResourceLink("exportLink", bar);
add(exportLink);

Previously, with the DownloadLink, the code was:

DownloadLink exportLink = new DownloadLink("exportLink",
generateExcelFile()); //returns File
add(exportLink);

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-avoid-keeping-files-on-the-server-with-DownloadLink-tp3750767p3750974.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to avoid keeping files on the server with DownloadLink

2011-08-17 Thread Martin Grigorov
maybe you need ResourceLink instead backed by ByteArrayResource

On Wed, Aug 17, 2011 at 9:04 PM, eugenebalt  wrote:
> Just one more question,
>
> Is it possible to do a resource download from memory, *not* from a file on
> the server?
>
> I currently have a DownloadLink pointing to a generated file. That is fine,
> but we have multiple files getting generated and residing on the server that
> don't get cleaned up. We are interested in whether it's possible to do a
> download purely from memory.
>
> BTW, I am aware that DownloadLink has a method called
> "setDeleteAfterDownload(true)", but that's not what we want. If we have
> that, then the 2nd time the user clicks the same link, there's an error.
>
> We want correct file download each and every time the link is clicked, we
> just don't want server files getting created.
>
> Thanks
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/How-to-avoid-keeping-files-on-the-server-with-DownloadLink-tp3750767p3750767.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



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

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



How to avoid keeping files on the server with DownloadLink

2011-08-17 Thread eugenebalt
Just one more question,

Is it possible to do a resource download from memory, *not* from a file on
the server?

I currently have a DownloadLink pointing to a generated file. That is fine,
but we have multiple files getting generated and residing on the server that
don't get cleaned up. We are interested in whether it's possible to do a
download purely from memory.

BTW, I am aware that DownloadLink has a method called
"setDeleteAfterDownload(true)", but that's not what we want. If we have
that, then the 2nd time the user clicks the same link, there's an error.

We want correct file download each and every time the link is clicked, we
just don't want server files getting created.

Thanks

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-avoid-keeping-files-on-the-server-with-DownloadLink-tp3750767p3750767.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: DownloadLink pre-generating file, need new generation each time

2011-08-17 Thread Igor Vaynberg
the link supports imodel so you can generate and cache the file
when imodel.getobject() is called. you can even use the LDM for this..

-igor

On Wed, Aug 17, 2011 at 10:10 AM, eugenebalt  wrote:
> I have a DownloadLink which links to a file which is generated on the fly. Is
> there a way to force the construction of the file at the precise moment the
> link is clicked, not before?
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/DownloadLink-pre-generating-file-need-new-generation-each-time-tp3750595p3750595.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



DownloadLink pre-generating file, need new generation each time

2011-08-17 Thread eugenebalt
I have a DownloadLink which links to a file which is generated on the fly. Is
there a way to force the construction of the file at the precise moment the
link is clicked, not before?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-pre-generating-file-need-new-generation-each-time-tp3750596p3750596.html
Sent from the Users forum mailing list archive at Nabble.com.

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



DownloadLink pre-generating file, need new generation each time

2011-08-17 Thread eugenebalt
I have a DownloadLink which links to a file which is generated on the fly. Is
there a way to force the construction of the file at the precise moment the
link is clicked, not before?

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DownloadLink-pre-generating-file-need-new-generation-each-time-tp3750595p3750595.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Force DownloadLink

2010-10-31 Thread d2marcelo

I've tried the above options but they didn't work.
what I have now is

 exportEnv.setWindowClosedCallback(new ModalWindow.WindowClosedCallback()
{
public void onClose(AjaxRequestTarget target)
{
 final File exportFile= getFile();

 IResourceStream resourceStream = new FileResourceStream(
 new
org.apache.wicket.util.file.File(exportFile));
 
getRequestCycle().setRequestTarget(
 new
ResourceStreamRequestTarget(resourceStream) {
 public String 
getFileName() {
 return 
exportFile.getName();
 }
 });
 
}



   
});
   
the code is being processed but the file is not being exported. 
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-DownloadLink-tp3020797p3021666.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Force DownloadLink

2010-10-31 Thread Thomas Singer
 ?

On 31.10.2010 03:07, d2marcelo wrote:
> 
> Hello, 
> 
> how to force the DownloadLink to start downloading a file without the user
> clicking on it?
> 
> I'm trying to do dowload.onClick(); from a setWindowClosedCallback but it
> won't start. 
> 
> Any thoughts?
> 

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



Re: Force DownloadLink

2010-10-30 Thread Jeremy Thomerson
JavaScript: document.getElementById("markup-id-of-link").click();

On Sat, Oct 30, 2010 at 9:07 PM, d2marcelo  wrote:

>
> Hello,
>
> how to force the DownloadLink to start downloading a file without the user
> clicking on it?
>
> I'm trying to do dowload.onClick(); from a setWindowClosedCallback but it
> won't start.
>
> Any thoughts?
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Force-DownloadLink-tp3020797p3020797.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*


Force DownloadLink

2010-10-30 Thread d2marcelo

Hello, 

how to force the DownloadLink to start downloading a file without the user
clicking on it?

I'm trying to do dowload.onClick(); from a setWindowClosedCallback but it
won't start. 

Any thoughts?

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Force-DownloadLink-tp3020797p3020797.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: DownloadLink with AjaxIndicator

2010-10-13 Thread Altuğ Bilgin Altıntaş
my below example codes works on http://jquery.malsup.com/block/

//**
public class BlockerBehaviour {


@SuppressWarnings("unused")
private String componentId;

public BlockerBehaviour(String componentId) {
   this.componentId = componentId;
}

public String getJSBlock() {
String JS = " $(document).ready(function() {\n" +
"  $.blockUI({ message: '  "+ new
ResourceModel("please.wait").getObject()+"' });\n" +
"}) ;";

return JS;
}

 public String getJSUnBlock() {
String JS = " $(document).ready(function() {\n" +
"  $.unblockUI(); " +
"}) ;";

return JS;
}

}


//***

public abstract class MyAjaxIndicatorButton extends AjaxButton {
private static final long serialVersionUID = 1L;


public MyAjaxIndicatorButton (String id) {
super(id);
}


@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new AjaxCallDecorator() {
private static final long serialVersionUID = 1L;

@Override
public CharSequence decorateOnFailureScript(CharSequence script)
{
return script + " " + new
BlockerBehaviour(getId()).getJSUnBlock();
}

@Override
public CharSequence decorateScript(CharSequence script) {

return script + " " + new
BlockerBehaviour(getId()).getJSBlock();
}

@Override
public CharSequence decorateOnSuccessScript(CharSequence script)
{
return script + " " + new
BlockerBehaviour(getId()).getJSUnBlock();
}
};
}  ;
}

2010/10/13 Ann Baert 

> I would like to add an ajaxindicator on a DownloadLink.
> How can I do this?
>
> But because DownloadLink isn't ajax, I tried the following:
>
> AjaxLink downloadLink = new AjaxLink("id") {
>
>@Override
>public void onClick(AjaxRequestTarget target) {
>
>}
> };
> downloadLink.add(new AjaxEventBehavior("onclick") {
>
>@Override
>public void onEvent(final AjaxRequestTarget target) {
>RequestCycle.get().setRequestTarget(new IRequestTarget() {
>
>public void detach(RequestCycle requestCycle) {
>}
>
>public Object getLock(RequestCycle requestCycle) {
>return null;
>}
>
>public void respond(RequestCycle requestCycle) {
>WebResponse r = (WebResponse) requestCycle.getResponse();
>r.setAttachmentHeader("header.ext");
>r.setContentType("application/contentype");
>
>...
>Streams.copy(bais, r.getOutputStream());
>
>target.appendJavascript("...");
>    }
>    });
>
>}
>
>@Override
>protected CharSequence getEventHandler() {
>AppendingStringBuffer handler = new AppendingStringBuffer();
>handler.append("...");
>handler.append(super.getEventHandler());
>return handler;
>}
> });
> add(downloadLink);
>
>
>
> Thanks
> Ann
>  DISCLAIMER 
>
> http://www.tvh.com/newen2/emaildisclaimer/default.html
>
> "This message is delivered to all addressees subject to the conditions
> set forth in the attached disclaimer, which is an integral part of this
> message."
>


Re: DownloadLink with AjaxIndicator

2010-10-13 Thread MZemeck
AjaxIndicatorAppender?
http://wicket.apache.org/apidocs/1.4/org/apache/wicket/extensions/ajax/markup/html/AjaxIndicatorAppender.html



From:   Ann Baert 
To: users@wicket.apache.org
Date:   10/13/2010 10:09 AM
Subject:DownloadLink with AjaxIndicator



I would like to add an ajaxindicator on a DownloadLink.
How can I do this?

But because DownloadLink isn't ajax, I tried the following:

AjaxLink downloadLink = new AjaxLink("id") {

@Override
public void onClick(AjaxRequestTarget target) {
 
}
};
downloadLink.add(new AjaxEventBehavior("onclick") {
 
@Override
public void onEvent(final AjaxRequestTarget target) {
RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle requestCycle) {
}

public Object getLock(RequestCycle requestCycle) {
return null;
}

public void respond(RequestCycle requestCycle) {
WebResponse r = (WebResponse) requestCycle.getResponse();
r.setAttachmentHeader("header.ext");
r.setContentType("application/contentype");

...
Streams.copy(bais, r.getOutputStream());
 
target.appendJavascript("...");
}
});
 
}

@Override
protected CharSequence getEventHandler() {
AppendingStringBuffer handler = new AppendingStringBuffer();
handler.append("...");
handler.append(super.getEventHandler());
return handler;
}
});
add(downloadLink);



Thanks
Ann
 DISCLAIMER 

http://www.tvh.com/newen2/emaildisclaimer/default.html 

"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."





Notice: This communication, including any attachments, is intended solely 
for the use of the individual or entity to which it is addressed. This 
communication may contain information that is protected from disclosure 
under State and/or Federal law. Please notify the sender immediately if 
you have received this communication in error and delete this email from 
your system. If you are not the intended recipient, you are requested not 
to disclose, copy, distribute or take any action in reliance on the 
contents of this information.

DownloadLink with AjaxIndicator

2010-10-13 Thread Ann Baert
I would like to add an ajaxindicator on a DownloadLink.
How can I do this?

But because DownloadLink isn't ajax, I tried the following:

AjaxLink downloadLink = new AjaxLink("id") {

@Override
public void onClick(AjaxRequestTarget target) {
 
}
};
downloadLink.add(new AjaxEventBehavior("onclick") {
 
@Override
public void onEvent(final AjaxRequestTarget target) {
RequestCycle.get().setRequestTarget(new IRequestTarget() {

public void detach(RequestCycle requestCycle) {
}

public Object getLock(RequestCycle requestCycle) {
return null;
}

public void respond(RequestCycle requestCycle) {
WebResponse r = (WebResponse) requestCycle.getResponse();
r.setAttachmentHeader("header.ext");
r.setContentType("application/contentype");

...
Streams.copy(bais, r.getOutputStream());
 
target.appendJavascript("...");
}
});
 
}

@Override
protected CharSequence getEventHandler() {
AppendingStringBuffer handler = new AppendingStringBuffer();
handler.append("...");
handler.append(super.getEventHandler());
return handler;
}
});
add(downloadLink);



Thanks
Ann
 DISCLAIMER 

http://www.tvh.com/newen2/emaildisclaimer/default.html 

"This message is delivered to all addressees subject to the conditions
set forth in the attached disclaimer, which is an integral part of this
message."


Re: LinkTree and DownloadLink

2010-06-23 Thread Anna Simbirtsev
Thank you, its showing now.


On Wed, Jun 23, 2010 at 3:24 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Anna,
>
> Third parameter ( "Example DownloadLink" in your case) is just an
> alternative fine name: see onClick() method to see how it is used. Can
> you try following panel?
>
> import java.io.File;
>
> import org.apache.wicket.markup.html.basic.Label;
> import org.apache.wicket.markup.html.link.DownloadLink;
> import org.apache.wicket.markup.html.panel.Panel;
>
> public class DownLoadLinkPanel extends Panel {
>
>private static final long serialVersionUID = 1L;
>
> /**
> * @param id
> */
>public DownLoadLinkPanel(String id) {
>super(id);
>DownloadLink dl = new DownloadLink( "download", new File(
>"wat-application/images/addmore.jpg" ), "AddMore.jpg" );
>add(dl);
>dl.add(new Label("text", "Example DownloadLink"));
>}
>
> }
>
> 
>
> DownLoadLinkPanel.html
>
> 
> 
> 
>
> ---
>
> and then
>
> return new DownLoadLinkPanel(componentId);
>
> Ernesto
>
> On Tue, Jun 22, 2010 at 10:43 PM, Anna Simbirtsev 
> wrote:
> > I think the problem is in this: DownloadLink dl = new DownloadLink( id,
> new
> > File( "wat-application/images/addmore.jpg" ), "Example DownloadLink" );
> >
> > This does not produce any output.
> >
> > On Tue, Jun 22, 2010 at 4:18 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> >> Not sure but I think if you put Link on a  you will have a
> >> generated markup  which might not be visible.
> >> Why don't you use a panel like following?
> >>
> >> 
> >>   
> >> 
> >>
> >> Ernesto
> >>
> >>
> >> On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev  >
> >> wrote:
> >> > Thanks
> >> >
> >> > Do you know why if I add DownloadLink directly without the panel, its
> >> > invisible?
> >> >
> >> > On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro <
> >> > reier...@gmail.com> wrote:
> >> >
> >> >> Your MyPanel extends Form and Form should be applied to  tag
> not
> >> >>  tag.
> >> >>
> >> >> Ernesto
> >> >>
> >> >> On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev <
> asimbirt...@gmail.com
> >> >
> >> >> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > I am trying to extend newNodeComponent on a LinkTree to make nodes
> >> >> > DownLoadLink.
> >> >> >
> >> >> > tree = new LinkTree("tree", createTreeModel()){
> >> >> >
> >> >> > private static final long serialVersionUID = 1L;
> >> >> >
> >> >> > @Override
> >> >> > protected Component newNodeComponent( String id, IModel
> >> model
> >> >> )
> >> >> > {
> >> >> > return new LinkIconPanel( id, model, this ) {
> >> >> >
> >> >> >private static final long serialVersionUID =
> >> 1L;
> >> >> >
> >> >> > @Override
> >> >> > protected Component
> newContentComponent(
> >> >> String
> >> >> > componentId, BaseTree tree, IModel model ) {
> >> >> >     Object obj = ( (
> >> >> DefaultMutableTreeNode
> >> >> > )model.getObject() ).getUserObject();
> >> >> > if( !obj.equals("1:subtree...,
> >> >> > 2:subtree..., 3:subtree...") ) {
> >> >> > LOGGER.debug("link");
> >> >> > return new
> MyPanel(componentId);
> >> >> > }
> >> >> >
> >> >> > return new Label( componentId,
> >> >> > model.getObject().toString() );
> >> >> > }
> >> >> >
> >> >> > };
> >> >&

Re: LinkTree and DownloadLink

2010-06-23 Thread Ernesto Reinaldo Barreiro
Anna,

Third parameter ( "Example DownloadLink" in your case) is just an
alternative fine name: see onClick() method to see how it is used. Can
you try following panel?

import java.io.File;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.DownloadLink;
import org.apache.wicket.markup.html.panel.Panel;

public class DownLoadLinkPanel extends Panel {

private static final long serialVersionUID = 1L;

/**
 * @param id
 */
public DownLoadLinkPanel(String id) {
super(id);
    DownloadLink dl = new DownloadLink( "download", new File(
"wat-application/images/addmore.jpg" ), "AddMore.jpg" );
add(dl);
    dl.add(new Label("text", "Example DownloadLink"));
}

}



DownLoadLinkPanel.html





---

and then

return new DownLoadLinkPanel(componentId);

Ernesto

On Tue, Jun 22, 2010 at 10:43 PM, Anna Simbirtsev  wrote:
> I think the problem is in this: DownloadLink dl = new DownloadLink( id, new
> File( "wat-application/images/addmore.jpg" ), "Example DownloadLink" );
>
> This does not produce any output.
>
> On Tue, Jun 22, 2010 at 4:18 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> Not sure but I think if you put Link on a  you will have a
>> generated markup  which might not be visible.
>> Why don't you use a panel like following?
>>
>> 
>>   
>> 
>>
>> Ernesto
>>
>>
>> On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev 
>> wrote:
>> > Thanks
>> >
>> > Do you know why if I add DownloadLink directly without the panel, its
>> > invisible?
>> >
>> > On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro <
>> > reier...@gmail.com> wrote:
>> >
>> >> Your MyPanel extends Form and Form should be applied to  tag not
>> >>  tag.
>> >>
>> >> Ernesto
>> >>
>> >> On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev > >
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > I am trying to extend newNodeComponent on a LinkTree to make nodes
>> >> > DownLoadLink.
>> >> >
>> >> > tree = new LinkTree("tree", createTreeModel()){
>> >> >
>> >> > private static final long serialVersionUID = 1L;
>> >> >
>> >> > @Override
>> >> >             protected Component newNodeComponent( String id, IModel
>> model
>> >> )
>> >> > {
>> >> >                     return new LinkIconPanel( id, model, this ) {
>> >> >
>> >> >                        private static final long serialVersionUID =
>> 1L;
>> >> >
>> >> > @Override
>> >> >                             protected Component newContentComponent(
>> >> String
>> >> > componentId, BaseTree tree, IModel model ) {
>> >> >                                     Object obj = ( (
>> >> DefaultMutableTreeNode
>> >> > )model.getObject() ).getUserObject();
>> >> >                                     if( !obj.equals("1:subtree...,
>> >> > 2:subtree..., 3:subtree...") ) {
>> >> >                                     LOGGER.debug("link");
>> >> >                                     return new MyPanel(componentId);
>> >> >                                     }
>> >> >
>> >> >                                     return new Label( componentId,
>> >> > model.getObject().toString() );
>> >> >                             }
>> >> >
>> >> >                     };
>> >> >             }
>> >> >  };
>> >> >     form.add(tree);
>> >> >     tree.getTreeState().collapseAll();
>> >> >
>> >> >
>> >> >
>> >> >       public class MyPanel extends Form   {
>> >> >
>> >> >
>> >> >         private static final long serialVersionUID = 1L;
>> >> >
>> >> >         MyPanel(String id) {
>> >> >         super(id);
>> >> >
>> >> >         DownloadLink dl = new DownloadLink( id, new File(
>> >> > "wat-application/images/addmore.jpg" ), "Ex

Re: LinkTree and DownloadLink

2010-06-22 Thread Anna Simbirtsev
I think the problem is in this: DownloadLink dl = new DownloadLink( id, new
File( "wat-application/images/addmore.jpg" ), "Example DownloadLink" );

This does not produce any output.

On Tue, Jun 22, 2010 at 4:18 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Not sure but I think if you put Link on a  you will have a
> generated markup  which might not be visible.
> Why don't you use a panel like following?
>
> 
>   
> 
>
> Ernesto
>
>
> On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev 
> wrote:
> > Thanks
> >
> > Do you know why if I add DownloadLink directly without the panel, its
> > invisible?
> >
> > On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro <
> > reier...@gmail.com> wrote:
> >
> >> Your MyPanel extends Form and Form should be applied to  tag not
> >>  tag.
> >>
> >> Ernesto
> >>
> >> On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev  >
> >> wrote:
> >> > Hi,
> >> >
> >> > I am trying to extend newNodeComponent on a LinkTree to make nodes
> >> > DownLoadLink.
> >> >
> >> > tree = new LinkTree("tree", createTreeModel()){
> >> >
> >> > private static final long serialVersionUID = 1L;
> >> >
> >> > @Override
> >> > protected Component newNodeComponent( String id, IModel
> model
> >> )
> >> > {
> >> > return new LinkIconPanel( id, model, this ) {
> >> >
> >> >private static final long serialVersionUID =
> 1L;
> >> >
> >> > @Override
> >> > protected Component newContentComponent(
> >> String
> >> > componentId, BaseTree tree, IModel model ) {
> >> > Object obj = ( (
> >> DefaultMutableTreeNode
> >> > )model.getObject() ).getUserObject();
> >> > if( !obj.equals("1:subtree...,
> >> > 2:subtree..., 3:subtree...") ) {
> >> > LOGGER.debug("link");
> >> > return new MyPanel(componentId);
> >> >     }
> >> >
> >> > return new Label( componentId,
> >> > model.getObject().toString() );
> >> > }
> >> >
> >> > };
> >> > }
> >> >  };
> >> > form.add(tree);
> >> > tree.getTreeState().collapseAll();
> >> >
> >> >
> >> >
> >> >   public class MyPanel extends Form   {
> >> >
> >> >
> >> > private static final long serialVersionUID = 1L;
> >> >
> >> > MyPanel(String id) {
> >> > super(id);
> >> >
> >> > DownloadLink dl = new DownloadLink( id, new File(
> >> > "wat-application/images/addmore.jpg" ), "Example DownloadLink" );
> >> > add(dl);
> >> > }
> >> >  }
> >> >
> >> >
> >> > I copied the example from:
> >> > http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
> >> >
> >> >
> >> > But i get the following error:
> >> > WicketMessage: Component content must be applied to a tag of type
> 'form',
> >> > not '' (line
> 0,
> >> > column 0)
> >> >
> >> >
> >> > 
> >> >  >> wicket:id="icon"
> >> > class="icon"/> wicket:id="contentLink"> >> > wicket:id="content" class="content">
> >> > , index = 8, current = ' >> > class="content">' (line 19, column 144)]
> >> >
> >> > Thanks
> >> >
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> >> For additional commands, e-mail: users-h...@wicket.apache.org
> >>
> >>
> >
> >
> > --
> > Anna Simbirtsev
> > (416) 729-7331
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Anna Simbirtsev
(416) 729-7331


Re: LinkTree and DownloadLink

2010-06-22 Thread Ernesto Reinaldo Barreiro
Not sure but I think if you put Link on a  you will have a
generated markup  which might not be visible.
Why don't you use a panel like following?


   


Ernesto


On Tue, Jun 22, 2010 at 9:09 PM, Anna Simbirtsev  wrote:
> Thanks
>
> Do you know why if I add DownloadLink directly without the panel, its
> invisible?
>
> On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro <
> reier...@gmail.com> wrote:
>
>> Your MyPanel extends Form and Form should be applied to  tag not
>>  tag.
>>
>> Ernesto
>>
>> On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev 
>> wrote:
>> > Hi,
>> >
>> > I am trying to extend newNodeComponent on a LinkTree to make nodes
>> > DownLoadLink.
>> >
>> > tree = new LinkTree("tree", createTreeModel()){
>> >
>> > private static final long serialVersionUID = 1L;
>> >
>> > @Override
>> >             protected Component newNodeComponent( String id, IModel model
>> )
>> > {
>> >                     return new LinkIconPanel( id, model, this ) {
>> >
>> >                        private static final long serialVersionUID = 1L;
>> >
>> > @Override
>> >                             protected Component newContentComponent(
>> String
>> > componentId, BaseTree tree, IModel model ) {
>> >                                     Object obj = ( (
>> DefaultMutableTreeNode
>> > )model.getObject() ).getUserObject();
>> >                                     if( !obj.equals("1:subtree...,
>> > 2:subtree..., 3:subtree...") ) {
>> >                                     LOGGER.debug("link");
>> >                                     return new MyPanel(componentId);
>> >                                     }
>> >
>> >                                     return new Label( componentId,
>> > model.getObject().toString() );
>> >                             }
>> >
>> >                     };
>> >             }
>> >  };
>> >     form.add(tree);
>> >     tree.getTreeState().collapseAll();
>> >
>> >
>> >
>> >       public class MyPanel extends Form   {
>> >
>> >
>> >         private static final long serialVersionUID = 1L;
>> >
>> >         MyPanel(String id) {
>> >         super(id);
>> >
>> >         DownloadLink dl = new DownloadLink( id, new File(
>> > "wat-application/images/addmore.jpg" ), "Example DownloadLink" );
>> >         add(dl);
>> >         }
>> >  }
>> >
>> >
>> > I copied the example from:
>> > http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
>> >
>> >
>> > But i get the following error:
>> > WicketMessage: Component content must be applied to a tag of type 'form',
>> > not '' (line 0,
>> > column 0)
>> >
>> >
>> > 
>> > > wicket:id="icon"
>> > class="icon"/>> > wicket:id="content" class="content">
>> > , index = 8, current = '> > class="content">' (line 19, column 144)]
>> >
>> > Thanks
>> >
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Anna Simbirtsev
> (416) 729-7331
>

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



Re: LinkTree and DownloadLink

2010-06-22 Thread Anna Simbirtsev
Thanks

Do you know why if I add DownloadLink directly without the panel, its
invisible?

On Tue, Jun 22, 2010 at 2:55 PM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Your MyPanel extends Form and Form should be applied to  tag not
>  tag.
>
> Ernesto
>
> On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev 
> wrote:
> > Hi,
> >
> > I am trying to extend newNodeComponent on a LinkTree to make nodes
> > DownLoadLink.
> >
> > tree = new LinkTree("tree", createTreeModel()){
> >
> > private static final long serialVersionUID = 1L;
> >
> > @Override
> > protected Component newNodeComponent( String id, IModel model
> )
> > {
> > return new LinkIconPanel( id, model, this ) {
> >
> >private static final long serialVersionUID = 1L;
> >
> > @Override
> > protected Component newContentComponent(
> String
> > componentId, BaseTree tree, IModel model ) {
> > Object obj = ( (
> DefaultMutableTreeNode
> > )model.getObject() ).getUserObject();
> > if( !obj.equals("1:subtree...,
> > 2:subtree..., 3:subtree...") ) {
> > LOGGER.debug("link");
> > return new MyPanel(componentId);
> > }
> >
> > return new Label( componentId,
> > model.getObject().toString() );
> > }
> >
> > };
> > }
> >  };
> > form.add(tree);
> > tree.getTreeState().collapseAll();
> >
> >
> >
> >   public class MyPanel extends Form   {
> >
> >
> > private static final long serialVersionUID = 1L;
> >
> > MyPanel(String id) {
> > super(id);
> >
> > DownloadLink dl = new DownloadLink( id, new File(
> > "wat-application/images/addmore.jpg" ), "Example DownloadLink" );
> > add(dl);
> > }
> >  }
> >
> >
> > I copied the example from:
> > http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
> >
> >
> > But i get the following error:
> > WicketMessage: Component content must be applied to a tag of type 'form',
> > not '' (line 0,
> > column 0)
> >
> >
> > 
> >  wicket:id="icon"
> > class="icon"/> > wicket:id="content" class="content">
> > , index = 8, current = ' > class="content">' (line 19, column 144)]
> >
> > Thanks
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Anna Simbirtsev
(416) 729-7331


Re: LinkTree and DownloadLink

2010-06-22 Thread Ernesto Reinaldo Barreiro
Your MyPanel extends Form and Form should be applied to  tag not
 tag.

Ernesto

On Tue, Jun 22, 2010 at 7:50 PM, Anna Simbirtsev  wrote:
> Hi,
>
> I am trying to extend newNodeComponent on a LinkTree to make nodes
> DownLoadLink.
>
> tree = new LinkTree("tree", createTreeModel()){
>
> private static final long serialVersionUID = 1L;
>
> @Override
>             protected Component newNodeComponent( String id, IModel model )
> {
>                     return new LinkIconPanel( id, model, this ) {
>
>                        private static final long serialVersionUID = 1L;
>
> @Override
>                             protected Component newContentComponent( String
> componentId, BaseTree tree, IModel model ) {
>                                     Object obj = ( ( DefaultMutableTreeNode
> )model.getObject() ).getUserObject();
>                                     if( !obj.equals("1:subtree...,
> 2:subtree..., 3:subtree...") ) {
>                                     LOGGER.debug("link");
>                                     return new MyPanel(componentId);
>                                     }
>
>                                     return new Label( componentId,
> model.getObject().toString() );
>                             }
>
>                     };
>             }
>  };
>     form.add(tree);
>     tree.getTreeState().collapseAll();
>
>
>
>       public class MyPanel extends Form   {
>
>
>         private static final long serialVersionUID = 1L;
>
>         MyPanel(String id) {
>         super(id);
>
>         DownloadLink dl = new DownloadLink( id, new File(
> "wat-application/images/addmore.jpg" ), "Example DownloadLink" );
>         add(dl);
>         }
>  }
>
>
> I copied the example from:
> http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0
>
>
> But i get the following error:
> WicketMessage: Component content must be applied to a tag of type 'form',
> not '' (line 0,
> column 0)
>
>
> 
>  class="icon"/> wicket:id="content" class="content">
> , index = 8, current = ' class="content">' (line 19, column 144)]
>
> Thanks
>

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



LinkTree and DownloadLink

2010-06-22 Thread Anna Simbirtsev
Hi,

I am trying to extend newNodeComponent on a LinkTree to make nodes
DownLoadLink.

tree = new LinkTree("tree", createTreeModel()){

private static final long serialVersionUID = 1L;

@Override
 protected Component newNodeComponent( String id, IModel model )
{
 return new LinkIconPanel( id, model, this ) {

private static final long serialVersionUID = 1L;

@Override
 protected Component newContentComponent( String
componentId, BaseTree tree, IModel model ) {
 Object obj = ( ( DefaultMutableTreeNode
)model.getObject() ).getUserObject();
 if( !obj.equals("1:subtree...,
2:subtree..., 3:subtree...") ) {
 LOGGER.debug("link");
 return new MyPanel(componentId);
 }

 return new Label( componentId,
model.getObject().toString() );
 }

 };
 }
 };
 form.add(tree);
 tree.getTreeState().collapseAll();



   public class MyPanel extends Form   {


 private static final long serialVersionUID = 1L;

 MyPanel(String id) {
 super(id);

 DownloadLink dl = new DownloadLink( id, new File(
"wat-application/images/addmore.jpg" ), "Example DownloadLink" );
 add(dl);
 }
 }


I copied the example from:
http://www.wicket-library.com/wicket-examples/ajax/tree/simple.0


But i get the following error:
WicketMessage: Component content must be applied to a tag of type 'form',
not '' (line 0,
column 0)




, index = 8, current = '' (line 19, column 144)]

Thanks


RE: DownloadLink problem

2010-03-02 Thread Martin Asenov
It doesn't... :-)

Thank you anyway! :-)
-Original Message-
From: Riyad Kalla [mailto:rka...@gmail.com] 
Sent: Tuesday, March 02, 2010 6:35 PM
To: users@wicket.apache.org
Subject: Re: DownloadLink problem

Martin,

If it makes you feel any better, it would have been a week or longer before
I thought to change that, good fine :)

-R

On Tue, Mar 2, 2010 at 9:32 AM, Martin Asenov  wrote:

> Oh my God!!! The problem was that the button that is supposed to do the
> export was of type submit and it reloads the page, instead of refreshing
> components. I changed to type=button and everything's fine...
>
> As people say - there is no patch for human stupidity...
>
> Thank you all for the help!
>
> Best,
> Martin
>
> -Original Message-
> From: Martin Asenov [mailto:mase...@velti.com]
> Sent: Tuesday, March 02, 2010 4:34 PM
> To: users@wicket.apache.org
> Subject: RE: DownloadLink problem
>
> Thanks Ernesto!
>
> But I want to have the link invisible on startup (because the file's
> empty). So I have this: (doesn't work, but has to)
>
>exportedFileLink = new DownloadLink("exported_file_link", new
> LoadableDetachableModel() {
>
>  private static final long serialVersionUID = 1L;
>
>  @Override
>  protected File load() {
>return exportedFile;
>  }
>}, PhonebookExporter.OUTPUT_FILE_NAME) {
>
>  private static final long serialVersionUID = 1L;
>
>  @Override
>  public boolean isVisible() {
>return exportedFile != null;
>  }
>};
>final WebMarkupContainer exportedFileLinkHolder = new
> WebMarkupContainer("link_holder");
>exportedFileLinkHolder.setOutputMarkupId(true);
>exportedFileLinkHolder.add(exportedFileLink);
>
>rightForm.add(exportedFileLinkHolder);
>rightForm.add(new AjaxButton("export_button") {
>
>  private static final long serialVersionUID = 1L;
>
>  @Override
>  protected void onSubmit(AjaxRequestTarget target, Form form) {
>
>PhonebookExporter exporter = getExporter();
>exportedFile = exporter.export(uploadFolder);
>
>if (exportedFile == null) {
>  error(getString("not_exported"));
>} else {
>  info(getString("exported"));
>}
>
>target.addComponent(exportedFileLinkHolder);
>target.addComponent(feed);
>  }
>
>});
>
> I really start to get pissed off by this one!!! g
>
> Regards,
> Martin
>
> -Original Message-
> From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Sent: Tuesday, March 02, 2010 3:50 PM
> To: users@wicket.apache.org
> Subject: Re: DownloadLink problem
>
> Weird. Just try this example:
>
> import java.io.File;
>
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.AjaxLink;
> import org.apache.wicket.markup.html.link.DownloadLink;
> import org.apache.wicket.markup.html.panel.Panel;
> import org.apache.wicket.model.AbstractReadOnlyModel;
>
> /**
>  * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
>  *
>  */
> public class TestDownLoadLink extends Panel {
>
>
>private static final long serialVersionUID = 1L;
>
>private File test = null;
>
>private DownloadLink download;
>/**
> * @param id
> */
>public TestDownLoadLink(String id) {
>super(id);
>
>this.download = new DownloadLink("download", new
> AbstractReadOnlyModel(){
>
> private static final long
> serialVersionUID = 1L;
>
>@Override
>public File getObject() {
>return test;
>}
>
> },"TestDownLoadLink.html") {
>
>private static final long serialVersionUID = 1L;
>
>@Override
>public boolean isEnabled() {
>
>return test != null;
>}
> };
> download.setOutputMarkupId(true);
> add(download);
>
> AjaxLink update = new AjaxLink("update") {
>
>private static final long serialVersionUID = 1L;
>
>@Override
>public void onClick(AjaxRequestTarget target) {
>test = new
>
> File(TestDownLoadLink.class.getResource("TestDownLoadLink.html").getFile());
>if(target != null) {
>target.addComponent(TestDownLoadLink.this.download);
>}
>}
> };
>
> add(update);
>

Re: DownloadLink problem

2010-03-02 Thread Riyad Kalla
Martin,

If it makes you feel any better, it would have been a week or longer before
I thought to change that, good fine :)

-R

On Tue, Mar 2, 2010 at 9:32 AM, Martin Asenov  wrote:

> Oh my God!!! The problem was that the button that is supposed to do the
> export was of type submit and it reloads the page, instead of refreshing
> components. I changed to type=button and everything's fine...
>
> As people say - there is no patch for human stupidity...
>
> Thank you all for the help!
>
> Best,
> Martin
>
> -Original Message-
> From: Martin Asenov [mailto:mase...@velti.com]
> Sent: Tuesday, March 02, 2010 4:34 PM
> To: users@wicket.apache.org
> Subject: RE: DownloadLink problem
>
> Thanks Ernesto!
>
> But I want to have the link invisible on startup (because the file's
> empty). So I have this: (doesn't work, but has to)
>
>exportedFileLink = new DownloadLink("exported_file_link", new
> LoadableDetachableModel() {
>
>  private static final long serialVersionUID = 1L;
>
>  @Override
>  protected File load() {
>return exportedFile;
>  }
>}, PhonebookExporter.OUTPUT_FILE_NAME) {
>
>  private static final long serialVersionUID = 1L;
>
>  @Override
>  public boolean isVisible() {
>return exportedFile != null;
>  }
>};
>final WebMarkupContainer exportedFileLinkHolder = new
> WebMarkupContainer("link_holder");
>exportedFileLinkHolder.setOutputMarkupId(true);
>exportedFileLinkHolder.add(exportedFileLink);
>
>rightForm.add(exportedFileLinkHolder);
>rightForm.add(new AjaxButton("export_button") {
>
>  private static final long serialVersionUID = 1L;
>
>  @Override
>  protected void onSubmit(AjaxRequestTarget target, Form form) {
>
>PhonebookExporter exporter = getExporter();
>exportedFile = exporter.export(uploadFolder);
>
>if (exportedFile == null) {
>  error(getString("not_exported"));
>} else {
>  info(getString("exported"));
>}
>
>target.addComponent(exportedFileLinkHolder);
>target.addComponent(feed);
>  }
>
>});
>
> I really start to get pissed off by this one!!! g
>
> Regards,
> Martin
>
> -Original Message-
> From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Sent: Tuesday, March 02, 2010 3:50 PM
> To: users@wicket.apache.org
> Subject: Re: DownloadLink problem
>
> Weird. Just try this example:
>
> import java.io.File;
>
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.markup.html.AjaxLink;
> import org.apache.wicket.markup.html.link.DownloadLink;
> import org.apache.wicket.markup.html.panel.Panel;
> import org.apache.wicket.model.AbstractReadOnlyModel;
>
> /**
>  * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
>  *
>  */
> public class TestDownLoadLink extends Panel {
>
>
>private static final long serialVersionUID = 1L;
>
>private File test = null;
>
>private DownloadLink download;
>/**
> * @param id
> */
>public TestDownLoadLink(String id) {
>super(id);
>
>this.download = new DownloadLink("download", new
> AbstractReadOnlyModel(){
>
> private static final long
> serialVersionUID = 1L;
>
>@Override
>public File getObject() {
>return test;
>}
>
> },"TestDownLoadLink.html") {
>
>private static final long serialVersionUID = 1L;
>
>@Override
>public boolean isEnabled() {
>
>return test != null;
>}
> };
> download.setOutputMarkupId(true);
> add(download);
>
> AjaxLink update = new AjaxLink("update") {
>
>private static final long serialVersionUID = 1L;
>
>@Override
>public void onClick(AjaxRequestTarget target) {
>test = new
>
> File(TestDownLoadLink.class.getResource("TestDownLoadLink.html").getFile());
>if(target != null) {
>target.addComponent(TestDownLoadLink.this.download);
>}
>}
> };
>
> add(update);
>}
> }
>
> and the HTML
>
> 
> 
> 
> 
> 
> download
> Click me to update download
> 
> 
> 
>
> Just place them somewhere and do
>
> new TestDownLoadL

RE: DownloadLink problem

2010-03-02 Thread Martin Asenov
Oh my God!!! The problem was that the button that is supposed to do the export 
was of type submit and it reloads the page, instead of refreshing components. I 
changed to type=button and everything's fine...

As people say - there is no patch for human stupidity...

Thank you all for the help!

Best,
Martin

-Original Message-
From: Martin Asenov [mailto:mase...@velti.com] 
Sent: Tuesday, March 02, 2010 4:34 PM
To: users@wicket.apache.org
Subject: RE: DownloadLink problem

Thanks Ernesto!

But I want to have the link invisible on startup (because the file's empty). So 
I have this: (doesn't work, but has to)

exportedFileLink = new DownloadLink("exported_file_link", new 
LoadableDetachableModel() {

  private static final long serialVersionUID = 1L;

  @Override
  protected File load() {
return exportedFile;
  }
}, PhonebookExporter.OUTPUT_FILE_NAME) {

  private static final long serialVersionUID = 1L;

  @Override
  public boolean isVisible() {
return exportedFile != null;
  }
};
final WebMarkupContainer exportedFileLinkHolder = new 
WebMarkupContainer("link_holder");
exportedFileLinkHolder.setOutputMarkupId(true);
exportedFileLinkHolder.add(exportedFileLink);

rightForm.add(exportedFileLinkHolder);
rightForm.add(new AjaxButton("export_button") {

  private static final long serialVersionUID = 1L;

  @Override
  protected void onSubmit(AjaxRequestTarget target, Form form) {

PhonebookExporter exporter = getExporter();
exportedFile = exporter.export(uploadFolder);

if (exportedFile == null) {
  error(getString("not_exported"));
} else {
  info(getString("exported"));
}

target.addComponent(exportedFileLinkHolder);
target.addComponent(feed);
  }
  
});

I really start to get pissed off by this one!!! g

Regards,
Martin

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Tuesday, March 02, 2010 3:50 PM
To: users@wicket.apache.org
Subject: Re: DownloadLink problem

Weird. Just try this example:

import java.io.File;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.link.DownloadLink;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.AbstractReadOnlyModel;

/**
 * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
 *
 */
public class TestDownLoadLink extends Panel {


private static final long serialVersionUID = 1L;

private File test = null;

private DownloadLink download;
/**
 * @param id
 */
public TestDownLoadLink(String id) {
super(id);

this.download = new DownloadLink("download", new
AbstractReadOnlyModel(){

 private static final long
serialVersionUID = 1L;

@Override
public File getObject() {
return test;
}

 },"TestDownLoadLink.html") {

private static final long serialVersionUID = 1L;

@Override
public boolean isEnabled() {

return test != null;
}
 };
 download.setOutputMarkupId(true);
 add(download);

 AjaxLink update = new AjaxLink("update") {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
test = new
File(TestDownLoadLink.class.getResource("TestDownLoadLink.html").getFile());
if(target != null) {
target.addComponent(TestDownLoadLink.this.download);
}
}
 };

 add(update);
}
}

and the HTML






download
Click me to update download




Just place them somewhere and do

new TestDownLoadLink("xxx");

It works for me. First time the download link is disable and when you click
on the AJAX link file is assigned, link is refreshed and you can download
your file;-)

Best,

Ernesto

On Tue, Mar 2, 2010 at 2:24 PM, Martin Asenov  wrote:

> Unfortunately doesn't work this way... The model is never refreshed...
>
> -Original Message-
> From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Sent: Tuesday, March 02, 2010 2:31 PM
> To: users@wicket.apache.org
> Subject: Re: DownloadLink problem
>
> Not sure... but could you try something like:
>
> DownloadLink downloadLink = new DownloadLink("link_id", new
> AbstractReadOnlyModel(){
>public File getObject() {
>return this.linkModel;
>};
>},"myfile.xxx");
>

RE: DownloadLink problem

2010-03-02 Thread Martin Asenov
Thanks Ernesto!

But I want to have the link invisible on startup (because the file's empty). So 
I have this: (doesn't work, but has to)

exportedFileLink = new DownloadLink("exported_file_link", new 
LoadableDetachableModel() {

  private static final long serialVersionUID = 1L;

  @Override
  protected File load() {
return exportedFile;
  }
}, PhonebookExporter.OUTPUT_FILE_NAME) {

  private static final long serialVersionUID = 1L;

  @Override
  public boolean isVisible() {
return exportedFile != null;
  }
};
final WebMarkupContainer exportedFileLinkHolder = new 
WebMarkupContainer("link_holder");
exportedFileLinkHolder.setOutputMarkupId(true);
exportedFileLinkHolder.add(exportedFileLink);

rightForm.add(exportedFileLinkHolder);
rightForm.add(new AjaxButton("export_button") {

  private static final long serialVersionUID = 1L;

  @Override
  protected void onSubmit(AjaxRequestTarget target, Form form) {

PhonebookExporter exporter = getExporter();
exportedFile = exporter.export(uploadFolder);

if (exportedFile == null) {
  error(getString("not_exported"));
} else {
  info(getString("exported"));
}

target.addComponent(exportedFileLinkHolder);
target.addComponent(feed);
  }
  
});

I really start to get pissed off by this one!!! g

Regards,
Martin

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Tuesday, March 02, 2010 3:50 PM
To: users@wicket.apache.org
Subject: Re: DownloadLink problem

Weird. Just try this example:

import java.io.File;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.link.DownloadLink;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.AbstractReadOnlyModel;

/**
 * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
 *
 */
public class TestDownLoadLink extends Panel {


private static final long serialVersionUID = 1L;

private File test = null;

private DownloadLink download;
/**
 * @param id
 */
public TestDownLoadLink(String id) {
super(id);

this.download = new DownloadLink("download", new
AbstractReadOnlyModel(){

 private static final long
serialVersionUID = 1L;

@Override
public File getObject() {
return test;
}

 },"TestDownLoadLink.html") {

private static final long serialVersionUID = 1L;

@Override
public boolean isEnabled() {

return test != null;
}
 };
 download.setOutputMarkupId(true);
 add(download);

 AjaxLink update = new AjaxLink("update") {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
test = new
File(TestDownLoadLink.class.getResource("TestDownLoadLink.html").getFile());
if(target != null) {
target.addComponent(TestDownLoadLink.this.download);
}
}
 };

 add(update);
}
}

and the HTML






download
Click me to update download




Just place them somewhere and do

new TestDownLoadLink("xxx");

It works for me. First time the download link is disable and when you click
on the AJAX link file is assigned, link is refreshed and you can download
your file;-)

Best,

Ernesto

On Tue, Mar 2, 2010 at 2:24 PM, Martin Asenov  wrote:

> Unfortunately doesn't work this way... The model is never refreshed...
>
> -Original Message-
> From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Sent: Tuesday, March 02, 2010 2:31 PM
> To: users@wicket.apache.org
> Subject: Re: DownloadLink problem
>
> Not sure... but could you try something like:
>
> DownloadLink downloadLink = new DownloadLink("link_id", new
> AbstractReadOnlyModel(){
>public File getObject() {
>return this.linkModel;
>};
>},"myfile.xxx");
>downloadLink.setOutputMarkupId(true);
>
> and make linkModel a member variable? This way file will be "refreshed".
>
> Best,
>
> Ernnesto
>
> On Tue, Mar 2, 2010 at 1:14 PM, Martin Asenov  wrote:
>
> > Hi, guys!
> >
> > I experience some DownloadLink problem - I have these fields:
> >
> > File linkModel;
> > DownloadLink theLink = new DownloadLink("link_id", new
> > Model(linkModel));
> &g

Re: DownloadLink problem

2010-03-02 Thread Ernesto Reinaldo Barreiro
Weird. Just try this example:

import java.io.File;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.link.DownloadLink;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.AbstractReadOnlyModel;

/**
 * @author Ernesto Reinaldo Barreiro (reier...@gmail.com)
 *
 */
public class TestDownLoadLink extends Panel {


private static final long serialVersionUID = 1L;

private File test = null;

private DownloadLink download;
/**
 * @param id
 */
public TestDownLoadLink(String id) {
super(id);

this.download = new DownloadLink("download", new
AbstractReadOnlyModel(){

 private static final long
serialVersionUID = 1L;

@Override
public File getObject() {
return test;
}

 },"TestDownLoadLink.html") {

private static final long serialVersionUID = 1L;

@Override
public boolean isEnabled() {

return test != null;
}
 };
 download.setOutputMarkupId(true);
 add(download);

 AjaxLink update = new AjaxLink("update") {

private static final long serialVersionUID = 1L;

@Override
public void onClick(AjaxRequestTarget target) {
test = new
File(TestDownLoadLink.class.getResource("TestDownLoadLink.html").getFile());
if(target != null) {
target.addComponent(TestDownLoadLink.this.download);
}
}
 };

 add(update);
}
}

and the HTML






download
Click me to update download




Just place them somewhere and do

new TestDownLoadLink("xxx");

It works for me. First time the download link is disable and when you click
on the AJAX link file is assigned, link is refreshed and you can download
your file;-)

Best,

Ernesto

On Tue, Mar 2, 2010 at 2:24 PM, Martin Asenov  wrote:

> Unfortunately doesn't work this way... The model is never refreshed...
>
> -Original Message-
> From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Sent: Tuesday, March 02, 2010 2:31 PM
> To: users@wicket.apache.org
> Subject: Re: DownloadLink problem
>
> Not sure... but could you try something like:
>
> DownloadLink downloadLink = new DownloadLink("link_id", new
> AbstractReadOnlyModel(){
>public File getObject() {
>return this.linkModel;
>};
>},"myfile.xxx");
>downloadLink.setOutputMarkupId(true);
>
> and make linkModel a member variable? This way file will be "refreshed".
>
> Best,
>
> Ernnesto
>
> On Tue, Mar 2, 2010 at 1:14 PM, Martin Asenov  wrote:
>
> > Hi, guys!
> >
> > I experience some DownloadLink problem - I have these fields:
> >
> > File linkModel;
> > DownloadLink theLink = new DownloadLink("link_id", new
> > Model(linkModel));
> > theLink.setOutputMarkupId(true);
> >
> > After another button click I have the linkModel field pointing to real
> file
> > on the file system. And then I say:
> >
> > target.addComponent(theLink);
> >
> > the link name is still invisible, and when I click on the small clickable
> > area, Wicket comes up with:
> >
> > WicketMessage: Method onLinkClicked of interface
> > org.apache.wicket.markup.html.link.ILinkListener targeted at component
> > [MarkupContainer [Component id = exported_file_link]] threw an exception
> >
> > Root cause:
> >
> > java.lang.IllegalStateException:
> > org.apache.wicket.markup.html.link.DownloadLink failed to retrieve a File
> > object from model
> > at
> >
> org.apache.wicket.markup.html.link.DownloadLink.onClick(DownloadLink.java:141)
> > at
> org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:224)
> > at java.lang.reflect.Method.invoke(Method.java:597)
> > I thought I've made everything perfect, but it seems that I haven't.
> > Any help is appreciated!
> >
> > Best regards,
> > Martin
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DownloadLink problem

2010-03-02 Thread James Carman
Use a LoadableDetachableModel?

On Tue, Mar 2, 2010 at 8:24 AM, Martin Asenov  wrote:
> Unfortunately doesn't work this way... The model is never refreshed...
>
> -Original Message-
> From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com]
> Sent: Tuesday, March 02, 2010 2:31 PM
> To: users@wicket.apache.org
> Subject: Re: DownloadLink problem
>
> Not sure... but could you try something like:
>
> DownloadLink downloadLink = new DownloadLink("link_id", new
> AbstractReadOnlyModel(){
>            public File getObject() {
>                return this.linkModel;
>            };
>        },"myfile.xxx");
>        downloadLink.setOutputMarkupId(true);
>
> and make linkModel a member variable? This way file will be "refreshed".
>
> Best,
>
> Ernnesto
>
> On Tue, Mar 2, 2010 at 1:14 PM, Martin Asenov  wrote:
>
>> Hi, guys!
>>
>> I experience some DownloadLink problem - I have these fields:
>>
>> File linkModel;
>> DownloadLink theLink = new DownloadLink("link_id", new
>> Model(linkModel));
>> theLink.setOutputMarkupId(true);
>>
>> After another button click I have the linkModel field pointing to real file
>> on the file system. And then I say:
>>
>> target.addComponent(theLink);
>>
>> the link name is still invisible, and when I click on the small clickable
>> area, Wicket comes up with:
>>
>> WicketMessage: Method onLinkClicked of interface
>> org.apache.wicket.markup.html.link.ILinkListener targeted at component
>> [MarkupContainer [Component id = exported_file_link]] threw an exception
>>
>> Root cause:
>>
>> java.lang.IllegalStateException:
>> org.apache.wicket.markup.html.link.DownloadLink failed to retrieve a File
>> object from model
>>     at
>> org.apache.wicket.markup.html.link.DownloadLink.onClick(DownloadLink.java:141)
>>     at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:224)
>>     at java.lang.reflect.Method.invoke(Method.java:597)
>> I thought I've made everything perfect, but it seems that I haven't.
>> Any help is appreciated!
>>
>> Best regards,
>> Martin
>>
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



RE: DownloadLink problem

2010-03-02 Thread Martin Asenov
Unfortunately doesn't work this way... The model is never refreshed...

-Original Message-
From: Ernesto Reinaldo Barreiro [mailto:reier...@gmail.com] 
Sent: Tuesday, March 02, 2010 2:31 PM
To: users@wicket.apache.org
Subject: Re: DownloadLink problem

Not sure... but could you try something like:

DownloadLink downloadLink = new DownloadLink("link_id", new
AbstractReadOnlyModel(){
public File getObject() {
return this.linkModel;
};
},"myfile.xxx");
downloadLink.setOutputMarkupId(true);

and make linkModel a member variable? This way file will be "refreshed".

Best,

Ernnesto

On Tue, Mar 2, 2010 at 1:14 PM, Martin Asenov  wrote:

> Hi, guys!
>
> I experience some DownloadLink problem - I have these fields:
>
> File linkModel;
> DownloadLink theLink = new DownloadLink("link_id", new
> Model(linkModel));
> theLink.setOutputMarkupId(true);
>
> After another button click I have the linkModel field pointing to real file
> on the file system. And then I say:
>
> target.addComponent(theLink);
>
> the link name is still invisible, and when I click on the small clickable
> area, Wicket comes up with:
>
> WicketMessage: Method onLinkClicked of interface
> org.apache.wicket.markup.html.link.ILinkListener targeted at component
> [MarkupContainer [Component id = exported_file_link]] threw an exception
>
> Root cause:
>
> java.lang.IllegalStateException:
> org.apache.wicket.markup.html.link.DownloadLink failed to retrieve a File
> object from model
> at
> org.apache.wicket.markup.html.link.DownloadLink.onClick(DownloadLink.java:141)
> at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:224)
> at java.lang.reflect.Method.invoke(Method.java:597)
> I thought I've made everything perfect, but it seems that I haven't.
> Any help is appreciated!
>
> Best regards,
> Martin
>
>

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



Re: DownloadLink problem

2010-03-02 Thread Ernesto Reinaldo Barreiro
Not sure... but could you try something like:

DownloadLink downloadLink = new DownloadLink("link_id", new
AbstractReadOnlyModel(){
public File getObject() {
return this.linkModel;
};
},"myfile.xxx");
downloadLink.setOutputMarkupId(true);

and make linkModel a member variable? This way file will be "refreshed".

Best,

Ernnesto

On Tue, Mar 2, 2010 at 1:14 PM, Martin Asenov  wrote:

> Hi, guys!
>
> I experience some DownloadLink problem - I have these fields:
>
> File linkModel;
> DownloadLink theLink = new DownloadLink("link_id", new
> Model(linkModel));
> theLink.setOutputMarkupId(true);
>
> After another button click I have the linkModel field pointing to real file
> on the file system. And then I say:
>
> target.addComponent(theLink);
>
> the link name is still invisible, and when I click on the small clickable
> area, Wicket comes up with:
>
> WicketMessage: Method onLinkClicked of interface
> org.apache.wicket.markup.html.link.ILinkListener targeted at component
> [MarkupContainer [Component id = exported_file_link]] threw an exception
>
> Root cause:
>
> java.lang.IllegalStateException:
> org.apache.wicket.markup.html.link.DownloadLink failed to retrieve a File
> object from model
> at
> org.apache.wicket.markup.html.link.DownloadLink.onClick(DownloadLink.java:141)
> at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:224)
> at java.lang.reflect.Method.invoke(Method.java:597)
> I thought I've made everything perfect, but it seems that I haven't.
> Any help is appreciated!
>
> Best regards,
> Martin
>
>


DownloadLink problem

2010-03-02 Thread Martin Asenov
Hi, guys!

I experience some DownloadLink problem - I have these fields:

File linkModel;
DownloadLink theLink = new DownloadLink("link_id", new Model(linkModel));
theLink.setOutputMarkupId(true);

After another button click I have the linkModel field pointing to real file on 
the file system. And then I say:

target.addComponent(theLink);

the link name is still invisible, and when I click on the small clickable area, 
Wicket comes up with:

WicketMessage: Method onLinkClicked of interface 
org.apache.wicket.markup.html.link.ILinkListener targeted at component 
[MarkupContainer [Component id = exported_file_link]] threw an exception

Root cause:

java.lang.IllegalStateException: 
org.apache.wicket.markup.html.link.DownloadLink failed to retrieve a File 
object from model
 at 
org.apache.wicket.markup.html.link.DownloadLink.onClick(DownloadLink.java:141)
 at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:224)
 at java.lang.reflect.Method.invoke(Method.java:597)
I thought I've made everything perfect, but it seems that I haven't.
Any help is appreciated!

Best regards,
Martin



Re: DownloadLink and Resource

2009-09-09 Thread Igor Vaynberg
1.3.x branch is no longer actively developed. you can add your wishes
to the 1.4.x branch.

downloadlink is a small class that does nothing special, you can copy
paste it into your own and customize if the core one does not meet
your needs.

-igor

On Wed, Sep 9, 2009 at 1:34 AM, Eyal Golan  wrote:
> Hi,
> I have two separate questions/wishes:
> we use Wicket 1.3.6
> DownloadLink - can we add a getter for fileName (I can open an issue in JIRA
> if it's necessary).
>
> Resource:
> onResourceRequested is final so I can't override  the
> ResourceStreamRequestTarget in the line cycle.setRequestTarget(new
> ResourceStreamRequestTarget(resourceStream));
> Is it possible to add something like:
> protected ResourceStreamRequestTarget
> getResourceStreamRequestTarget(IResourceStream resourceStream) {
>  return new ResourceStreamRequestTarget(resourceStream);
> }
>
> so we could override the ResourceStreamRequestTarget that is used?
>
> thanks,
>
>
>
> Eyal Golan
> egola...@gmail.com
>
> Visit: http://jvdrums.sourceforge.net/
> LinkedIn: http://www.linkedin.com/in/egolan74
>
> P  Save a tree. Please don't print this e-mail unless it's really necessary
>

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



DownloadLink and Resource

2009-09-09 Thread Eyal Golan
Hi,
I have two separate questions/wishes:
we use Wicket 1.3.6
DownloadLink - can we add a getter for fileName (I can open an issue in JIRA
if it's necessary).

Resource:
onResourceRequested is final so I can't override  the
ResourceStreamRequestTarget in the line cycle.setRequestTarget(new
ResourceStreamRequestTarget(resourceStream));
Is it possible to add something like:
protected ResourceStreamRequestTarget
getResourceStreamRequestTarget(IResourceStream resourceStream) {
  return new ResourceStreamRequestTarget(resourceStream);
}

so we could override the ResourceStreamRequestTarget that is used?

thanks,



Eyal Golan
egola...@gmail.com

Visit: http://jvdrums.sourceforge.net/
LinkedIn: http://www.linkedin.com/in/egolan74

P  Save a tree. Please don't print this e-mail unless it's really necessary


Re: DownloadLink (Javadoc)

2009-05-26 Thread Martijn Dashorst
Read the free downloadable bonus chapter 15 to WIA, downloadable from
http://wicketinaction.com/downloads

This explains all this stuff, including setting up your Eclipse
workspace from maven, and running the embedded Jetty server.

Martijn

On Tue, May 26, 2009 at 4:52 PM, David Brown
 wrote:
> Hello Steve, thanks, this worked. I imported the entire wicket 1.3.6 into 
> Eclipse and a whole bunch of other things started working a whole lot better 
> in the WIA Eclipse project. Since you got unlucky and I have you on the hook 
> is there anyway of getting the mvn jetty:run to import into Eclipse such that 
> I don't have to switch to a terminal or command window to redeploy to see the 
> results of my changes. Maybe, somebody out there has a suggestion? Thanks and 
> please advise, David.
>
>
>
> There are 10 kinds of people in this world: those who understand binary and 
> those who don’t (Valid only for 2's complement).
>
> - Original Message -
> From: "Steve Swinsburg" 
> To: users@wicket.apache.org
> Sent: Monday, May 25, 2009 5:10:57 PM GMT -06:00 US/Canada Central
> Subject: Re: DownloadLink (Javadoc)
>
> Hi David,
>
> You can get the Javadoc either by building it yourself from source via
> 'mvn javadoc:javadoc' or by issuing 'mvn eclipse:eclipse -
> DdownloadJavadocs=true' which will get the Javadoc and adjust your
> Eclipse classpath to link it up.
>
>
> cheers,
> Steve
>
>
> On 25/05/2009, at 10:54 PM, David Brown wrote:
>
>> Hello, it just so happens I have been looking for Wicket Javadoc.
>> the Wicket jar I have contains no javadoc. Please reply with the
>> source of the Wicket javadoc you are referencing. Please advise,
>> David.
>>
>> There are 10 kinds of people in this world: those who understand
>> binary and those who don’t (Valid only for 2's complement).
>>
>> - Original Message -
>> From: "Douglas Ferguson" 
>> To: users@wicket.apache.org
>> Sent: Monday, May 25, 2009 12:11:06 PM GMT -06:00 US/Canada Central
>> Subject: DownloadLink
>>
>> I was just reading the javadoc for DownloadLink and it says that it
>> locks the PageMap, does this mean that the page becomes unresponsive
>> during the download?
>>
>> It mentions using a "shared resource" as an alternative. Is there
>> example of this online somewhere?
>>
>> Douglas
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.3.5 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

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



Re: DownloadLink (Javadoc)

2009-05-26 Thread David Brown
Hello Steve, thanks, this worked. I imported the entire wicket 1.3.6 into 
Eclipse and a whole bunch of other things started working a whole lot better in 
the WIA Eclipse project. Since you got unlucky and I have you on the hook is 
there anyway of getting the mvn jetty:run to import into Eclipse such that I 
don't have to switch to a terminal or command window to redeploy to see the 
results of my changes. Maybe, somebody out there has a suggestion? Thanks and 
please advise, David.



There are 10 kinds of people in this world: those who understand binary and 
those who don’t (Valid only for 2's complement).

- Original Message -
From: "Steve Swinsburg" 
To: users@wicket.apache.org
Sent: Monday, May 25, 2009 5:10:57 PM GMT -06:00 US/Canada Central
Subject: Re: DownloadLink (Javadoc)

Hi David,

You can get the Javadoc either by building it yourself from source via  
'mvn javadoc:javadoc' or by issuing 'mvn eclipse:eclipse - 
DdownloadJavadocs=true' which will get the Javadoc and adjust your  
Eclipse classpath to link it up.


cheers,
Steve


On 25/05/2009, at 10:54 PM, David Brown wrote:

> Hello, it just so happens I have been looking for Wicket Javadoc.  
> the Wicket jar I have contains no javadoc. Please reply with the  
> source of the Wicket javadoc you are referencing. Please advise,  
> David.
>
> There are 10 kinds of people in this world: those who understand  
> binary and those who don’t (Valid only for 2's complement).
>
> - Original Message -
> From: "Douglas Ferguson" 
> To: users@wicket.apache.org
> Sent: Monday, May 25, 2009 12:11:06 PM GMT -06:00 US/Canada Central
> Subject: DownloadLink
>
> I was just reading the javadoc for DownloadLink and it says that it
> locks the PageMap, does this mean that the page becomes unresponsive
> during the download?
>
> It mentions using a "shared resource" as an alternative. Is there
> example of this online somewhere?
>
> Douglas
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>


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



RE: DownloadLink

2009-05-25 Thread Douglas Ferguson
But how would this prevent the PageMap from getting blocked?

Would it be possible to somehow span a request that isn't tied to the same 
session i.e get the same behavior of a "non-wicket servlet" but still have it 
live inside the wicket application?

Douglas

-Original Message-
From: Alex Objelean [mailto:alex_objel...@yahoo.com] 
Sent: Monday, May 25, 2009 2:12 PM
To: users@wicket.apache.org
Subject: Re: DownloadLink


A shared resource can be added like this:

Application.get().getSharedResources().add("urlOfTheResource", new
WebResource() {
@Override
public IResourceStream getResourceStream() {
  return new PackageResourceStream(FlowPlayerPanel.class,
"ref/flowplayer-3.1.0.swf");
}
});

Instead of webResource, you can have another implementation of Resource
which suites your needs.

Alex Objelean



Douglas Ferguson-2 wrote:
> 
> I was just reading the javadoc for DownloadLink and it says that it 
> locks the PageMap, does this mean that the page becomes unresponsive 
> during the download?
> 
> It mentions using a "shared resource" as an alternative. Is there 
> example of this online somewhere?
> 
> Douglas
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DownloadLink-tp23710131p23711709.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


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



Re: DownloadLink (Javadoc)

2009-05-25 Thread Steve Swinsburg

Hi David,

You can get the Javadoc either by building it yourself from source via  
'mvn javadoc:javadoc' or by issuing 'mvn eclipse:eclipse - 
DdownloadJavadocs=true' which will get the Javadoc and adjust your  
Eclipse classpath to link it up.



cheers,
Steve


On 25/05/2009, at 10:54 PM, David Brown wrote:

Hello, it just so happens I have been looking for Wicket Javadoc.  
the Wicket jar I have contains no javadoc. Please reply with the  
source of the Wicket javadoc you are referencing. Please advise,  
David.


There are 10 kinds of people in this world: those who understand  
binary and those who don’t (Valid only for 2's complement).


- Original Message -
From: "Douglas Ferguson" 
To: users@wicket.apache.org
Sent: Monday, May 25, 2009 12:11:06 PM GMT -06:00 US/Canada Central
Subject: DownloadLink

I was just reading the javadoc for DownloadLink and it says that it
locks the PageMap, does this mean that the page becomes unresponsive
during the download?

It mentions using a "shared resource" as an alternative. Is there
example of this online somewhere?

Douglas

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


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





smime.p7s
Description: S/MIME cryptographic signature


Re: DownloadLink

2009-05-25 Thread David Brown
Hello, it just so happens I have been looking for Wicket Javadoc. the Wicket 
jar I have contains no javadoc. Please reply with the source of the Wicket 
javadoc you are referencing. Please advise, David.

There are 10 kinds of people in this world: those who understand binary and 
those who don’t (Valid only for 2's complement).

- Original Message -
From: "Douglas Ferguson" 
To: users@wicket.apache.org
Sent: Monday, May 25, 2009 12:11:06 PM GMT -06:00 US/Canada Central
Subject: DownloadLink

I was just reading the javadoc for DownloadLink and it says that it 
locks the PageMap, does this mean that the page becomes unresponsive 
during the download?

It mentions using a "shared resource" as an alternative. Is there 
example of this online somewhere?

Douglas

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


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



Re: DownloadLink

2009-05-25 Thread Alex Objelean

A shared resource can be added like this:

Application.get().getSharedResources().add("urlOfTheResource", new
WebResource() {
@Override
public IResourceStream getResourceStream() {
  return new PackageResourceStream(FlowPlayerPanel.class,
"ref/flowplayer-3.1.0.swf");
}
});

Instead of webResource, you can have another implementation of Resource
which suites your needs.

Alex Objelean



Douglas Ferguson-2 wrote:
> 
> I was just reading the javadoc for DownloadLink and it says that it 
> locks the PageMap, does this mean that the page becomes unresponsive 
> during the download?
> 
> It mentions using a "shared resource" as an alternative. Is there 
> example of this online somewhere?
> 
> Douglas
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DownloadLink-tp23710131p23711709.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



DownloadLink

2009-05-25 Thread Douglas Ferguson
I was just reading the javadoc for DownloadLink and it says that it 
locks the PageMap, does this mean that the page becomes unresponsive 
during the download?


It mentions using a "shared resource" as an alternative. Is there 
example of this online somewhere?


Douglas

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



Help,DownloadLink, when file is not existed, not error message

2009-01-06 Thread wch2001

Dear all,

I am doing downloadLink , when the file is existed, it is ok to download it,
but when the file is not existed, no any error message "No file exist!" to
popup!

According to debug, i can see it already  go to the line:
target.appendJavascript("alert('No file exist!')");

the codes is below,

any suggest?

thanks you  for help.


File file = new File("C:/Documents and
Settings/cw/Desktop/Advertiser_csv/AdSmart/2008/B-ONE FLORIST (SHAW
TOWER)_m_2008_12.csv");
form.add( new CustomDownloadLink("donld", file));



public class CustomDownloadLink extends DownloadLink {

private static final long serialVersionUID = 1L;
private File file;

@Override
public void onClick() {
if (file.exists()) {

super.onClick();
}
}

public CustomDownloadLink(String id, File file) {
super(id, file);
this.file = file;

add(new AjaxEventBehavior("onclick") {

private static final long serialVersionUID = 1L;

@Override
protected void onEvent(AjaxRequestTarget target) {
if (!CustomDownloadLink.this.file.exists()) {
target.appendJavascript("alert('No file exist!')");
}
}
});
}
}
-- 
View this message in context: 
http://www.nabble.com/Help%2CDownloadLink%2C-when-file-is-not-existed%2C-not-error-message-tp21307695p21307695.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: DownloadLink, BIRT report

2009-01-05 Thread Ernesto Reinaldo Barreiro
Hi,

I already wrote to you in private and didn't noticed you were also
posting to the list... Here is the transcript of my last two private e-mails

.

You have to download the BIRT runtime from

http://download.eclipse.org/birt/downloads/

This is what you have to deploy with your WEB application.  The 
runtime  is like an eclipse (an equinox OSGi runtime) but stripped of
all the GUI thing and containing just the minimal functionality to
execute BIRT reports: the designer but without the design part. That way
the footprint is small as you have to distribute it with your WEB
application.  The code I showed you on the list was to instantiate this
runtime from within your WEB application. Then you use that runtime to
build your reports. In my experience, it is better if this runtime is
the same version as the designer you used to build your reports
(otherwise you might find unpleasant surprises).

newbieabc wrote:
> Thank you for your reply...
> I am sorry to sound redundant...
> I had started off by downloading the birt-all-in-one (came bundled with the
> full Eclipse SDK).
> Created a maven project( wicket quickstart) , then designed the birt
> rptdesign (all within the eclipse platform) I run it outside eclipse, (mvn
> jetty:run)
>
> Now, I have downloaded the birt runtime engine, and copied files from the
> birtrunttime\ReportEngine\plugins to the eclipse\plugins
>
> But when I try to use "org.eclipse.birt.report.engine.api.ReportEngine" i
> get "org.eclipse cannot be resolved"
>
>   
This error is because you have to copy some of the jar files on
runtime/plugins to your classpath (and/or the WEB-INF/lib folder
depending on how you setup your project). I have the following:

/WEB-INF/lib/birt-chartengineapi-2.3.jar
/WEB-INF/lib/birt-com.ibm.icu_3.8.1.v20080530.jar
/WEB-INF/lib/birt-coreapi-2.3.jar
/WEB-INF/lib/birt-crosstabcoreapi-2.3.jar
/WEB-INF/lib/birt-dataadapterapi-2.3.jar
/WEB-INF/lib/birt-dataaggregationapi-2.3.jar
/WEB-INF/lib/birt-dteapi-2.3.jar
/WEB-INF/lib/birt-emitter.prototype.excel_2.3.0.v20080606.jar
/WEB-INF/lib/birt-engineapi-2.3.jar
/WEB-INF/lib/birt-flute-2.3.jar
/WEB-INF/lib/birt-js-2.3.jar
/WEB-INF/lib/birt-modelapi-2.3.jar
/WEB-INF/lib/birt-modelodaapi-2.3.jar
/WEB-INF/lib/birt-odadesignapi-2.3.jar
/WEB-INF/lib/birt-org.apache. commons.codec_1.3.0.v20080530-1600.jar
/WEB-INF/lib/birt-org.eclipse.birt.report.engine.dataextraction_2.3.0.v20080611.jar
/WEB-INF/lib/birt-org.eclipse.emf.common_2.4.0.v200806091234.jar
/WEB-INF/lib/birt-org.eclipse.emf.ecore_2.4.0.v200806091234.jar
/WEB-INF/lib/birt-org.eclipse.emf.ecore.xmi_2.4.0.v200806091234.jar
/WEB-INF/lib/birt-org.w3c.css.sac_1.3.0.v200805290154.jar
/WEB-INF/lib/birt-scriptapi-2.3.jar

But maybe I'm missing in this list some related  jars... Some of the
jars on previous list have shortened names, not the names they have on
the runtime/plugins folder, but I guess you will have no problems in
finding them. If you don't add these jars then your IDE (eclipse?) won't
be able to compile the "Birt" class of my first e-mail. Once the class
compiles then try something simple (like building a hello world report).

I forgot to mention this on my previous e-mails...

Best,

Ernesto

> Not sure what I should do for this.
> Thank you for your help..and again sorry to sound redundant, I am really new
> to this.
>
>
> reiern70 wrote:
>   
>> Hi,
>>
>> For the BIRT part you need to install somewhere a BIRT runtime.
>> Essentially, this an equinox OSGi runtime with a folder structure like:
>>
>> {root}-configuration`
>>  -plugins
>>
>> If you have extended BIRT by adding your own ODA extensions then you have
>> to drop them on the plugins folder. There is also a folder (e.g.
>> plugins/org.eclipse.birt.report.data.oda.jdbc_2.3.0.v20080610/drivers)
>> where you have to drop any JDBC drivers you need to connect to your
>> database (in case you are using standard ODA drivers). I usually install
>> the BIRT runtime under WEB-INF...
>>
>> The next step is to have instantiate this runtime and use it to generate
>> your reports. I do this via a class like the following:
>>
>>
>> public class Birt {
>>  
>> .
>>
>> private static IReportEngine engine;
>>
>>
>>  public static final void startEngine() {
>>  try {
>>  if(engine != null)
>>  return;
>>  
>>  EngineConfig engCnf = new EngineConfig();   
>> 
>>  
>> engCnf.setEngineHome(ConfigGlobal.i.resuelveRuta("WEB-INF/birt").toString());
>>  
>> engCnf.setLogConfig(ConfigGlobal.i.resuelveRuta("../logs").toString(),
>> Level.ALL);  
>>  Platform.startup(engCnf);
>>  IReportEngineFactory factory = (IReportEngineFactory) 
>> Platform
>>  .createFactoryObject(
>> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>> 

RE: DownloadLink, BIRT report

2009-01-05 Thread Ames, Tim
You should not need to copy anything to the eclipse\plugins since you 
downloaded Eclipse with Birt support.


You will need to add the birt runtime jars into your eclipse project. They can 
be found in \ReportEngine\lib

There are a couple ways to do this in eclipse:

1.  Go to Build Path --> Configure Build Path --> Libraries.  You can manually 
add jars with the Add External Jars button.  You need at least 2 of the birt 
jars - engineapi.jar and coreapi.jar. You may need more depending on what 
functions you are using within birt.

2.  If you want Maven to handle this, then you will need to add the artifacts 
manually to your local repository. The latest birt runtime 2.3.1 is not in a 
central repository. I added all the jars that you see in the \lib directory; a 
few where already there from the central repository. I then created a 
birt-2.3.1 artifact with a pom.xml that has all of the jars as dependencies.  
All I need to do then is add the birt-2.3.1 artifact to my project and all of 
the birt jars are automatically added.

There may be other ways to do this too.  I am new to Maven also.  It took quite 
a bit of research to get this far.  Good luck!

--Tim

-Original Message-
From: newbieabc [mailto:newbie...@yahoo.com]
Sent: Monday, January 05, 2009 11:16 AM
To: users@wicket.apache.org
Subject: Re: DownloadLink, BIRT report


Thank you for your reply...
I am sorry to sound redundant...
I had started off by downloading the birt-all-in-one (came bundled with the
full Eclipse SDK).
Created a maven project( wicket quickstart) , then designed the birt
rptdesign (all within the eclipse platform) I run it outside eclipse, (mvn
jetty:run)

Now, I have downloaded the birt runtime engine, and copied files from the
birtrunttime\ReportEngine\plugins to the eclipse\plugins

But when I try to use "org.eclipse.birt.report.engine.api.ReportEngine" i
get "org.eclipse cannot be resolved"

Not sure what I should do for this.
Thank you for your help..and again sorry to sound redundant, I am really new
to this.


reiern70 wrote:
>
> Hi,
>
> For the BIRT part you need to install somewhere a BIRT runtime.
> Essentially, this an equinox OSGi runtime with a folder structure like:
>
> {root}-configuration`
>  -plugins
>
> If you have extended BIRT by adding your own ODA extensions then you have
> to drop them on the plugins folder. There is also a folder (e.g.
> plugins/org.eclipse.birt.report.data.oda.jdbc_2.3.0.v20080610/drivers)
> where you have to drop any JDBC drivers you need to connect to your
> database (in case you are using standard ODA drivers). I usually install
> the BIRT runtime under WEB-INF...
>
> The next step is to have instantiate this runtime and use it to generate
> your reports. I do this via a class like the following:
>
>
> public class Birt {
>
> .
>
> private static IReportEngine engine;
>
>
>   public static final void startEngine() {
>   try {
>   if(engine != null)
>   return;
>
>   EngineConfig engCnf = new EngineConfig();
>
> engCnf.setEngineHome(ConfigGlobal.i.resuelveRuta("WEB-INF/birt").toString());
>   
> engCnf.setLogConfig(ConfigGlobal.i.resuelveRuta("../logs").toString(),
> Level.ALL);
>   Platform.startup(engCnf);
>   IReportEngineFactory factory = (IReportEngineFactory) 
> Platform
>   .createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
>   engine = factory.createReportEngine(engCnf);
>   engine.changeLogLevel( Level.OFF );
>   } catch (Throwable ex) {
>   log.fatal("", ex);
>   }
>   }
>
>   public static final void stopEngine() {
>   try {
>   engine.destroy();
>   engine = null;
>   } catch (Exception e) {
>   }
>   }
>
>   public static IReportEngine getEngine() {
>   if(engine == null) {
>   startEngine();
>   }
>   return engine;
>   }
>
>
> public static void generateBirtReport(String file,
>   String fmt,
>   OutputStream out,
>   IdSql area,
>   ReportInfo petA,
>   JSONObject parametros_Reporte, Locale locale, boolean 
> autoPageBreaking)
> throws Exception {
>   Attachment attachment = Attachment.loadFromTable(file, area);
>   File tmpDir =
> ConfigGlobal.i.resuelveRuta(LectorConfig.i.get()

Re: DownloadLink, BIRT report

2009-01-05 Thread newbieabc
a pagina tal como sale desde el 
> diseñador BIRT
>   opc.setOption(PDFRenderOption.PAGEBREAK_PAGINATION_ONLY,
> autoPageBreaking);
>   opc.setOption(PDFRenderOption.FIT_TO_PAGE, 
> autoPageBreaking);
>   
>   opcRend = opc;
>   } else if ("excel".equals(fmt)){
>   // TODO: find if there is 
>   opcRend = new RenderOption();
>   opcRend.setOutputFormat("xls"); 
>   } else {
>   HTMLRenderOption opc = new HTMLRenderOption();
>   opc.setHtmlTitle(design.getReportName());
>   opc.setBaseImageURL("/recursos/img/x.birt-img?imagen=");
>   opc.setImageDirectory(tmpDir.getAbsolutePath());
>   opc.setImageHandler(new HTMLServerImageHandler());
>   opcRend = opc;
>   }
>   // hanlde report paramteters.
>   if(parametros_Reporte != null) {
>   Iterator it = 
> (Iterator)parametros_Reporte.keys(); 
>   while(it.hasNext()) {
>   String param = it.next();
>   try {
>   // first try to handle the parameter as 
> multivalued.
>   JSONArray array = 
> parametros_Reporte.getJSONArray(param);
>   Object[] values = new 
> Object[]{array.length()};
>   for(int i=0; i < array.length(); i++) {
>   try {
>   values[i] = 
> array.get(i);
>   } catch (Exception e) {
>   values[i] = null;
>   }
>   }
>   renderTask.setParameterValue(param, 
> values);
>   } catch (Exception e) {
>   // if parameter is not multi-valued 
> then treat it as single-valued.
>   String value = 
> parametros_Reporte.getString(param); 
>   renderTask.setParameterValue(param, 
> value);
>   }   
>   }
>   }
>   opcRend.setOutputStream(out);   
>   renderTask.setLocale(locale);
>   renderTask.setRenderOption(opcRend);
>   renderTask.run();
>   }
> .
> 
> }
> 
> This class initializes a singleton BIRT runtime and the
> generateBirtReport(...) method can be used to read the report design from
> a database and generate the corresponding report (PDF, excel, HTML).  If
> you filter out the logic that is specific to my use case you can easily
> build your own machinery for building reports based on code given above.
> 
> As for the generation of the download link there should be plenty of
> examples and/or related threads in this list... 
> 
> Best,
> 
> Ernesto
> 
> 
> 
> 
> 
> 
> 
> newbieabc wrote:
>> 
>> The generation of the excel report.
>> I am really new to BIRT and wicket..
>> I've created the BIRT report (report.rptdesign)(in eclipse) but need it
>> to be output as xls.
>> I'd really appreciate some help. 
>> Thank you
>> 
>> 
>> reiern70 wrote:
>>> 
>>> Sure you can... Which part is giving you problems? The generation of the
>>> excel report with BIRT? Or the creation of the link?
>>> 
>>> Best,
>>> 
>>> Ernesto
>>> 
>>> newbieabc wrote:
>>>> Hello..
>>>> How can create a download link on a webpage, that converts a BIRT
>>>> report to
>>>> excel format and downloads to client machine?
>>>>
>>>> Thank you.
>>>>   
>>> 
>>> 
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21293883.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: DownloadLink, BIRT report

2009-01-01 Thread reiern70

Another thing: if your excel is not very complex you could also consider
using [1] to generate it.

Best,

Ernesto

1-http://jexcelapi.sourceforge.net/



newbieabc wrote:
> 
> The generation of the excel report.
> I am really new to BIRT and wicket..
> I've created the BIRT report (report.rptdesign)(in eclipse) but need it to
> be output as xls.
> I'd really appreciate some help. 
> Thank you
> 
> 
> reiern70 wrote:
>> 
>> Sure you can... Which part is giving you problems? The generation of the
>> excel report with BIRT? Or the creation of the link?
>> 
>> Best,
>> 
>> Ernesto
>> 
>> newbieabc wrote:
>>> Hello..
>>> How can create a download link on a webpage, that converts a BIRT report
>>> to
>>> excel format and downloads to client machine?
>>>
>>> Thank you.
>>>   
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21240273.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: DownloadLink, BIRT report

2008-12-31 Thread reiern70
 Iterator it = 
(Iterator)parametros_Reporte.keys(); 
while(it.hasNext()) {
String param = it.next();
try {
// first try to handle the parameter as 
multivalued.
JSONArray array = 
parametros_Reporte.getJSONArray(param);
Object[] values = new 
Object[]{array.length()};
for(int i=0; i < array.length(); i++) {
try {
values[i] = 
array.get(i);
} catch (Exception e) {
values[i] = null;
}
}
renderTask.setParameterValue(param, 
values);
} catch (Exception e) {
// if parameter is not multi-valued 
then treat it as single-valued.
String value = 
parametros_Reporte.getString(param); 
renderTask.setParameterValue(param, 
value);
}   
}
}
opcRend.setOutputStream(out);   
renderTask.setLocale(locale);
renderTask.setRenderOption(opcRend);
renderTask.run();
}
.

}

This class initializes a singleton BIRT runtime and the
generateBirtReport(...) method can be used to read the report design from a
database and generate the corresponding report (PDF, excel, HTML).  If you
filter out the logic that is specific to my use case you can easily build
your own machinery for building reports based on code given above.

As for the generation of the download link there should be plenty of
examples and/or related threads in this list... 

Best,

Ernesto







newbieabc wrote:
> 
> The generation of the excel report.
> I am really new to BIRT and wicket..
> I've created the BIRT report (report.rptdesign)(in eclipse) but need it to
> be output as xls.
> I'd really appreciate some help. 
> Thank you
> 
> 
> reiern70 wrote:
>> 
>> Sure you can... Which part is giving you problems? The generation of the
>> excel report with BIRT? Or the creation of the link?
>> 
>> Best,
>> 
>> Ernesto
>> 
>> newbieabc wrote:
>>> Hello..
>>> How can create a download link on a webpage, that converts a BIRT report
>>> to
>>> excel format and downloads to client machine?
>>>
>>> Thank you.
>>>   
>> 
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21238208.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: DownloadLink, BIRT report

2008-12-31 Thread Jim Pinkham
I don't know about BIRT, but I recently did an output to Excel page.  You
link to it like any other page:


http://wicket.apache.org/";>

Auction Excel Download






 
 
 

That meta content in the head is more for documentation - it doesn't seem to
work without the final step below:

The Java code looks something like this to populate the table:

add(new DataView("rows", new MyDataProvider()) {
public void populateItem(final Item item) {
item.setModel(new CompoundPropertyModel(new
DetachableXYZModel(item.getModelObject(;
item.add(new Label("name"));

And the final magic makes it ask if you want to open it with excel:

@Override
protected void configureResponse() {
super.configureResponse();
getRequestCycle().getResponse().setContentType("application/x-msexcel");
}

That worked for me - hope it helps.  (Also note you can output a mix of
literal data and formulas)

I use web app to collect data, then word merge templates for reports.

-- Jim Pinkham
http://firstuucolumbus.org/auction

On Wed, Dec 31, 2008 at 10:22 AM, newbieabc  wrote:

> The generation of the excel report.
> I am really new to BIRT and wicket..
> I've created the BIRT report (report.rptdesign)(in eclipse) but need it to
> be output as xls.
> I'd really appreciate some help.
> Thank you
>
>
> reiern70 wrote:
> >
> > Sure you can... Which part is giving you problems? The generation of the
> > excel report with BIRT? Or the creation of the link?
> >
> > Best,
> >
> > Ernesto
> >
> > newbieabc wrote:
> >> Hello..
> >> How can create a download link on a webpage, that converts a BIRT report
> >> to
> >> excel format and downloads to client machine?
> >>
> >> Thank you.
> >>
> >
> >
> > -----
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> >
>
>
> -- View this message in context:
> http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21232850.html
>
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
> -
>
>  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For
> additional commands, e-mail: users-h...@wicket.apache.org
>
>
>


Re: DownloadLink, BIRT report

2008-12-31 Thread newbieabc

The generation of the excel report.
I am really new to BIRT and wicket..
I've created the BIRT report (report.rptdesign)(in eclipse) but need it to
be output as xls.
I'd really appreciate some help. 
Thank you


reiern70 wrote:
> 
> Sure you can... Which part is giving you problems? The generation of the
> excel report with BIRT? Or the creation of the link?
> 
> Best,
> 
> Ernesto
> 
> newbieabc wrote:
>> Hello..
>> How can create a download link on a webpage, that converts a BIRT report
>> to
>> excel format and downloads to client machine?
>>
>> Thank you.
>>   
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21232850.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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



Re: DownloadLink, BIRT report

2008-12-31 Thread Ernesto Reinaldo Barreiro
Sure you can... Which part is giving you problems? The generation of the
excel report with BIRT? Or the creation of the link?

Best,

Ernesto

newbieabc wrote:
> Hello..
> How can create a download link on a webpage, that converts a BIRT report to
> excel format and downloads to client machine?
>
> Thank you.
>   


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



DownloadLink, BIRT report

2008-12-30 Thread newbieabc

Hello..
How can create a download link on a webpage, that converts a BIRT report to
excel format and downloads to client machine?

Thank you.
-- 
View this message in context: 
http://www.nabble.com/DownloadLink%2C-BIRT-report-tp21218997p21218997.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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




Re: Re: DownloadLink, can anyone help me?

2008-10-10 Thread bruno . borges

You can create a Filter to that path. :-)

Bruno

On Oct 10, 2008 11:04am, Pablo Scagno <[EMAIL PROTECTED]> wrote:
Maybe, I can have a link like  
this "http://wwwcom/files/mydoc.pdf";, but I don't know how to make  
that folder visible...




--

From: "Pablo Scagno" [EMAIL PROTECTED]>

Sent: Friday, October 10, 2008 10:45 AM

To: users@wicket.apache.org>

Subject: Re: DownloadLink, can anyone help me?




Hi Steffen, Can you give me another idea to do this? Thanks

Pablo



--

From: "Steffen Fritzsche" [EMAIL PROTECTED]>

Sent: Friday, October 10, 2008 10:14 AM

To: users@wicket.apache.org>

Subject: Re: DownloadLink, can anyone help me?




We've got problems with the DownloadLink, too. They work fine in Firefox  
and Webkit-based browsers. However they do not work in IE6/7. IE complains  
about the URL, it might be the same message but I'm not in front of the  
system right now to verify this.




Steffen





Am 10.10.2008 um 15:07 schrieb Serkan Camurcuoglu:




actually I have no experience with this but just trying to help.. what  
happens when you copy the download link url and paste it into a new browser  
tab, do you get a 404 error? which path does the error specify? is it  
different from the download link url? do you see any exception in the logs?








Pablo Scagno wrote:


First of all thanks for you help,

Regarding my problem, yes, I debug It and the code executed without any  

problem, it calls the super method.












--

From: "Serkan Camurcuoglu" [EMAIL PROTECTED]>

Sent: Friday, October 10, 2008 9:34 AM

To: users@wicket.apache.org>

Subject: Re: Fw: DownloadLink, can anyone help me?




do you know whether the request reaches your downloadlink? for example,  

you could check it by using:




add(new DownloadLink("download", fileModel) {

@Override

public void onClick() {

System.out.println("onClick of download link called!");

try {

super.onClick();

System.out.println("super onClick was successful");

} catch (Throwable t) {

t.printStackTrace();

}

}

});



or you could debug it of course..







Pablo Scagno wrote:


FYI

--

From: "Pablo Scagno" [EMAIL PROTECTED]>

Sent: Thursday, October 09, 2008 5:54 PM

To: users@wicket.apache.org>

Subject: DownloadLink




Hi,

I was trying to use DownloadLink but for some reason I couldn't make it  

work.


I'm trying to insert the link in a grid, but when I test the application  

and I click the link, an error page appears "The webPage cannot be found"




this url appears in the page

http:///?wicket:interface=:7:table:rows:1:cells:  

2:cell:download::ILinkListener::




here Is the code where I create the link



public class ActionPanel extends Panel{

public ActionPanel(String id, IModel model){

super(id, model);

try {

File file = ((Document)model.getObject()).getOriginalFile();

IModel fileModel = new Model();

fileModel.setObject(file);

add(new DownloadLink("download",fileModel));

} catch (FileNotFoundException e) {

e.printStackTrace();

}

}

}



I've debug the app and I saw that the file was loaded, and the link was  
created without any problem. Can anyone tell me if need anything else to  
make it works?




Thanks in advance



Pablo






-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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










-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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








-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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










-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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








-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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








-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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








-

To unsubscribe, e-mail: [EMAIL PROTECTED]

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





Re: DownloadLink, can anyone help me?

2008-10-10 Thread Pablo Scagno
Maybe, I can have a link like this "http://wwwcom/files/mydoc.pdf";, 
but I don't know how to make that folder visible...


--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 10:45 AM
To: 
Subject: Re: DownloadLink, can anyone help me?


Hi Steffen, Can you give me another idea to do this? Thanks
Pablo

--
From: "Steffen Fritzsche" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 10:14 AM
To: 
Subject: Re: DownloadLink, can anyone help me?

We've got problems with the DownloadLink, too. They work fine in  Firefox 
and Webkit-based browsers. However they do not work in IE6/7.  IE 
complains about the URL, it might be the same message but I'm not  in 
front of the system right now to verify this.


Steffen


Am 10.10.2008 um 15:07 schrieb Serkan Camurcuoglu:

actually I have no experience with this but just trying to help..  what 
happens when you copy the download link url and paste it into a  new 
browser tab, do you get a 404 error? which path does the error  specify? 
is it different from the download link url? do you see any  exception in 
the logs?




Pablo Scagno wrote:

First of all thanks for you help,
Regarding my problem, yes, I debug It and the code executed without 
any problem, it calls the super method.






--
From: "Serkan Camurcuoglu" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:34 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?

do you know whether the request reaches your downloadlink? for 
example, you could check it by using:


add(new DownloadLink("download", fileModel) {
@Override
public void onClick() {
System.out.println("onClick of download link called!");
try {
 super.onClick();
 System.out.println("super onClick was successful");
} catch (Throwable t) {
 t.printStackTrace();
}
}
});

or you could debug it of course..



Pablo Scagno wrote:

FYI
--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Thursday, October 09, 2008 5:54 PM
To: 
Subject: DownloadLink


Hi,
I was trying to use DownloadLink but for some reason  I couldn't 
make it work.
I'm trying to insert the link in a grid, but when I test the 
application and I click the link, an error page appears "The 
webPage cannot be found"


this url appears in the page
http:///?wicket:interface=:7:table:rows:1:cells: 
2:cell:download::ILinkListener::


here Is the code where I create the link

public class ActionPanel extends Panel{
  public ActionPanel(String id, IModel model){
  super(id, model);
  try {
  File file = 
((Document)model.getObject()).getOriginalFile();

  IModel fileModel = new Model();
  fileModel.setObject(file);
  add(new DownloadLink("download",fileModel));
  } catch (FileNotFoundException e) {
  e.printStackTrace();
  }
  }
}

I've debug the app and I saw that the file was loaded, and the  link 
was created without any problem. Can anyone tell me if need 
anything else to make it works?


Thanks in advance

Pablo



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





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




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





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




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




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




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



Re: DownloadLink, can anyone help me?

2008-10-10 Thread Pablo Scagno
Hi Steffen, Can you give me another idea to do this? 
Thanks

Pablo

--
From: "Steffen Fritzsche" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 10:14 AM
To: 
Subject: Re: DownloadLink, can anyone help me?

We've got problems with the DownloadLink, too. They work fine in  
Firefox and Webkit-based browsers. However they do not work in IE6/7.  
IE complains about the URL, it might be the same message but I'm not  
in front of the system right now to verify this.


Steffen


Am 10.10.2008 um 15:07 schrieb Serkan Camurcuoglu:

actually I have no experience with this but just trying to help..  
what happens when you copy the download link url and paste it into a  
new browser tab, do you get a 404 error? which path does the error  
specify? is it different from the download link url? do you see any  
exception in the logs?




Pablo Scagno wrote:

First of all thanks for you help,
Regarding my problem, yes, I debug It and the code executed without  
any problem, it calls the super method.






--
From: "Serkan Camurcuoglu" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:34 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?

do you know whether the request reaches your downloadlink? for  
example, you could check it by using:


add(new DownloadLink("download", fileModel) {
@Override
public void onClick() {
System.out.println("onClick of download link called!");
try {
 super.onClick();
 System.out.println("super onClick was successful");
} catch (Throwable t) {
 t.printStackTrace();
}
}
});

or you could debug it of course..



Pablo Scagno wrote:

FYI
--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Thursday, October 09, 2008 5:54 PM
To: 
Subject: DownloadLink


Hi,
I was trying to use DownloadLink but for some reason  I couldn't  
make it work.
I'm trying to insert the link in a grid, but when I test the  
application and I click the link, an error page appears "The  
webPage cannot be found"


this url appears in the page
http:///?wicket:interface=:7:table:rows:1:cells: 
2:cell:download::ILinkListener::


here Is the code where I create the link

public class ActionPanel extends Panel{
  public ActionPanel(String id, IModel model){
  super(id, model);
  try {
  File file =  
((Document)model.getObject()).getOriginalFile();

  IModel fileModel = new Model();
  fileModel.setObject(file);
  add(new DownloadLink("download",fileModel));
  } catch (FileNotFoundException e) {
  e.printStackTrace();
  }
  }
}

I've debug the app and I saw that the file was loaded, and the  
link was created without any problem. Can anyone tell me if need  
anything else to make it works?


Thanks in advance

Pablo



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





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




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





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




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




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



Re: Fw: DownloadLink, can anyone help me?

2008-10-10 Thread Pablo Scagno

sorry about that...

--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 10:34 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?


Pancu, dame los datos del hotel, quizas salga hoy al mediodia pra alla
quiero ver si hay hotel

--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:48 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?


First of all thanks for you help,
Regarding my problem, yes, I debug It and the code executed without any 
problem, it calls the super method.






--
From: "Serkan Camurcuoglu" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:34 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?

do you know whether the request reaches your downloadlink? for example, 
you could check it by using:


add(new DownloadLink("download", fileModel) {
 @Override
 public void onClick() {
 System.out.println("onClick of download link called!");
 try {
  super.onClick();
  System.out.println("super onClick was successful");
 } catch (Throwable t) {
  t.printStackTrace();
 }
 }
});

or you could debug it of course..



Pablo Scagno wrote:

FYI
--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Thursday, October 09, 2008 5:54 PM
To: 
Subject: DownloadLink


Hi,
I was trying to use DownloadLink but for some reason  I couldn't make 
it work.
I'm trying to insert the link in a grid, but when I test the 
application and I click the link, an error page appears "The webPage 
cannot be found"


this url appears in the page
http:///?wicket:interface=:7:table:rows:1:cells:2:cell:download::ILinkListener::

here Is the code where I create the link

public class ActionPanel extends Panel{
   public ActionPanel(String id, IModel model){
   super(id, model);
   try {
   File file = 
((Document)model.getObject()).getOriginalFile();

   IModel fileModel = new Model();
   fileModel.setObject(file);
   add(new DownloadLink("download",fileModel));
   } catch (FileNotFoundException e) {
   e.printStackTrace();
   }
   }
}

I've debug the app and I saw that the file was loaded, and the link 
was created without any problem. Can anyone tell me if need anything 
else to make it works?


Thanks in advance

Pablo



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





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




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




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




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



Re: Fw: DownloadLink, can anyone help me?

2008-10-10 Thread Pablo Scagno

Pancu, dame los datos del hotel, quizas salga hoy al mediodia pra alla
quiero ver si hay hotel

--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:48 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?


First of all thanks for you help,
Regarding my problem, yes, I debug It and the code executed without any 
problem, it calls the super method.






--
From: "Serkan Camurcuoglu" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:34 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?

do you know whether the request reaches your downloadlink? for example, 
you could check it by using:


add(new DownloadLink("download", fileModel) {
 @Override
 public void onClick() {
 System.out.println("onClick of download link called!");
 try {
  super.onClick();
  System.out.println("super onClick was successful");
 } catch (Throwable t) {
  t.printStackTrace();
 }
 }
});

or you could debug it of course..



Pablo Scagno wrote:

FYI
--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Thursday, October 09, 2008 5:54 PM
To: 
Subject: DownloadLink


Hi,
I was trying to use DownloadLink but for some reason  I couldn't make 
it work.
I'm trying to insert the link in a grid, but when I test the 
application and I click the link, an error page appears "The webPage 
cannot be found"


this url appears in the page
http:///?wicket:interface=:7:table:rows:1:cells:2:cell:download::ILinkListener::

here Is the code where I create the link

public class ActionPanel extends Panel{
   public ActionPanel(String id, IModel model){
   super(id, model);
   try {
   File file = ((Document)model.getObject()).getOriginalFile();
   IModel fileModel = new Model();
   fileModel.setObject(file);
   add(new DownloadLink("download",fileModel));
   } catch (FileNotFoundException e) {
   e.printStackTrace();
   }
   }
}

I've debug the app and I saw that the file was loaded, and the link was 
created without any problem. Can anyone tell me if need anything else 
to make it works?


Thanks in advance

Pablo



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





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




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




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



Re: DownloadLink, can anyone help me?

2008-10-10 Thread Steffen Fritzsche
We've got problems with the DownloadLink, too. They work fine in  
Firefox and Webkit-based browsers. However they do not work in IE6/7.  
IE complains about the URL, it might be the same message but I'm not  
in front of the system right now to verify this.


Steffen


Am 10.10.2008 um 15:07 schrieb Serkan Camurcuoglu:

actually I have no experience with this but just trying to help..  
what happens when you copy the download link url and paste it into a  
new browser tab, do you get a 404 error? which path does the error  
specify? is it different from the download link url? do you see any  
exception in the logs?




Pablo Scagno wrote:

First of all thanks for you help,
Regarding my problem, yes, I debug It and the code executed without  
any problem, it calls the super method.






--
From: "Serkan Camurcuoglu" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:34 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?

do you know whether the request reaches your downloadlink? for  
example, you could check it by using:


add(new DownloadLink("download", fileModel) {
@Override
public void onClick() {
System.out.println("onClick of download link called!");
try {
 super.onClick();
 System.out.println("super onClick was successful");
} catch (Throwable t) {
 t.printStackTrace();
}
}
});

or you could debug it of course..



Pablo Scagno wrote:

FYI
--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Thursday, October 09, 2008 5:54 PM
To: 
Subject: DownloadLink


Hi,
I was trying to use DownloadLink but for some reason  I couldn't  
make it work.
I'm trying to insert the link in a grid, but when I test the  
application and I click the link, an error page appears "The  
webPage cannot be found"


this url appears in the page
http:///?wicket:interface=:7:table:rows:1:cells: 
2:cell:download::ILinkListener::


here Is the code where I create the link

public class ActionPanel extends Panel{
  public ActionPanel(String id, IModel model){
  super(id, model);
  try {
  File file =  
((Document)model.getObject()).getOriginalFile();

  IModel fileModel = new Model();
  fileModel.setObject(file);
  add(new DownloadLink("download",fileModel));
  } catch (FileNotFoundException e) {
  e.printStackTrace();
  }
  }
}

I've debug the app and I saw that the file was loaded, and the  
link was created without any problem. Can anyone tell me if need  
anything else to make it works?


Thanks in advance

Pablo



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





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




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





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




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



Re: Fw: DownloadLink, can anyone help me?

2008-10-10 Thread Serkan Camurcuoglu
actually I have no experience with this but just trying to help.. what 
happens when you copy the download link url and paste it into a new 
browser tab, do you get a 404 error? which path does the error specify? 
is it different from the download link url? do you see any exception in 
the logs?




Pablo Scagno wrote:

First of all thanks for you help,
Regarding my problem, yes, I debug It and the code executed without 
any problem, it calls the super method.






--
From: "Serkan Camurcuoglu" <[EMAIL PROTECTED]>
Sent: Friday, October 10, 2008 9:34 AM
To: 
Subject: Re: Fw: DownloadLink, can anyone help me?

do you know whether the request reaches your downloadlink? for 
example, you could check it by using:


add(new DownloadLink("download", fileModel) {
 @Override
 public void onClick() {
 System.out.println("onClick of download link called!");
 try {
  super.onClick();
  System.out.println("super onClick was successful");
 } catch (Throwable t) {
  t.printStackTrace();
 }
 }
});

or you could debug it of course..



Pablo Scagno wrote:

FYI
--
From: "Pablo Scagno" <[EMAIL PROTECTED]>
Sent: Thursday, October 09, 2008 5:54 PM
To: 
Subject: DownloadLink


Hi,
I was trying to use DownloadLink but for some reason  I couldn't 
make it work.
I'm trying to insert the link in a grid, but when I test the 
application and I click the link, an error page appears "The 
webPage cannot be found"


this url appears in the page
http:///?wicket:interface=:7:table:rows:1:cells:2:cell:download::ILinkListener:: 



here Is the code where I create the link

public class ActionPanel extends Panel{
   public ActionPanel(String id, IModel model){
   super(id, model);
   try {
   File file = 
((Document)model.getObject()).getOriginalFile();

   IModel fileModel = new Model();
   fileModel.setObject(file);
   add(new DownloadLink("download",fileModel));
   } catch (FileNotFoundException e) {
   e.printStackTrace();
   }
   }
}

I've debug the app and I saw that the file was loaded, and the link 
was created without any problem. Can anyone tell me if need 
anything else to make it works?


Thanks in advance

Pablo



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





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




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





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



  1   2   >