A couple of script questions:

1. A number of personal firewalls (ie ZoneAlarm) now offer popup blocking.
This feature disables <body onload> and prevents Tapestry from completing
script initializations.  There are ways to get around this problem
(http://www.projectseven.com/faqbase/faqs/faq18.asp?cat=-1&ts=body+onload&pg
=1&id=18), but they don't seem to fit well into Tapestry's scripting
environment.  Any practical suggestions on how this problem might be
addressed in the "Tapestry way".  Even better would be a native framework
solution that would avoid this problem.

2. Is there some way to include a global variable declaration in the .script
or am I stuck with including it in a .js (the only way I have found to make
it work so far)?  In case I haven't made myself clear, my script contains
code that allows it to track a menu item's state and reset it on the next
click.

=========== partial contents of my.script:

<include-script resource-path="my.js" />

<let key="item">
  document.${itemName}
</let>

function ${onMouseClickName}()
{
  <!-- reset remembered image object -->
  if (resetItem != undefined) {
    resetItem.src = resetItem.defaultimage;
  }

  <!-- change state of image object -->
  $(item).src = ${item}.selectimage;

  <!-- remember image object for next time -->
  resetItem = ${item}
}

function ${onLoadName}()
{
  <!-- have image remember various states -->
  ${item}.src = ${defaultImageURL};
  ${item}.defaultimage = ${defaultImageURL};
  ${item}.selectimage = ${selectImageURL};
}

=========== contents of my.js:

<!-- its lonely in here -->
var resetItem;





-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
Tapestry-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/tapestry-developer

Reply via email to