thanks

I use the following solution;

{{for result in res:}}
<h5>{{=result.id}}</h5>
<h5>{{=result.title}}</h5>
{{=A(TAG.i(_class="icon-plus-sign"), _rel="tooltip", _title="testing",
_class="btn", _href='#', _onclick="jQuery('#uc').toggle();")}}
<div id="uc">
  {{=LOAD('default','comment.load',args=result.id,ajax=True)}}
</div>

with this I can load the form.
two things remains.
1. I need to close or clear the form so that it is clear that it has
been submitted.
2: I need an unique id for every comment, something like this:

<div id={{="comments"+str(result.id)}} class="collapse">
    {{a=0}}
    {{for comment in com:}}
  {{if comment.post_id==result.id:}}
  {{a=1}}
    <small>{{=comment.created_on}}</small>
    <h5>{{=comment.created_by}}</h5>
    <h5>{{=comment.comment}}</h5>
  <br>
  {{pass}}
 {{pass}}

is it possible to create unique id in any other way? the above
solution to add result.id to the id works for displaying comments but
not for displaying forms.

On Tue, Dec 11, 2012 at 4:16 PM, Anthony <abasta...@gmail.com> wrote:
>>
>> {{=LOAD('default','comment.load',args=result.id,ajax=True,ajax_trap=True,target="userComment")}}
>
>
> Note, the above will load the component immediately when the page is first
> loaded (even if the div is hidden). If you want to delay any loading until
> the link is clicked, you can just create an empty (possibly hidden) div:
>
> <div id="userComment"></div>
>
>> than you have a button call an action and refresh a component
>>
>> {{=A('click me', _href=URL('comment.load'), component='target')}}
>
>
> I think the correct syntax here is:
>
> {{=A('click me', component=URL('comment.load'), target='userComment')}}
>
> When the link is clicked, the component will be loaded into the
> "userComment" div (and will be re-loaded upon subsequent clicks).
>
> Anthony
>
> --
>
>
>

-- 



Reply via email to