You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Yazeed Isaacs <Ya...@transactionjunction.co.za> on 2008/11/10 14:04:19 UTC

RE: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

I understand that the markupid needs to be there in order for ajax to
update the component.

The component that it complains about is called "content" which is the
inner content of the AjaxLazyLoadPanel.

I have set the ajaxlazyloadpanel to setRenderBodyOnly(false) and
setOutputMarkupId(true) and I did the same for the
AjaxFallbackDefaultDataTable, but I still get the same error.

This is my component layout:

Form  -> AjaxButton
	-> AjaxLazyLoadPanel returns AjaxFallbackDefaultDataTable
  					
    
Component id = content, page =
za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable


Any ideas?

Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za



-----Original Message-----
From: Ernesto Reinaldo Barreiro [mailto:reiern70@gmail.com] 
Sent: 06 October 2008 10:01 AM
To: users@wicket.apache.org
Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting and paging throws an IllegalStateException

The problem is, as Igor pointed, you cannot re-render a component via
AJAX
if it has set setRenderBodyOnly(true)... Why?
<div wicket:id="testAjax">
  <p>Content...</p>
</div>

will be renderend as

<p>Content...</p>

instead of

<div id="someid">
  <p>Content...</p>
</div>

So, there is no way wicket AJAX js can replace the div with something
else... Additionally you have to set setOutputMarkupId(true) on the
component you want to replace..

Ernesto

On Mon, Oct 6, 2008 at 9:41 AM, Yazeed Isaacs <
Yazeed@transactionjunction.co.za> wrote:

> Hi Igor
>
> Here is the java code:
>
> add(new AjaxButton("ajaxSubmitButton", this) {
>
>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>
>                AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
>                                "transactions") {
>
>                        private static final long serialVersionUID =
1L;
>
>                        @Override
>                        public Component getLazyLoadComponent(String
id)
> {
>
>                                TransactionQuery transactionQuery = new
> TransactionQuery();
>
>
> transactionQuery.setCardNumber(cardNumberField
>                                                .getInput());
>
> transactionQuery.setDateFrom(dateFromField
>                                                .getInput());
>
> transactionQuery.setDateTo(dateToField.getInput());
>
> transactionQuery.setStoreId(storeIdsDropDownChoice
>                                                .getInput());
>                                transactionQuery
>
> .setTerminalId(terminalIdsDropDownChoice
>
> .getInput());
>                                int transactionNumber = 0;
>                                if (transNumberField.getInput() !=
null)
> {
>                                        if
> ((transNumberField.getInput().length() > 0))
>                                                transactionNumber =
> Integer
>
> .parseInt(transNumberField
>
> .getInput());
>                                }
>                                transactionQuery
>
> .setTransactionNumber(transactionNumber);
>
>
>
>                                AjaxFallbackDefaultDataTable results =
> new AjaxFallbackDefaultDataTable(
>                                                id,
>                                                columns,
>                                                new
> SortableTransactionQueryResultsDataProvider(
>
> transactionQuery), 10);
>
>                                //
transactions.setOutputMarkupId(true);
>
>                                results.setRenderBodyOnly(false);
>
>                                return results;
>                        }
>
>                };
>
>                transactions.setRenderBodyOnly(false);
>
>                form.replace(transactions);
>
>                target.addComponent(transactions);
>        }
>
> });
>
>
>
> HTML code:
>
> <table cellpadding="2" cellspacing="0" width="521"
> wicket:id="transactions">
>
> </table>
>
>
> I have tried playing around with the way I've implemented this, but I
> keep on getting the same exception (java.lang.IllegalStateException)
> when I sort a column or navigate to a page.
>
> Let me know what you think.
>
> Regards,
> Yazeed Isaacs
>
>
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: 06 October 2008 09:31 AM
> To: users@wicket.apache.org
> Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting and paging throws an IllegalStateException
>
> if i were you i would read the exception message, it is telling you
> exactly what is going wrong...if you showed some code or provided a
> quickstart we can help further.
>
> -igor
>
> On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
> <Ya...@transactionjunction.co.za> wrote:
> > Anybody?
> >
> > Guys please help me with this one.
> >
> >
> >
> > -----Original Message-----
> > From: Yazeed Isaacs
> > Sent: 03 October 2008 03:00 PM
> > To: users@wicket.apache.org
> > Subject: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting
> and paging throws an IllegalStateException
> >
> > Hi
> >
> > I have an AjaxFallbackDefaultDataTable table and I am using an
> AjaxLazyLoadPanel when rendering this table. When I click the
AjaxButton
> the table lazy loads.
> >
> > To summarize (in short) I have a AjaxButton that when clicked the
> onSubmit() method creates the AjaxLazyLoadPanel, the
AjaxLazyLoadPanel's
> getLazyLoadComponent() method returns the AjaxFallbackDefaultDataTable
> table. Therefore the AjaxLazyLoadPanel renders as the
> AjaxFallbackDefaultDataTable table.
> >
> > The table lazy loads correctly, but when I click on a column in
order
> to sort it or click on the page navigation links, I get the following
> error:
> >
> > java.lang.IllegalStateException: Ajax render cannot be called on
> component that has setRenderBodyOnly enabled.
> > ...
> > Component id = content, page =
> za.co.transactionjunction.transpector.pages.TransactionQueryPage, path
=
>
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable
> >
> > Where transactions is the AjaxLazyLoadPanel.
> >
> > Am I missing something? Please help.
> >
> > Regards,
> > Yazeed Isaacs
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

