Santiago,

I'm still puzzled why you actually need this and it doesn't seem very
lift-ish. Please take a look on lift-widgets project there is a demo
app as well in the test folder and you can see how we build widgets
usable in any lift app.

But let's get back to your case for one moment. Assume that at the
begining of the page you have:

<lift:foo.bar variable="value"/>
<lift:foo.bar variable="value1"/>
<lift:foo.bar variable="value2"/>

you can have something like:

object variables extends RequestVar[List[String]](Nil)

from your foo.bar snippet you just set

class Foo {
  def bar(xml: NodeSeq) : NodeSeq = {
    S.attr("variable") map (v => variables(variables.is ::: List(v)))

    NodeSeq.Empty
  }
}

So the values are accumulated in a RequestVar that later on you can
use when processing other snippets.

If you don't like the RequestVar approach you can consider using a
StatefulSnippet and keep the list of values in your snippet.

Now I'm not completely sure that this is something you're looking for
but this is what I could "compile" from your notes.

Br's,
Marius

On Jul 15, 8:29 pm, Naftoli Gugenheim <naftoli...@gmail.com> wrote:
> Could you explain better what you're trying to do?You could nest all the xml
> inside another snippet that takes note of what snippet calls it contains and
> returns it as is, letting lift process the nested snippets, which could then
> access the information made available by the outer snippet somehow.
>
> On Wed, Jul 15, 2009 at 1:02 PM, DFectuoso <santiago1...@gmail.com> wrote:
>
> > What I'm trying to do(and why I asked) is because i like to make
> > widgets that are easy to plug to any application that i can call just
> > by adding the source code and a html tag and lift binding are just
> > made for that. (For example a shoutbox widget)
>
> > So the one's I've made before(in php mostly) also had a admin console
> > (very simple tho) to know a little bit about the statistics, configure
> > some stuff and manage some information(change labels, or manage
> > comments or whatever). One thing i was never able to do right was
> > making that admin console know where it's been called without having
> > to log each invocation, so being a compiled language and not knowing
> > how it process the html(but it shouts at me if i do <br> instead of
> > <br/>) I decided to ask if there's a way to parse all the html in
> > compile time checking for that tag and get all the values either store
> > somewhere or available for that method.
>
> > On Jul 14, 11:07 pm, "marius d." <marius.dan...@gmail.com> wrote:
> > > On Jul 15, 8:10 am, DFectuoso <santiago1...@gmail.com> wrote:
>
> > > > I don't know if its possible, but lift have surprised me so many times
> > > > so far that it worth to ask.
>
> > > > I have a html lift binding that i would like to place on several
> > > > places of my web application like:
> > > > <lift:Foo.Bar variable="value"/>
> > > > <lift:Foo.Bar variable="value1"/>
> > > > <lift:Foo.Bar variable="value2"/>
>
> > > > Is there any way for Foo.Bar to programaticly know all the possible
> > > > values that it could receive in variable(and those being value, value1
> > > > and value2 and if someone adds a new binding somewhere else with
> > > > value3 then value3 too)?
>
> > > No because each line over there is a different invocation of a
> > > potentially "stateless" snippet meaning a new instance of Foo. Inside
> > > your snippet you can use S.attr("variable") to get the value of the
> > > variable.
>
> > > But what is the use case? ... what are you trying to solve?
>
> > > > Its a long shot but if you have any idea please do tell!
--~--~---------~--~----~------------~-------~--~----~
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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to