[Lift] Re: how to use thread in lift

2009-08-31 Thread pravin

Thanks
its help me lot..
it made my lift easy.

Thanks

On Aug 28, 5:11 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Using threads in Lift is the same as using threads in any JVM-based
 application.  Scala has a particular friendly mechanism for dealing with
 threads called Actors (others have noted this).  Combined with Futures, they
 make for some nice coding.  Here's an example:

 import scala.actors._
 import Actor._

 object Actor1 extends Actor {
   def act = loop {
     react {
       case M1 =
       Thread.sleep(2000)
       reply((8 to 15).toList)
     }
   }

   this.start

 }

 object Actor2 extends Actor {
   def act = loop {
     react {
       case M1 =
       Thread.sleep(1000)
       reply((100 to 103).toList)
     }
   }

   this.start

 }

 val start = System.currentTimeMillis

 val f1 = Actor1 !! (M1, {case a: List[Int] = a})
 println(Got a future from Actor 1: +f1)
 println(Time1: +(System.currentTimeMillis - start))

 val f2 = Actor2 !! (M1, {case a: List[Int] = a})
 println(Got a future from Actor 2: +f2)
 println(Time2: +(System.currentTimeMillis - start))

 println(Answer: +(f1() ::: f2()))
 println(Took: +(System.currentTimeMillis - start))

 The main thread sends messages to the two different actors and receives a
 Future from each.  The time to receive the future is very short, but the
 thread blocks on the application of f1 and f2... waiting for the answers
 from the Actors.

 Hope you find this useful



 On Fri, Aug 28, 2009 at 2:05 AM, pravin pravinka...@gmail.com wrote:

  Hi,
  i want to use thread in my lift application.
  I have two Lists i.e. List1() and List2();
  when i click on submit button
  i want to do following things -

  i am executing to method  to populate above to list -;

  List1() = fun1();
  List2() = fun2();

  So i want to do above things with thread s

  thread 1 will do List1() = fun1();
  and thread 2 will do List2() = fun2();

  so i can increase performance of my application

  Note:serial execution is working

  Is this possible with lift

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://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] How to do pagination in lift application...

2009-08-28 Thread pravin

Hi..
i am using lift ORM (mapper framework) and MS SQL server(2008)
i want to do pagination in my application.

i tried with  to starAt() and maxRows() but this generate Limit
query...

And MSSQL server not support limit query (it uses top for same..)


So how can i do pagination  with Lift ORM and MSSQL Server


Thanks
-Pravin


--~--~-~--~~~---~--~~
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] how to use thread in lift

2009-08-28 Thread pravin

Hi,
i want to use thread in my lift application.
I have two Lists i.e. List1() and List2();
when i click on submit button
i want to do following things -

i am executing to method  to populate above to list -;

List1() = fun1();
List2() = fun2();

So i want to do above things with thread s

thread 1 will do List1() = fun1();
and thread 2 will do List2() = fun2();

so i can increase performance of my application

Note:serial execution is working

Is this possible with lift


--~--~-~--~~~---~--~~
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: error while SHtml.ajaxInvoke call

2009-08-24 Thread pravin

hi,
its former method i am using in my app(u mentioned it in last reply).

i have one text box and submit button.

when i click on submit button -
i have to show employee info on my GUI page.  (in text box i will
enter emp Id))

This info have to table
one table have information with ajax and other have info with normal
call.

how can i populate these two table when i click on submit button...


hope this will help u to understand my problem.


Thanks...

waiting for u reply

