[Lift] Traversing all the HTML nodes in YUI

2009-02-05 Thread David Pollak
Folks,

In jQuery, I can do something like:

jQuery(*).each(function() {});

To traverse all the elements in the document.  Is there something similar in
YUI?

Thanks,

David

-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Using Quaere in Scala

2009-02-05 Thread Meredith Gregory
Scalads and lasses and Lifted,
Does anyone have any experience with using Quaere under Scala? In
particular, i'm wondering if anyone has already done implementations for
flatMap, etc? This would seem a quick and relatively painless way to get
type safety on top of a nearly LINQ implementation that lacks some type
safety.

Best wishes,

--greg

-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105

+1 206.650.3740

http://biosimilarity.blogspot.com

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] JQuery corners

2009-02-05 Thread Alex Boisvert
Lifteds,

I'm trying to use jQuery
cornershttp://www.atblabs.com/jquery.corners.htmlin conjunction with
Lift... so I added the following in my header:

  script id=jquery-corners src=jquery.corners.min.js
type=text/javascript/
  script type=text/javascript
  $(document).ready(function(){
$('.rounded').corners();
  });
  /script

which works well and I get the desired effect on my links/buttons however
somehow it breaks form submission...

Is there a better/different way to initialize jQuery corners so it doesn't
upset Lift?

not-a-javascript-or-jquery-master,
alex

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Re: Using Quaere in Scala

2009-02-05 Thread Jorge Ortiz
You may want to look at this
http://szeiger.de/blog/2008/12/21/a-type-safe-database-query-dsl-for-scala/

--j

On Thu, Feb 5, 2009 at 11:21 AM, Meredith Gregory
lgreg.mered...@gmail.comwrote:

 Scalads and lasses and Lifted,
 Does anyone have any experience with using Quaere under Scala? In
 particular, i'm wondering if anyone has already done implementations for
 flatMap, etc? This would seem a quick and relatively painless way to get
 type safety on top of a nearly LINQ implementation that lacks some type
 safety.

 Best wishes,

 --greg

 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 806 55th St NE
 Seattle, WA 98105

 +1 206.650.3740

 http://biosimilarity.blogspot.com

 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Re: Need access to session variables when about to shut down a session.

2009-02-05 Thread Kris Nuttycombe
David, I'm a little confused by how to use registerCleanupFunc after your
most recent set of changes. It now appears to be package-private, so what is
the recommended way to register a cleanup func for a RequestVar? Previously,
I'd implemented my JNDIResource class for use with the JPA stuff like this:

object JNDIResource {
  val context = new InitialContext()
}

abstract class JNDIResource[T](val name: String) extends
RequestVar[T](context.lookup(name).asInstanceOf[T]) {

  // This is way too dependent upon an implementation detail of the
superclass.
  override def cleanupFunc : Box[() = Unit] = {
Log.debug(Initializing JNDI resource  + name + ( + this.is + ))
initialize(this.is) //this will result in a recursive call, but the the
order of operations is such that it will take the other branch.

Full(() = {
Log.debug(Releasing JNDI resource  + name + ( + this.is + ))
dispose(this.is)
  })
  }

  /**
   * Subclasses should override this method to provide initialization
   */
  protected def initialize(resource : T) {
  }

  /**
   * Subclasses should override this method to provide initialization
   */
  protected def dispose(resource: T) {
  }
}

Using the cleanupFunc like this was of course a complete hack to add the
ability to do additional delgated initialization to the variable retrieved
from the JNDI context. I can handle the initialization part by overriding
setFunc in my new implementation, but how can I set up the delegation to
dispose?

Thanks,

