FYI
The improper rendering of the html was from not calling ${h.end_form}
... this for some reason caused Firefox to drop a <tr> tag.
Dan wrote:
I am having trouble with the link_to_remote webhelper. I am
using
Mako as my templating language.
I am clicking on a link within a page that has a <div
id='search'></div>.
The link looks like this:
${h.link_to_remote("Search", dict(update="search",
url="">
loading="Element.show('loading')",
complete=h.visual_effect('Highlight', 'category_id',
duration=1) + "; Element.hide('loading')")
)}
This updates the <div id='search'></div> just fine.
However, the HTML produced does not display as expected... see the
relevant code for the controller and template.
Controller
-------------
def search(self):
return render_response('search.html')
Template
------------
<table class="search_table" width="100%">
<tr>
<td>
${h.form_remote_tag(
url="" action=''),
update='search_results'
)}
${h.text_field('myquery')}
${h.submit(value='Search', name='commit')}
</td>
<td>
${h.link_to_remote(
"Close", dict(update="search",
url="">
loading="Element.show('loading')",
complete="Element.hide('loading')")
)}
</td>
</tr>
<tr>
<td colspan="2">
<div id="search_results"></div>
</td>
</tr>
</table>
The result (below) is NOT the HTML structure as expected from above.
Result
--------
<div id="search"> <table class="search_table" width="100%">
<tbody><tr>
<td>
<form action="" method="post"
>
<input id="myquery" name="myquery" type="text">
<input name="commit" value="Search" type="submit">
</form>
<td>
<a href="" >Close</a>
</td>
</td>
<tr>
<td colspan="2">
<div id="search_results"></div>
</td>
</tr>
</tr></tbody></table></div>
Thanks for any help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
|