[Chameleon] 1 on n widget parameters

Jacob Delfos jacob.delfos at maunsell.com
Tue Dec 21 18:44:51 EST 2004


Are you sure you can set the SRC of a DIV? I thought traditionally, that should not be possible.... I use IFRAME for this purpose. Something from my dusty dhtml memory tells me that the SRC of a DIV is only supported in either mozilla or explorer....... but I could be wrong.

Just as a thought on the side, you could place your URL values in a javascript array, and on the loading of the page, you can load these values into your popup dynamically. Seems cleaner than putting them all in the URL of the popup.



-----Original Message-----
From: chameleon-bounces at maptools.org [mailto:chameleon-bounces at maptools.org] On Behalf Of Paul Spencer
Sent: 21 December 2004 21:14
To: bartvde at xs4all.nl
Cc: chameleon at maptools.org
Subject: Re: [Chameleon] 1 on n widget parameters


passing multiple values for the same attribute in a url can be 
accomplished in several ways:

1. multiple identical keys


PHP will only see the first value in $_GET/$_POST/$_REQUEST so you have 
to inspect the $_SERVER array and parse the values manually

2. multiple identical keys as an array


This is a convenience method that PHP provides, any attribute that ends 
in [] coming from POST or GET will be interpreted as an array of values 
in $_GET/$_POST/$_REQUEST.  In this case, you would be able to access 
your values from

$_GET['szWcasURL'][0] and $_GET['szWcasURL'][1]

3. multiple values from the same key


use some separator that is not valid in a URL then use:

$aszWcasURL = explode( "|", $_GET['szWcasURL'] );

If you are using Popup.php to generate the popup link, you should 
probably use #3 above.  If you are crafting your own URL for the popup, 
then #2 is probably slightly more efficient as PHP will parse the 
headers into an array automagically.

My idea to change all popups to "popins" would not change this, you 
still need to craft an appropriate URL for this.



bartvde at xs4all.nl wrote:
> Hello list,
> for embedding a widget into my main page (instead of a popup) I use a div
> for which after the page load I put the src to the ...Popup.phtml file of
> a widget, e.g.:
>  function myOnLoad()
>  {
>   pageLoaded = true;
>      CWC2OnLoadFunction();
>   document.getElementById("catalogframe"). src =
> "/chameleon/widgets/GeoservicesCatalogSearch/CatalogSearchPopup.phtml?szCallbackFunc=catalogSearchCB&szWcasURL=http://geoservice1-agi.minvenw.nl:8080/deegreewcas/wcas&iMaxRecords=10&sid=[$gszSessId$]&bEmbedded=1&szMapviewerURL="+MapviewerURL+"&szMapviewerLiteURL="+MapviewerLiteURL;
>     }
> Now I wanted to change this approach to incorporate a 1 to n parameter (I
> now have one WCASURL, but I need n). For widgets it is possible to define
> parameters which are children of the widget CWC2 tag (1 to n parameters).
> How does this work in Chameleon when these "arrays" need to be passed over
> the URL to the popup.phtml page? Are there examples of this? Or can a
> popup.phtml page also access the widget params through another way? How
> would one go about this?
> I remember Paul mentioning a different approach to this embedding popups
> problem by changing Popup.php to use div's inside the page. Would that
> approach solve my problem described above or would I still have a problem
> with 1 to n widget params?
> Hope the e-mail is still clear :), must sound a bit vague ....
> Thanks in advance,
> Bart
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

|Paul Spencer                           pspencer at dmsolutions.ca   |
|Applications & Software Development                              |
|DM Solutions Group Inc                 http://www.dmsolutions.ca/|
Chameleon mailing list
Chameleon at lists.maptools.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20041222/a5a77ed9/attachment.html

More information about the Chameleon mailing list