On Aug 21, 9:40 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 I still don't understand.

 Does the user do anything to get the faster table updated or do you want the
 faster table pushed from the server when something changes on the server?

 If it's the former (the user does something to get the faster table
 updated), you want to use ajaxButton... the user clicks on the button and
 the server-responds with JavaScript that updates the browser.

 If it's the latter (the user does nothing, but the server pushes changes to
 the client), see CometActor.  You can see an example in the Clock.scala code
 in the Lift sites/example project.



 On Fri, Aug 21, 2009 at 1:25 AM, pravin pravinka...@gmail.com wrote:

  Hi,
  Thanks for u r quick reply.
  Now I am explain my problem in details :

  I have normal form with one text box and one submit button.

  Also i have 2 table components(these are dynamic tables )..but these
  table are out of the from tag.These table only displays information.

  Flow of the application:

  When i click on submit button.
  i am population two Lists .

      One list get populated from DB.( Slower)
      second list get populated from hard code values (faster)

  Now i am populate above 2 tables with these two lists when i click on
  submit button.

  With the above flow i am able to populate above tables(synchronously).

  But now i want to configure Ajax into this so i can get faster
  results...(as one List get faster)
  while other list can get populated asynchronously.

  So when i click on Submit button i will populate one list ..but how
  can i populate other list with Ajax...

  i tried for following:
  i was planning when other table getting render  make ajax call with
  ajaxInvokebut i wont work...

  Please help ...

  Thanks in advance

  -Pravin

  On Aug 20, 6:56 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   On Wed, Aug 19, 2009 at 10:50 PM, pravin pravinka...@gmail.com wrote:

yes i have submit button.
on click event of this i am doing other tasks.

   What is the user interface (HTML) element that causes the Ajax update to
   happen?  What does the user do in order to get the Ajax thing to happen?

   ajaxInvoke is a very low level call.  If you want to have an Ajax button,
   use SHtml.ajaxButton.  If you want to have an Ajax form, use
  SHtml.ajaxForm.
    If you can describe what the user interaction should be, I'll write up
  some
   example code for you.

above data population for text is not on click submit button.

On Aug 20, 2:56 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Are you trying to create a link/button that someone clicks on to
  cause
the
 Ajax call to be made?

 On Wed, Aug 19, 2009 at 8:43 AM, pravin pravinka...@gmail.com
  wrote:

  Hi ,
  i am trying to configure Ajax in my application using lift.

  I have :

  lift:DisplayResults.showFeeds
               table border=0 width=100% class = resultheader
  cellpadding=10
                          t:feedsResultRows/
              /table
  /lift:DisplayResults.showFeeds

  snippet for given html code :

  def showFeeds(xhtml:NodeSeq):NodeSeq ={
        println(Inside showFeeds);
        bind(t, xhtml,feedsResultRows - SHtml.ajaxInvoke
  (updateStartDate)._2)
  }

  def updateStartDate () : JsCmd= {

      JsCmds.SetHtml(resultsRow, displayResult(List(abc,xyz)))
   }

  def displayResult(rList:List[Object]):NodeSeq={
        trtd 
                       table
                          trtdrList(0).toString()}/
  td
                          /tr
                          trtd{rList(1).toString()}/a /
  td
                          /tr
                       /table
                      /td/tr
   }

  But its not working-
  Giving out put on html page like-
                       lift_ajaxHandler('F966737512075R2E' + '=true',
  null, null)

  What is this 
  How can i use Ajax in my application.I want to give asynchronous
  call
  (Ajax) for my above html component so it can get show list that i
  get
  from Db call .

  This all  happening  on submit button click

  Appreciate any pointer regarding this

  -Pravin

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp

[Lift] i want sample code for ajaxForm

2009-08-24 Thread pravin

Hi,

i have one text box and one submit button on my html form...

how can i use ajaxForm method to do this,,,

i go through the sample codes from sample application that lift
provided ...but i want more details for ajaxForm


Thanks in advance...


-Pravin


--~--~-~--~~~---~--~~
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] why ajaxButton not submit the form

2009-08-24 Thread pravin

Hi
i have form with text box and Submit button(with ajax Submit button)

But when i submit the button form is not submitting so i am not able
to get the value of text box..
onclick function get called...

Just i want to show text value in response with ajax ...
how can i do this

--~--~-~--~~~---~--~~
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: error while SHtml.ajaxInvoke call

2009-08-21 Thread pravin

Hi,
Thanks for u r quick reply.
Now I am explain my problem in details :

I have normal form with one text box and one submit button.

Also i have 2 table components(these are dynamic tables )..but these
table are out of the from tag.These table only displays information.

Flow of the application:

When i click on submit button.
i am population two Lists .

 One list get populated from DB.( Slower)
 second list get populated from hard code values (faster)

Now i am populate above 2 tables with these two lists when i click on
submit button.

With the above flow i am able to populate above tables(synchronously).

But now i want to configure Ajax into this so i can get faster
results...(as one List get faster)
while other list can get populated asynchronously.