Posted by Yazeed Isaacs <Ya...@transactionjunction.co.za>.
Hi Igor

A basic example of this would be the following:

You have a LazyLoadPanel and override getLazyLoadComponent() to return a
AjaxTabbedPanel with at least 1 tab. Click on a tab and the same
IllegalStateException is thrown. 

java.lang.IllegalStateException: Ajax render cannot be called on
component that has setRenderBodyOnly enabled.
Component id = content,...
tabs:panel:webContainer:lazyLoadPanel:content.AjaxTabbedPanel

The same as with the AjaxFallbackDefaultDataTable:

Component id = content,... form:
lazyLoadPanel:content.AjaxFallbackDefaultDataTable


I assume that the LazyLoadComponent with id "content" is the problem,
but I cannot seem to solve this one. Is there any other way that I may
use the AjaxTabbedPanel or AjaxFallbackDefaultDataTable and have them
lazyloaded?


Oh yes, did I mention that WICKET is AWESOME !!!

Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za



-----Original Message-----
From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com] 
Sent: 11 November 2008 06:54 PM
To: users@wicket.apache.org
Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting and paging throws an IllegalStateException

create a quickstart and i will take a look.

-igor

On Tue, Nov 11, 2008 at 12:38 AM, Yazeed Isaacs
<Ya...@transactionjunction.co.za> wrote:
> Hi Igor
>
> I am still having a problem with the paging & sorting of the
> AjaxFallbackDefaultDataTable when it is used within a LazyLoadPanel
ie.
> LazyLoadPanel.getLazyLoadComponent() returns the
> AjaxFallbackDefaultDataTable.
>
> The AjaxFallbackDefaultDataTable loads correctly within the
> LazyLoadPanel, but when I sort a column or navigate to the next page,
> the IllegalStateException is thrown and the error message is: Ajax
> render cannot be called on component that has setRenderBodyOnly
enabled
> - Component id: "content".
>
> lazyloadpanel:content.AjaxFallbackDefaultDataTable
>
> Please help.
>
> Yazeed Isaacs - Java Developer
> yazeed@transactionjunction.co.za
>
>
>
> -----Original Message-----
> From: Yazeed Isaacs [mailto:Yazeed@transactionjunction.co.za]
> Sent: 10 November 2008 03:04 PM
> To: users@wicket.apache.org
> Subject: RE: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting and paging throws an IllegalStateException
>
> I understand that the markupid needs to be there in order for ajax to
> update the component.
>
> The component that it complains about is called "content" which is the
> inner content of the AjaxLazyLoadPanel.
>
> I have set the ajaxlazyloadpanel to setRenderBodyOnly(false) and
> setOutputMarkupId(true) and I did the same for the
> AjaxFallbackDefaultDataTable, but I still get the same error.
>
> This is my component layout:
>
> Form  -> AjaxButton
>        -> AjaxLazyLoadPanel returns AjaxFallbackDefaultDataTable
>
>
> Component id = content, page =
> za.co.transactionjunction.transpector.pages.TransactionQueryPage, path
=
>
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable
>
>
> Any ideas?
>
> Yazeed Isaacs - Java Developer
> yazeed@transactionjunction.co.za
>
>
>
> -----Original Message-----
> From: Ernesto Reinaldo Barreiro [mailto:reiern70@gmail.com]
> Sent: 06 October 2008 10:01 AM
> To: users@wicket.apache.org
> Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting and paging throws an IllegalStateException
>
> The problem is, as Igor pointed, you cannot re-render a component via
> AJAX
> if it has set setRenderBodyOnly(true)... Why?
> <div wicket:id="testAjax">
>  <p>Content...</p>
> </div>
>
> will be renderend as
>
> <p>Content...</p>
>
> instead of
>
> <div id="someid">
>  <p>Content...</p>
> </div>
>
> So, there is no way wicket AJAX js can replace the div with something
> else... Additionally you have to set setOutputMarkupId(true) on the
> component you want to replace..
>
> Ernesto
>
> On Mon, Oct 6, 2008 at 9:41 AM, Yazeed Isaacs <
> Yazeed@transactionjunction.co.za> wrote:
>
>> Hi Igor
>>
>> Here is the java code:
>>
>> add(new AjaxButton("ajaxSubmitButton", this) {
>>
>>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>>
>>                AjaxLazyLoadPanel transactions = new
AjaxLazyLoadPanel(
>>                                "transactions") {
>>
>>                        private static final long serialVersionUID =
> 1L;
>>
>>                        @Override
>>                        public Component getLazyLoadComponent(String
> id)
>> {
>>
>>                                TransactionQuery transactionQuery =
new
>> TransactionQuery();
>>
>>
>> transactionQuery.setCardNumber(cardNumberField
>>                                                .getInput());
>>
>> transactionQuery.setDateFrom(dateFromField
>>                                                .getInput());
>>
>> transactionQuery.setDateTo(dateToField.getInput());
>>
>> transactionQuery.setStoreId(storeIdsDropDownChoice
>>                                                .getInput());
>>                                transactionQuery
>>
>> .setTerminalId(terminalIdsDropDownChoice
>>
>> .getInput());
>>                                int transactionNumber = 0;
>>                                if (transNumberField.getInput() !=
> null)
>> {
>>                                        if
>> ((transNumberField.getInput().length() > 0))
>>                                                transactionNumber =
>> Integer
>>
>> .parseInt(transNumberField
>>
>> .getInput());
>>                                }
>>                                transactionQuery
>>
>> .setTransactionNumber(transactionNumber);
>>
>>
>>
>>                                AjaxFallbackDefaultDataTable results =
>> new AjaxFallbackDefaultDataTable(
>>                                                id,
>>                                                columns,
>>                                                new
>> SortableTransactionQueryResultsDataProvider(
>>
>> transactionQuery), 10);
>>
>>                                //
> transactions.setOutputMarkupId(true);
>>
>>                                results.setRenderBodyOnly(false);
>>
>>                                return results;
>>                        }
>>
>>                };
>>
>>                transactions.setRenderBodyOnly(false);
>>
>>                form.replace(transactions);
>>
>>                target.addComponent(transactions);
>>        }
>>
>> });
>>
>>
>>
>> HTML code:
>>
>> <table cellpadding="2" cellspacing="0" width="521"
>> wicket:id="transactions">
>>
>> </table>
>>
>>
>> I have tried playing around with the way I've implemented this, but I
>> keep on getting the same exception (java.lang.IllegalStateException)
>> when I sort a column or navigate to a page.
>>
>> Let me know what you think.
>>
>> Regards,
>> Yazeed Isaacs
>>
>>
>>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: 06 October 2008 09:31 AM
>> To: users@wicket.apache.org
>> Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
>> sorting and paging throws an IllegalStateException
>>
>> if i were you i would read the exception message, it is telling you
>> exactly what is going wrong...if you showed some code or provided a
>> quickstart we can help further.
>>
>> -igor
>>
>> On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
>> <Ya...@transactionjunction.co.za> wrote:
>> > Anybody?
>> >
>> > Guys please help me with this one.
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: Yazeed Isaacs
>> > Sent: 03 October 2008 03:00 PM
>> > To: users@wicket.apache.org
>> > Subject: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting
>> and paging throws an IllegalStateException
>> >
>> > Hi
>> >
>> > I have an AjaxFallbackDefaultDataTable table and I am using an
>> AjaxLazyLoadPanel when rendering this table. When I click the
> AjaxButton
>> the table lazy loads.
>> >
>> > To summarize (in short) I have a AjaxButton that when clicked the
>> onSubmit() method creates the AjaxLazyLoadPanel, the
> AjaxLazyLoadPanel's
>> getLazyLoadComponent() method returns the
AjaxFallbackDefaultDataTable
>> table. Therefore the AjaxLazyLoadPanel renders as the
>> AjaxFallbackDefaultDataTable table.
>> >
>> > The table lazy loads correctly, but when I click on a column in
> order
>> to sort it or click on the page navigation links, I get the following
>> error:
>> >
>> > java.lang.IllegalStateException: Ajax render cannot be called on
>> component that has setRenderBodyOnly enabled.
>> > ...
>> > Component id = content, page =
>> za.co.transactionjunction.transpector.pages.TransactionQueryPage,
path
> =
>>
>
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable
>> >
>> > Where transactions is the AjaxLazyLoadPanel.
>> >
>> > Am I missing something? Please help.
>> >
>> > Regards,
>> > Yazeed Isaacs
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


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


