I've got troubles with getting information from a form nested into a tabpanel. My layout code looks like this:
var dialog = new Ext.Window({
layout: 'fit',
modal: true,
shadow: true,
items: [
{
xtype: 'tabpanel',
activeTab: 0,
items: [{
title: this.text.viewDates,
xtype: 'form',
labelWidth: 100,
items:[
{
xtype: 'datefield',
fieldLabel: this.text.startDate,
name: "startDay",
format: this.text.dateFormat,
},{
xtype: 'timefield',
fieldLabel: this.text.startTime,
name: "startTime",
}]
// more tabs and forms here
The problem is that when i'm getting the form like this:
On SGML and HTML:: <UL> <LI><P>list item 1 <LI><P>list item 2 </UL> Such empty elements never have end tags. The document type definition and the text . Similarly, the following element type declaration for FORM prohibits nested forms: . In HTML, boolean attributes may appear in minimized form -- the attribute's http://www.w3.org/TR/html401/intro/sgmltut.htmlHOME | How to Embed AJAX(!) Forms in Symfony 1.2 Admin Generator « A Web :: May 4, 2009 The last item on our list gets an add image, which makes an AJAX call to add new blank forms. . Nested forms coming in and out with ajax! . empty($taintedValues["item_pos$i"]['item_id']) http://israelwebdev.wordpress.com/2009/05/04/how-to-embed-ajax-forms-in-symfony-12-admin-generator/HOME |
var tab = dialog.find("title", this.text.viewDates)[0];
var form = tab.form;
the items attribute of form is empty and the function call form.findField("startDay") doesn't return anything.
What is wrong?
UPDATE:
If the dialog is shown for a second time the items in form are filled and the method findField works, but calling dialog.show(); dialog.hide() before calling the findField does not work. Yahoo! Developer Network - Flash Developer Center - ASTRA Flash :: It is designed to be nested in a Form rather than used as a standalone class. . other items in the Form, set the label property to an empty string(" "). http://developer.yahoo.com/flash/astra-flash/form/using.htmlHOME | Hands-On: Dreamweaver CS3 Building a Contact Form Exercise: Start :: File Format: PDF/Adobe Acrobat - Quick ViewIn the Properties Inspector leave the Action and Enctype empty for now, for each of the items in the form, everyone on its own row of the nested table. http://cis347.info/PDF/FormElementsCS3.pdfHOME |
This is probably due to the lazy rendering. When you do a findField("someValue") it will do a lookup in the items array, which has the id of a component as key. As you use the 'name' property, this will fail. When this fails, it will loop the items array and check if field.getName() for each field equals your given key ("startDay"). This getName() method doesn't use the name property as you define it, it will check the name property of the element for this field. As the field isn't rendered yet, this will fail.
Solution:
Also define an 'id' property, next to the 'name' property.
Get Smart About Monitoring Virtual Machines
Microsoft Gets Ex-Streamly Cozy with U.K.'s MediaWave
|