Skip to content

Create/Update Radio Button Dynamically #421

Closed
tneil opened this Issue Oct 26, 2012 · 5 comments

3 participants

@tneil
Open Source Projects member
tneil commented Oct 26, 2012

Ability to create and dynamically change the properties of a radio button dynamically after the DOM for a screen has been loaded.

  • show() [Completed]
  • hide() [Completed]
  • remove() [Completed]
  • Dynamic way to create/style a radio button after screen is inserted into the DOM [Completed]
  • Update the existing radio sample page to just show the control working [Completed]
  • Add sample page to show how to manipulate control with JavaScript similar to the Dynamic Buttons page [Completed]
@tneil
Open Source Projects member
tneil commented Oct 26, 2012

Creating the radio button dynamically should be similar to that of the button control

// Create the element just like you would in a normal screen declaration
var radio = document.createElement('input');
radio.setAttribute('type','radio');
radio.setAttribute('name', 'group1');
radio.setAttribute('value', 'foo');
radio.onclick = function() {
        alert(this.value);
    };

// Apply our styling
radio = bb.radio.style(radio);

// Insert it into the screen and update the scroller
document.getElementById('radioContainer').appendChild(radio);
bb.refresh();
@lyricidal

I've got show, hide, and remove done - will send pull request in a few minutes

@tneil
Open Source Projects member
tneil commented Oct 26, 2012

Cool.. only the dynamic creation and samples updates left to go.

I updated the wiki page and the change log

@karancan

Cool, @lyricidal got to it slightly before I could :)

@tneil tneil pushed a commit that referenced this issue Nov 9, 2012
Tim Neil sample updates for issue #421 b90deec
@tneil tneil pushed a commit that referenced this issue Dec 11, 2012
Tim Neil added dynamic addition of radio buttons for issue #421 80601f1
@tneil
Open Source Projects member
tneil commented Dec 11, 2012

Wiki has been updated so this can now be closed

@tneil tneil closed this Dec 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.