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
Highlighted
Developer
Posts: 82
Registered: ‎12-16-2010
My Device: BlackBerry Storm 9950
Accepted Solution

Append String with another String.

[ Edited ]

I have gotten the Text from this source XML document to appear in the BrowserField

 

 

 src="wp-content/uploads/2011/01/Chris_bild.jpg" 

 

 

 I was thinking far too much about this.  The question is more simple that I thought originally.

How can I programatically insert the string "fie:///store/home/" into the above string so it says?

 

 

src="fie:///store/home/users/wp-content/uploads/2011/01/Chris_bild.jpg"
Developer
Posts: 82
Registered: ‎12-16-2010
My Device: BlackBerry Storm 9950

Re: XML and HTML and Browserfields (oh my!)

Shameless bump.

Developer
Posts: 82
Registered: ‎12-16-2010
My Device: BlackBerry Storm 9950

Re: XML and HTML and Browserfields (oh my!)

have to bump it again. sorry.

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

Re: Append String with another String.

Sorry, I think I am missing the point here:

 

What is wrong with this java code:

 

String src="wp-content/uploads/2011/01/Chris_bild.jpg";

....

src="file:///store/home/users" + src;

Developer
Posts: 82
Registered: ‎12-16-2010
My Device: BlackBerry Storm 9950

Re: Append String with another String.

[ Edited ]

Sorry Peter, I edited the string I was working with down too far.

 

The full String that I have to work with is :

 

 

<p><img class="wp-image-17 size-full alignnone" title="Chris" src="wp-content/uploads/2011/01/Chris_bild.jpg" alt=""   /></p><p><strong>Chris</strong></p> <p>Some guy </p> <p>testing with some more text</p>

 

 

I dumbly posted only a part of it.  Making the issue seem more simple than it is.

 

That above code is pulled out of an XML file.  I need to trick the BrowserField into looking for that Chris_bild.jpg locally.  only way I can think to do that is do put the file path in the HTML.

 

The only way I can do that is to append that string with the missing parts.

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

Re: Append String with another String.

 

find the index you want to manipulate, for example using indexof("src=")

use substrings and add the parts together as you want.

----------------------------------------------------------
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: 82
Registered: ‎12-16-2010
My Device: BlackBerry Storm 9950

Re: Append String with another String.

So pull it apart into several substrings and then reassemble them together?

 

using that indexof() makes it dynamic?

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

Re: Append String with another String.

yes
----------------------------------------------------------
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: 82
Registered: ‎12-16-2010
My Device: BlackBerry Storm 9950

Re: Append String with another String.

::hugs Simon::