>
> If you view the network requests in the browser developer tools and
> refresh the page, do you see a request to suggestions.load (...)?
>
Yes, there is the request to suggestions.load in the Network tab on the
pages where LOAD works. None suggestions.load in the same tab after
refreshing on pages where LOAD doesn't work.
I created a dummy app to attach but LOAD works fine on every page, although
I used the code from my controllers and views. Anyway, thanks.
On Tuesday, August 13, 2013 3:02:26 PM UTC+2, Anthony wrote:
>
> If you set ajax=False and the component contains a form, you should then
> set ajax_trap=True -- that will submit the form via ajax back to the
> component's action (otherwise the form will be submitted to the action of
> the page that contains the component, and therefore it won't get processed).
>
> Anyway, let's go back to ajax=True. In that case, how are you determining
> that "no suggestions.load request is sent"? If you view the network
> requests in the browser developer tools and refresh the page, do you see a
> request to suggestions.load (first, confirm that you can see the request on
> pages where the component works)?
>
> Can you attach an app that demonstrates the problem?
>
> Anthony
>
> On Tuesday, August 13, 2013 5:48:27 AM UTC-4, lesssugar wrote:
>>
>> Thanks, Joe, I'm getting some progress... When changed to ajax=False, the
>> feedback form displays correctly on all the pages. However, with ajax set
>> to False, the feedback is not being sent to my email. When the form is
>> submitted - nothing happens. No email sent, no response.flash message.
>>
>> Plus, how do I check if ajax gets triggered?
>>
>> my feedback (default/suggestions) function:
>> def suggestions():
>>
>> suggest_form=SQLFORM.factory(
>> Field('your_email', label="Your email",
>> requires=IS_EMAIL(error_message="Wrong email")),
>> Field('question', 'text', label="Your suggestions",
>> requires=IS_NOT_EMPTY(error_message="Enter suggestions")),
>> formstyle='divs', submit_button="Send", separator=None,
>> _name='suggestions', _class='formstyle')
>>
>> if suggest_form.process(formname='suggestions').accepted:
>>
>> if mail.send(
>> to=mail.settings.sender,
>> subject='New suggestion from',
>> message=suggest_form.vars.question + '\n\n' +
>> suggest_form.vars.your_email,
>> encoding='utf-8'):
>> response.flash = "Suggestions sent. Thanks!"
>>
>> elif suggest_form.errors:
>> response.flash = "Errors in form. Try again."
>>
>> return dict(suggest_form=suggest_form)
>>
>> current LOAD() in my layout.html:
>> {{=LOAD('default', 'suggestions.load', ajax=False)}}
>>
>>
>>
>> On Monday, August 12, 2013 8:30:44 AM UTC+2, Joe Barnhart wrote:
>>>
>>> How about if you make the ajax=False. Does it load then? When dealing
>>> with this ajaxy stuff, you need to break it down into steps...
>>>
>>> 1. Does the function on the backend work as I expect? Is the url right?
>>>
>>> 2. Does the ajax ever get triggered?
>>>
>>> 3. Is there a place for the response to go?
>>>
>>> If you can separate those and test them one at a time, you can make
>>> progress on the problem.
>>>
>>> -- Joe
>>>
>>> On Sunday, August 11, 2013 7:04:36 AM UTC-7, lesssugar wrote:
>>>>
>>>> Both web2py.js and jquery.js are loaded and accessible. There are no JS
>>>> errors shown in console, all looks "normal" - but there's none .load
>>>> request sent at all.
>>>>
>>>> The few pages where LOAD doesn't work include a respective form and
>>>> other javascript. Commenting the javascript doesn't solve the problem. In
>>>> addition, LOAD works on some other pages with forms.
>>>>
>>>> On Sunday, August 11, 2013 3:47:42 PM UTC+2, Anthony wrote:
>>>>>
>>>>> Id it possible either web2py.js or jQuery is not loaded on that page?
>>>>
>>>>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.