So when i click on Submit button i will populate one list ..but how
can i populate other list with Ajax...

i tried for following:
i was planning when other table getting render  make ajax call with
ajaxInvokebut i wont work...

Please help ...

Thanks in advance

-Pravin






On Aug 20, 6:56 pm, David Pollak feeder.of.the.be...@gmail.com
wrote:
 On Wed, Aug 19, 2009 at 10:50 PM, pravin pravinka...@gmail.com wrote:

  yes i have submit button.
  on click event of this i am doing other tasks.

 What is the user interface (HTML) element that causes the Ajax update to
 happen?  What does the user do in order to get the Ajax thing to happen?

 ajaxInvoke is a very low level call.  If you want to have an Ajax button,
 use SHtml.ajaxButton.  If you want to have an Ajax form, use SHtml.ajaxForm.
  If you can describe what the user interaction should be, I'll write up some
 example code for you.





  above data population for text is not on click submit button.

  On Aug 20, 2:56 am, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   Are you trying to create a link/button that someone clicks on to cause
  the
   Ajax call to be made?

   On Wed, Aug 19, 2009 at 8:43 AM, pravin pravinka...@gmail.com wrote:

Hi ,
i am trying to configure Ajax in my application using lift.

I have :

lift:DisplayResults.showFeeds
             table border=0 width=100% class = resultheader
cellpadding=10
                        t:feedsResultRows/
            /table
/lift:DisplayResults.showFeeds

snippet for given html code :

def showFeeds(xhtml:NodeSeq):NodeSeq ={
      println(Inside showFeeds);
      bind(t, xhtml,feedsResultRows - SHtml.ajaxInvoke
(updateStartDate)._2)
}

def updateStartDate () : JsCmd= {

    JsCmds.SetHtml(resultsRow, displayResult(List(abc,xyz)))
 }

def displayResult(rList:List[Object]):NodeSeq={
      trtd 
                     table
                        trtdrList(0).toString()}/
td
                        /tr
                        trtd{rList(1).toString()}/a /
td
                        /tr
                     /table
                    /td/tr
 }

But its not working-
Giving out put on html page like-
                     lift_ajaxHandler('F966737512075R2E' + '=true',
null, null)

What is this 
How can i use Ajax in my application.I want to give asynchronous call
(Ajax) for my above html component so it can get show list that i get
from Db call .

This all  happening  on submit button click

Appreciate any pointer regarding this

-Pravin

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

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://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] error while SHtml.ajaxInvoke call

2009-08-19 Thread pravin

Hi ,
i am trying to configure Ajax in my application using lift.

I have :



lift:DisplayResults.showFeeds
  table border=0 width=100% class = resultheader
cellpadding=10
 t:feedsResultRows/
 /table
/lift:DisplayResults.showFeeds


snippet for given html code :

def showFeeds(xhtml:NodeSeq):NodeSeq ={
   println(Inside showFeeds);
   bind(t, xhtml,feedsResultRows - SHtml.ajaxInvoke
(updateStartDate)._2)
}

def updateStartDate () : JsCmd= {

 JsCmds.SetHtml(resultsRow, displayResult(List(abc,xyz)))
 }

def displayResult(rList:List[Object]):NodeSeq={
   trtd 
  table
 trtdrList(0).toString()}/
td
 /tr
 trtd{rList(1).toString()}/a /
td
 /tr
  /table
 /td/tr
 }

But its not working-
Giving out put on html page like-
  lift_ajaxHandler('F966737512075R2E' + '=true',
null, null)

What is this 
How can i use Ajax in my application.I want to give asynchronous call
(Ajax) for my above html component so it can get show list that i get
from Db call .

This all  happening  on submit button click

Appreciate any pointer regarding this

-Pravin


--~--~-~--~~~---~--~~
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: error while SHtml.ajaxInvoke call

2009-08-19 Thread pravin

yes i have submit button.
on click event of this i am doing other tasks.

above data population for text is not on click submit button.


