Armin? Could you please help me? Do you have any idea what is wrong in my
code?

Regards,

Andreas



Andreas P. wrote:
> 
> Dear Armin,
> Dear All,
> 
> I am writing again to this topic and I would like to have some help in
> order to integrate the calendar to the new version.
> 
> In map.phtml, the code for the calendar (Javascript) is the following:
> 
> 
> <!-- Reference Map -->
>         
>             <div id="refmap" class="refmap" style="width:210px;
> height:180px" >
>             
>             <div style="float: left;" id="calendar-container"></div>
> 
> <script type="text/javascript">
> 
>   function dateChanged(calendar) {
>       if (calendar.dateClicked) {
>       
>       var Y = calendar.date.getFullYear();
>       var m = calendar.date.getMonth();     // integer, 0..11
>       var d = calendar.date.getDate();      // integer, 1..31
>       
>       var l = calendar.date.print("%Y/%m/%d");
>       
>       var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&date='+l;
>       PM.Map.updateMap(mapurl, '');
>    }
> };
> 
>   Calendar.setup(
>     {
>       date         : '<?php echo ($_SESSION['date']) ?>',
>       flat         : "calendar-container",
>       flatCallback : dateChanged
>     }
>   );
> </script>
>             
> </div>        
> 
> 
> The same code (without "PM.Map" when calling updateMap(mapurl)) is in
> previous version of pmapper.
> 
> Here, v.4, the calendar is displayed very well, but it can not be
> connected with the MySQL database, as in previous version. Is there
> anything wrong? I repeat, that I use the same files (javascripts and css)
> in both version and the code with a small change. In the previous version,
> the calendar is connected with the MySQL DB from where I use data. In v.4,
> this cannot be done.
> 
> Any help?
> 
> Thank you in advance!
> 
> 
> Andreas
> 
> 
> 
> Armin Burger-2 wrote:
>> 
>> p.mapper v4 has nearly no global Javascript functions any more. This 
>> avoids conflicts with a user defined function overwriting existing ones 
>> when having the same name. All functions are encapsulated in their 
>> static class and namespace.
>> 
>>  From outside the class you have therefore to call the functions with 
>> the namespace prefix. In your case this would be
>> 
>> PM.Map.updateMap(mapurl, '');
>> 
>> because the function is declared in the class Map which is a child of 
>> PM. This is for all calls to existing functions (except the remaining 
>> very few global ones, like '_p()').
>> 
>> Armin
>> 
>> On 10/07/2009 13:45, Andreas P. wrote:
>>> Hello Armin and all,
>>> 
>>> I would like to call functions showloading() and updateMap(mapurl) from
>>> map.phtml.
>>> 
>>> How I can do so? I would like to call these two functions from map.phtml
>>> as
>>> I have integrated a javascript calendar in div section of Reference Map.
>>> I
>>> have done the same in v.3.2 and I was able to call them as they are
>>> (showloading() , updateMap(mapurl)).
>>> 
>>> Unfortunately, I can't do the same in v.4
>>> 
>>> Here is my code in v.3.2 that works fine: 
>>> 
>>> <script type="text/javascript">
>>> 
>>>   function dateChanged(calendar) {
>>>       if (calendar.dateClicked) {
>>>       var y = calendar.date.getFullYear();
>>>       var m = calendar.date.getMonth();     // integer, 0..11
>>>       var d = calendar.date.getDate();      // integer, 1..31
>>>       var l = calendar.date.print("%Y/%m/%d");
>>>         showloading();
>>>         // var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID;
>>>         var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&date='+l +
>>> '&resultlayer=remove';
>>>           updateMap(mapurl);
>>>    }
>>>   };
>>> 
>>>   Calendar.setup(
>>>     {
>>>       date         : '<?php echo $_SESSION['date']?>',
>>>       flat         : "calendar-container",
>>>       flatCallback : dateChanged
>>>     }
>>>   );
>>> </script>
>>> 
>>> Could anyone give me help on how I can integrate the same code in v.4?
>>> 
>>> Thank you in advance!
>>> 
>>> Regards,
>>> 
>>> Andreas
>> 
>> 
>> ------------------------------------------------------------------------------
>> Enter the BlackBerry Developer Challenge  
>> This is your chance to win up to $100,000 in prizes! For a limited time, 
>> vendors submitting new applications to BlackBerry App World(TM) will have
>> the opportunity to enter the BlackBerry Developer Challenge. See full
>> prize  
>> details at: http://p.sf.net/sfu/Challenge
>> _______________________________________________
>> pmapper-users mailing list
>> pmapper-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/pmapper-users
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/call-functions-showloading-and-updateMap%28mapurl%29-from-pmapper-map.phtml-v.4-tp24426013p24859684.html
Sent from the pmapper users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to