Re: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

Posted by Igor Vaynberg <ig...@gmail.com>.
create a quickstart and i will take a look.

-igor

On Tue, Nov 11, 2008 at 12:38 AM, Yazeed Isaacs
<Ya...@transactionjunction.co.za> wrote:
> Hi Igor
>
> I am still having a problem with the paging & sorting of the
> AjaxFallbackDefaultDataTable when it is used within a LazyLoadPanel ie.
> LazyLoadPanel.getLazyLoadComponent() returns the
> AjaxFallbackDefaultDataTable.
>
> The AjaxFallbackDefaultDataTable loads correctly within the
> LazyLoadPanel, but when I sort a column or navigate to the next page,
> the IllegalStateException is thrown and the error message is: Ajax
> render cannot be called on component that has setRenderBodyOnly enabled
> - Component id: "content".
>
> lazyloadpanel:content.AjaxFallbackDefaultDataTable
>
> Please help.
>
> Yazeed Isaacs - Java Developer
> yazeed@transactionjunction.co.za
>
>
>
> -----Original Message-----
> From: Yazeed Isaacs [mailto:Yazeed@transactionjunction.co.za]
> Sent: 10 November 2008 03:04 PM
> To: users@wicket.apache.org
> Subject: RE: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting and paging throws an IllegalStateException
>
> I understand that the markupid needs to be there in order for ajax to
> update the component.
>
> The component that it complains about is called "content" which is the
> inner content of the AjaxLazyLoadPanel.
>
> I have set the ajaxlazyloadpanel to setRenderBodyOnly(false) and
> setOutputMarkupId(true) and I did the same for the
> AjaxFallbackDefaultDataTable, but I still get the same error.
>
> This is my component layout:
>
> Form  -> AjaxButton
>        -> AjaxLazyLoadPanel returns AjaxFallbackDefaultDataTable
>
>
> Component id = content, page =
> za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
> 8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable
>
>
> Any ideas?
>
> Yazeed Isaacs - Java Developer
> yazeed@transactionjunction.co.za
>
>
>
> -----Original Message-----
> From: Ernesto Reinaldo Barreiro [mailto:reiern70@gmail.com]
> Sent: 06 October 2008 10:01 AM
> To: users@wicket.apache.org
> Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting and paging throws an IllegalStateException
>
> The problem is, as Igor pointed, you cannot re-render a component via
> AJAX
> if it has set setRenderBodyOnly(true)... Why?
> <div wicket:id="testAjax">
>  <p>Content...</p>
> </div>
>
> will be renderend as
>
> <p>Content...</p>
>
> instead of
>
> <div id="someid">
>  <p>Content...</p>
> </div>
>
> So, there is no way wicket AJAX js can replace the div with something
> else... Additionally you have to set setOutputMarkupId(true) on the
> component you want to replace..
>
> Ernesto
>
> On Mon, Oct 6, 2008 at 9:41 AM, Yazeed Isaacs <
> Yazeed@transactionjunction.co.za> wrote:
>
>> Hi Igor
>>
>> Here is the java code:
>>
>> add(new AjaxButton("ajaxSubmitButton", this) {
>>
>>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>>
>>                AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
>>                                "transactions") {
>>
>>                        private static final long serialVersionUID =
> 1L;
>>
>>                        @Override
>>                        public Component getLazyLoadComponent(String
> id)
>> {
>>
>>                                TransactionQuery transactionQuery = new
>> TransactionQuery();
>>
>>
>> transactionQuery.setCardNumber(cardNumberField
>>                                                .getInput());
>>
>> transactionQuery.setDateFrom(dateFromField
>>                                                .getInput());
>>
>> transactionQuery.setDateTo(dateToField.getInput());
>>
>> transactionQuery.setStoreId(storeIdsDropDownChoice
>>                                                .getInput());
>>                                transactionQuery
>>
>> .setTerminalId(terminalIdsDropDownChoice
>>
>> .getInput());
>>                                int transactionNumber = 0;
>>                                if (transNumberField.getInput() !=
> null)
>> {
>>                                        if
>> ((transNumberField.getInput().length() > 0))
>>                                                transactionNumber =
>> Integer
>>
>> .parseInt(transNumberField
>>
>> .getInput());
>>                                }
>>                                transactionQuery
>>
>> .setTransactionNumber(transactionNumber);
>>
>>
>>
>>                                AjaxFallbackDefaultDataTable results =
>> new AjaxFallbackDefaultDataTable(
>>                                                id,
>>                                                columns,
>>                                                new
>> SortableTransactionQueryResultsDataProvider(
>>
>> transactionQuery), 10);
>>
>>                                //
> transactions.setOutputMarkupId(true);
>>
>>                                results.setRenderBodyOnly(false);
>>
>>                                return results;
>>                        }
>>
>>                };
>>
>>                transactions.setRenderBodyOnly(false);
>>
>>                form.replace(transactions);
>>
>>                target.addComponent(transactions);
>>        }
>>
>> });
>>
>>
>>
>> HTML code:
>>
>> <table cellpadding="2" cellspacing="0" width="521"
>> wicket:id="transactions">
>>
>> </table>
>>
>>
>> I have tried playing around with the way I've implemented this, but I
>> keep on getting the same exception (java.lang.IllegalStateException)
>> when I sort a column or navigate to a page.
>>
>> Let me know what you think.
>>
>> Regards,
>> Yazeed Isaacs
>>
>>
>>
>> -----Original Message-----
>> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
>> Sent: 06 October 2008 09:31 AM
>> To: users@wicket.apache.org
>> Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
>> sorting and paging throws an IllegalStateException
>>
>> if i were you i would read the exception message, it is telling you
>> exactly what is going wrong...if you showed some code or provided a
>> quickstart we can help further.
>>
>> -igor
>>
>> On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
>> <Ya...@transactionjunction.co.za> wrote:
>> > Anybody?
>> >
>> > Guys please help me with this one.
>> >
>> >
>> >
>> > -----Original Message-----
>> > From: Yazeed Isaacs
>> > Sent: 03 October 2008 03:00 PM
>> > To: users@wicket.apache.org
>> > Subject: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting
>> and paging throws an IllegalStateException
>> >
>> > Hi
>> >
>> > I have an AjaxFallbackDefaultDataTable table and I am using an
>> AjaxLazyLoadPanel when rendering this table. When I click the
> AjaxButton
>> the table lazy loads.
>> >
>> > To summarize (in short) I have a AjaxButton that when clicked the
>> onSubmit() method creates the AjaxLazyLoadPanel, the
> AjaxLazyLoadPanel's
>> getLazyLoadComponent() method returns the AjaxFallbackDefaultDataTable
>> table. Therefore the AjaxLazyLoadPanel renders as the
>> AjaxFallbackDefaultDataTable table.
>> >
>> > The table lazy loads correctly, but when I click on a column in
> order
>> to sort it or click on the page navigation links, I get the following
>> error:
>> >
>> > java.lang.IllegalStateException: Ajax render cannot be called on
>> component that has setRenderBodyOnly enabled.
>> > ...
>> > Component id = content, page =
>> za.co.transactionjunction.transpector.pages.TransactionQueryPage, path
> =
>>
> 8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable
>> >
>> > Where transactions is the AjaxLazyLoadPanel.
>> >
>> > Am I missing something? Please help.
>> >
>> > Regards,
>> > Yazeed Isaacs
>> >
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: AjaxFallbackDefaultDataTable with ajax lazy loading - sorting and paging throws an IllegalStateException