On Aug 20, 2:56 am, David Pollak feeder.of.the.be...@gmail.com
wrote:
 Are you trying to create a link/button that someone clicks on to cause the
 Ajax call to be made?



 On Wed, Aug 19, 2009 at 8:43 AM, pravin pravinka...@gmail.com wrote:

  Hi ,
  i am trying to configure Ajax in my application using lift.

  I have :

  lift:DisplayResults.showFeeds
               table border=0 width=100% class = resultheader
  cellpadding=10
                          t:feedsResultRows/
              /table
  /lift:DisplayResults.showFeeds

  snippet for given html code :

  def showFeeds(xhtml:NodeSeq):NodeSeq ={
        println(Inside showFeeds);
        bind(t, xhtml,feedsResultRows - SHtml.ajaxInvoke
  (updateStartDate)._2)
  }

  def updateStartDate () : JsCmd= {

      JsCmds.SetHtml(resultsRow, displayResult(List(abc,xyz)))
   }

  def displayResult(rList:List[Object]):NodeSeq={
        trtd 
                       table
                          trtdrList(0).toString()}/
  td
                          /tr
                          trtd{rList(1).toString()}/a /
  td
                          /tr
                       /table
                      /td/tr
   }

  But its not working-
  Giving out put on html page like-
                       lift_ajaxHandler('F966737512075R2E' + '=true',
  null, null)

  What is this 
  How can i use Ajax in my application.I want to give asynchronous call
  (Ajax) for my above html component so it can get show list that i get
  from Db call .

  This all  happening  on submit button click

  Appreciate any pointer regarding this

  -Pravin

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://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] how to use BySql query

2009-08-14 Thread pravin

Hi,
I am new to lift .
I am using mapper framework.
i have table emp with name ,salary, location columns


 now i want to put query to find employee whose salary is less than
1  and greater that 1000 and location is California.

For this i am using BySql query...as foolows -

val emp_List = emp_details.findAll(BySql(salary between ? and ?,
1000,1,IHaveValidatedThisSQL(pravin,2009-08-03)));

but when i compileing this i get following error -

java.io.IOException: MALFORMED[1]
at scala.tools.nsc.io.SourceReader$.decode(SourceReader.scala:
134)
at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:95)
at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:46)
at scala.tools.nsc.io.SourceReader.read(SourceReader.scala:65)
at scala.tools.nsc.Global.getSourceFile(Global.scala:211)
at scala.tools.nsc.Global.getSourceFile(Global.scala:217)
at scala.tools.nsc.Global$Run$$anonfun$compile$1.apply
(Global.scala:667)
at scala.tools.nsc.Global$Run$$anonfun$compile$1.apply
(Global.scala:667)
at scala.List.map(List.scala:805)
at scala.tools.nsc.Global$Run.compile(Global.scala:667)
at scala.tools.nsc.Main$.process(Main.scala:73)
at scala.tools.nsc.Main$.main(Main.scala:87)
at scala.tools.nsc.Main.main(Main.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.scala_tools.maven.executions.MainHelper.runMain
(MainHelper.java:105)
at org.scala_tools.maven.executions.MainWithArgsInFile.main
(MainWithArgsInFile.java:26)
error: IO error while decoding C:\Documents and Settings\pravin_karne
\Scala_workspace\mobworx\src\main\scala\com\mobworx\snip
pet\DisplayResults.scala with UTF-8
Please try specifying another one using the -encoding option
one error found



So what is cause of this error and is there other way to find it out


Thanks in advance
-Pravin

--~--~-~--~~~---~--~~
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] how to wtite scala code in dynamic table

2009-08-12 Thread pravin

Hi ,
i going to populate dynamic table contains.
but i want to do some validation before dispaly
how can i do this ...

e.g ..
i have one snippet with one method

abc(){
...
td width=45% valign=topp class=bedSleepHeader CellNo :
{ emp.CellNo} ,Name :{emp.Name} ,/p br/br
  /td

/// suppose if there no cell no i dont want to display this record how
can i add this code in this td
}


Thanks in advance
-Pravin

--~--~-~--~~~---~--~~
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: How to use Mapper and record framework

2009-07-31 Thread pravin

Hi Giuseppe,
Thanks for u r valuable support.i got the flavor of this framework.

I did one POC(sample application) with MySQL ...and its worked very
smoothly.

Is Lift provides support for MS SQL.?
Now i am using same thing with MS SQL but i am getting following
error :-

Message: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid
column name 'id'.
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError
(Unknown Source)
com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown
Source)

com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement
(Unknown Source)
 
 ..

