Re: Render large page

2010-03-15 Thread Dariusz Majewski
Hi,

   Actually Dmitry is right that javascript variables are invalid. They
cannot contain '-' character and error that is shown when they do is exactly
SyntaxError: missing ; before
statement. I've happend to have similiar issue. This is because tapestry
adds '-' + random number to generated client ids during ajax request. You
propably could still use RoundCornerContainer component you just have to
change your code to remove '-' from client id's for example
   pageRenderSupport.addScript(
var %s = new Ck.Rounded('%s', '%s', '%s',
'%s', '%s');,

 getClientId().replace(-,), getClientId(), bgcolor, fgcolor, size,
renderPart);

Above should fix the problem.

Kind Regards,
Dariusz

On Sat, Mar 6, 2010 at 7:38 AM, Henry Chen hc...@peacocknine.com wrote:


 The variables are valid. The problem is both Confirm and
 RoundCornerContainer
 components use prototype to manipulate the html. I ended up replacing those
 component with some simple js functions and problem solved.
 --
 View this message in context:
 http://n2.nabble.com/Render-large-page-tp4677583p4685449.html
 Sent from the Tapestry Users mailing list archive at Nabble.com.

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




Re: Render large page

2010-03-05 Thread Henry Chen

This is great! I'm going to upgrade to 5.1 first and then try this
ProgressDisplay component. Thank you.
-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4681697.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Render large page

2010-03-05 Thread Henry Chen

OK. I've upgraded to 5.1.0.5 and wrapped each topic with ProgressiveDisplay
component. When the page is loaded, it shows all the Loading... text but
now I have another problem. The ProgressiveDisplay is inside a loop
component like below.

t:loop source=subtopics value=subtopic index=subtopicIdx
t:ProgressiveDisplay   
   div id=post_${subtopic.id}
   detail of this subtopic ...
   /div
/t:ProgressiveDisplay   
/t:loop

The Loading... goes forever and I get a bunch of error messages in the
console shown below.

Communication with the server failed: Render queue error in
SetupRender[Discussion:loop_0]: Failure reading parameter 'source' of
component Discussion:loop_0:
org.apache.tapestry5.ioc.internal.util.TapestryException

I've tried making the subtopics persist which didn't help. Can you help
me? Thanks a lot!


-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4682462.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Render large page

2010-03-05 Thread Henry Chen

I just figured it out. The error was caused by a nested loop component in the
ProgressiveDisplay and was not set to persist.
-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4682975.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Render large page

2010-03-05 Thread Henry Chen

Thanks. The contents are now ajax loaded as expected :) except one small
thing. I used RoundCornerContainer component and confirm mixin inside the
ProgressDisplay component. Both of them inject javascripts.  It looks like
the javascripts are generated correctly in the response but was not handled
at all by the browser. Is there something I missed? Below is the code from
RoundCornerContainer.

void afterRender(MarkupWriter writer)
{
writer.end();
pageRenderSupport.addScript(var %s = new Ck.Rounded('%s', 
'%s', '%s',
'%s', '%s');,

getClientId(), getClientId(), bgcolor, fgcolor, size, renderPart);
pageRenderSupport.addScript(%s.round();, getClientId());
}



-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4683503.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Render large page

2010-03-05 Thread Howard Lewis Ship
That should work; what errors are you seeing on the client side?

On Fri, Mar 5, 2010 at 1:17 PM, Henry Chen hc...@peacocknine.com wrote:

 Thanks. The contents are now ajax loaded as expected :) except one small
 thing. I used RoundCornerContainer component and confirm mixin inside the
 ProgressDisplay component. Both of them inject javascripts.  It looks like
 the javascripts are generated correctly in the response but was not handled
 at all by the browser. Is there something I missed? Below is the code from
 RoundCornerContainer.

        void afterRender(MarkupWriter writer)
        {
                writer.end();
                pageRenderSupport.addScript(var %s = new Ck.Rounded('%s', 
 '%s', '%s',
 '%s', '%s');,
                                                                        
 getClientId(), getClientId(), bgcolor, fgcolor, size, renderPart);
                pageRenderSupport.addScript(%s.round();, getClientId());
        }



 --
 View this message in context: 
 http://n2.nabble.com/Render-large-page-tp4677583p4683503.html
 Sent from the Tapestry Users mailing list archive at Nabble.com.

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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: Render large page

2010-03-05 Thread Henry Chen

I got this error.

Client exception processing response: SyntaxError: missing ; before
statement
-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4684254.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Render large page

2010-03-05 Thread Howard Lewis Ship
http://www.catb.org/esr/faqs/smart-questions.html

On Fri, Mar 5, 2010 at 3:48 PM, Henry Chen hc...@peacocknine.com wrote:

 I got this error.

 Client exception processing response: SyntaxError: missing ; before
 statement
 --
 View this message in context: 
 http://n2.nabble.com/Render-large-page-tp4677583p4684254.html
 Sent from the Tapestry Users mailing list archive at Nabble.com.

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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: Render large page

2010-03-05 Thread Henry Chen

