Hello guys,

I'm working with an ajax observeField in a select tag, this is my view
code:

<?php echo $html->selectTag('Laboratory/Section', $sections) ?>
<?php echo $ajax->observeField('LaboratorySection',
array('url'=>'loadResults/' . $data['Appointment']['id'], 'frecuency'
=> 1, 'update' => 'results', 'loading' =>
"Element.hide('results');Element.show('loadingResults')", 'complete'
=> "Element.hide('loadingResults');Effect.Appear('results')")) ?>

$data and $sections are set in controller's function.

<div style="display: none;" id="loadingResults"><?php echo $html-
>image("spinner.gif", array('align' => 'left'))?>Loading results,
please wait ...</div>
<div id="results"><!-- Results are supposed to load here //--></div>

So, the problem is that it is not loading the results, I've checked
the html code generated and it's good:

<script type="text/javascript">new
Form.Element.Observer('LaboratorySection', 2, function(element, value)
{new Ajax.Updater('results','/intranet/appointments/loadResults/
16410', {asynchronous:true, evalScripts:true,
onLoading:function(request)
{Element.hide('results');Element.show('loadingResults')},
onComplete:function(request)
{Element.hide('loadingResults');Effect.Appear('results')},
parameters:Form.Element.serialize('LaboratorySection'), requestHeaders:
['X-Update', 'results']})})</script>

if I visit directly the url generated by observeField method in
Ajax.Updater, for instance: http:///intranet/appointments/loadResults/16410
the results are loaded correctly, but using the ajax observeField I
get an empty view and some queries executed but not the ones I'm
trying to in loadResults controller's method.

Any idea of what might be happening?, I have some other ajax
observeField in the view and they work properly, so I don't understand
what I'm missing.

Thanks for your time and help!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to