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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:52:35+00:00 2026-06-11T21:52:35+00:00

I am new to develop Windows 8 app using HTML/Javascript. I want to create/remove

  • 0

I am new to develop Windows 8 app using HTML/Javascript.

I want to create/remove buttons in appbar dynamically.

For example, I have the following appbar div in html.

<div id="appbar" data-win-control="WinJS.UI.AppBar" data-win-options="{placement: 'top'}">
    <button id="button" data-win-control="WinJS.UI.AppBarCommand" 
        data-win-options="{id:'button', label:'Button', icon:'add'}" type="button">
    </button>
</div>

I want to replace the button triggered by some action, so what I did was replacing the innerHTML of appbar div as follows in js, but what I got was a strange blank square in appbar.

var appbar = document.getElementById("appbar");
var html = "<button data-win-control=\"WinJS.UI.AppBarCommand\" data-win-options=\"{id:'button', label:'Another Button', icon:'add'}\" type=\"button\"></button>";
appbar.innerHTML = html;

Any help is appreciated.

Thanks,

  • 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-11T21:52:36+00:00Added an answer on June 11, 2026 at 9:52 pm

    The recommendation for the app bar is to define all of your commands ahead of time and use hideCommands / showCommands to show & hide the commands in the appbar itself.

    However, if you DO want to create the commands yourself, dynamically, you only need to add one more step to your code:

    WinJS.UI.process(elementThatYouJustCreated);
    

    This will create the win control, and do all the work of getting that control setup.

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

Sidebar

Related Questions

I am trying to develop C# app where I want to have login form
I develop an app for Windows Phone 7 with using of Caliburn Micro and
I have to develop Windows C# application, using Visual Studio 2008. It have dynamical
I am fairly new to windows programming world. I want to develop a windows
I am new to Windows-8 metro app development, I am developing my app using
I have designed an interface for Windows. I want to develop it. Instead of
I am new to Ubuntu. Before, I used VS in Windows and develop applications
how to develop new facebook application (login , add photos ) using the api
I'm trying to develop a new webservice using JAX-WS and JAXB annotations. When I
I am using ASP MVC to develop a new project. I am using the

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.