OK, things are working well with RequestVar, but now I need to know
how to kill it!
After I create and save my record, if I refresh the browser, I get
another record created. I did a temporary hack-fix with:
if(! myRecord.saved_?)
but I would just like to kill the RequestVar after the first
The code Derek included:
// Set the up the RequstVar to initialize a new MyUserClass by default
object userVar extends RequestVar[MyUserClass](MyUserClass.create)
By default creates a MyUserClass instance.
Maybe you want to init the RequestVar as an Empty Box and then
conditionally modify it.
Nice!
Things are moving now, thanks to your guidance. It's a matter of: 1)
knowing what you want to do, and 2) knowing how to do things with
Scala... duh, yea.
I will post my results in a few days after I get everything working
well, but the RequestVar is doing its job.
On Jun 8, 7:18 am,
Generally you can either use RequestVars or a StatefulSnippet class to keep
the values around on form resubmission. If you're using a Mapper class, you
really just need one RequestVar to hold your Mapper instance. For example,
if I had a Mapper class for a person with first name, last name and
I now have the due date arriving OK from the jQuery datepicker, and I
cobbled together some ugliness to give days left until the ToDo due
date, so that is good.
My problem now is since we are not using the 'magic' of the _toForm
methods for the form elements, I have to set each var value for the
Greg,
I dont really use toForm; have you explored doing it manually? It
seems like that would be able to tell you if there is a problem with
toForm on MappedDateTime.
I use mapped date time quite a bit and have no problems at all
persisting the dates :-)
Cheers, Tim
On Jun 3, 3:09 am, g-man
The only issue I would mention is that there's currently an open ticket
because MappedDateTime won't save the time portion when you use Derby. I
haven't had time to triage this yet.
Derek
On Wed, Jun 3, 2009 at 3:01 AM, Timothy Perrett timo...@getintheloop.euwrote:
Greg,
I dont really use
Very good!
I did a little homework, rearranged some things, and am getting some
nice results with the 'manual method'...
Since I am following the PocketChange app now rather than the ToDo
example, there is no 'todo' val in scope to bind, so the
todo.priority.toForm method will not work.
I have
Box is the base class. What you want is Full(2).
Derek
On Wed, Jun 3, 2009 at 8:53 PM, g-man gregor...@gmail.com wrote:
Very good!
I did a little homework, rearranged some things, and am getting some
nice results with the 'manual method'...
Since I am following the PocketChange app now
Are there no ideas for my problem?
I have many more questions saved up, but would like to clear each out
before starting a new one.
Thanks again!
On May 31, 1:57 pm, g-man gregor...@gmail.com wrote:
As I proceed to enhance the ToDo example, I have added a new field to
the ToDo.scala model:
10 matches
Mail list logo