OK,

That function afterLoad - I meant pageIsComplete :)

here's how i have done it:

On the page I have following code:

  <tc:panel width="0" height="0">
        <tc:script>
            function doAfterLoadingReportsBrowserTab()
            {
            if (!Tobago.pageIsComplete)
            {
            setTimeout('doAfterLoadingReportsBrowserTab()', 50);
            }
            else 
if(document.getElementById('overview:reportsBrowserTab:storedReport')
!= null)
            {
            Tobago.submitAction('overview:reportsBrowserTab:storedReport', 
false);
            }
            else
            {
            return;
            }
            }
            doAfterLoadingReportsBrowserTab();
        
            <tc:link
                label=""
                id="storedReport"
                transition="false"
                
action="#{reportsBrowserManagedBean.reportsBrowserController.getReport}"
                
rendered="#{reportsBrowserManagedBean.reportsBrowserController.fetchReport}"/>
        </tc:script>
</tc:panel>

And here is your button:

<tc:link label="#{bundle.catalogExport}"
actionListener="#{excelExport.exportToExcel}"
action="#{excelExport.exportToExcel}" transition="false">

You have to change yout excelExport method, so it  only creates a file
and stores it somehow and sets fetchReport to true. You also want to
set transition to true

So, after clicking your button, the same page reloads, but this time
the link with id storedReports is rendered. The included javascript
checks if it exists - and now it does - so it submits the getReport
action - which sends your file to the browser (as described here:
http://wiki.apache.org/myfaces/Sending_Files) and sets fetchReport to
false for obvious reason.

Perhaps it is not a clean solution, but I didn't come up with anything better

regards,
michal


On 08/04/07, Vinay Konanki <[EMAIL PROTECTED]> wrote:
Hi Michal,

Thanks for your reply,
i have couple of doubts in the solution you provided.
before that let me explain my case.

I have a link which will generate the excel export of all the products,
According to my current Code my <tc:link> will be like this:

<tc:link label="#{bundle.catalogExport}"
actionListener="#{excelExport.exportToExcel}"

action="#{excelExport.exportToExcel}" transition="false">
NB: for this i'm making transition as false

My questions  are:
1) How can we set one action for two events i.e generating excel stufff
(calling Controller) and setting an element on the page(with Specific ID).
2) Can you provide a sample code snippet so that it will be helpful for me
to get an idea.
3) I search for afterLoad method in Tobago but i dont find any methods
similar to that, Can you provide code for the java Script and how we will
call.
Please provide me Sample Code Snippet, that will be greatly helpful for me.

Awaiting your reply.

Thanks,
Vinay



On 4/6/07, Michał 'Gandalf' Stawicki <[EMAIL PROTECTED]> wrote:
> You can do as follows:
>
> use a button with transition - pressing the button would generate your
> excel stuff and couse some invisible element to render on the page
> (with a specific ID)
>
> to the page, add a java script using Tobago.afterLoad (perhaps it was
> called some different way, check...) that checks if the special
> element was rendered and if so, then it submits action that sends
> excel stuff to the browser without transition. I have been using this
> method  to submit PDF reports :)
>
> regards,
> michał
>
> On 07/04/07, Vinay Konanki <[EMAIL PROTECTED]> wrote:
> > Hi,
> > Could any one help me in this regard...
> > I need to done this module as soon as possible
> >
> > Any help will be appreciated.
> >
> > Thanks,
> > Vinay
> >
> >
> > On 4/5/07, Vinay Konanki < [EMAIL PROTECTED]> wrote:
> > > Hi All,
> > > I got success in generating excel sheet, Thanks for your help, but
today i
> > found a problem with in exporting the excel.
> > >
> > > Problem was:
> > > When i'm trying to export the results to excel as there are more than
700
> > elements to generate, it taking around 5-6 seconds to show window "which
> > contains OpenWith SaveAs Cancel" buttons.
> > > In the mean while when i click on other links in the application its
> > getting blocked UI (i.e non editable UI with progress bar image) for
> > infinite time.
> > >
> > > So how can i make the screen as non editable when it generating Excel
> > sheet. i.e. i want to show to the user that some process is going on and
> > make the screen non editable i.e user can not make any actions on the
> > screen.
> > >
> > > Is there any way to make the screen non editable while other process
is
> > going on.
> > >
> > > Please help me in this regard.
> > >
> > > Any kind of help will be appreciated. I'm running out of time, as my
> > product release is very soon.
> > >
> > > Thanks,
> > > Vinay
> >
> >
>
>
> --
> [EMAIL PROTECTED]
> http://stawicki.jasliska.pl
> GG: 3691111
> JID: [EMAIL PROTECTED]
>




--
[EMAIL PROTECTED]
http://stawicki.jasliska.pl
GG: 3691111
JID: [EMAIL PROTECTED]

Reply via email to