Posted by Yazeed Isaacs <Ya...@transactionjunction.co.za>.
Hi Igor

I am still having a problem with the paging & sorting of the
AjaxFallbackDefaultDataTable when it is used within a LazyLoadPanel ie.
LazyLoadPanel.getLazyLoadComponent() returns the
AjaxFallbackDefaultDataTable.

The AjaxFallbackDefaultDataTable loads correctly within the
LazyLoadPanel, but when I sort a column or navigate to the next page,
the IllegalStateException is thrown and the error message is: Ajax
render cannot be called on component that has setRenderBodyOnly enabled
- Component id: "content".

lazyloadpanel:content.AjaxFallbackDefaultDataTable

Please help.

Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za



-----Original Message-----
From: Yazeed Isaacs [mailto:Yazeed@transactionjunction.co.za] 
Sent: 10 November 2008 03:04 PM
To: users@wicket.apache.org
Subject: RE: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting and paging throws an IllegalStateException

I understand that the markupid needs to be there in order for ajax to
update the component.

The component that it complains about is called "content" which is the
inner content of the AjaxLazyLoadPanel.

I have set the ajaxlazyloadpanel to setRenderBodyOnly(false) and
setOutputMarkupId(true) and I did the same for the
AjaxFallbackDefaultDataTable, but I still get the same error.

