Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 74

jlescribanoc
Aspiring developer
Profile
Posts: 25
Reg: Aug 12, 2012
VALLADOLID, SPA...
6,500
09/09/12 02:49 AM (13 years ago)

How I know what ItemId of any screen?

Hi! I try to customize Menu Simple, generating dinamically form SQL server query .. I generate JSON file on-fly of menuListSimple and childsitem .. ok But How I identified a screen to include item "LoadScreenWithItemId" with value correct? Example "childItems":[ { "itemId":"menu_1", "itemType":"BT_menuItem", "titleText":"This is row 1", "loadScreenWithItemId":"1234" } .... Where I find the value "1234" in my BT App screens? Where is this information ? Thanks
 
theGreek
Aspiring developer
Profile
Posts: 648
Reg: May 25, 2011
Schaumburg, IL
7,830
like
09/09/12 06:03 AM (13 years ago)
Did you check the the "Show App's Configuration Data ".
 
jlescribanoc
Aspiring developer
Profile
Posts: 25
Reg: Aug 12, 2012
VALLADOLID, SPA...
6,500
like
09/09/12 09:03 AM (13 years ago)
Yeah! Thank gbakakos
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/09/12 01:10 PM (13 years ago)
Or, if you wanna get really fancy, you can use the "loadScreenObject" property instead of the "loadScreenWithItemId" property. Example: "childItems":[ { "itemId":"menu_1", "itemType":"BT_menuItem", "titleText":"This is row 1", "loadScreenWithItemId":"1234" } .... Like @gbakakos mentioned, you could get the id of the screen to load by looking at the config data screen in the apps control panel. But...what if you don't know which screen to load in advance? Or, what happens if you want to load an entirely new screen that does NOT exist in the app's master config.txt file? Hmm...How about the "loadScreenObject" property. You can use this to load a screen that does not exist yet... Example: "childItems":[ { "itemId":"menu_1", "itemType":"BT_menuItem", "titleText":"This is row 1", "loadScreenObject":"{"itemId":"na", "itemType":"BT_screen_customURL", "itemNickname":"Google", "dataURL":"http://www.google.com", "navBarTitleText":"Google"} } .... See how that works? You can dynamically load screens using this approach without knowing in advance what may or may not exist in the app's master config file.
 
Don
Aspiring developer
Profile
Posts: 40
Reg: Aug 10, 2012
moving within e...
2,550
like
09/25/12 06:08 AM (13 years ago)
Hey guys, Thanks for sharing this. I am trying to achieve something similar : loading a screen from a custom button that I have added manually in the code (not part of a BT_screen_menuButtons). I don't manage to pass the new screen parameters correctly. Here is currently the java code I have for my button, and it's not working Button bmore= (Button) findViewById(R.id.bmore); bmore.setOnClickListener(new OnClickListener() { public void onClick(View v) { // creating a new BT_item with custom parameters mybtitem = new BT_item(); mybtitem.setItemType("BT_screen_blank"); mybtitem.setItemId("55555"); mybtitem.setItemNickname("mynickname"); //calling loadScreenObject static method here, and I don't get it right, not knowing well enough what does each of the 4 arguments BT_act_controller.loadScreenObject(thisActivity, screenData, mybtitem, <don't know what to put here as 4th argument or what it is used for>); } }); I am desperately trying to make this work and would really need some help :)
 
Don
Aspiring developer
Profile
Posts: 40
Reg: Aug 10, 2012
moving within e...
2,550
like
09/25/12 07:34 AM (13 years ago)
I have found a "temporary" solution that I have written here: https://www.buzztouch.com/forum/thread.php?tid=E2A10EE0BA2D9B7BE960C2F Please consider it as a temporary solution, and please write your solution if you have one, it is probably better (I am definitely no expert in java) Hope it can help the community
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/26/12 12:37 AM (13 years ago)
Great work @Don, I posted a detailed response in the other post here: https://www.buzztouch.com/forum/thread.php?tid=E2A10EE0BA2D9B7BE960C2F
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.