Results 1 to 6 of 6

Thread: FormPanel - unable to find field when using composite fields or fieldsets

  1. #1

    Default FormPanel - unable to find field when using composite fields or fieldsets

    Hi all,

    I am currently prototyping an application where I have created a great scalable form panel organising the fields using fieldsets and composite fields. It looks great but I have hit a problem when I have to set attributes on one field dynamically based on a selection in a combo box. I can see many ways to do this when not using fieldsets and composite fields but when I introduce these constructs, I seem to be unable to find the parent form from within a field event handler and I seem to be unable to find the field or component from the parent formPanel or form. This is the case even if I add the code in the afterrender event.

    I have seen a few posts highlighting similar issues but also comments that this has been resolved in 3.x.

    Am I missing something here. Shouldn't I be able to find the parent formPanel from within a composite field or a field set or finding a field from within the events of the parent form? It seems to me as a very basic issue. Any help greatly appreciated.

    Kind Regards

    Jorgen

  2. #2

    Default

    Hi again,

    I haven't received any response on this question. I think it is a fairly fundamental functionality and are very puzzled if this is not supported and significantly reduces the usability of composite fields and field sets in a production application as if used, you can't reference the nested field if needed in the future. Any help is greatly appreciated.

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2007
    Location
    Halifax, NS, Canada
    Posts
    28

    Default

    I'm running into a similar issue (i think). I have a composite field consisting of a ComboBox and a button. When the button is clicked, I want to grab the value of the combo and place it in a grid below. Unfortunately, I can't seem to find a way to access anything inside the composite. Why doesn't the 'ref' attribute work? or 'itemId'? Can anyone on the Ext.js team pleas explain how to access composite elements?

  4. #4
    Sencha User berend's Avatar
    Join Date
    Mar 2007
    Location
    Auckland, NZ
    Posts
    47

    Default

    Same problem here...

    Composite fields have quite a few issues it appears, as this is the Xth problem I have with them.

  5. #5
    Ext JS Premium Member
    Join Date
    Jun 2007
    Location
    Halifax, NS, Canada
    Posts
    28

    Default

    Is anyone from Ext.js going to look at this, or just keep ignoring it? I've seen others on the web and in the forum complaining about this issue as well.

    The Composite type could very useful if we had a way of accessing components inside it. (other than creating variable references in the code).

    I got around this issue by creating a hard reference in the class...

    Code:
    var _field1 = Ext.form.TextField(...);
    var _field2 = Ext.form.TextField(...);
    var _composite = {
         items:[_field1, _field2]
    }
    This way I can reference the variables in events,etc in the class. Crappy, but it works.
    Last edited by TheCatWhisperer; 14 May 2010 at 5:14 AM. Reason: Add details

  6. #6
    Sencha User
    Join Date
    Nov 2010
    Posts
    13

    Default

    Same problem here. I got around it by using xtype:'container' with layout:'hbox' in place of whatever used to be xtype:'compositefield'. You can even still use fieldLabel:'myField' and it will be rendered correctly by the parent container (assuming it is layout:'form', of course).

    Edit: apparently findParentBy* functions are broken by compositefield, which is a known issue. I wonder if find* functions are similarly broken.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •