Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Create/Update Action Bar Dynamically #311

Closed
tneil opened this Issue · 28 comments

10 participants

@tneil
Owner

Create and modify an action bar dynamically after the screen has been inserted into the DOM

For the Action Bar:

  • show() [Completed]
  • hide() [Completed]
  • setSelectedTab(action) [Completed]
  • setBackCaption(caption) [Completed]

For an Action:

  • show() [Complete]
  • hide() [Complete]
  • setCaption(text) [Completed]
  • getCaption(); [Completed]
  • getAccentText();
  • setAccentText(value);
  • setImage(img) [Completed]
  • getImage(); [Completed]
  • enable() // Excludes tabs, tabs shouldn't be disabled, but the method will be stubbed out so there isn't an undefined error
  • disable() // Excludes tabs, tabs shouldn't be disabled, but the method will be stubbed out so there isn't an undefined error

General

  • Add sample page to show how to manipulate the control with JavaScript [Completed]
@tneil tneil referenced this issue from a commit
Tim Neil Added some functions for issue #311 and #310 9ec56ee
@tneil
Owner

setCaption() and setImage() have now been added for Action Items

@arturolinares arturolinares referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@lyricidal lyricidal referenced this issue from a commit
@lyricidal lyricidal Added setBackCaption to Action Bars #311, setOnCaption/setOffCaption …
…to Toggle Buttons #315 and added show, hide, remove to Scroll Panels
c39c5ca
@tneil
Owner

ActionBar setBackCaption() has now been implemented

@rrenna
using setCaption() on an action seems to break my ActionBar, not sure if it's a mistake somewhere in my code or not. Leaving the Action bar to be labelled declaratively works perfectly.
@tneil
Owner

Can you explain more what you're referring to by break?

Are you able to post a screenshot of what you are seeing?

Can you list the device and OS version combination that you are using?

The examples in the bbUI samples for action bar manipulation are working, so I'm wondering what you're seeing.

@rrenna

The issue was on my end, I'll update the comment to avoid confusion. Thanks Tim.

@tneil tneil referenced this issue from a commit
Tim Neil updates for issue #311 9d0a73a
@tneil
Owner

Added setSelectedTab(), getCaption(),getImage()

@tneil tneil referenced this issue from a commit
Tim Neil updates for issues #494 #311 #487 e6f2ece
@tneil
Owner

Added show() and hide()

@mtfranchetto

I'm a BB10 developer, when are you planning to release this updates?

appendAction(action)
insertActionBefore(newAction, existingAction)

Thanks

@tneil
Owner

It will likely be sometime in January

@tneil
Owner

Started work on the show(), hide()... Keeping a todo list here..

  • Simple show/hide on action button [Complete]
  • Add data-bb-visible attribute for initial action visibility [Complete]
  • Simple show/hide on action overflow item [Complete]
  • Add data-bb-visible attribute for initial action overflow item visibility [Complete]
  • Simple show/hide on tab [Complete]
  • Add data-bb-visible attribute for initial tab visibility [Complete]
  • Simple show/hide on tab overflow item [Complete]
  • Add data-bb-visible attribute for initial tab overflow item visibility [Complete]
  • Handle shadowing on action overflow button when tab appears/disappears beside it [Complete]
  • General glitches with action overflow button issues when dynamically changing tab/action visibility [Complete]
@tneil tneil referenced this issue
Closed

Screen Management #616

@gcsantiago

Simple show/hide on action button [Complete]

:+1: stay walking... i will follow :)

@tneil
Owner

First revisions for show, hide for actions/tabs that are not in the overflow menus are checked in.. there are still bugs with the action overflow button appearing/disappearing when you sometimes call show,hide on the items. I think this is a padding issue where the action overflow button wraps to the below the action bar.

But if you aren't using the action overflow menu on your action bar, this first check-in should work not too bad. Still more work to do

@tneil tneil referenced this issue from a commit
Tim Neil show, hide for tab overflow items issue #311 a4d674c
@tneil
Owner

Checked in some progress.. the darn show/hide for main actions/tabs on the action bar are giving me grief. Especially when you have tab/action overflow buttons. Combine that with the initial data-bb-visible attribute and it's a bit of a mess.

I'm going to have to do some major surgery on the action sizing code. But I have some ideas on how I can structure it to make things simpler than they are now.

@gcsantiago

never retreat, never surrender ! I appreciate your effort, and will be highlighted with my app behavior ! Thanks

@tneil
Owner

Making some pretty good progress today on the button/tab show and hide functions. Still some more tweaking yet, but I'm getting closer :o)

@tneil
Owner

Dynamic show/hide of actions is now checked in. The wiki has also been updated. All that we have left for action bars is enabled/disabled states for buttons :o)

Giddy-up!!

@tneil tneil referenced this issue from a commit
Tim Neil tweak for issue #311 e72bd5b
@andreyavram

Very good news! Thanks Tim!

@achan

Is appending actions to the action bar still on the road map? Any suggestions on how to do this in the meantime?

I am adding tabs to the actionbar from onscreenready... is that supposed to work? The web inspector shows that my divs have been appended to the actionbar, but they are unprocessed.

@splatterb0y

@achan
It will work if you add the markup in the onscreenready event, but not if you add it in the ondomready event because at this point all the markup is already processed by bbUI.js

 bb.init({onscreenready : function(element, id, params) {
        // Markup generated here will be processed by bbUI.js

       // Add markup with jQuery Example
       $("#selector", element).append('<input type="text"></input>');
     },
     ondomready: function(element, id, params) {
         // Markup generated here is not touched by bbUI.js
     }});
}, false);
@tneil
Owner

Correct, you should be able to manipulate adding/removing items in the onscreenready event. For the foreseeable future, I don't see the ability to add/remove/insert functions being available.

@rodnolan

This will work if you're hard coding the elements you want to add but you run into the issue described by @achan if you try to async load the page fragment. Maybe this idea #643 would solve that.

@achan

That was exactly what I was doing @rodnolan. My temporary solution was to load the objects that would represent my tabs into localStorage and pull them from there in onscreenready.

@splatterb0y

Can you please add the set/getAccentText?

@bert2002

Will it be possible to change the onclick event after the screen has been inserted into the DOM?

@tneil
Owner

@bert2002 you should be able to do that now by re-assigning the onclick

document.getElementById('myaction').onclick = function() {alert('hello world');};
@bert2002

@tneil oh that was easy and working as you said :) many thanks

@T-M-C

+1 for setAccentText(value)

@tneil
Owner

Closing this issue in favor of the new v1.0 markup and associated JavaScript interfaces based on issue #933

@tneil tneil closed this
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.