Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 183
Registered: ‎12-17-2008
My Device: 8320

List out all the available ui components name dynamically.

Hi All,

 

I want to display, what are the available components in a list view dynamically

 

from the package net.rim.device.api.ui.component for blackberry device.

 

That means i want to list out all the class names available in component package at runtime.

 

Is there any API available to read all the ui.components at run time? Otherwise how can i achieve this?

 

Please help me on this.

 

Thanks,

Kumar


kums

******************************

Press kudos which the post help you
Please mark posts as solved if you got a solution
Developer
Posts: 183
Registered: ‎12-17-2008
My Device: 8320

Re: List out all the available ui components name dynamically.

anybody help me .

kums

******************************

Press kudos which the post help you
Please mark posts as solved if you got a solution
Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: List out all the available ui components name dynamically.

There is no way to do this.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 183
Registered: ‎12-17-2008
My Device: 8320

Re: List out all the available ui components name dynamically.

Thanks for your reply.

 

Is your answer , 100% sure?

 

any other suggestion to do this?

 

 

kums

******************************

Press kudos which the post help you
Please mark posts as solved if you got a solution
Developer
Posts: 723
Registered: ‎03-12-2009
My Device: Playbook

Re: List out all the available ui components name dynamically.

ping the javadoc and parse the HTML... What for anyways?
Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: List out all the available ui components name dynamically.

BlackBerry does not have a public method of reflection beyond Class.forName. Even then, not all UI components have a default constructor, thus making Class.forName useless as it will throw an exception when you try to create a new instance. Your only real option is what dnepr said, and also what he said "What for anyways?" Maybe there is an alternative.
---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 183
Registered: ‎12-17-2008
My Device: 8320

Re: List out all the available ui components name dynamically.

Thanks for your reply,

 

I achieve this concept in android side. In that i gave the system level path for accessing the framework.jar .

 

As the same way, is that any way to accesing the device system level to achieve the UI framework predefind classes.

 

Thanks

 

 

kums

******************************

Press kudos which the post help you
Please mark posts as solved if you got a solution
Developer
Posts: 183
Registered: ‎12-17-2008
My Device: 8320

Re: List out all the available ui components name dynamically.

Anybody please help? give me a suggestion

kums

******************************

Press kudos which the post help you
Please mark posts as solved if you got a solution
Developer
Posts: 16,652
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: List out all the available ui components name dynamically.

the BB file system is a virtual layer, there is no access to any OS files etc.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 19,624
Registered: ‎07-14-2008
My Device: Not Specified

Re: List out all the available ui components name dynamically.

Can I just confirm what a number of people have already told you a number of times, there is no way to find out the available components name dynamically.  Even if you could, you couldn't use any of the extra facilities anyway because you can't cast the class to anything that is not in the API that you have developed with. 

 

Can you answer the question asked early, why are you wanting to do this? 

 

Perhaps we can suggest another way.