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: 950
Registered: ‎06-22-2010
My Device: 9550

Re: parse 2 elements at a time USING DOM

I mean to say this,

 

 

NodeList list = doc.getElementsByTagName("Title");
NodeList list1 = doc.getElementsByTagName("Description");

for (int i = 0; i < list.getLength(); i++) 
{
	Node textNode = list.item(i).getFirstChild();
	listElements.addElement(textNode.getNodeValue());
	Node textNode1 = list.item(i).getFirstChild();
	listElements.addElement(textNode.getNodeValue());
}

/*for (int i = 0; i < list1.getLength(); i++) 
{
	Node textNode = list.item(i).getFirstChild();
	listElements.addElement(textNode.getNodeValue());
}*/

 Be sure first that Ur code for titte is perfectly running.

 

Trusted Contributor
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer

Re: parse 2 elements at a time USING DOM

ok ll try it ..

Trusted Contributor
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer

Re: parse 2 elements at a time USING DOM

and in drawlistrow function should i need to do any modification , since now am displaying description too ?

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: parse 2 elements at a time USING DOM

U get the Description too, then No need to change drawListRaw Method.Ok..

 

 

----------------------------------------------------------------------------------------------------------

Press Kudoed if U got the Answer.

Thanks

Regular Contributor
Posts: 89
Registered: ‎07-13-2010
My Device: 8700

Re: parse 2 elements at a time USING DOM

hey kirthiga....coz of d second for loop u were gettin arrayindexoutofbound error...thts y i told u 2 check ur for loop...n d code tht nitin gave u wid for loop commented is correct...i gave u d same code yest...i think ur prob shd b solved nw...

Trusted Contributor
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer

Re: parse 2 elements at a time USING DOM

i get a empty screen .. neither title nor descpription is not displayed

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: parse 2 elements at a time USING DOM

Before U applying that,

r u getting the Title Correctly.

If yes then

Post Ur block of code.

Highlighted
Regular Contributor
Posts: 89
Registered: ‎07-13-2010
My Device: 8700

Re: parse 2 elements at a time USING DOM

Vector v=new v();

_list.setSize(v.size());

 

 

den after for loop...

 

_list.insert(i,new LabelField());
                
                    v.addElement(value.getNodeValue());

 

 

try dis...