Kris


 On Feb 4, 11:56 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I've just realized that I'm a complete idiot.
  I need to totally re-do the clean-up mechanism.
 
  Please give me an hour.
 
  On Wed, Feb 4, 2009 at 3:06 PM, Kris Nuttycombe
  kris.nuttyco...@gmail.comwrote:
 
 
 
   Heh, this one just bit me too. I can't say I didn't warn myself,
 though:
 
 // This is way too dependent upon an implementation detail of the
   superclass.
 override def cleanupFunc : Box[() = Unit] = {
...
 }
 
   Kris
 
   On Wed, Feb 4, 2009 at 1:47 PM, David Pollak 
   feeder.of.the.be...@gmail.com wrote:
 
   That's because cleanUpFunc is gone.
 
   You must do:
 
   object sessDirHash extends SessionVar[String]() {
 registerCleanupFunc(session = println(Got hash:  + this.is))
 
   }
 
   On Wed, Feb 4, 2009 at 12:43 PM, Alli allilis...@gmail.com wrote:
 
   Hey David,
 
   Two questions this time:
 
   I've been playing with your commit earlier today and cleaning up
   SessionVar's.
   I got:
 
   object sessDirHash extends SessionVar[String]() {
def cleanUpFunc(sess: LiftSession) = {
 println(Got hash:  + this.is)
   }
 
   In my test snippet I got:
   sessDirHash(this is a test)
   println(Got var:  + ResizeMyPics.sessDirHash.is)
 
   I can see it printed out correctly after setting it but it's empty in
   the cleanup function.
 
   2)
   Second question, I submit a form and my flash component starts e.g. 3
   new sessions and POST's to /resize
 
   /resize sets a SessionVar variable but it's like it's only being set
   the first time. I'm printing out right before I register
   the clean up handler in the SessionVar, from my jetty logs:
 
   INFO - Service request (GET) /images/cancelbutton.gif took 9
   Milliseconds
   Rez Gots: 127.0.0.1
   Registering cleanup for: 1uvl5176sdy9r
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 270 Milliseconds
   Rez Gots: 127.0.0.1
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 91 Milliseconds
   Rez Gots: 127.0.0.1
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 481 Milliseconds
 
   I would think it should print out Registering cleanup handler ...
   after each /resize request since they are different sessions.
 
   Then the sessions all timeout and I can see there are 4 sessions
   expiring but there is only message printed out once
   from the clean up handler.
 
   What are your thoughts on this?
 
   Cheers,
   Alfred
 
   On Feb 4, 1:19 am, Alli allilis...@gmail.com wrote:
Thanks David, I'll get it tomorrow from scala-tools.org and finish
 up
the app.
URL will behttp://www.resizemypics.netafree service for people to
resize their pictures
and view them online. Just a simple, yet convenient service. Gives
 me
a chance to learn
more about lift as well. Been following lift for a while but this
 is
the first site I finish, have a
half finished blog site in lift. Doing all this stuff outside of
 work
so it's easy to get distracted.
 
Will let you know once the site is in production.
 
Again thanks for your help.
 
Cheers,
Alli
 
On Feb 4, 1:12 am, David Pollak feeder.of.the.be...@gmail.com
 wrote:
 
 0.11-SNAPSHOT is 0.10 with bug fixes.  It's very stable and will
 be
   1.0 on
 2/26.
 I'll commit up a fix to this problem in a few minutes.
 
 Also, what's the URL of the site? :-)
 
 On Tue, Feb 3, 

[Lift] Re: JQuery corners

2009-02-05 Thread Marius

Alex,

Do you have the actual markup without applying the corners and after
applying it?

What does it mean in breaks submission? ... No request is made?
request is made but doesn't call the user's function? Is only Ajax
affected or any form?

Br's,
Marius

On Feb 5, 9:29 pm, Alex Boisvert boisv...@intalio.com wrote:
 Lifteds,

 I'm trying to use jQuery
 cornershttp://www.atblabs.com/jquery.corners.htmlin conjunction with
 Lift... so I added the following in my header:

   script id=jquery-corners src=jquery.corners.min.js
 type=text/javascript/
   script type=text/javascript
   $(document).ready(function(){
     $('.rounded').corners();
   });
   /script

 which works well and I get the desired effect on my links/buttons however
 somehow it breaks form submission...

 Is there a better/different way to initialize jQuery corners so it doesn't
 upset Lift?

 not-a-javascript-or-jquery-master,
 alex
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Re: JQuery corners

2009-02-05 Thread Marius

By markup I meant the DOM tree...

Br's,
Marius