In my application i am just reading table content with findAll method.

in my table i have only two fields - EmpId, EmpName

i checked all things but didnt get any clue


In short -
Is lift's mapper framework provides Support for MS SQL ?


Thanks
-Pravin


On Jul 30, 12:34 pm, Giuseppe Fogliazza g.foglia...@mcmspa.it wrote:
 Dear Pravin.
 Your requests address very basic behaviour of the framework, and you
 should not experience any problem in adapting examples from the
 aforementioned book.
 Even simpler you could follow the Todo example in Getting Started with
 Lift accessible from liftweb site (http://liftweb.net/docs/
 getting_started/mod_master.html).
 Related to persistency at the moment you should concentrate on using
 Mapper.
 Creating your model object is a breeze. Create a MyItem.scala file
 with the following entities (your project should have a model package
 to contain this stuff)

 class MyItem extends LongKeyedMapper[MyItem] with IdPK {
 def getSingleton = MyItem
 object name extends MappedPoliteString(this,64)}

 object MyItem extends MyItem with LongKeyedMetaMapper[MyItem]

 Modify the Schemifier line in Boot.scala to add your MetaMapper object
 Schemifier.schemify(true, Log.infoF _, User, MyItem)

 ... and now you can start having fun in creating the next web killer
 app using Lift.

 Regards
 Giuseppe

 On 30 Lug, 07:52, pravin pravinka...@gmail.com wrote:

  Hi,
  Guys i am new to Lift.

  I want to use mapper and record framework.

  I have following case:

  1. Table with two column [id,name] ...// I have MySQL DB

   2. i want to fire select query on above table

   3. Display above result on GUI

  How can i do this with mapper and record:

  I done with Boot.scala chages as per steps mentioned in Exploring
  Lift: Scala-based Web Framework book
  but i am not able to create mapper or record class ...how can i do
  this and put query on top of this.

  Also where can i get detail information about mapper and record
  framework as above book is not sufficient for this

  Thanks in advance..
  -Pravin

--~--~-~--~~~---~--~~
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] How to use Mapper and record framework

2009-07-30 Thread pravin

Hi,
Guys i am new to Lift.

I want to use mapper and record framework.

I have following case:

1. Table with two column [id,name] ...// I have MySQL DB

 2. i want to fire select query on above table

 3. Display above result on GUI

How can i do this with mapper and record:

I done with Boot.scala chages as per steps mentioned in Exploring
Lift: Scala-based Web Framework book
but i am not able to create mapper or record class ...how can i do
this and put query on top of this.

Also where can i get detail information about mapper and record
framework as above book is not sufficient for this


Thanks in advance..
-Pravin

--~--~-~--~~~---~--~~
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] How to configure MySQL In Lift

2009-07-29 Thread pravin

Hi,
I want to configure MySQL in my lift application.

From following site
http://scala-tools.org/scaladocs/liftweb/1.0/
 i come to know that there is one object called
net.liftweb.mapper.MySqlDriver.

So how can i use this for MySQL connectivity in my lift application.

Thanks
-Pravin

--~--~-~--~~~---~--~~
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] how to create data transfer object in lift

2009-07-20 Thread pravin

Hi,
i want to create DTO(data transfer object) of employee.

Then i want to create list of this employee object. want to display
this list on GUI.

How can i do this in lift.

--~--~-~--~~~---~--~~
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] How to use DTO(data transfer object) in lift

2009-05-19 Thread pravin

Hi,
How to use DTO(data transfer object) in lift.

e.g
In Java ,i have user defined object i.e Employee with
name ,address,emp Id, salary,department
attribute.

i want to display employee details on UI. for that i will make query
for Db for particular employee.
Will retrieve all attribute and create new employee object above
details.

So in scala, can we define such employee class(DTO) with getter setter
method?

is there any other way for this in scala?


Thanks in advance


--~--~-~--~~~---~--~~
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] how to display all template with chooseTemplate

2009-05-14 Thread pravin

Hi ,
I am using chooseTemplate in UI.

As per condition i am able to hide and display particular template but
suppose i want to display all templates at one condition ,how can i do
that.

e.g  suppose from count game example

case run if lastGuess == number =
xhtml = win(chooseTemplate(choose, win, xhtml))

