Hi,

1. You can use snippet attributes.
2. You can leave the divs in the template page and "attach" only
certain attributes from the snippet. Note that Scala XML API is
immutable but that was never an inconvenience for me :) ... you could
pattern match them easily.

Br's,
Marius

On Sep 10, 8:05 pm, "Kris Nuttycombe" <[EMAIL PROTECTED]>
wrote:
> Hi, all,
>
> I'm in the process of moving a Rails app over to Lift, and have a
> couple of questions about how to achieve a few things that aren't
> really addressed in the basic template tutorials.
>
> First, I have a situation where I have a list of orders, each of which
> has some number of items. What would the binding look like for
> something like the following?
>
> <lift:snippet type="Orders:list">
>   <order:id>sample_order_id</order:id>
>   <order:items>
>     <item:name>Sample Item</item:name>
>     <item:cost>$0.00</item:cost>
>   </order:items>
> </lift:snippet>
>
> Secondly, I know that there have been some additions since the
> discussion on dynamic node attributes 
> here:http://groups.google.com/group/liftweb/browse_thread/thread/c7fe7b4b3...
>
> What is the best way to go about porting something that looks like
> this in Rails:
>
> <div style="color:blue;cursor:pointer"
> onclick="document.getElementById('order_<%=
> order.id%>').style.display='block';this.style.display='none'">[View
> Details]</div>
>
> <div id="order_<%= order.id %>" style="display:none">
>  ...
> </div>
>
> It seems a bit odd to use different snippet functions to write the
> onclick and id attributes. I know that I could move the generation of
> both divs into the snippet, but that won't make our designers happy
> because they won't be able to play with the functionality in their
> browsers.
>
> Thanks,
>
> Kris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to