[CLOSED] TextField in codebehind

  1. #1

    [CLOSED] TextField in codebehind

    Hi,

    I am creating a TextField in codebehind and I run into a few issues:

    When I try to set the Vtype, I can't use the following
    Vtype = Ext.Net.ValidationType.Email.ToString()
    whereas
    Vtype = "email"
    works.
    For other properties on other fields, I can use
    Layout = Ext.Net.LayoutType.Fit.ToString()
    just fine.

    Also, the Validator property is read-only. Is that by design? That means that I can't do this
    <ext:TextField 
        runat="server" 
        Name="password2" 
        FieldLabel="Repeat Password"
        InputType="Password"
        AllowBlank="false">
        <Validator Handler="return (value === this.previousSibling('[name=password1]').getValue()) ? true : 'Passwords do not match.';" />
    </ext:TextField>
    as in the examples...

    Another minor thing is the code assist tooltip that pops up in VS when hovering over the Margin property: it says "Specifies the margin for this component. The margin can be a single numeric value to apply to all sides or it can be a CSS style specification for each style, for example '10 5 3 10'.". This property is an int? so it won't accept a string. MarginSpec seems to be the proper way to set the margins with a string so the "...or ....." should be removed.

    Thanks,
    Vince
    Last edited by Daniil; Jul 16, 2013 at 4:15 AM. Reason: [CLOSED]
  2. #2
    When I try to set the Vtype, I can't use the following
    It is case sensitive property, please use
    Vtype = Ext.Net.ValidationType.Email.ToString().ToLowerInvariant()
    Why don't you want to use StandardVtype property?

    Also, the Validator property is read-only. Is that by design?
    Yes, Validator already has instance therefore just use it
    field.Validator.Handler = "...";
    MarginSpec seems to be the proper way to set the margins with a string
    Yes, you are right
  3. #3
    Most of those questions are because I did not know of those properties. Not all of those are approached in the examples and if they are, they might not be in a category I would think to look at for a particular property. I can't find anything about StandardVtype in the docs at http://docs.ext.net/

    For Validator, how would you include it in the following snippet:

    new Ext.Net.TextField
    {
        ID = "confirm",
        FieldLabel = "Confirm Password",
        AllowBlank = false,
        AllowOnlyWhitespace = false,
        Plugins = 
        {
            new Ext.Net.PasswordMask
            {
            }
        }
    }
  4. #4
    For Validator, how would you include it in the following snippet:
    Validator = 
    {
        Handler = "...."
    }

Similar Threads

  1. Replies: 6
    Last Post: Feb 21, 2013, 4:44 AM
  2. Replies: 0
    Last Post: Aug 01, 2012, 1:20 AM
  3. Ext.NET & Codebehind
    By plykkegaard in forum Examples and Extras
    Replies: 17
    Last Post: Jul 31, 2012, 2:03 PM
  4. Adding Tab using codebehind
    By gevik in forum 1.x Help
    Replies: 9
    Last Post: Oct 02, 2011, 7:43 PM
  5. Codebehind: Best practice
    By plykkegaard in forum Open Discussions
    Replies: 3
    Last Post: Jan 27, 2011, 8:41 PM

Posting Permissions