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
Trusted Contributor
kirthiga
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer

use the values of one screen to nextscreen

screen 1:

 

    1. am parsing a rss as url using dom parser.

     2.fetch the values and display them in listfield.

 

eg:

      am fetching the title and displaying it in a list.

    say :

     

weather

politics

invention  

 

 

now ,

when i click  weather it should take me to next screen which displays the weather reports again as

a list.

 

 

can anyone help me how to sort it out?

 

 

 

 

 

 

Please use plain text.
Developer
WesleyT
Posts: 206
Registered: ‎07-02-2010
My Device: 8320 Curve
My Carrier: Vodacom

Re: use the values of one screen to nextscreen

I am not sure this will help but when you push to a new screen are you adding a parameter to the new screen's contructor ?

 

e.g

 

 

pushScreen(new TabAddPage(RegNo));

 

 

On the TabAddPage you will have two constructors :

 

 

public TabAddPage()
{    	
}

public TabAddPage(String RegNo) 
{
}

 When you pushscreen just add your variable.

 

Regards

 

Wes

 

Please use plain text.
Trusted Contributor
kirthiga
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer

Re: use the values of one screen to nextscreen

i ll explain yu clearly ,

 

 

screen 1 :

  

url = x

 

items in list of screen1 are:

 

weather

politics

invention

 

 

 

screen 2 :

 

url = y + the link of  selected item weather

 

items in list of screen 2 :

 

weather descrption

weather image

weather  degree

 

now my question is ,

 

how to implement this part ?

 

url = y + the link of  selected item weather in screen 2

 

 

 

 

Please use plain text.
Developer
swati-srivastava
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: use the values of one screen to nextscreen

navigationclick()

 {

    if(mylist.getSelectedindex==2) //assuming for weather

     {

       //url = y + the link of  selected item weather

       String str="link" ;// this str will contain link of selected item

        uiApplication.getUiapplication.pushscreen(new WeatherScreen(str))

     }

 }

 

class WeatherScreen extends MainScreen

{

   WeatherScreen(String str)

     {

        String url = y + str;

    //now use this url to send request and after u get data parse it and display the list field


      }

}

Please use plain text.
Trusted Contributor
kirthiga
Posts: 204
Registered: ‎07-14-2010
My Device: 8100
My Carrier: Blackberry developer

Re: use the values of one screen to nextscreen

thanks swati ..

 

can yu tell me as how to add in this line ?

 

conn = (StreamConnection) Connector.open ("--link1--" + " variable of selected item "; deviceside=true);

 

 

is this format correct ??

 

but if i give like this

 

the expression is marked as error

 

can yu give the correct format

Please use plain text.
Developer
nitinverma274
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: use the values of one screen to nextscreen

Yes Kirti,

The Solution in Your thread of Swati. Is Right.

That is the way which U want.

 

When U want to Use a value of One Screen in to other Screen then U have to Pass that Value

as Parameter Like this

 

uiApplication.getUiapplication.pushscreen(new WeatherScreen(str))

 

Then in the Other class

The Constructer has the responsibility to catch that Parameter.

But U have to remember that Both values have the same Data types.

Like This

 

class WeatherScreen extends MainScreen

{

   WeatherScreen(String str)

     {

        String url = y + str;

    }

}

 

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

 

Press Kudoed If Problem Solved.

Thanks.

Please use plain text.
Developer
WesleyT
Posts: 206
Registered: ‎07-02-2010
My Device: 8320 Curve
My Carrier: Vodacom

Re: use the values of one screen to nextscreen

I am sorry but no offence intended here, but is that not what i said ?

Please use plain text.
Developer
swati-srivastava
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: use the values of one screen to nextscreen

conn = (StreamConnection) Connector.open ("--link1--" + " variable of selected item "; deviceside=true);

 

 

i hope link1 i s a url,

 

link1+ variable must be together forming a url

 

please check on browser whether its returning u any data or not

 

also please mention the error as i think ots fine

Please use plain text.
Developer
nitinverma274
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: use the values of one screen to nextscreen

When U concat the Url with the Other var.. then U should confirm that the Final String U pass is the Correct URL or not.

 

 

Please use plain text.
Developer
swati-srivastava
Posts: 282
Registered: ‎02-25-2010
My Device: curve,bold,storm
My Carrier: Verizon,AT&T

Re: use the values of one screen to nextscreen

what u said wesley was right but may be the person didnt understand

Please use plain text.