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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:04:38+00:00 2026-05-27T03:04:38+00:00

How do I define the target for _addButton? Below is the code I am

  • 0

How do I define the target for _addButton? Below is the code I am using. I read the Magento docs located here but they didn’t have this info: http://docs.magentocommerce.com/Mage_Adminhtml/Mage_Adminhtml_Block_Widget_Container.html#method_addButton

 $this->_addButton('rebuild_files', array(
    'label'     => Mage::helper('core')->__('Rebuild Special Cache'),
    'onclick'   => 'setLocation(\'http://mysite.com/page/\')',
    'class'     => 'rebuild',
)); 
  • 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-27T03:04:38+00:00Added an answer on May 27, 2026 at 3:04 am

    Setting a target is not possible because a container’s buttons are not inside a form, and it is the form’s target that makes a difference. Furthermore that button doesn’t trigger any form but uses javascript to direct the browser (hence the setLocation bit). Magento admin has a convenience function for what you want called popWin, it is shorthand for Window.open so the second parameter is the target window name.

    $this->addButton('rebuild_files', array(
        'label'     => Mage::helper('core')->__('Rebuild Special Cache'),
        'onclick'   => 'popWin("http://mysite.com/page/", "_blank")',
        'class'     => 'rebuild',
    ));
    

    PS. _addButton is a protected method. It is better to use the public addButton in case another developer should attempt to change it’s behaviour.

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

Sidebar

Related Questions

I'm using a set of Constant.m files, one per target, to define specific things
I have an ant build target using csc: <target name=compile> <echo>Starting compiling ServiceLauncher</echo> <csc
I am using the below statement to define the transitionstyle _viewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; in
I have an application developed using Adobe AIR. If the target machine is using
I have this as my target file: #define NUMTHREADS 4 #define ar 1000 #define
I want to define a target using a property as part of its name
I have this code header(location:login_success.php); The frame target code that I used in html
I have a ARM NEON Cortex-A8 based processor target. I was optimizing my code
How do you define dynamic variables in a makefile target? For example: all: VAR
code: #define f(a,b) a##b #define g(a) #a #define h(a) g(a) main() { printf(%s\n,h(f(1,2))); //[case

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.