[Chameleon] another button question (bug?)

Paul Spencer pagameba at magma.ca
Tue May 4 15:49:16 EDT 2004


ah yes :)  if you want to pass parameters in the onclick, you would now 
add a second parameter to the SetOnClick as in:

$this->moButton->SetOnClick( 'myfunction', 'myvalue' );

which should generate something like:

onclick='myfunction(null, 'myvalue');

and you can pass multiple values too, I forget exactly how right now ... 
but if you need to, let me know and I'll look it up again

Cheers,

Paul

Bart van den Eijnden wrote:
> Hi Paul,
> 
> this is all a bit of a misunderstandig on my side of how things work.
> 
> I had set the on click event like this (so including the brackets for 
> the function):
> 
> $this->moButton->SetOnClick('myfunction()');
> 
> and then Chameleon would create this:
> <a href="javascript:void(0);" onclick='myfunction()(null, "")'>
> 
> The function would be called, but would generate a javascript error that 
> myfunction() is not a function.
> 
> When I leave out the brackets in the SetOnClick function there is no 
> problem.
> 
> Best regards,
> Bart
> 
> On Tue, 04 May 2004 10:25:34 -0400, Paul Spencer <pagameba at magma.ca> wrote:
> 
>> Bart,
>>
>> how does this generate an error message?  This looks valid to me ... 
>> but this is the case when you don't have multi-state buttons I think.  
>> It occurs to me that I haven't tested that in a while.  Hopefully I 
>> will get a chance to check today and let you know.
>>
>> Paul
>>
>>
>>
>> bartvde at xs4all.nl wrote:
>>
>>> Hi list,
>>>
>>> if I use a widget which is not part of a toolset (no toolset attribute
>>> defined for the widget in the template) the code in Button.php appends
>>> some default parameters to the name of the onclick function. This 
>>> results
>>> in the fact that you will get a javascript error that the corresponding
>>> function is not defined. Is this intentional?
>>>
>>> An example to illustrate what I encountered:
>>> <a href="javascript:void(0);" 
>>> onclick='onClickServerManagerDialog(null, "")'>
>>>
>>> Best regards,
>>> 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/|
  -----------------------------------------------------------------



More information about the Chameleon mailing list