the onclick needs to be "ajax.........; return false;"

On Wednesday, 18 April 2012 11:13:34 UTC+1, Johann Spies wrote:
>
> When the details of the journal is viewed, there is a button inviting the 
> viewer to click in order to show articles published by this journal.
>
> I want then a grid to appear below the journal details.
>
> If I just put a 
> {{=LOAD('default', 'joernaalartikels.load', ajax=True)}}')}}',
>
>
> in the view the grid appears with the relevant data.
>
> I want to shift that action to a 'onclick' linked to the submit button.
>
> This is not working:
>
> In the Controller:
>
> wys_artikels = FORM(INPUT(_type='submit',
>                             _value = T('Click to view articles'),
>                             _onclick = "ajax('joernaalartikels', [], 
> 'artikels')"))
>     
>
> And in the view: 
>
> {{=wys_artikels}}
> <div class = 'artikels'>
> </div>
>
>
> A click on the submit button just loads to a reload of the whole page even 
> if I change the controller to 
>
> wys_artikels = FORM(INPUT(_type='submit',
>                             _value = T('Click to view articles'),
>                             _onclick = "ajax('joernaalartikels.load', [], 
> 'artikels')"))
>     
>
> How do I get the component to load after a click?
>
> Regards
> Johann
>
>

Reply via email to