[Chameleon] Re: Tutorial Developing new chameleon Widget - Problem
Ines
mleonsoft at yahoo.com.ar
Tue Oct 24 10:12:58 EDT 2006
Jacob, thank you very much for your help.
I fixed the error but I have another error:
function GetJavascriptOnLoadFunctions()
{
// init vars
$aReturn = parent::GetJavascriptOnLoadFunctions();
// show report
$aReturn['showReport'] = "showReport();\n"; ------------------> Error in
this line
// return
return $aReturn;
}
ERROR:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in
D:\ms4w\apps\wmsviewer\htdocs\widgets\UUW\UUW.widget.php on line 194
The function GetJavascriptFunctions():
function GetJavascriptFunctions()
{
// init vars
// $aReturn = parent::GetJavascriptFunctions();
// show the report
$szShowReport =
strlen($this->mszReport)>0?"alert('".$this->mszReport."')":"";
$szJsFunctionName = "showReport";
$szFunction = <<<EOT
function {$szJsFunctionName}()
{
{$szShowReport};
return true;
}
EOT;
$aReturn[$szJsFunctionName]=$szFunction;
// return
return $aReturn;
// end GetJavascriptFunctions() function
}
Thanks every body for your help.
Ines
-----Mensaje original-----
De: Delfos, Jacob [mailto:Jacob.Delfos at maunsell.com]
Enviado el: lunes, 23 de octubre de 2006 20:32
Para: Ines
CC: chameleon at lists.maptools.org
Asunto: RE: [Chameleon] Re: Tutorial Developing new chameleon Widget -
Problem
Ines,
This error can happen if you have spaces after "<<<EOT" (which it seems like
you do). Try to remove them.
Also, I see you have declarations like:
$aReturn$szJsFunctionName = $szFunction;
This should be:
$aReturn[$szJsFunctionName] = $szFunction;
Hope that fixes things.
Jacob
» -----Original Message-----
» From: chameleon-bounces at lists.maptools.org
» [mailto:chameleon-bounces at lists.maptools.org] On Behalf Of
» Paul Spencer
» Sent: 24 October 2006 06:49
» To: Ines
» Cc: chameleon at lists.maptools.org Users
» Subject: [Chameleon] Re: Tutorial Developing new chameleon
» Widget - Problem
»
» Ines,
»
» please use the mailing list to ensure maximum chance of getting a
» useful response.
»
» I know that there were some bugs in that code, and it seems to me
» that this was one of them but I don't recall the resolution.
» Hopefully someone else does!
»
» Cheers
»
» Paul
»
» On 23-Oct-06, at 11:20 AM, Ines wrote:
»
» > Hello, Paul Spencer, I'm trying to make my own widget whit this
» > tutorial:
» > http://chameleon-tiki.maptools.org/tiki-index.php?page=Developing+a
» > +new+Chameleon+Widget
» >
» > But I have some problem, when I add this code in the
» > GetJavascriptFunctions(): Can you help me please?
» >
» > // show the report
» > $szShowReport = strlen( $this->mszReport ) > 0?"alert('".$this-
» > >mszReport."')":"";
» > $szJsFunctionName = "showReport";
» > $szFunction = <<<EOT
» > --------------------------------------------------->ERROR
» in this line
» > function {$szJsFunctionName}()
» > {
» > {$szShowReport};
» > return true;
» > }
» > EOT;
» > $aReturn$szJsFunctionName = $szFunction;
» >
» > The error says:
» > Parse error: parse error, unexpected T_SL in D:\ms4w\apps\wmsviewer
» > \htdocs\widgets\UUW\UUW.widget.php on line 342
» >
» > This is my complete "GetJavascriptFunctions() " in UUUW.widget.php:
» >
» >
» > function GetJavascriptFunctions()
» > {
» > // init vars
» > $aReturn = parent::GetJavascriptFunctions();
» >
» > // show the report
» > $szShowReport = strlen( $this->mszReport ) >
» > 0?"alert('".$this->mszReport."')":"";
» > $szJsFunctionName = "showReport";
» > $szFunction = <<<EOT
» > function {$szJsFunctionName}()
» > {
» > {$szShowReport};
» > return true;
» > }
» > EOT;
» > $aReturn$szJsFunctionName = $szFunction;
» >
» >
» > // return
» > return $aReturn;
» >
» > // end GetJavascriptFunctions() function
» > }
» >
» >
» > Can You help me width this? Thank You very much
» >
» > Ma. Inés Etchichury - Argentina
» >
» >
»
» +-----------------------------------------------------------------+
» |Paul Spencer pspencer at dmsolutions.ca |
» +-----------------------------------------------------------------+
» |Chief Technology Officer |
» |DM Solutions Group Inc http://www.dmsolutions.ca/ |
» +-----------------------------------------------------------------+
»
»
»
»
»
» _______________________________________________
» Chameleon mailing list
» Chameleon at lists.maptools.org
» http://lists.maptools.org/mailman/listinfo/chameleon
»
More information about the Chameleon
mailing list