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: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: Place EditField in Listfield

let suppose there are three row in listfield and i am selecting the first row on which i want to show a list check box where a user can select multiple days as he wants and now i have to show that selected values in my listfield how can i achieve this any idea .. if you can help me with some code snippet then its very good for me thank you for your intrest peter ..

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

Re: Place EditField in Listfield

Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: Place EditField in Listfield

hi peter yes it worked for me now i am now able to show a checkbox list when the first row selected. Now my question is how can i get the selected item and display it in the list ..... can you help me .

Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: Place EditField in Listfield

hey peter i have to show the Datepicker when a row is selected how can i do this any idea please help me ....
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Place EditField in Listfield

What problem are you having with this?

Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: Place EditField in Listfield

[ Edited ]

i have to show date picker when i will click on row and i have to show time on that row which is selected from the date picker how can i do this .. any help will be appreciated.... iam searchin in the forum but didnt get any relevant assiatance ...please help..

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

Re: Place EditField in ListField

There are two issues here:

 

1) How to make a row 'clickable'

2) How to update a row

 

Here is some code to do (1).  Now in your fieldChanged, you can call the DatePicker.

http://supportforums.blackberry.com/t5/Java-Development/How-to-select-an-item-in-a-listfield/m-p/550...

 

To do (2), if you look at the API, you will see that you can invalidate one Row in the ListField.  Do that and it will be repainted. 

Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: Place EditField in ListField

Thank you for your reply it was saturday and sunday so i can't reply so sorry for replying late. Ok i will do it and let you know thank you peter for your concern ...
Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: Place EditField in ListField

[ Edited ]

hey Peter as you told i am doing this

protected boolean navigationClick(int status, int time) 
{
if (_list.getSelectedIndex() == 0){
			DateTimePicker dateTimePicker = DateTimePicker.createInstance(Calendar.getInstance(), null, "hh:mm aa");
			dateTimePicker.doModal();
			this.invalidate();
			
}


 After doing this when i click first row of the list i see the time picker but when i click the ok button of the time picker  the row value donot updated... why this is so .....

Highlighted
Developer
Posts: 144
Registered: ‎03-15-2011
My Device: blackberry smart phone
My Carrier: Airtel

Re: Place EditField in ListField

[ Edited ]

get solved ... as peter told i have just implemented that like below

 

protected boolean navigationClick(int status, int time) 
{
if (_list.getSelectedIndex() == 0){
			
				dateTimePicker = DateTimePicker.createInstance(Calendar.getInstance(), null, "hh:mm aa");
				dateTimePicker.doModal();
				cal = dateTimePicker.getDateTime();
				date = cal.getTime();
				selectedTime = date.toString();
}

and in the drawListRow() method

public void drawListRow(ListField list, Graphics g, int index, int y, int w)
		   {
			  
			   if (index == 0){

				   g.drawText(selectedTime, 150, y, 0, w-100);
				   
			   }

 now its working fine thank you all for your concerns Smiley Happy