case run  =
xhtml = nextGuess(chooseTemplate(choose, guess, xhtml))

 In this ,it displays one template(win or guess) at time ,
 but i want to display both template at time for particular condition.
 how can i do this?

Thanks in advance

--~--~-~--~~~---~--~~
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: how to hide /display div tag in lift

2009-05-07 Thread pravin

Hi,
If there are more than 10 div tags on page ,So how can we display or
hide them with chooseTemplate technique.
boz chooseTemplate  method chose one tag at time
e.g
val dispatch: DispatchIt = {
case run if lastGuess == number =
xhtml = win(chooseTemplate(choose, win, xhtml))

case run  =
xhtml = nextGuess(chooseTemplate(choose, guess, xhtml))

case count_down =
xhtml = countDown(attr(from).map(Helpers.toInt).openOr(0))
  }

this code is from site /examples (Number guess example)

can we chose multiple templates at a time so ,we can display no of div
tag ?
or is there any other way to do this?

Thanks in advace

On May 4, 7:33 pm, marius d. marius.dan...@gmail.com wrote:
 There are so many ways ...

 1. Use chooseTemplate technique. I think the examples application
 from /sites uses this.
 2. In the snippet you have the snippet content and you can just strip
 it out
 3. You can have a little JavaScript that is called when the page loads
 that shows or hides the div ... if you need something more dynamic.

 Br's,
 Marius

 On May 4, 1:28 pm, pravin pravinka...@gmail.com wrote:

  HI,

  I want to hide /display div tag.
  how can i controlled it from my snippet?
  my div tag contain table tag.

  Thanks

--~--~-~--~~~---~--~~
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: how to add object into session scope in lift

2009-04-29 Thread pravin karne
hi,
i want some explanation for following code

object sessionObj extends SessionVar[HashMap[String, Int]](
   new HashMap[String, Int]
 {
  override def default(key: String): Int = 0
}
)

1. how object extends class in scala.?
2. are we going to create object of SessionVar class?
3. are we calling constructor of given class?
4. is it similar to java class which extends other class ,and then create
object of subclass?

I am beginner to scala and lift.

On Tue, Apr 28, 2009 at 7:28 PM, Timothy Perrett timo...@getintheloop.euwrote:



 Try:

 // this gets you whatever is in the session object so add to it here
 SessionObj.is

 Do you specifically need to use Java HashMap? If not, seems like
 List[(String,Int)] would be more lift-esq.

 Cheers, Tim

 On 28/04/2009 13:30, pravin pravinka...@gmail.com wrote:

 
  Hi guys,
  I want to add objects into session scope.
 
  i am using following code :
 
  object sessionObj extends SessionVar[HashMap[String, Int]](
  new HashMap[String, Int]
{
 override def default(key: String): Int = 0
   }
  )
 
  So as per my understanding :-
 
  1. Session object is of HashMap[String, Int] type.
  2. I want to add no of string object into above map so i can
  access them during my session
 
  correct me if i am wrong
 
 
 So please let me know how can i add/remove  different String object
  from session scope with above code snippet
 
  Thanks in advance
 
  
 



 


--~--~-~--~~~---~--~~
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: how to add object into session scope in lift

2009-04-29 Thread pravin karne
what is the is+ method
 sessionObj.is+ (foo - 1)
how it differ from sessionObj.is(foo - 1)

On Tue, Apr 28, 2009 at 8:33 PM, David Pollak feeder.of.the.be...@gmail.com
 wrote:



 On Tue, Apr 28, 2009 at 5:30 AM, pravin pravinka...@gmail.com wrote:


 Hi guys,
 I want to add objects into session scope.

 i am using following code :

 object sessionObj extends SessionVar[HashMap[String, Int]](
new HashMap[String, Int]
  {
   override def default(key: String): Int = 0
 }
 )

 So as per my understanding :-

1. Session object is of HashMap[String, Int] type.
2. I want to add no of string object into above map so i can
 access them during my session


 to add an object to this session var:

 sessionObj.is+ (foo - 1)
 sessionObj.is+ (bar - 88)

 if (sessionObj.is.contains(bar)) println(yes, it works)

 The only caveat is that HashMap is not thread-safe and you might be
 accessing this object from multiple threads at the same time.





