[Chameleon] Re: EMBEDDED (revisited)

Bart van den Eijnden bartvde at xs4all.nl
Fri Jun 4 02:51:47 EDT 2004


Hi Aaron,

this is probably not the easiest thing to do as a first widget adaptation 
:)

With the Locate widget, the popup is called Locate.phtml instead of 
LocatePopup.phtml.

So you will probably have the following in your template (besides the 
actual iframe itself for which I assume an id="locateframe" in my example):

<script>
function myOnLoad()
{
	CWC2OnLoadFunction();
	document.getElementById("locateframe").src = 
"[$gszCoreWebPath$]/widgets/Locate/Locate.		phtml?szCallbackFunc=LocateCB&sid=[$gszSessId$]";
	alert(document.getElementById("locateframe").src);
}
</script>

<body onload="myOnLoad()">

This way you can see whether or not the [$ $] values are filled in by 
Chameleon.

Best regards,
Bart

On Thu, 3 Jun 2004 22:12:31 -0400 (EDT), 
<griffin.watersheds.ca at mail2.storm.ca> wrote:

> This is my first attempt at changing a widget, i'm not really sure how to
> find out about the $gszSessId$ and so on.  I am using a pre-release of 
> the
> 1.99 Beta release.  Also, there is no locatePopup.phtml... does this
> change the steps you would need to take to make this work?
>
> How do i alert the src of the iframe with javascript?
>
> Thanks for any help you can offer.
>
> Aaron.
>
>> Hi Aaron,
>>
>> I don't see any reason why this would not be possible for the Locate
>> widget.
>>
>> Can you try and alert the src of the iframe with javascript at the end 
>> of
>> the OnLoad function? Are the $gszSessId$ etc. values filled in by the
>> application? Are you passing all the necessary parameters for the Locate
>> widget? And are you using Chameleon 1.99?
>>
>> Best regards,
>> Bart
>>
>>> Is it possible to do this for the locate widget?  I tried to do this
>>> using
>>> what you have provided, but all i get is a blank page?
>>>
>>> Aaron Griffin
>>>
>>> ----- Original Message -----
>>> From: "Bart van den Eijnden" <bartvde at xs4all.nl>
>>> To: <chameleon at lists.maptools.org>
>>> Sent: Wednesday, June 02, 2004 2:18 PM
>>> Subject: Re: [Chameleon] Re: EMBEDDED (revisited)
>>>
>>>
>>>> Final update on this one, if anybody in future wants to try this
>>>> approach
>>>> for embedding popup widgets:
>>>>
>>>> 1) I named my form (<form name="blabla">) and made all references in
>>>> the
>>>> popup refer to this named form (instead of document.forms[0])
>>>>
>>>> 2) I added the following to my application index.phtml just before the
>>>> CWCExecute call:
>>>>
>>>> $oApp->setVar( 'gszCoreWebPath', $_SESSION['gszCoreWebPath'] );
>>>> $oApp->setVar( 'gszSessId', $GLOBALS['gszSessId'] );
>>>>
>>>> 3) I added an iframe to my HTML template:
>>>>
>>>> <iframe frameborder="0" id="catalogframe" scrolling="No" width="600px"
>>>> height="450px" ></iframe>
>>>>
>>>> 4) I set the src of the iframe at the end of the OnLoad function (of
>>>> the
>>>> body in the HTML template), because otherwise the session is locked:
>>>>
>>>> document.getElementById("catalogframe"). src =
>>>>
>>> "[$gszCoreWebPath$]/widgets/GeoservicesCatalogSearch/CatalogSearchPopup.phtm
>>> l?szCallbackFunc=catalogSearchCB&szWcasURL=http://grosserver:8080/deegreewca
>>> s/wcas&iMaxRecords=10&sid=[$gszSessId$]&bEmbedded=1";
>>>>
>>>> 5) I also had to add the callback function to my template.
>>>>
>>>> 6) finally I implemented a widget attribute called EMBEDDED which will
>>>> determine the state of the widget, e.g. when it is embedded I cannot
>>>> use
>>>> "opener" in js, but I have to use "parent". Also the close button is
>>>> not
>>>> very functional in the EMBEDDED mode, so I made this depend on the
>>>> state
>>>> as well.
>>>>
>>>> Conclusion: it seemed simpler than it turned out to be :)
>>>>
>>>> Best regards,
>>>> Bart
>>>>
>>>> On Wed, 2 Jun 2004 10:40:26 +0200 (CEST), <bartvde at xs4all.nl> wrote:
>>>>
>>>> > Found it, or at least think I found it :)
>>>> >
>>>> > The popup was using a lot of document.forms[0] statements, and
>>>> ofcourse
>>>> > this is now referring to the main form in the template, i.e. to the
>>> wrong
>>>> > form.
>>>> >
>>>> > I will change all this to {$this->mszHTMLForm}. Do I need to set
>>> anything
>>>> > else Paul?
>>>> >
>>>> > Best regards,
>>>> > Bart
>>>> >
>>>> >> Hi Paul,
>>>> >>
>>>> >> We started trying the iframe option today but ran into some trouble
>>>> for
>>>> >> which we cannot find the cause.
>>>> >>
>>>> >> This is the iframe we use in the HTML template:
>>>> >> <iframe frameborder="0" id="treeview" scrolling="No" width="330px"
>>>> >> height="335px"
>>>> >>
>>> src="[$gszCoreWebPath$]/widgets/GeoservicesCatalogSearch/CatalogSearchPopup.
>>> phtml?szCallbackFunc=catalogSearchCB&szWcasURL=http://grosserver:8080/deegre
>>> ewcas/wcas&iMaxRecords=10&<?php
>>>> >> echo SID; ?>/>" ></iframe>
>>>> >>
>>>> >> E
>>> verything is loaded probably (except css and buttonized buttons), but
>>>> >> all
>>>> >> things in the popup which use the session are empty strings (the
>>>> popup
>>>> >> includes the session.inc though), e.g.:
>>>> >>
>>>> >> <script language="JavaScript" src="<?php echo
>>>> >> $_SESSION['gszCoreWebPath'];
>>>> >> ?>/widgets/js/cwc_dhtml.js"></script>
>>>> >>
>>>> >> is resolved into:
>>>> >>
>>>> >> <script language="JavaScript"
>>>> src="/widgets/js/cwc_dhtml.js"></script>
>>>> >>
>>>> >> I hope you have some idea on what is causing this?
>>>> >>
>>>> >> Thanks in advance.
>>>> >>
>>>> >> Best regards,
>>>> >> Bart
>>>> >>
>>>> >
>>>> > _______________________________________________
>>>> > Chameleon mailing list
>>>> > Chameleon at lists.maptools.org
>>>> > http://lists.maptools.org/mailman/listinfo/chameleon
>>>> >
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> _______________________________________________
>>>> Chameleon mailing list
>>>> Chameleon at lists.maptools.org
>>>> http://lists.maptools.org/mailman/listinfo/chameleon
>>>>
>>>
>>
>> _______________________________________________
>> Chameleon mailing list
>> Chameleon at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/chameleon
>>
>
>
>



-- 
  


More information about the Chameleon mailing list