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

Web and WebWorks Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Building HTML on the fly at run time - HOW TO?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
	<head>
	    <meta name="viewport" id="viewport" content="initial-scale=1.0,user-scalable=no" />
	    <meta name="x-blackberry-defaultHoverEffect" content="false" /> 
	    <link  rel="stylesheet" type="text/css" href="inbox.css"><link />
		<title>Message List</title>
		<script type="text/javascript" src="Scripts/common.js"></script>
		<script type="text/javascript" src="Scripts/actions.js"></script>
	</head>
	<body>
	    <div class="inboxList">
	        <div class="header" x-blackberry-focusable="true">
	            <p>Today</p>
	        </div>
	        <div class="listItem" x-blackberry-focusable="true" onclick = "openMessage()">
	            <img src="Images/new.png" />
	            <div class="title">SENDER_VARIABLE</div>
	            <div class="time">TIME_VARIABLE</div>
	            <div class="description">MESSAGE_VARIABLE</div>	            
	        </div>

 Can anyone give me a pointer as to how I would build the above using variables dynamically at run time where _VARIABLE would be replaced by values from a series of variables.

 

Thanks in advance

Highlighted
Developer
Posts: 37
Registered: ‎01-18-2011
My Device: Huron 8800
My Carrier: IM3

Re: Building HTML on the fly at run time - HOW TO?

	        <div class="listItem" x-blackberry-focusable="true" onclick = "openMessage()">
	            <img src="Images/new.png" />
	            <div class="title">SENDER_VARIABLE</div>
	            <div class="time">TIME_VARIABLE</div>
	            <div class="description">MESSAGE_VARIABLE</div>	            
	        </div>

If you want to change the _VARIABLE on the fly, you can easily do it using the javascript and I think the easiest way is by leveraging the jQuery. You might want to see jQuery replaceWith.

 

Using that API, you can replace the _VARIABLE inside the div by another value that changed in runtime.