On Feb 5, 10:28 pm, Marius marius.dan...@gmail.com wrote:
 Alex,

 Do you have the actual markup without applying the corners and after
 applying it?

 What does it mean in breaks submission? ... No request is made?
 request is made but doesn't call the user's function? Is only Ajax
 affected or any form?

 Br's,
 Marius

 On Feb 5, 9:29 pm, Alex Boisvert boisv...@intalio.com wrote:

  Lifteds,

  I'm trying to use jQuery
  cornershttp://www.atblabs.com/jquery.corners.htmlin conjunction with
  Lift... so I added the following in my header:

    script id=jquery-corners src=jquery.corners.min.js
  type=text/javascript/
    script type=text/javascript
    $(document).ready(function(){
      $('.rounded').corners();
    });
    /script

  which works well and I get the desired effect on my links/buttons however
  somehow it breaks form submission...

  Is there a better/different way to initialize jQuery corners so it doesn't
  upset Lift?

  not-a-javascript-or-jquery-master,
  alex
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Re: Need access to session variables when about to shut down a session.

2009-02-05 Thread Kris Nuttycombe
Just to clarify, the use case for this post-assignment initialization is
this:

object EM extends
JNDIResource[EntityManager](java:comp/env/persistence/em) with
ScalaEntityManager {
  object t extends
JNDIResource[UserTransaction](java:comp/UserTransaction)

  override protected def initialize(em : EntityManager) = t.is.begin()
  override protected def dispose(em : EntityManager) = t.is.commit()
  override def em = this.is
}

On Thu, Feb 5, 2009 at 1:13 PM, Kris Nuttycombe
kris.nuttyco...@gmail.comwrote:

 David, I'm a little confused by how to use registerCleanupFunc after your
 most recent set of changes. It now appears to be package-private, so what is
 the recommended way to register a cleanup func for a RequestVar? Previously,
 I'd implemented my JNDIResource class for use with the JPA stuff like this:

 object JNDIResource {
   val context = new InitialContext()
 }

 abstract class JNDIResource[T](val name: String) extends
 RequestVar[T](context.lookup(name).asInstanceOf[T]) {

   // This is way too dependent upon an implementation detail of the
 superclass.
   override def cleanupFunc : Box[() = Unit] = {
 Log.debug(Initializing JNDI resource  + name + ( + this.is + ))
 initialize(this.is) //this will result in a recursive call, but the
 the order of operations is such that it will take the other branch.

 Full(() = {
 Log.debug(Releasing JNDI resource  + name + ( + this.is + ))
 dispose(this.is)
   })
   }

   /**
* Subclasses should override this method to provide initialization
*/
   protected def initialize(resource : T) {
   }

   /**
* Subclasses should override this method to provide initialization
*/
   protected def dispose(resource: T) {
   }
 }

 Using the cleanupFunc like this was of course a complete hack to add the
 ability to do additional delgated initialization to the variable retrieved
 from the JNDI context. I can handle the initialization part by overriding
 setFunc in my new implementation, but how can I set up the delegation to
 dispose?

 Thanks,

 Kris



 On Feb 4, 11:56 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I've just realized that I'm a complete idiot.
  I need to totally re-do the clean-up mechanism.
 
  Please give me an hour.
 
  On Wed, Feb 4, 2009 at 3:06 PM, Kris Nuttycombe
  kris.nuttyco...@gmail.comwrote:
 
 
 
   Heh, this one just bit me too. I can't say I didn't warn myself,
 though:
 
 // This is way too dependent upon an implementation detail of the
   superclass.
 override def cleanupFunc : Box[() = Unit] = {
...
 }
 
   Kris
 
   On Wed, Feb 4, 2009 at 1:47 PM, David Pollak 
   feeder.of.the.be...@gmail.com wrote:
 
   That's because cleanUpFunc is gone.
 
   You must do:
 
   object sessDirHash extends SessionVar[String]() {
 registerCleanupFunc(session = println(Got hash:  + this.is))
 
   }
 
   On Wed, Feb 4, 2009 at 12:43 PM, Alli allilis...@gmail.com wrote:
 
   Hey David,
 
   Two questions this time:
 
   I've been playing with your commit earlier today and cleaning up
   SessionVar's.
   I got:
 
   object sessDirHash extends SessionVar[String]() {
def cleanUpFunc(sess: LiftSession) = {
 println(Got hash:  + this.is)
   }
 
   In my test snippet I got:
   sessDirHash(this is a test)
   println(Got var:  + ResizeMyPics.sessDirHash.is)
 
   I can see it printed out correctly after setting it but it's empty
 in
   the cleanup function.
 
   2)
   Second question, I submit a form and my flash component starts e.g.
 3
   new sessions and POST's to /resize
 
   /resize sets a SessionVar variable but it's like it's only being set
   the first time. I'm printing out right before I register
   the clean up handler in the SessionVar, from my jetty logs:
 
   INFO - Service request (GET) /images/cancelbutton.gif took 9
   Milliseconds
   Rez Gots: 127.0.0.1
   Registering cleanup for: 1uvl5176sdy9r
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 270 Milliseconds
   Rez Gots: 127.0.0.1
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 91 Milliseconds
   Rez Gots: 127.0.0.1
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 481 Milliseconds
 
   I would think it should print out Registering cleanup handler ...
   after each /resize request since they are different sessions.
 
   Then the sessions all timeout and I can see there are 4 sessions
   expiring but there is only message printed out once
   from the clean up handler.
 
   What are your thoughts on this?
 
   Cheers,
   Alfred
 
   On Feb 4, 1:19 am, Alli allilis...@gmail.com wrote:
