[Catalyst] Losing subrequest output

Nigel Metheringham nigel.metheringham at dev.intechnology.co.uk
Tue Dec 13 13:48:09 CET 2005


Inspired by http://catalyst.perl.org/calendar/2005/12 and yesterdays
experiments with AJAX I decided to change my code to use subrequests
rather than outputting the same item twice in different contexts.

So I made myself a new controller - AJAX - not really necessary I know,
but it seemed cleaner.

Now if I go to
  http://localhost:3000/ajax/select_groups

I get the select fragment back as I expect.

In the main page TT that uses this I have taken out the original select
box generation and replaced it with:-
          <label>
            <span class="field">Group</span>
            <div id="select_group0">
        [% Catalyst.subreq('/ajax/select_groups', {}, {
                bs_sp    => item.bs_sp.id,
                default  => 1}); %]
            </div>
          </label>
        [% Catalyst.prototype.observe_field('bs_sp',{
                url    => '/ajax/select_groups',
                with   => "'bs_sp='+document.getElementById('bs_sp').value",
                update => 'select_group0',
        }) %]

I can see in the debug output that the sub request is being run:-
.------------------------------------------------------------------+-----------.
| Action                                                           | Time      |
+------------------------------------------------------------------+-----------+
| /admin/billset/auto                                              | 0.000503s |
| /admin/billset/add                                               | 0.025997s |
| /ajax/auto                                                       | 0.000139s |
| /ajax/select_groups                                              | 0.000660s |
| -> BroadsoftFeature::V::TT->process                              | 0.001521s |
| /end                                                             | 0.009979s |
| -> BroadsoftFeature::V::TT->process                              | 0.231651s |
| /end                                                             | 0.232373s |
'------------------------------------------------------------------+-----------'

along with other debugging output I have on which shows its picking up
the template (which will always output something even if all the input
data is null).

However the HTML generated has absolutely nothing between the <div...>
and </div> where the sub request output should be.

Presumably I have made a trivial error, but can anyone suggest whats
eating my output, and why?

	Nigel.

-- 
[ Nigel Metheringham           Nigel.Metheringham at InTechnology.co.uk ]
[ - Comments in this message are my own and not ITO opinion/policy - ]





More information about the Catalyst mailing list