Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:34:07+00:00 2026-06-09T00:34:07+00:00

I am unable to set the value for the textfield which is inside fieldcontainer.

  • 0

I am unable to set the value for the textfield which is inside fieldcontainer. I want to set the value and other config for the “textfield” which is inside the “fieldcontainer”. So basically i set the configuration for the textfield which i receive from the server, like for example : allowBank: true , maxlength: 4, value: ‘Hello World’ i get from the server and want to supply it to the textdfield which is inside my custom control which is fieldcontainer. All other configuration is applied except for the value config using the built in textConfig. Below is my code:

Ext.define('PTextField', { extend: 'Ext.form.FieldContainer',
            alias: 'widget.ptextfield',
            requires: ['Ext.form.TextField', 'Ext.Img'],
            width: 170,
            fieldLabel: 'Empty Label',
            labelAlign: 'top',
            layout: {
                type: 'hbox'
            },
            BLANK_IMAGE_URL: '',


            constructor: function (config) {
                this.callParent(arguments);


                Ext.apply(this.down('textfield'), this.textConfig);
                Ext.apply(this.down('image'), this.imgConfig);


            }, // eo function constructor




            initComponent: function () {
                var me = this;
                this.textBox = this.createTextField();
                this.imageBox = this.createImagefield();
                this.items = [this.imageBox, this.textBox];
                this.callParent(arguments);
            }, //eo initComponent
            createTextField: function () { return {xtype: 'textfield'} },
            createImagefield: function () { return { xtype: 'image', height: 20, width: 20} }
        });

var fname = Ext.create('PTextField', {
            fieldLabel: 'First Name',
            textConfig: { value: 'Hello World', allowBlank: false, readOnly: true,     maxLength: 4, width: 100 },
            imgConfig: { src: 'http://www.sencha.com/img/20110215-feat-html5.png' }
        });

fname.render(Ext.getBody());

I am using extjs 4.1.
Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:34:10+00:00Added an answer on June 9, 2026 at 12:34 am

    You should simply create the textfield and image using your configs. Then define your items array using the created objects, like this:

    initComponent: function() { 
        var me = this,
            textfield = Ext.widget('textfield', me.textConfig),
            image = Ext.widget('image', me.imgConfig);
    
        me.items = [textfield, image];
        me.callParent(arguments); 
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unable to set json value to scr attribute of embed tag from
I am unable to set value of text, radio and other form elements based
I am unable to set value for ef_name fetched from db. There are multiple
I am unable to set my custom php session saving path from inside an
I have a horribly coded set of controllers which I am unable to refactor
ASP.NET using C#; .net3.5 I want to set some value for this label lblSkill1
I am unable to set default value for a dropdown while loading forms. Here
I am unable to set a nullable field with a default value of null
I am unable to set my inbuilt database to update . It is always
I am using Apache Hadoop (hadoop-0.20.203.0) and unable to set sticky bit for /tmp

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.