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: 19,629
Registered: ‎07-14-2008
My Device: Not Specified

Re: ListField Issue

I;m not sure what you are asking in the last post.  Your code does not explain much.  When you ask a question, it is important that you explain what you are trying to do, and why it is failing and what you are actually seeing. 

 

But in answer to your previous post I normally increase 'y' by adding the height of the font I have used to write the previous line. 

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: ListField Issue

In that code i was trying to implement variable height to custom field. Which is not implementing..

Developer
Posts: 16,682
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: ListField Issue

it is useful to keep one thread about one topic. if that is solved, open a new thread for a new problem instead of switching from one to another again and again.
----------------------------------------------------------
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,629
Registered: ‎07-14-2008
My Device: Not Specified

Re: ListField Issue

I agree with Simon's comment. 

 

In your response, you say "Which is not implementing..". 

 

I suggested in my previous post that "you explain what you are trying to do, and why it is failing and what you are actually seeing.".

 

"is not implementing" is just a different way of saying "I am unable to display variable height" which is what you said last time. 

 

Can you please expand on this comment as suggested?  What is the height of each Field suppsed to be set to?  What do you actually see.  Have you done anything like set a Background on the Field (See Background and BackgroundFactory classes), so you know what size it is on the Screen.  Have you made the Field focusable? 

 

We are trying to help, but you have to make it as easy as posisble for us. 

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: ListField Issue

Thanks for your suggestions. I want a Custom Field which will be like listfield in which height of each row should be variable. In the previous comment in which i have specified i am trying to vary height. But its not getting displayed.

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: ListField Issue

Is there anyone on this forum to help me in this problem?
Developer
Posts: 19,629
Registered: ‎07-14-2008
My Device: Not Specified

Re: ListField Issue

As noted, I think the issue is that you are not helping us.

 

Start with something very simple (copy a sample), add it to you screen, and make sure it works.  Keep adding functionality to this until it breaks.  Then you will know what the problem is.  Post that code and describe, in detail, what the problem is.  What you see, what you expect, screen shots if needed etc.  We are not mind readers, we do this in our spare time, so you need to make sure we can help you with the least effort. 

 

OK?

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: ListField Issue

CustomListControl

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: ListField Issue

[ Edited ]

I have posted wireframe above.I want such CustomListControl with rows should be variable in height.

class CustomListField extends Field
{
private String [] strHeader;
private String str;

public MultiElementTextField(String [] strHeader,String str, long style) throws IllegalArgumentException
{
super(style);
this.str=str;
this.strHeader=strHeader;
}

public boolean isFocusable()
{
return true;
}

protected void layout(int arg0, int arg1)
{
int height;
height = str.length/9;
if(height%9 > 0)
height++;
height = height * 20;
int _fieldWidth = Display.getWidth();
setExtent(_fieldWidth, height);
}

protected void paint(Graphics graphics)
{
graphics.drawText(strHeader, 5, 5);
for(int i=0;i<str.length;i++)
{
graphics.drawText(str[i],5,30,DrawStyle.ELLIPSIS);
}

}
}

 

I will call it in loop until my data is getting parsed and coming from web server. Is it a right way? what should i do?

Developer
Posts: 255
Registered: ‎05-03-2012
My Device: 9930
My Carrier: Vodafone

Re: ListField Issue

@peter_strange: I have posted code and wireframe...now can u pls help?