-
26 Nov 2007 1:58 PM #1
BasicForm not setting Items?
BasicForm not setting Items?
Is there something explicitly wrong with the following code, or is the BasicForm not supposed to be able to load records into existing markup?
When using the above code, and inspecting the object after the page renders, the items array is empty, which is why the loadRecord, setValues function(s) aren't working properly, is there some gross error in how I'm attempting to use BasicForm?PHP Code:<script type="text/javascript" src="/js/Ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="/js/Ext/ext-all.js"></script>
<script>
Ext.onReady(function(){
testForm = new Ext.form.BasicForm('test');
testForm.render('test');
});
</script>
<form name="test" id="test">
<input type="text" name="name" />
</form>
-
26 Nov 2007 2:11 PM #2
Kinda of hard to say without seeing more code. What does the json response look like? Did you call load and does firebug show the request going out and coming back?
Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
26 Nov 2007 2:24 PM #3
not the problem
not the problem
I can rule out JSON Being the problem, because all the XHR looks completely normal, try this in firebug, with that code example you should be able to run this in the console & have the field populate testForm.setValues({id:'name',value:'test'}); but that doesn't work...
-
26 Nov 2007 2:37 PM #4
I don't see how that could work - you have a field called name but you're calling setvalue with id and value.
You shouldn't be doing that directly anyway - calling load will populate the fields with the data you send back, assuming that you match the names correctly.Tim Ryan
Read BEFORE posting a question / BEFORE posting a Bug
Use Google to Search - API / Forum
API Doc (4.x | 3.x | 2.x | 1.x) / FAQ / 1.x->2.x Migration Guide / 2.x->3.x Migration Guide
-
27 Nov 2007 8:07 AM #5
Load calls setValues
Load calls setValues
I've dug all the way back into this code, and the load method invokes the same thing that setValues or loadRecord does, one problem is I'm trying to work with this with a single row result from a grid's datastore, but again, the use of the load method doesn't appear to be the problem, when the form is constructed, it doesn't set the internal items array properly, I've tried dropping the id value from every field and I still don't get that array...
-
27 Nov 2007 8:59 AM #6
No properties
No properties
It appears unless I define each of the values in js and attach them to the elements in my basicForm, (Double the work) the basicform doesn't serve the purpose of an effective container.
-
16 Mar 2008 11:50 AM #7


Reply With Quote