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

Web and WebWorks Development

Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

How to include CSS styles??

Hi all,


These are my queries...


1) Is it possible to combine both html content and RIM controls in single screen??


        in detail can i display a ButtonField of RIM and a marquee of html on the same screen


2) how to include css styles to my html that is to be displayed on the screen. (raw html page only)


currently in my program i followed in this manner. I saved the html doc locally, and using inputstream i streamed it and then i passed it to the browsersession.displayPage( output.toString() ); It is displaying theHTML content only, withhout any css styles applied. i included all the necessary files in the project locally. 


when i test this in IE or Mozilla it is working fine with css styles applied.  so how can i include these css styles. 


this my code snippet. 


try{ is = getClass().getResourceAsStream("/file/order.txt"); DataBuffer buffer = new DataBuffer(); byte []data = new byte[1024]; while( true) { int bytesread = is.read(data, 0, 1024); if(bytesread == -1) break; buffer.write(data, 0, bytesread); } is.close(); ByteArrayOutputStream output = new ByteArrayOutputStream(); Base64OutputStream boutput = new Base64OutputStream( output ); output.write("data:text/html;base64,".getBytes()); boutput.write(buffer.toArray()); boutput.flush(); boutput.close(); output.flush(); output.close(); BrowserSession bSession = Browser.getDefaultSession(); bSession.displayPage( output.toString() ); } catch(IOException ie) { add(new LabelField(ie.getMessage())); }




3) Is there any better way, please let me know, how to do that.




Thanks and Regards,