You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa Gomez" <da...@xsall.nl> on 2003/12/01 18:32:07 UTC

[Script] Static-binding and ,s in a string

Hi,

I'm experiencing a bit of a js challenge that is keeping me wrongfooted 
for the moment.
The situation is as follows:
- All js functions and parameters are 'stored' in a hidden frame on the 
client (call it a lib if you wish).
  This allows me to do not only normal stuff but I can also do things 
that would otherwise not be possible if the js were in the html page 
itself & it keeps my html file clean.
- There is a page with a js-popup link (used for informational purposes) 
that works totally fine as long as the window-properties are defined in 
the .script (which is loaded at startup).

For one reason or the other I cannot get the following line into the 
generated html page:
.jwc ...
<parameter name="popupOnClick" type="java.lang.String" required="yes" 
direction="custom" />

.page ...
<static-binding 
name="popupOnClick">parent.frmScripts.processLinkPopup(self, this.href, 
"AveragePriceComposition","", 
"resizable=yes,scrollbars=yes,top=100,left=100,height=236,width=382"); 
return false;</static-binding>

.script ...
        var _popWindowProperties 
="resizable=no,scrollbars=yes,top=100,left=100,height=681,width=382";
       
        /**
         * This function takes care of processing the selected object 
and readying the proper object on the server for further processing
         *
         * @param targetFrame = the window containing the page that has 
to be refreshed/ reloaded/ replaced
         * @param loadURL = is the actual url that has to refill the 
window (basically points to the object required). Used in Object 
specific cases
         * @param popupPagename = contains the name of the Tapestry page 
to be shown in the popup window
         * @param showDetailURL =  is the url to the page which is to 
show in the detailpage to be popped-up
         * @param windowProperties = the carrier for the properties of 
the window to be popped up (default in _popWindowProperties)
         */
        function processLinkPopup(targetFrame, loadURL, popupPageName, 
showDetailURL, windowProperties)  {
            if (windowProperties) _popWindowProperties = windowProperties;
            (showDetailURL=="" ) ? _pop2URL = _popURL+popupPageName 
:_pop2URL = showDetailURL;
            _pop = true;
            targetFrame.location.href = loadURL;
        }

All runs fine as long as I use the default. For one reason or the other 
it does not like the static-binding line in the .page.

Do I need escape characters (or something) to make it work *or* does 
someone have a much more elegant solution to the problem?
Looking at Tapestry there probably is but it hasn't 'shown' itself to me 
yet :-(
Any takers?

TIA,
Fermin DCG


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org