Thanks David, I'll get it tomorrow from scala-tools.org and
 finish up
the app.
URL will behttp://www.resizemypics.netafree service for people to
resize their pictures
and view them online. Just a simple, yet convenient service. Gives
 me
a chance to learn
more about lift as well. Been following lift for a while but this
 is
the 

[Lift] Re: Need access to session variables when about to shut down a session.

2009-02-05 Thread David Pollak
On Thu, Feb 5, 2009 at 12:13 PM, Kris Nuttycombe
kris.nuttyco...@gmail.comwrote:

 David, I'm a little confused by how to use registerCleanupFunc after your
 most recent set of changes. It now appears to be package-private, so what is
 the recommended way to register a cleanup func for a RequestVar? Previously,
 I'd implemented my JNDIResource class for use with the JPA stuff like this:

 object JNDIResource {
   val context = new InitialContext()
 }

 abstract class JNDIResource[T](val name: String) extends
 RequestVar[T](context.lookup(name).asInstanceOf[T]) {


The onShutdown method will always be called:

override protected def onShutdown(session: CleanUpParam): Unit = {
  dispose(this.is)
}

If you are putting something in the RequestVar that needs cleanup, you
should register the cleanup method on the session:

S.session.foreach(_.addSessionCleanup(session = cleanup))




   // This is way too dependent upon an implementation detail of the
 superclass.
   override def cleanupFunc : Box[() = Unit] = {
 Log.debug(Initializing JNDI resource  + name + ( + this.is + ))
 initialize(this.is) //this will result in a recursive call, but the
 the order of operations is such that it will take the other branch.

 Full(() = {
 Log.debug(Releasing JNDI resource  + name + ( + this.is + ))
 dispose(this.is)
   })
   }

   /**
* Subclasses should override this method to provide initialization
*/
   protected def initialize(resource : T) {
   }

   /**
* Subclasses should override this method to provide initialization
*/
   protected def dispose(resource: T) {
   }
 }

 Using the cleanupFunc like this was of course a complete hack to add the
 ability to do additional delgated initialization to the variable retrieved
 from the JNDI context. I can handle the initialization part by overriding
 setFunc in my new implementation, but how can I set up the delegation to
 dispose?

 Thanks,

 Kris



 On Feb 4, 11:56 pm, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  I've just realized that I'm a complete idiot.
  I need to totally re-do the clean-up mechanism.
 
  Please give me an hour.
 
  On Wed, Feb 4, 2009 at 3:06 PM, Kris Nuttycombe
  kris.nuttyco...@gmail.comwrote:
 
 
 
   Heh, this one just bit me too. I can't say I didn't warn myself,
 though:
 
 // This is way too dependent upon an implementation detail of the
   superclass.
 override def cleanupFunc : Box[() = Unit] = {
...
 }
 
   Kris
 
   On Wed, Feb 4, 2009 at 1:47 PM, David Pollak 
   feeder.of.the.be...@gmail.com wrote:
 
   That's because cleanUpFunc is gone.
 
   You must do:
 
   object sessDirHash extends SessionVar[String]() {
 registerCleanupFunc(session = println(Got hash:  + this.is))
 
   }
 
   On Wed, Feb 4, 2009 at 12:43 PM, Alli allilis...@gmail.com wrote:
 
   Hey David,
 
   Two questions this time:
 
   I've been playing with your commit earlier today and cleaning up
   SessionVar's.
   I got:
 
   object sessDirHash extends SessionVar[String]() {
def cleanUpFunc(sess: LiftSession) = {
 println(Got hash:  + this.is)
   }
 
   In my test snippet I got:
   sessDirHash(this is a test)
   println(Got var:  + ResizeMyPics.sessDirHash.is)
 
   I can see it printed out correctly after setting it but it's empty
 in
   the cleanup function.
 
   2)
   Second question, I submit a form and my flash component starts e.g.
 3
   new sessions and POST's to /resize
 
   /resize sets a SessionVar variable but it's like it's only being set
   the first time. I'm printing out right before I register
   the clean up handler in the SessionVar, from my jetty logs:
 
   INFO - Service request (GET) /images/cancelbutton.gif took 9
   Milliseconds
   Rez Gots: 127.0.0.1
   Registering cleanup for: 1uvl5176sdy9r
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 270 Milliseconds
   Rez Gots: 127.0.0.1
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 91 Milliseconds
   Rez Gots: 127.0.0.1
   Rez Rep Gots: 127.0.0.1
   INFO - Service request (POST) /resize took 481 Milliseconds
 
   I would think it should print out Registering cleanup handler ...
   after each /resize request since they are different sessions.
 
   Then the sessions all timeout and I can see there are 4 sessions
   expiring but there is only message printed out once
   from the clean up handler.
 
   What are your thoughts on this?
 
   Cheers,
   Alfred
 
   On Feb 4, 1:19 am, Alli allilis...@gmail.com wrote:
