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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:31:30+00:00 2026-05-26T15:31:30+00:00

I have a screen where the formBase contains all of the dynamically created UI

  • 0

I have a screen where the formBase contains all of the dynamically created UI controls. I am using card layout and switching between views. Now it so happened that I have to execute the formBase for each time the card switches (I mean for each time my screen appears).

I have used the beforeshow listeners for form to achieve that. But its not working. Below is my code.

var formBase = new Ext.form.FormPanel({
        scroll: 'vertical',
        ui: 'round',
        items: [fieldSet, {
            xtype : 'fieldset',
            items : [ item1, item2, item3]
            ]
        }],
         listeners: {
            beforerender: function(ele) {
               console.log(" Screen before render");
               initScreenComps()
            },

            beforeshow: function(ele) {
                console.log(" screen before show");

            }
        }
    });

Edit:1

I have a viewport.js file, where i have reveal method to change the viewport. here is the below code of Viewport.js. Still it has no effect. pls suggest.

MyApp.views.Viewport = Ext.extend(Ext.Panel, {
    fullscreen: true,
    layout: 'card',
    initComponent: function() {
        Ext.apply(this, {

            items: [
                { xtype: 'MyApp.views.view1', id: 'view1' },
                { xtype: 'MyApp.views.view2', id: 'view2' },
                { xtype: 'MyApp.views.view3', id: 'view3' },
                { xtype: 'MyApp.views.view4', id: 'view4' },
                { xtype: 'MyApp.views.view5', id: 'view5' }             
            ],
        listeners:{
           beforecardswitch:function(newCard, oldCard, index, animated){
                 //do something...
               console.log(" Card switched"  + " New " + newCard + " OLD : " + oldCard + " index + " index);
           }
        }
        }
        );
        MyApp.views.Viewport.superclass.initComponent.apply(this, arguments);
    },

    // used for changing view port of application
    reveal: function(target) {      
        this.setActiveItem(MyApp.views[target],{ type: 'slide', direction: 'right' }
        );
    }
});

And now i am calling view2 from the controller, on button click event.

MyApp.views.viewport.reveal('view2');
  • 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-05-26T15:31:31+00:00Added an answer on May 26, 2026 at 3:31 pm

    I think, it will be best if you use “beforeactivate” or “activate” event listeners for it. These events get fired whenever the card layout sets this item as the active item. So, the code will be like this:

    var formBase = new Ext.form.FormPanel({
            scroll: 'vertical',
            ui: 'round',
            items: [fieldSet, {
                xtype : 'fieldset',
                items : [ item1, item2, item3]
                ]
            }],
             listeners: {
                beforeactivate: function(panel) {
                   console.log(" Screen before render");
                   initScreenComps()
                }
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a screen with a ListBox of items. The item template contains an
i have a screen with multiple little widgets (all with different divs around them).
I have a screen in my project that contains 3 UIScrollView . These scrollviews
I have a screen with several UISwitch controls. On my iPhone simulator this screen
I have an screen that displays all the names in the Contacts in a
I have a screen where i have 2 fullscreen views, and i want an
I have a screen that pops up on load with a print dialog using
I am new to Ruby, using ruby 1.9.2P180 and Rails 3.1.0.rc2 I have screen.css
I have created Pygame, which has objects (balls) which randomly move around the screen
I have a Screen base class from which all other Screens extend. Within this

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.