Form handling and persisting values - LIFT

31 views
Skip to first unread message

Bhuvana

unread,
Jul 18, 2011, 10:43:38 AM7/18/11
to lif...@googlegroups.com
Hi,

I am trying to do a simple search form , hit and API with the values input by the user and display the response in another page.

I am able to do the first two parts as well as redirecting to a new page but having difficulty with persisting the response to display in the new page. I am not sure as to how to do it. I have create a model class RateReponse as below

class RateResponse {
   private var _pickUpLoc = ""
  private var _returnLoc = ""

  //Getter
  def pickUpLoc = _pickUpLoc
  def returnLoc = _returnLoc


  //Setter
  def serviceType_= (pLocValue:String):Unit = _pickUpLoc = pLocValue
  def specInstr_= (rLocValue:String):Unit = _returnLoc = rLocValue

}

I am trying to set values into this as soon as I get the response and access these values in the new page.

Could anyone help me out with this?

Thanks and Regards,
Bhuvana 

David Pollak

unread,
Jul 18, 2011, 11:58:29 AM7/18/11
to lif...@googlegroups.com
Please see http://simply.liftweb.net/index-Chapter-4.html#toc-Chapter-4

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To view this discussion on the web visit https://groups.google.com/d/msg/liftweb/-/LNhW7AOQvVgJ.
To post to this group, send email to lif...@googlegroups.com.
To unsubscribe from this group, send email to liftweb+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.



--
Lift, the simply functional web framework http://liftweb.net

Bhuvana

unread,
Jul 18, 2011, 3:34:58 PM7/18/11
to lif...@googlegroups.com
Thanks David. I checked that section but my issue is that I want to store the values in Domain model objects and access them in the next page. Storing all values in session might not be a good practice right?

Something like I give a search query and I want to create various objects from the response and display them in the Results page.

Any help is appreciated.

Thanks and Regards,
Bhuvana

Naftoli Gugenheim

unread,
Jul 20, 2011, 2:23:26 AM7/20/11
to lif...@googlegroups.com
So put the domain model object in the session. There's no difference if you keep it in memory outside of the session or in the session except for that if you keep it in global state then every use will see the same value, which you obviously don't want.
If you want to persist it, what backend would you want to use?



Thanks and Regards,
Bhuvana

--
You received this message because you are subscribed to the Google Groups "Lift" group.
To view this discussion on the web visit https://groups.google.com/d/msg/liftweb/-/KKSGC99KdKQJ.
Reply all
Reply to author
Forward
0 new messages