Thanks David, I'll get it tomorrow from scala-tools.org and
 finish up
the app.
URL will behttp://www.resizemypics.netafree service for people to
resize their pictures
and view them online. Just a simple, yet convenient service. Gives
 me
a chance to learn
more about lift as well. Been following lift for a while but this
 is
the first site I finish, have a
half finished blog site in lift. Doing all this stuff outside of
 work

[Lift] Re: Using Quaere in Scala

2009-02-05 Thread Meredith Gregory
Jorge,

Much obliged.

Best wishes,

--greg

On Thu, Feb 5, 2009 at 12:10 PM, Jorge Ortiz jorge.or...@gmail.com wrote:

 You may want to look at this
 http://szeiger.de/blog/2008/12/21/a-type-safe-database-query-dsl-for-scala/

 --j


 On Thu, Feb 5, 2009 at 11:21 AM, Meredith Gregory 
 lgreg.mered...@gmail.com wrote:

 Scalads and lasses and Lifted,
 Does anyone have any experience with using Quaere under Scala? In
 particular, i'm wondering if anyone has already done implementations for
 flatMap, etc? This would seem a quick and relatively painless way to get
 type safety on top of a nearly LINQ implementation that lacks some type
 safety.

 Best wishes,

 --greg

 --
 L.G. Meredith
 Managing Partner
 Biosimilarity LLC
 806 55th St NE
 Seattle, WA 98105

 +1 206.650.3740

 http://biosimilarity.blogspot.com




 



-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
806 55th St NE
Seattle, WA 98105

+1 206.650.3740

http://biosimilarity.blogspot.com

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Re: Need access to session variables when about to shut down a session.

