Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3490272
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:29:45+00:00 2026-05-18T11:29:45+00:00

I am working on a web application project using Tapestry 5 framework/javascript. This application

  • 0

I am working on a web application project using Tapestry 5 framework/javascript. This application takes few inputs and returns pdf files.

I got a new requirement of disabling the form submit button when the user clicks it. The button should stay disabled till the reports are generated. I am planning to write javascript for disabling the submit button. But how can I reenable the buttons while returning pdf file?

I have gone through Tapestry documentation. As per the doc, the valid return types are “Nothing, String, Class, Page, Link, Stream”. If I return a page, I can reenable the submit button. If I return a stream, the user will be able to download the pdf. But I want to do both. Is there any way by which I can return multiple objects (may be one object inside another object). (or) Can someone suggest any solution to this problem?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:29:46+00:00Added an answer on May 18, 2026 at 11:29 am

    I’m guessing your workflow is that the form submit handler directs to a page which returns a stream (the pdf) in the onActivate method. I’m also guessing your set the response headers so that the file is downloaded rather than opened by the browser.

    if you do this, the browser typically creates a ‘save file as’ dialog and the current page is never navigated away from (does not refresh). you will never receive any callback telling you that a file has been downloaded either.

    therefore with the above workflow, you will not be able to re-enable your button as a response to the download initiating or completing. this is because the stream response is nothing but arbitrary binary data and not html/javascript capable of being executed by the browser. you cannot return a mixed response of html/javascript + binary file data.

    the best you could achieve would be to disable the button for a period of time, and then re-enable it to prevent double clicking. if you don’t want to add too much complexity to your application i recommend this approach.

    however, you could change your workflow inserting an extra request-response between your form submission and your download.

    i.e. instead of directing straight to the page which returns the stream, you could reload your current page which in turn requests the download:

    1. your form submission saves your pdf generation parameters to the session and returns response (reloading the page)
    2. the new page loads along with a meta-refresh or script directive to redirect to the download url
    3. the download url is called returns the stream response along with the correct headers set so that the user sees the ‘save file as’ dialog

    there are probably other approaches which would achieve your desired functionality too however the pattern will be the same in that you will need an additional request-response between form submission and file download.

    ps. this is not really a tapestry problem, you will come across the same issue regardless of framework (unless the framework does something special to handle this case). it is just how http/browser technology works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm recently working on a semantic web application project using Rowlex. I've reached some
i am working on a struts2 web application-project and using netbeans 6.9. i want
I'm working on an ASP .NET 2.0 site which uses a Web Application project
I am working on a project management web application. The user has a variety
I'm working on a new project, a web application, where I need to focus
I am working on a .NET 3.5 project which consists of a web application
I am working on a web application using Python (Django) and would like to
I'm working on a Web project using Asp.Net MVC, which I'll have to deploy
I am working on an MVC application using Entity Framework. After creating an EDMX,
I'm working on a solution that has two projects: One ASP.NET web application, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.