15 messages in org.netbeans.nbusersRe: [nbusers] Woodstock Calendar spee...
FromSent OnAttachments
Andreas HesseSep 5, 2008 5:00 am 
Andreas HesseSep 5, 2008 6:53 am 
Nick BeareSep 9, 2008 1:54 am 
Andreas HesseSep 9, 2008 4:20 am 
Nick BeareSep 9, 2008 7:55 am 
Andreas HesseSep 12, 2008 3:11 am.jpg
Andreas HesseSep 12, 2008 4:42 am 
Nick BeareSep 12, 2008 10:21 am 
Nick BeareSep 17, 2008 8:36 am 
Nick BeareSep 17, 2008 9:30 am 
qwertyqwertyOct 7, 2008 10:27 am 
Nick BeareOct 8, 2008 1:50 am 
qwertyqwertyOct 8, 2008 2:26 am 
Andreas HesseOct 8, 2008 3:23 am 
Nick BeareOct 8, 2008 4:13 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [nbusers] Woodstock Calendar speedup? Workaround foundActions
From:Andreas Hesse (andr@bvu.de)
Date:Sep 12, 2008 3:11:09 am
List:org.netbeans.nbusers
Attachments:

Hi all,

After spending some time with the woodstock calendar component i finally found a good workaround (at least for me).

First of all you should know that the performance degradation of the Woodstock calendar could easily be traced back to the integrated datepicker. To give it a try just disable the datepicker by invalidating it's used HTML-Template (for example in the prerender() function of the page):

mycal.getDatePicker().setHtmlTemplate("NONE");

The rendered page loads faster now but you'll miss the fool-proved datepicker widget. As user are usually fools ;-) you can/should add another (quicker/better) javascript based datepicker to the component. I decided to use the 'Javascript Advanced Calendar Script (JACS) by Anthony Garrett' (s. http://www.garrett.nildram.co.uk/calendar/jacs.htm ). See the attached picture for the results..

Read on to get know howto exchange the datepicker of the woodstock calendar component:

1) Get a javascript based HTML-Calendar widget script that fits your needs (We'll use jacs.js in this example) and include it in your page by using the JPS script tag:

<webuijsf:script id="js_jacs" url="/my/path/under/web_pages/jacs.js"/>

2) In NB's Project tab goto the Libraries folder and open the "Web UI Default Theme - webui-jsf-suntheme.jar" - Library Make a copy of "com/sun/webui/jsf/suntheme4_2-080320/templates/calendarField.html" and store it as somewhere in your packages as for e.g. "myCalField.html".

3) In your copy ("myCalField.html") modify the content of the TD-tag for the calendar in the following way:

<!-- Table cell for the calendar --> <td class="myCalPopup" onclick="JACS.show(document.getElementById(this.parentNode.parentNode.parentNode.id+'_field'),event);"> <div dojoAttachPoint="linkContainer" valign="top"> <div dojoAttachPoint="calendarContainer"/> </div> </td>

(Note that the getElementById() call passes the corresponding input-Control to the show() function! ) 4) Add following code to the prerender() function of the page (mycal is the calendar component):

mycal.setHtmlTemplate("/my/path/in/package/myCalField.html"); mycal.getDatePicker().setHtmlTemplate("NONE");

5) Add the following class to your stylesheet that is included in your page:

.myCalPopup{ background-image: url(<<APPNAME>>/theme/com/sun/webui/jsf/suntheme4_2-080320/images/other/combinedImage.png ); background-position: 0px -810px; width: 20px; height: 20px; position:relative; left: 10px; }

NOTE: You have to exchange <<APPNAME>> with the context path of your app (e.g. "/myApp" - see Project settings->run). This CSS-Class is used to display the image which is used for invoking the datepicker.

6) Build, run, enjoy. If it doesn't work doublecheck that your browsercache is cleared. It'a good idea to use a tool like the "webdeveloper toolbar" for problem investigation (and disabling of caching).

Fortunately we use an derivation of the original calendar class (to archive a better, homegrown converter) in our pages. For this reason we didn't need to modify the prerender() on each page. We just added the two lines (from step four above) to the constructor method of our Calendar class and we were done.

Enjoy and thank Anthony Garrett for this great datepicker!

Andreas

Nick Beare wrote:

Andreas,

Sounds like you are really up against it. I have the luxury of one smallish app used for internal purposes and I have really been 'prototyping' the technologies before we start using them in our products.

I am going with the calendar for now until 'The Announcement' is made.

As a bit of an aside, I have just started using page validation. It looks very pretty and is a really cool idea, however, I suspect that too is spanking the performance!

Good luck with your calendar.js tweaking/tuning and your CEO!

-----Original Message----- From: Andreas Hesse [mailto:andr@bvu.de] Sent: 09 September 2008 12:21 To: nbus@netbeans.org Subject: Re: [nbusers] Woodstock Calendar speedup?

Hej Nick,

see my comments inline, please.

Nick Beare wrote:

Andreas,

I am in the same boat as you, having 4 calendar components on one page.

I got some tuning hints from an ex-sun employee (Richard Ratta) recently regarding playing about with the loading schemes which I tried, but to be honest each combination made little difference.

See my post and Richard's response:-

http://www.nabble.com/Loading-speed-of-Calendar-Component-to19179580.html#a1

9289095

I already noticed that you're on this leaking (don't wanna use 'sinking' yet) woodstock ship too. As i am an advanced Googler, i already stumbled over your postings in the net.java.dev.woodstock.dev mailinglist. Like you, i unsuccessfully played around with the attributes of the head tag to get some better loading performance.

I did not try tuning the calendar.js file as Richard suggested, as I want

to

use components 'out-of-the-box'.

That's on of the things i'm going to try next. One idea would be to use another free javascript calendar for the datepicker.

I am now considering whether to drop VW JSF/Woodstock in favour of a more performant framework/component library.

Unfortunately, i don't have this option. We just migrated our VWP / NB5.5 WebApp to NB6 with Woodstock components and don't have any resources left for another time-consuming framework change. (Besides that my gangleader (aka 'CEO') would explode when i suggest that. I had to beg over half a year to get a permission for that @#!*+ Woodstock-migration. and now that performance desaster ....aaaarrg!)

I had a look at the MyFaces example of their equivalent component :- http://www.irian.at/myfacesexamples/calendar.jsf (has 2 calendar controls on it).

But that seemed just as slow. I haven't tried IceFaces or Rich Faces. Another alternate would be to

resort

to JavaScript (again an option I am not keen on).

Sun have stated they are about to make an announcement regarding the

future

Well, if 'Project Woodstock' dies, we would of course (have to) change the underlaying framework of our webapp. But i'm not really keen on that.

Also there seems to be a number of ex-Sun-Woodstock employees about, which doesn't bode well! Another here... http://blogs.sun.com/winston/entry/my_last_blog_as_a

I already red that blog-entry due to your posting in the "VWP and Woodstock"-Thread. Winston's leaving is really a great leakage for the NB and Woodstock community, i think.

I would be interested to hear how you get on as we seem to have the same problem.

I, see you're true fan of horror stories. ;) I'll repost till the end of week. That's my definitive deadline for an (alternative) solution.

Good luck with your endeavours.

Same to you - we need it.