[Chameleon] Re: EMBEDDED (revisited)

Bart van den Eijnden bartvde at xs4all.nl
Wed Jun 2 14:18:57 EDT 2004


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.phtml?szCallbackFunc=catalogSearchCB&szWcasURL=http://grosserver:8080/deegreewcas/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/deegreewcas/wcas&iMaxRecords=10&<?php
>> echo SID; ?>/>" ></iframe>
>>
>> Everything 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
>



-- 
  


More information about the Chameleon mailing list