[CLOSED] CompositeField equivalent... FieldContainer is NOT a Field itself.

  1. #1

    [CLOSED] CompositeField equivalent... FieldContainer is NOT a Field itself.

    Hi, we developed our own control in Ext.Net 1.3, the "DateTimeField". We implemented it as a CompositeField (Date + Time fields), and we created the client-side override for get/setValue() in order to make it work dispatching the value to the other internal fields (Date and Time).

    Now we're trying to migrate to Ext.Net 2.0 and I saw that this can't be done easily with the FieldContainer. In fact, this new container is NOT a field itself.

    Do you suggest re-writing this control as a new "Field" and applying this composition logic there? Do you have some hints on doing that?

    Thank you!!
    Last edited by Daniil; Jun 26, 2012 at 9:12 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I think using FieldContainer instead of CompositeField would be best.

    Here is some example of such component.
    <Ext.NET 2 sources root>\Ext.Net\Build\Ext.Net\ux\calendar\src\form\f ield\DateRange.js

    There are the getValue and setValue methods defined.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I think using FieldContainer instead of CompositeField would be best.

    Here is some example of such component.
    <Ext.NET 2 sources root>\Ext.Net\Build\Ext.Net\ux\calendar\src\form\f ield\DateRange.js

    There are the getValue and setValue methods defined.
    Thank you Daniil, this can be done, however I need to change my implementation.

    Another question that is regarding the same issue. Since the component itself is NOT a field, does this impact somehow with the methods that deal with the "fields", for example to get/set form data?

    Thank you again,
    Cheers
  4. #4
    Well, it impacts.

    FieldContainer has no Name property and no isFormField flag. So, it won't be considered as a field within the loadRecord method. But this method will go through the FieldContainer items to find fields.

    The CheckboxGroup class can be an example of creating a "field" inheriting from FieldContainer.
    http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.CheckboxGroup

Similar Threads

  1. [CLOSED] Field and FieldContainer layout exception in form
    By cleve in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 13, 2012, 2:04 PM
  2. Replies: 3
    Last Post: Jul 17, 2012, 1:44 PM
  3. Replies: 5
    Last Post: Apr 10, 2012, 2:38 PM
  4. [CLOSED] 'div' equivalent in ext.net?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 06, 2011, 6:03 PM
  5. [CLOSED] TextArea field in CompositeField
    By ndotis in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Feb 23, 2011, 5:38 PM

Posting Permissions