[Dojo-interest] form submit in ContentPanes
Rose, Ryan
RRose at nerac.com
Wed Feb 7 11:07:52 MST 2007
$() was a short hand function I use for dojo.byId(). Just replace $(form) with dojo.byId(form). Sorry about that.
Regards,
Ryan Rose
http://www.digiwize.com
-----Original Message-----
From: dojo-interest-bounces at dojotoolkit.org [mailto:dojo-interest-bounces at dojotoolkit.org] On Behalf Of Christian Thies
Sent: Wednesday, February 07, 2007 11:47 AM
To: dojo-interest at dojotoolkit.org
Subject: Re: [Dojo-interest] form submit in ContentPanes
Sorry Ryan,
but is there a syntax error? Now, my ContentPane doesnt load anything:
"Error loading '/_framesets/start_content.html' (200 OK)"
What type of statement is "$(form)" ? Never saw such one!?
best regards,
Christian
Rose, Ryan schrieb:
> Try using dojo.io.FormBind on your form. Then when the result is returned you can set the display with the results returned from the server.
>
> Add this to your ContentPane to bind the form after your page loads: onLoad="postForm('o_ShopItem');"
>
> function postForm(form) {
> var e = $(form);
> var x = new dojo.io.FormBind({
> formNode: e,
> load: function(type, data, evt) {
> //display results data here
> dojo.byId("results").innerHTML = data;
> },
> error: function(t, e) {
> //handle errors from server here
> }
> });
>
> x.onSubmit = function(form) {
> //do your validation here
> return true; // needed to submit form
> }
> }
>
> Regards,
> Ryan Rose
> http://www.digiwize.com
>
> -----Original Message-----
> From: dojo-interest-bounces at dojotoolkit.org [mailto:dojo-interest-bounces at dojotoolkit.org] On Behalf Of Christian Thies
> Sent: Wednesday, February 07, 2007 10:54 AM
> To: Dojo-interest at dojotoolkit.org
> Subject: [Dojo-interest] form submit in ContentPanes
>
> Hi everybody!
>
> I'm trying to submit forms within a dynamically loaded ContentPane, like
> ...
> <div id="dw_content" dojoType="ContentPane" widgetId="display"
> layoutAlign="client" cacheContent="false"
> href="/_framesets/start_content.html" preventCache="true"
> useCache="false" refreshOnShow="true" executeScripts="true">
> </div>
> ...
>
> After loading another url to that pane via
> "dojo.widget.byId('display').setUrl('/commerce/item_group_content.html');"
> I wonder how to manage submitting the form of
> "/commerce/item_group_content.html" such that the results are showing in
> "display" again.
> ...
> <form name="o_ShopItem" action="/commerce/item_group_content.html"
> method="post">
> ...
>
> I've managed to catch the "onsubmit" event - if some <input
> type="submit"> is pressed:
> ...
> dojo.event.connect(display.domNode, "onsubmit",
> 'relaySubmits');
> ...
> function relaySubmits(evt){
> var form = evt.target;
> alert("submit "+form.name);
> }
> ...
> But if the form is submitted by a javascript call
> "document.forms[0].submit();" I don't catch anything at all :(
>
> So, how can I catch "submit();"-calls, and how is it going further on?
> Have I to loop over all elements of the form and concatenate the url
> myself to finally "display.setUrl(url)"?
>
> I sense that there is a "cheaper" way ...
>
> Thanks,
> Christian
>
>
>
>
--
Anwendungsentwicklung
BLACKBIT interactive GmbH | BLACKBIT Viani GmbH
Ernst-Ruhstrat-Str. 6 - D-37079 Goettingen
tel.: +49-551-50675-50 - fax.: +49-551-50675-55
email: christian.thies at go-community.de
Klassische Werbung und Online-Marketing: http://www.blackbit.de
Software für Online-Marketing: http://www.go-community.de
_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
Dojo-interest at dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest
More information about the Dojo-interest
mailing list