correct me if i am wrong


   So please let me know how can i add/remove  different String object
 from session scope with above code snippet

 Thanks in advance





 --
 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] how to add object into session scope in lift

2009-04-28 Thread pravin

Hi guys,
I want to add objects into session scope.

i am using following code :

object sessionObj extends SessionVar[HashMap[String, Int]](
new HashMap[String, Int]
  {
   override def default(key: String): Int = 0
 }
)

So as per my understanding :-

1. Session object is of HashMap[String, Int] type.
2. I want to add no of string object into above map so i can
access them during my session

correct me if i am wrong


   So please let me know how can i add/remove  different String object
from session scope with above code snippet

Thanks in advance

--~--~-~--~~~---~--~~
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] How to set different response in lift

2009-04-27 Thread pravin

Hi guys,

i want send xml response to request
when i click on button i should get xml file as response in browser .
How can i do that in lift?

Thanks in advanced.

--~--~-~--~~~---~--~~
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] from where can i get lifts sample examples

2009-04-27 Thread pravin

Hi guys,

i want sample examples of lift
from where i will get these sample examples?



--~--~-~--~~~---~--~~
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: How to create dynamic table in response

2009-04-21 Thread pravin karne
i have already done with this,

But this is static page.no of rows in display table is fixed.
 but suppose i have collection of data with variable  size , and i want to
display that data in table (e.g list of employee with details).

So my concern is how i iterate over collection dynamically in lifts.(In JSP
these is support of JSTL(Tag libraries)  [e.g c:test,c:forEach,c:if,]

How can i do this in lift


On Mon, Apr 20, 2009 at 6:44 PM, Dmitry Lipovoi dmitry.lipo...@gmail.comwrote:


 Is it what you looking for?

 http://wiki.liftweb.net/index.php/Lift_View_First

 On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:
 
  Hi,
  I want to create dynamic table into response.
  I have list of objects just i want to place them into table.
 
  Also i have to to place these rows conditionally.So i can use if
  else ,for loop in HTML code
 
 
  We can do this easily in JSP.(I am new to lift framework)
 
   Thanks in advance...!
 
  
 

 


--~--~-~--~~~---~--~~
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: How to create dynamic table in response

2009-04-21 Thread pravin

i have already done with this,

But this is static page.no of rows in display table is fixed.
 but suppose i have collection of data with variable  size , and i
want to display that data in table (e.g list of employee with
details).

So my concern is how i iterate over collection dynamically in lifts.
(In JSP these is support of JSTL(Tag libraries)  [e.g
c:test,c:forEach,c:if,]

How can i do this in lift

On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:
 Is it what you looking for?

 http://wiki.liftweb.net/index.php/Lift_View_First

 On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:

  Hi,
  I want to create dynamic table into response.
  I have list of objects just i want to place them into table.

  Also i have to to place these rows conditionally.So i can use if
  else ,for loop in HTML code

  We can do this easily in JSP.(I am new to lift framework)

   Thanks in advance...!

--~--~-~--~~~---~--~~
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: How to create dynamic table in response

2009-04-21 Thread pravin

but there is case ,
suppose, whether a particular row is  present depends on some
condition, leading to code like this :

%for(int a=0;acollection.size();a++){ //start loop
%

% if(condition)%// check
of condition
  trtd.../td/tr
% else{ %
   trtd.../td/tr
 %}   // if else block
closed
} // loop closed
%

we can do this in JSP ,what will be the corresponding code in lift

Sorry for such basic question but i am from JSP background and new to
lift

Thanks in advance





On Apr 21, 1:25 pm, marius d. marius.dan...@gmail.com wrote:
 Perhaps something like:

 // in your markup

 lift:TableFeed.build
 table
   t:rows/
 /table
 /lift:TableFeed.build

 // your snippet

 class TableFeed {

 val data = Item1 :: item2 :: Nil
 val empty: NodeSeq = NodeSeq.Empty

 def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
 td/tr)

 def build(xhtml: NodeSeq) : NodeSeq = {

   bind(t, xhtml,
     rows - buildRows
   )

 }
 }

 On Apr 21, 9:19 am, pravin pravinka...@gmail.com wrote:

  i have already done with this,

  But this is static page.no of rows in display table is fixed.
   but suppose i have collection of data with variable  size , and i
  want to display that data in table (e.g list of employee with
  details).

  So my concern is how i iterate over collection dynamically in lifts.
  (In JSP these is support of JSTL(Tag libraries)  [e.g
  c:test,c:forEach,c:if,]

  How can i do this in lift

  On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:

   Is it what you looking for?

  http://wiki.liftweb.net/index.php/Lift_View_First

   On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com wrote:

Hi,
I want to create dynamic table into response.
I have list of objects just i want to place them into table.

Also i have to to place these rows conditionally.So i can use if
else ,for loop in HTML code

We can do this easily in JSP.(I am new to lift framework)

 Thanks in advance...!

--~--~-~--~~~---~--~~
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: How to create dynamic table in response

2009-04-21 Thread pravin karne
I got that example also solution for my problem
Thanks Marius for u r valuable pointer

one more question ,how can i run these sites/
example applications.

I have created the jar file from given pom.xml.
but i am not able to run that jar file. could u please tell that?

Thanks


On Tue, Apr 21, 2009 at 5:49 PM, marius d. marius.dan...@gmail.com wrote:


 def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
 td/tr)

 is just an example that shows that you have full programmatic control
 for generating rows.

 such as:

 def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ (if
 (condition) trtd{r}/td/tr else ))

 There are many ways to do it ... this is just an example. You can also
 use chooseTemplate ... which you can find examples in the sites/
 example application (see CountGame)

 Br's,
 Marius

 On Apr 21, 1:57 pm, pravin pravinka...@gmail.com wrote:
  but there is case ,
  suppose, whether a particular row is  present depends on some
  condition, leading to code like this :
 
  %for(int a=0;acollection.size();a++){ //start loop
  %
 
  % if(condition)%// check
  of condition
trtd.../td/tr
  % else{ %
 trtd.../td/tr
   %}   // if else block
  closed} // loop
 closed
 
  %
 
  we can do this in JSP ,what will be the corresponding code in lift
 
  Sorry for such basic question but i am from JSP background and new to
  lift
 
  Thanks in advance
 
  On Apr 21, 1:25 pm, marius d. marius.dan...@gmail.com wrote:
 
   Perhaps something like:
 
   // in your markup
 
   lift:TableFeed.build
   table
 t:rows/
   /table
   /lift:TableFeed.build
 
   // your snippet
 
   class TableFeed {
 
   val data = Item1 :: item2 :: Nil
   val empty: NodeSeq = NodeSeq.Empty
 
   def buildRows: NodeSeq = (empty /: data)((l, r) = l ++ trtd{r}/
   td/tr)
 
   def build(xhtml: NodeSeq) : NodeSeq = {
 
 bind(t, xhtml,
   rows - buildRows
 )
 
   }
   }
 
   On Apr 21, 9:19 am, pravin pravinka...@gmail.com wrote:
 