Sorry, I edited it later but looks like it only saved on Nabble. Here is the
complete post.


I got this error.

Client exception processing response: SyntaxError: missing ; before
statement

Below is the script section from one of the ajax response.


script:new Confirm('eventlink_2-12730bcfdc5', 'Are you sure you want to
delete this subtopic and its responses?');\nvar src-12730bcfdc5 = new
Ck.Rounded('src-12730bcfdc5', '#FF', '#F8F1E4', 'big',
'both');\nsrc-12730bcfdc5.round();\n


The error occurred when executing the following code.

Tapestry.ScriptManager.addScripts(reply.scripts,
function()
{
callback.call(this);

// After the callback updates the DOM
// (presumably), continue on with
// evaluating the reply.script
// and other final steps.

if (reply.script) eval(reply.script);  -- exception

Tapestry.onDomLoadedCallback();

}); 
-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4684690.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Render large page

2010-03-05 Thread Howard Lewis Ship
Looks like some of the ChenilleKit code is unhappy to run inside an
Ajax update; I'm not sure why.

On Fri, Mar 5, 2010 at 6:20 PM, Henry Chen hc...@peacocknine.com wrote:

 Sorry, I edited it later but looks like it only saved on Nabble. Here is the
 complete post.


 I got this error.

 Client exception processing response: SyntaxError: missing ; before
 statement

 Below is the script section from one of the ajax response.

 
 script:new Confirm('eventlink_2-12730bcfdc5', 'Are you sure you want to
 delete this subtopic and its responses?');\nvar src-12730bcfdc5 = new
 Ck.Rounded('src-12730bcfdc5', '#FF', '#F8F1E4', 'big',
 'both');\nsrc-12730bcfdc5.round();\n
 

 The error occurred when executing the following code.

 Tapestry.ScriptManager.addScripts(reply.scripts,
                function()
                {
                    callback.call(this);

                    // After the callback updates the DOM
                    // (presumably), continue on with
                    // evaluating the reply.script
                    // and other final steps.

                    if (reply.script) eval(reply.script);  -- exception

                    Tapestry.onDomLoadedCallback();

                });
 --
 View this message in context: 
 http://n2.nabble.com/Render-large-page-tp4677583p4684690.html
 Sent from the Tapestry Users mailing list archive at Nabble.com.

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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: Render large page

2010-03-05 Thread Dmitry Gusev
May this be because of invalid js variable name (src-...)?

2010/3/6, Henry Chen hc...@peacocknine.com:

 Sorry, I edited it later but looks like it only saved on Nabble. Here is the
 complete post.


 I got this error.

 Client exception processing response: SyntaxError: missing ; before
 statement

 Below is the script section from one of the ajax response.

 
 script:new Confirm('eventlink_2-12730bcfdc5', 'Are you sure you want to
 delete this subtopic and its responses?');\nvar src-12730bcfdc5 = new
 Ck.Rounded('src-12730bcfdc5', '#FF', '#F8F1E4', 'big',
 'both');\nsrc-12730bcfdc5.round();\n
 

 The error occurred when executing the following code.

 Tapestry.ScriptManager.addScripts(reply.scripts,
 function()
 {
 callback.call(this);

 // After the callback updates the DOM
 // (presumably), continue on with
 // evaluating the reply.script
 // and other final steps.

 if (reply.script) eval(reply.script);  -- exception

 Tapestry.onDomLoadedCallback();

 });
 --
 View this message in context:
 http://n2.nabble.com/Render-large-page-tp4677583p4684690.html
 Sent from the Tapestry Users mailing list archive at Nabble.com.

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



-- 
Отправлено с моего мобильного устройства

Dmitry Gusev

AnjLab Team
http://anjlab.com

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



Re: Render large page

2010-03-05 Thread Henry Chen

The variables are valid. The problem is both Confirm and RoundCornerContainer
components use prototype to manipulate the html. I ended up replacing those
component with some simple js functions and problem solved.
-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4685449.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Render large page

2010-03-04 Thread Henry Chen

Hi, I'm using Tapestry 5.0.18. I have a big thread page that shows more than 
1000 responses. Now the problem is all major browsers (IE, FF, Safari) load
the page after the entire page is received. It is too long to wait. Is there
a way I can output the response gradually? Any help will be highly
appreciated. (Please understand that I can't do paging in this case due to
client's request)

-- 
View this message in context: 
http://n2.nabble.com/Render-large-page-tp4677583p4677583.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

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



Re: Render large page

2010-03-04 Thread Thiago H. de Paula Figueiredo
I would try loading the thread comments via AJAX in batches of 50 or some  
other number.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.

http://www.arsmachina.com.br

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



Re: Render large page

2010-03-04 Thread Howard Lewis Ship
The ProgressiveDisplay component is your friend here, but I can't
remember if that was available in 5.0 or introduced in 5.1.

On Thu, Mar 4, 2010 at 2:19 PM, Thiago H. de Paula Figueiredo
thiag...@gmail.com wrote:
 I would try loading the thread comments via AJAX in batches of 50 or some
 other number.

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
 instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

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





-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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