2009-02-05 Thread Kris Nuttycombe
On Thu, Feb 5, 2009 at 1:43 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Thu, Feb 5, 2009 at 12:13 PM, Kris Nuttycombe 
 kris.nuttyco...@gmail.com wrote:

 David, I'm a little confused by how to use registerCleanupFunc after your
 most recent set of changes. It now appears to be package-private, so what is
 the recommended way to register a cleanup func for a RequestVar? Previously,
 I'd implemented my JNDIResource class for use with the JPA stuff like this:

 object JNDIResource {
   val context = new InitialContext()
 }

 abstract class JNDIResource[T](val name: String) extends
 RequestVar[T](context.lookup(name).asInstanceOf[T]) {


 The onShutdown method will always be called:

 override protected def onShutdown(session: CleanUpParam): Unit = {
   dispose(this.is)
 }

 If you are putting something in the RequestVar that needs cleanup, you
 should register the cleanup method on the session:

 S.session.foreach(_.addSessionCleanup(session = cleanup))


I don't think I understand this - will the RequestVar onShutdown hook get
not called at the end of the processing of each HTTP request?

Thanks,

Kris




   // This is way too dependent upon an implementation detail of the
 superclass.
   override def cleanupFunc : Box[() = Unit] = {
 Log.debug(Initializing JNDI resource  + name + ( + this.is + ))
 initialize(this.is) //this will result in a recursive call, but the
 the order of operations is such that it will take the other branch.

 Full(() = {
 Log.debug(Releasing JNDI resource  + name + ( + this.is +
 ))
 dispose(this.is)
   })
   }

   /**
* Subclasses should override this method to provide initialization
*/
   protected def initialize(resource : T) {
   }

   /**
* Subclasses should override this method to provide initialization
*/
   protected def dispose(resource: T) {
   }
 }

 Using the cleanupFunc like this was of course a complete hack to add the
 ability to do additional delgated initialization to the variable retrieved
 from the JNDI context. I can handle the initialization part by overriding
 setFunc in my new implementation, but how can I set up the delegation to
 dispose?

 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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: JQuery corners

2009-02-05 Thread Alex Boisvert
On Thu, Feb 5, 2009 at 12:28 PM, Marius marius.dan...@gmail.com wrote:

 Do you have the actual markup without applying the corners and after
 applying it?


The DOM trees are exactly the same, except for the unique ids that Lift
generate for the field names.


 What does it mean in breaks submission? ... No request is made?
 request is made but doesn't call the user's function? Is only Ajax
 affected or any form?


The request is made but it doesn't call my user function.

I'm not sure how to tell the difference between AJAX or any form...

My snippet is fairly straightforward:

  def entry(xhtml: Group): NodeSeq = {
var entry: String = 

def add() = {
  S.notice(entry: %s.format(entry))
}

bind(ts, xhtml,
  entry - SHtml.text(entry, entry = _, (maxlength, 30)),
  submit - SHtml.submit(Submit, add _, (class, rounded
{transparent} button)))
  }

alex

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[Lift] Re: JQuery corners

2009-02-05 Thread Alex Boisvert
Here's the page source.  (Please forgive the CSS mess... this is a work in
progress...)

alex

On Thu, Feb 5, 2009 at 2:48 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Thu, Feb 5, 2009 at 2:46 PM, Alex Boisvert boisv...@intalio.comwrote:

 On Thu, Feb 5, 2009 at 12:28 PM, Marius marius.dan...@gmail.com wrote:

 Do you have the actual markup without applying the corners and after
 applying it?


 The DOM trees are exactly the same, except for the unique ids that Lift
 generate for the field names.


 What does it mean in breaks submission? ... No request is made?
 request is made but doesn't call the user's function? Is only Ajax
 affected or any form?


 The request is made but it doesn't call my user function.

 I'm not sure how to tell the difference between AJAX or any form...


 Can you send over the page source as well?




 My snippet is fairly straightforward:

   def entry(xhtml: Group): NodeSeq = {
 var entry: String = 

 def add() = {
   S.notice(entry: %s.format(entry))
 }

 bind(ts, xhtml,
   entry - SHtml.text(entry, entry = _, (maxlength, 30)),
   submit - SHtml.submit(Submit, add _, (class, rounded
 {transparent} button)))
   }

 alex






 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp


 


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---




  
  

  



  

  

   Week [-1]




	Week 6
Feb. 4th to Feb. 11th 2009




  Week [+1] 

  
  
  
  

  
  

  

  
  What have you done? (syntax)
  

  

  

  
  
  
  

  
  

  