i have already done with this,
 
But this is static page.no of rows in display table is fixed.
 but suppose i have collection of data with variable  size , and i
want to display that data in table (e.g list of employee with
details).
 
So my concern is how i iterate over collection dynamically in lifts.
(In JSP these is support of JSTL(Tag libraries)  [e.g
c:test,c:forEach,c:if,]
 
How can i do this in lift
 
On Apr 20, 6:14 pm, Dmitry Lipovoi dmitry.lipo...@gmail.com wrote:
 
 Is it what you looking for?
 
http://wiki.liftweb.net/index.php/Lift_View_First
 
 On Mon, Apr 20, 2009 at 4:37 PM, pravin pravinka...@gmail.com
 wrote:
 
  Hi,
  I want to create dynamic table into response.
  I have list of objects just i want to place them into table.
 
  Also i have to to place these rows conditionally.So i can use if
  else ,for loop in HTML code
 
  We can do this easily in JSP.(I am new to lift framework)
 
   Thanks in advance...!
 


--~--~-~--~~~---~--~~
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] how to call my servlet from lift form

2009-04-16 Thread pravin

Hi guys,
I am new to Lift framework.
I created one form. i want to submit this for to one servlet and
perform some business logic on form data and display other page.

How can i do this with the help of lift.

I short i want to do this like sample web application - form - web.xm
(navigartion rules)- servlet - web.xml --- other jsp


Thanks in advance

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