I am not sure because depends on details but you can name a component and 
name it (target=) as you did

{{=LOAD('default','comment.load',args=result.id
,ajax=True,ajax_trap=True,target="userComment")}}

than you have a button call an action and refresh a component

{{=A('click me', _href=URL('comment.load'), component='target')}}





On Tuesday, 11 December 2012 07:57:02 UTC-6, jonas wrote:
>
> Hi
>
> I have a link that redirects to a comment page:
>
> {{=A(TAG.i(_class="icon-pencil"), _rel="tooltip", _title="give a comment", 
> _class="btn", _href=URL('comment',args=result.id))}
>
> But I want to use LOAD instead of filling a form in a separate page: 
>
> {{=LOAD('default','comment.load',args=result.id
> ,ajax=True,ajax_trap=True,target="userComment")}}
>
> the controller and the view: 
>
> def comment():
>
>     """ create comment form. Every comment is id locked to the specific 
> post """
>
>     crud.settings.create_next = URL('index')
>     post=db(db.blog.id==request.args(0)).select().first()
>     db.comments.post_id.default=post.id
>     form=crud.create(db.comments)
>
>     return dict(form=form)
>
> {{=form.custom.begin}}
> <div class="row">
>       <h5>date: </h5>{{=form.custom.widget.created_on}}
> </div>
> <div class="row">
>       <h5>name: </h5>{{=form.custom.widget.created_by}}
> </div>
> <div class="row">
>       <h5>mail: </h5>{{=form.custom.widget.mail}}
> </div>
> <div class="row">
>       <h5>link: </h5>{{=form.custom.widget.link}}
> </div>
> <div class="row">
>       <h5>comment:</h5>{{=form.custom.widget.comment}}
> </div>
> {{=form.custom.submit}}
> {{=form.custom.end}}
>
> How do I trigger the load function from the button, i.e can I replace the 
> URL tag with a call to LOAD?
> Is it possible to close the LOAD form after completed form so it disappear 
> again or at least clear the field and gives a response.flash = T("Posted!")?
>

-- 



Reply via email to