[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-18 Thread apple
Put the jquery stuff in a file and include it in any view where you want to call the dialog function. The document.write just adds a container for the dialog box. You could just as easily put the html in the page directly but I put it here so that it is all together in one js file which can be inc

[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-18 Thread Annet
> I forgot you also need to include in your controller instructions to > open and close the dialog e.g. How would I include that in the user function: def user(): form=auth() if isinstance(form,FORM): if 'auth' in globals(): if not auth.is_logged_in():

[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-18 Thread Annet
Hi, Thanks for your reply, I am not sure I completely understand your solution. In which file(s) do I put the following lines of code: > // create dialogbox > document.write("") > $(document).ready(function(){ >         $('#dialogdiv').dialog({autoOpen : false, modal : false, width : > 'auto'});

[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-18 Thread apple
I forgot you also need to include in your controller instructions to open and close the dialog e.g. if form.process(. response.js="$('#dialogdiv').dialog('close');" elif form.errors: pass else: response.js="$('#dialogdiv').dialog('open').focus();" On Jan 18, 1:44 p

[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-18 Thread apple
Ah you want the whole URL to be in a dialog. I spent ages figuring this out and the answer is already included in web2py!! You just include the code below and then you can just replace any url with dialog(url) and it will show up in a dialog. Brilliant!! // create dialogbox document.write("") $(d

[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-18 Thread Annet
Does the first problem has anything to do with auth_menu: in menu.py: if 'auth' in globals(): if not auth.is_logged_in(): response.auth_menu = [ ['Login',request.function=='user' and request.args(0)=='login',URL('default','user/login')], ['Gebruikersnaam opvra

[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-18 Thread Annet
Hi, Thanks for your reply, I almost got the modal form dialog to work ... First the form dialog doesn't appear as a modal dialog, it leaves the original page, i.e. the url changes from: http://127.0.0.1:8000/init/admin/index to http://127.0.0.1:8000/init/default/user/login, therefore the underlyi

[web2py] Re: jQuery UI modal form dialog and user function.

2012-01-17 Thread apple
In user.html add lines: http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/ themes/{{=response.theme or "smoothness"}}/jquery-ui.css" rel="stylesheet" type="text/css" /> http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/ jquery-ui.min.js" type="text/javascript"> $(document).ready(functi