-------- Original Message --------
Subject:        Re: [fw-general] Zend_Dojo form problem (ZF v1.10.7 and 
1.11.0b1)
Date:   Fri, 22 Oct 2010 23:19:02 +0100
From:   Mike A <[email protected]>
To:     Matthew Weier O'Phinney <[email protected]>



On 22/10/2010 03:31, Matthew Weier O'Phinney wrote:
 -- Mike A<[email protected]>   wrote
 (on Thursday, 21 October 2010, 10:41 PM +0100):
 A Zend_Dojo form would normally produce something like /<form
 id="homesaleform" action="saleshelpunloaded" method="post"
 class="property-search" dojoType="dijit.form.Form">/.

 I have two Zend_Dojo forms on one page. One displays like the above
 but the other loses the dojoType="dijit.form.Form" bit. The form
 that loses it is almost identical to its sister form (of course,
 with different ids etc). The failing form is instantiated within an
 action helper in the style of MWO's helpful article at 
http://weierophinney.net/matthew/archives/246-Using-Action-Helpers-To-Implement-Re-Usable-Widgets.html...

 public function handleLogin()
 {
      $request = $this->getRequest();
      $form    = new User_Form_Login();
      ...

 Upon clicking submit my Javascript method produces an "undefined"
 error from...

 var loginform = dijit.byId(form_id);
 if(loginform.isValid()){...

 The form_id is fine but with the form dijit missing it fails.

 Any ideas about why Zend_Dojo Form fails to render the form dijit
 from an action helper but does render what appears to be a Zend form
 object?
 I need some code to better diagnose the issue. One potential issue is
 that the JS code generated may not be taking into account multiple forms
 when generating the onClick bindings. The other issue is that you may
 not have unique identifiers between the two forms, which could lead to a
 conflict when building and binding the forms to events.

 Could you paste the two form definitions and how they're invoked
 somewhere?

Not sure about the "JS code generated may not be taking into account
multiple forms" bit. Do you mean by the ZF or in my code?  I've examined
the forms to ensure each part of them, form and elements, do not contain
identifier clashes.

I don't know enough about combined ZF and Dojo to embark upon a
potential issue route. I do, however, know that I've worked my way into
confusion.

Could it be an issue of when to enable Dojo in a modular project? I only
have default and user modules at present. The search form, which renders
correctly with Dojo dijit mark-up, is enabled within appropriate view
scripts of the default module. The login form is instantiated within the
user module action helper. Although it seems logical that the problem
lays there I cannot get my head around it (even if I'm on the right track).

The purpose of my experimentation is to prove that multiple Dojo forms
per page can be used in a multi-module project.


Reply via email to