This is my component layout:

Form  -> AjaxButton
	-> AjaxLazyLoadPanel returns AjaxFallbackDefaultDataTable
  					
    
Component id = content, page =
za.co.transactionjunction.transpector.pages.TransactionQueryPage, path =
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable


Any ideas?

Yazeed Isaacs - Java Developer
yazeed@transactionjunction.co.za



-----Original Message-----
From: Ernesto Reinaldo Barreiro [mailto:reiern70@gmail.com] 
Sent: 06 October 2008 10:01 AM
To: users@wicket.apache.org
Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting and paging throws an IllegalStateException

The problem is, as Igor pointed, you cannot re-render a component via
AJAX
if it has set setRenderBodyOnly(true)... Why?
<div wicket:id="testAjax">
  <p>Content...</p>
</div>

will be renderend as

<p>Content...</p>

instead of

<div id="someid">
  <p>Content...</p>
</div>

So, there is no way wicket AJAX js can replace the div with something
else... Additionally you have to set setOutputMarkupId(true) on the
component you want to replace..

Ernesto

On Mon, Oct 6, 2008 at 9:41 AM, Yazeed Isaacs <
Yazeed@transactionjunction.co.za> wrote:

> Hi Igor
>
> Here is the java code:
>
> add(new AjaxButton("ajaxSubmitButton", this) {
>
>        protected void onSubmit(AjaxRequestTarget target, Form form) {
>
>                AjaxLazyLoadPanel transactions = new AjaxLazyLoadPanel(
>                                "transactions") {
>
>                        private static final long serialVersionUID =
1L;
>
>                        @Override
>                        public Component getLazyLoadComponent(String
id)
> {
>
>                                TransactionQuery transactionQuery = new
> TransactionQuery();
>
>
> transactionQuery.setCardNumber(cardNumberField
>                                                .getInput());
>
> transactionQuery.setDateFrom(dateFromField
>                                                .getInput());
>
> transactionQuery.setDateTo(dateToField.getInput());
>
> transactionQuery.setStoreId(storeIdsDropDownChoice
>                                                .getInput());
>                                transactionQuery
>
> .setTerminalId(terminalIdsDropDownChoice
>
> .getInput());
>                                int transactionNumber = 0;
>                                if (transNumberField.getInput() !=
null)
> {
>                                        if
> ((transNumberField.getInput().length() > 0))
>                                                transactionNumber =
> Integer
>
> .parseInt(transNumberField
>
> .getInput());
>                                }
>                                transactionQuery
>
> .setTransactionNumber(transactionNumber);
>
>
>
>                                AjaxFallbackDefaultDataTable results =
> new AjaxFallbackDefaultDataTable(
>                                                id,
>                                                columns,
>                                                new
> SortableTransactionQueryResultsDataProvider(
>
> transactionQuery), 10);
>
>                                //
transactions.setOutputMarkupId(true);
>
>                                results.setRenderBodyOnly(false);
>
>                                return results;
>                        }
>
>                };
>
>                transactions.setRenderBodyOnly(false);
>
>                form.replace(transactions);
>
>                target.addComponent(transactions);
>        }
>
> });
>
>
>
> HTML code:
>
> <table cellpadding="2" cellspacing="0" width="521"
> wicket:id="transactions">
>
> </table>
>
>
> I have tried playing around with the way I've implemented this, but I
> keep on getting the same exception (java.lang.IllegalStateException)
> when I sort a column or navigate to a page.
>
> Let me know what you think.
>
> Regards,
> Yazeed Isaacs
>
>
>
> -----Original Message-----
> From: Igor Vaynberg [mailto:igor.vaynberg@gmail.com]
> Sent: 06 October 2008 09:31 AM
> To: users@wicket.apache.org
> Subject: Re: AjaxFallbackDefaultDataTable with ajax lazy loading -
> sorting and paging throws an IllegalStateException
>
> if i were you i would read the exception message, it is telling you
> exactly what is going wrong...if you showed some code or provided a
> quickstart we can help further.
>
> -igor
>
> On Mon, Oct 6, 2008 at 12:04 AM, Yazeed Isaacs
> <Ya...@transactionjunction.co.za> wrote:
> > Anybody?
> >
> > Guys please help me with this one.
> >
> >
> >
> > -----Original Message-----
> > From: Yazeed Isaacs
> > Sent: 03 October 2008 03:00 PM
> > To: users@wicket.apache.org
> > Subject: AjaxFallbackDefaultDataTable with ajax lazy loading -
sorting
> and paging throws an IllegalStateException
> >
> > Hi
> >
> > I have an AjaxFallbackDefaultDataTable table and I am using an
> AjaxLazyLoadPanel when rendering this table. When I click the
AjaxButton
> the table lazy loads.
> >
> > To summarize (in short) I have a AjaxButton that when clicked the
> onSubmit() method creates the AjaxLazyLoadPanel, the
AjaxLazyLoadPanel's
> getLazyLoadComponent() method returns the AjaxFallbackDefaultDataTable
> table. Therefore the AjaxLazyLoadPanel renders as the
> AjaxFallbackDefaultDataTable table.
> >
> > The table lazy loads correctly, but when I click on a column in
order
> to sort it or click on the page navigation links, I get the following
> error:
> >
> > java.lang.IllegalStateException: Ajax render cannot be called on
> component that has setRenderBodyOnly enabled.
> > ...
> > Component id = content, page =
> za.co.transactionjunction.transpector.pages.TransactionQueryPage, path
=
>
8:transactionQueryForm:transactions:content.AjaxFallbackDefaultDataTable
> >
> > Where transactions is the AjaxLazyLoadPanel.
> >
> > Am I missing something? Please help.
> >
> > Regards,
> > Yazeed Isaacs
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


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