Hmmm....

.tml fragments for the components seems to be the way to go for me in this 
instance, I'll look further down this track.
I've already knocked up most of the html/css/js from some prototyping the UI 
last year - I'd rather just keep it XML-like rather than do it in code for this 
particular task.

Thanks for your suggestion - I saw it in jumpstart and thought it was Geoff's 
variable out of his utils package and didn't want to go down that alley :)

Chris



On 03/04/2012, at 7:34 PM, Lance Java wrote:

> This should work:
> 
> private static final String NEWLINE = System.getProperty("line.separator");
> ...
> 
> writer.element("div", "class", "userbackground");
> writer.writeRaw(NEWLINE);
> writer.element("div","id",currentPhone.getNumber(), "class","user");
> ...
> 
> On Tuesday, 3 April 2012, Chris Mylonas <ch...@opencsta.org> wrote:
>> Hi Tap List,
>> 
>> 
>> I've got production mode set to false and the parts of the html document
> that I haven't created come out quite nicely.
>> The parts I have rendered in my component (below) are coming out on one
> line.  It's the eye-sore of the document!!
>> 
>> How do I fix this?
>> 
>> 
>> I'm also wondering what the advantages are of using code to generate the
> html if I've already built the template in html?
>> This
>> 
>>               writer.element("div", "class", "userbackground");
>>               writer.element("div","id",currentPhone.getNumber(),
> "class","user");
>>               writer.element("div","class","infoline1");
>>               writer.element("div","class","name");
>>               writer.write(currentPhone.getName() + " " +
> currentPhone.getNumber());
>>               writer.end();
>>               writer.end();
>>               writer.element("div","class","infoline2");
>>               writer.element("div","class","voicemail");
>>               writer.element("img","src","email.png");
>>               writer.end();
>>               writer.end();
>>               writer.end();
>>               writer.element("div", "class","currentcall
> currentcallplaceholder");
>>               writer.writeRaw("&nbsp;");
>>               writer.end();
>>               writer.end();
>>               writer.end();
>>               writer.element("div","class","spacer");
>>               writer.end();
>> 
>> VS
>> this
>> 
>>               writer.writeRaw("" +
>>               "<div class=\"userbackground\">" +
>> "<div id=\"" + currentPhone.getNumber() + "\" class=\"user\">" +
>>   "<div class=\"infoline1\">" +
>>       "<div class=\"name\">" + currentPhone.getName() + " " +
> currentPhone.getNumber() + "</div>" +
>>       "</div>" +
>>   "<div class=\"infoline2\">" +
>>       "<div class=\"voicemail\"><img src=\"email.png\" /></div>" +
>>       "</div>" +
>>   "<div class=\"currentcall currentcallplaceholder\">&nbsp;" +
>>   "</div>" +
>> "</div>" +
>> "</div>" +
>> "<div class=\"spacer\">" +
>> "</div>");
>> 
>> 
>> 
>> It's just a copy paste, run over it with some backslashes where I need to.
>> 
>> Cheers
>> Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to