Invalid format: Unrecognized @ after "tas3"

  

  
  
  

  

  Day Description Duration Project Tags 


  Monday Implement DeploymentService 1.5h Server 5.3 @testing @tas3  

  

  
  

  Monday Implement DeploymentService 1.5h Server 5.3 @testing @tas3 [Delete]
  


  Tuesday Implement DeploymentService 1.5h Server 5.3 @testing @tas3 [Delete]
  

  Tuesday Implement DeploymentService 1.5h Server 5.3 @testing @tas3 [Delete]
  


  Total  33h   

  

  
  
  
  

  


  
  




[Lift] Re: Need access to session variables when about to shut down a session.

2009-02-05 Thread Alli

This works now smoothly.

On Feb 5, 8:50 pm, Kris Nuttycombe kris.nuttyco...@gmail.com wrote:
 On Thu, Feb 5, 2009 at 1:43 PM, David Pollak
 feeder.of.the.be...@gmail.comwrote:





  On Thu, Feb 5, 2009 at 12:13 PM, Kris Nuttycombe 
  kris.nuttyco...@gmail.com wrote:

  David, I'm a little confused by how to use registerCleanupFunc after your
  most recent set of changes. It now appears to be package-private, so what 
  is
  the recommended way to register a cleanup func for a RequestVar? 
  Previously,
  I'd implemented my JNDIResource class for use with the JPA stuff like this:

  object JNDIResource {
    val context = new InitialContext()
  }

  abstract class JNDIResource[T](val name: String) extends
  RequestVar[T](context.lookup(name).asInstanceOf[T]) {

  The onShutdown method will always be called:

  override protected def onShutdown(session: CleanUpParam): Unit = {
    dispose(this.is)
  }

  If you are putting something in the RequestVar that needs cleanup, you
  should register the cleanup method on the session:

  S.session.foreach(_.addSessionCleanup(session = cleanup))

 I don't think I understand this - will the RequestVar onShutdown hook get
 not called at the end of the processing of each HTTP request?

 Thanks,

 Kris



    // This is way too dependent upon an implementation detail of the
  superclass.
    override def cleanupFunc : Box[() = Unit] = {
      Log.debug(Initializing JNDI resource  + name + ( + this.is + ))
      initialize(this.is) //this will result in a recursive call, but the
  the order of operations is such that it will take the other branch.

      Full(() = {
          Log.debug(Releasing JNDI resource  + name + ( + this.is +
  ))
          dispose(this.is)
        })
    }

    /**
     * Subclasses should override this method to provide initialization
     */
    protected def initialize(resource : T) {
    }

    /**
     * Subclasses should override this method to provide initialization
     */
    protected def dispose(resource: T) {
    }
  }

  Using the cleanupFunc like this was of course a complete hack to add the
  ability to do additional delgated initialization to the variable retrieved
  from the JNDI context. I can handle the initialization part by overriding
  setFunc in my new implementation, but how can I set up the delegation to
  dispose?

  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 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: JQuery corners

2009-02-05 Thread Alex Boisvert
On Thu, Feb 5, 2009 at 3:02 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:

 Alex,

 I'm not seeing where the form is on the page.  Can you isolate the location
 of the form so we can see what kind of form is being generated... and
 perhaps also include the XHTML that invokes the snippet from your source.


The form in the source HTML is:

  h3What have you done? supa
href=syntaxnbsp;(syntax)/a/sup/h3
  lift:snippet type=Pager.entry form=POST
ts:entry/ nbsp; ts:submit/
  /lift:snippet

and my snippet source is:

  def entry(xhtml: Group): NodeSeq = {
var entry: String = 

def add() = {
  S.notice(entry: %s.format(entry))
}

bind(ts, xhtml,
  entry - SHtml.text(entry, entry = _, (maxlength, 90)),
  submit - SHtml.submit(Submit, add _, (class, rounded
{transparent} button)))
  }

which leads to this final HTML in the browser:

  h3What have you done? supa href=syntax (syntax)/a/sup/h3
  form method=post action=/timesheet/timesheet.html
input maxlength=90 type=text name=F517742881511ACF value=
/   input class=rounded {transparent} button type=submit
name=F517742881512J0M value=Submit /
  /form

alex

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---