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: 72
Registered: ‎06-29-2009
My Device: Not Specified

Multi select choice field

Hi there all,

 

I am trying to create a field that is basically a ObjectChoiceField but allows for multiple selects. What would be the appropriate way to go about creating such a field?

 

Thanks,

Schalk 

Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Multi select choice field

You could try the ObjectListField along with the inherited field method MULTI_SELECT  like so :

 new ObjectListField(ObjectListField.MULTI_SELECT)

 

 

 

--If u are satisfied with the solution , please mark the thread as solved-- 

------------------------------------------------------------------------------------------------------------------------
Click the Kudos! badge on left side of the message , if you are happy with a solution given by a user. When you do so, you are saying thanks to its author.
Mark a reply as a solution , if you think your question has been answered.
To mark a message as a solution: Click "Accept as solution" icon on the reply.
Developer
Posts: 19,624
Registered: ‎07-14-2008
My Device: Not Specified

Re: Multi select choice field

ListField only allows a continuous selection when using  MULTI_SELECT.

 

I have another another suggestion.  In your ObjectChoiceField, you have to turn each Object into a String for display.  If you prefix each String with

 

Characters.BALLOT_BOX

 

then you have a little check box.  Then, when an item is selected, you prefix the String with

 

Characters.BALLOT_BOX_WITH_CHECK

 

instead.  Thus it looks like the users are 'checking' each item.  When they have finished, you need to go through the choices and look for the ones that are prefixed with Characters.BALLOT_BOX_WITH_CHECK and process these.

 

Just a thought.  I've done something similar with ListField, since it only provided continuous selections.

Developer
Posts: 207
Registered: ‎07-31-2009
My Device: Not Specified

Re: Multi select choice field

Excellent!!!
------------------------------------------------------------------------------------------------------------------------
Click the Kudos! badge on left side of the message , if you are happy with a solution given by a user. When you do so, you are saying thanks to its author.
Mark a reply as a solution , if you think your question has been answered.
To mark a message as a solution: Click "Accept as solution" icon on the reply.
Developer
Posts: 72
Registered: ‎06-29-2009
My Device: Not Specified

Re: Multi select choice field

Hi Peter,

 

That sounds awesome! I will give it a try.

 

Thanks,

Schalk 

Developer
Posts: 265
Registered: ‎08-27-2009
My Device: Not Specified

Re: Multi select choice field

Peter Can u please explain with a piece of code....i dint understand...

Developer
Posts: 19,624
Registered: ‎07-14-2008
My Device: Not Specified

Re: Multi select choice field

Guys, got to give credit where it is due, I saw the idea in the following KB article....

 

How To - Create a ListField with check boxes 
Article Number: DB-00471  
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800345/...

 

 

@belberry - hope this is enough code for you.

New Developer
Posts: 10
Registered: ‎12-15-2010
My Device: blackberry bold
My Carrier: s/w developer

Re: Multi select choice field

Hi ,,

 

My requirement is to select multiple contacts  in auto complete Field Or any List Box Field .How can  iSelect multiple contacts  .and to  use  the selected contact 's  details 

 

 

 Thanks