Right now I amusing jqModal for this, but this should not impact too much on my question.
Right now the work flow is like that: user clicks on button --> - button id is saved in a hidden field - dialog is opened and content search form is loaded via ajax user click search button --> - radiobutton list in dialog is populated via ajax - list item change event is hooked up, so that it will write its value to the input box next() to the item which id is in the hidden field - dialog is closed I do not like this because everything crosses so many borders. the dialogue should have no knowledge about hidden fields (and that some button has an input field next to it) exterior to it. It should simply expose an event, the originating button is subscribing to. or the equivalent in js-speak. But so far I have not found a way to implement something like that. My javascript sucks, that's for sure :S -- Jan On Wed, Sep 17, 2008 at 7:22 AM, Richard D. Worth <[EMAIL PROTECTED]> wrote: > I'm not sure if this is exactly what you're looking for, but I wonder if > you've looked at the jQuery UI Dialog plugin: > > Docs: > http://docs.jquery.com/UI/Dialog > > Demos: > http://ui.jquery.com/repository/latest/demos/functional/#ui.dialog > > If it interests you and you have further questions, there's a dedicated > jQuery UI mailing list: > > http://groups.google.com/group/jquery-ui/ > > - Richard > > Richard D. Worth > http://rdworth.org/ > > On Tue, Sep 16, 2008 at 2:28 PM, Jan Limpens <[EMAIL PROTECTED]> wrote: >> >> ah and by popup i mean something like a modal dialogue on the page, >> not another browser instance. >> >> On Tue, Sep 16, 2008 at 3:22 PM, Jan Limpens <[EMAIL PROTECTED]> >> wrote: >> > hello, >> > >> > on several pages I have small forms (plural) with a textbox and a >> > button. If I click on the button, a popup shows a search form. The >> > results of the searchform are shown in the very same popup as a list >> > of radiobuttons/labels. If someone selects a radiobutton, it's value >> > should be inserted into the textbox next to the button. Then the popup >> > should go away. >> > >> > This popup (something like a singleton) serves many different pages, >> > so I cannot hardwire it. Probably I need to pass a delegate to some >> > event the form provides, indicating the originating form. Problem is: >> > I have no idea how something like this can be done. Anyone could give >> > me a hint or two, or direct me to good resources on similar matters? >> > >> > The popup looks like that: >> > >> > <form id="article-search-form" method="get" >> > action="${Url.For([EMAIL PROTECTED]:'articles', >> > @action:'FullTextSearchAsJson'})}"> >> > <input type="text" name="fragment" /> >> > <input type="submit" value="Buscar" /> >> > </form> >> > <form id="article-search-result" method> >> > </form> >> > >> > <script type="text/javascript" >> > src="/script/jquery-1.2.6.min.js"></script> >> > <script type="text/javascript" src="/script/jquery.form.js"></script> >> > >> > <script type="text/javascript"> >> > >> > $(document).ready(function() { >> > $('#article-search-form').ajaxForm({ >> > dataType: 'json', >> > success: fillListWithArticles >> > }); >> > }); >> > >> > function fillListWithArticles(data) >> > { >> > var list = $("#article-search-result"); >> > $(list).empty(); >> > i = 0; >> > $.each(data, function(){ >> > id = "article-search-result-" + i; >> > $("<div><input type='radio' value='"+this.Id+"' >> > id='"+id+"' >> > name='article.Id'/><label style='float: inherit' for='"+id+"'>" + >> > this.Name +"</label></div>").appendTo(list); >> > i++; >> > }); >> > } >> > </script> >> > >> > -- >> > Jan >> > ___________________ >> > [EMAIL PROTECTED] >> > www.limpens.com >> > +55 (11) 3082-1087 >> > +55 (11) 3097-8339 >> > >> >> >> >> -- >> Jan >> ___________________ >> [EMAIL PROTECTED] >> www.limpens.com >> +55 (11) 3082-1087 >> +55 (11) 3097-8339 > > -- Jan ___________________ [EMAIL PROTECTED] www.limpens.com +55 (11) 3082-1087 +55 (11) 3097-8339