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 9234445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:47:26+00:00 2026-06-18T06:47:26+00:00

I wont build a User Contact Form, with 2 tabs containing the same fields

  • 0

I wont build a User Contact Form, with 2 tabs containing the same fields but on different language. Using MVC and ExtJS 4.0.7.

I wont to reuse the userinfo panel .. and just give it a paramether langKey = en/fr

The tab widget with user information looks like this:

Ext.define('MyApp.view.user.FormUserInfo', {
     extend: 'Ext.Panel',
     alias: 'widget.userinfo', 
     defaultType: 'textfield',

     items: [
     { 
         name: 'first_name['+langKey+']',
     }, {
         name: 'last_name['+langKey+']',  
     }]
 });

And the form loads it like this:

Ext.define('MyApp.view.user.Form', {
    extend: 'Ext.FormPanel',
    xtype: 'form',
    items: [
    {
        xtype: 'tabpanel',  
        activeTab: 2,
        items:[
        {
            xtype: 'userinfo',
            cls: 'en',
            tabConfig: {
                title: 'Contact Details(EN)'
            }
        },{
            xtype: 'userinfo',
            cls: 'de',
            tabConfig: {
                title: 'Contact Details(DE)'
            } 
        }]// /TabPanel.items
    }]// /FormPanel.items
});

In fact the form contains 10+ fields and 2 or more languages ..so I need a good control over the data.

Any way to pass a variable when using the widget or a property that I can use ?
i tried to use the panel class (cls) 'first_name['+this.cls+']' but the scope is wrong or something (and is a bit ugly).

  • 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-18T06:47:27+00:00Added an answer on June 18, 2026 at 6:47 am

    One easy way to do this is to add a custom config property to your user info panel, and then apply the custom config value to the field names within initComponent().

    Example:

    Ext.define('UserInfo', {
        extend: 'Ext.Panel',
        alias: 'widget.userinfo', 
        defaultType: 'textfield',
        langKey: 'en',
        initComponent: function() {
            var me = this;
            Ext.apply(me, {
                items: [
                 { 
                     fieldLabel: 'First Name '+me.langKey,
                     name: 'first_name['+me.langKey+']',
                 }, {
                     fieldLabel: 'Last Name '+me.langKey,
                     name: 'last_name['+me.langKey+']',  
                 }]            
            });
            me.callParent( arguments );
        }
    
    });
    

    You can then pass through the custom config, just like you would with any other:

    {
        xtype: 'userinfo',
        lankKey: 'en',
        tabConfig: {
            title: 'Contact Details(EN)'
        }
    }
    

    Here’s a live example of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build an online ordering form for a restaurant. There are different
I built a dropdown menu using a script posted by another stack user, but
what's the point of using ant, maven, and buildr? won't the using build in
strtok wont work correctly when using char *str as the first parameter (not the
I'm trying to gradually build up an image based on user inputs. What I'm
I want to build a back end of a general web form which contains
I'm trying to build a safe user authentication system. The code is from http://net.tutsplus.com/tutorials/php/simple-techniques-to-lock-down-your-website/
in my application the user is requested to enter data in a form-like editor.
I'm using Sinatra and a client-side template called Dust.js (akin to Mustache) to build
So I've build this website in MVC3 in which I am using the default

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.