Configure fadeOut*** at one place
I separate business transaction from UI logic.
When create or update business model will occur notice or error,
and then do something for UI by the business transaction
for example:
business:
def MyBusinessTransaction(v: String) : Option[MyModel] = {
val myModel = MyModel.create.title(v)
myModel.validate match {
case Nil => {myModel.save();Some(myModel)}
case xs => {S.error(xs);None}
}
}
Snippet
def doSomething(): JsCmd = MyBusinessTransaction(v) match {
case Some(v) => //do something for UI, such as replace the old value
case None => //notice what's wrong. I could code fadeOutErrors(5 seconds, 1 second) if want, but should I code every where?
}
I think it's better could configure this at one place but not code every where.
Thanks
When create or update business model will occur notice or error,
and then do something for UI by the business transaction
for example:
business:
def MyBusinessTransaction(v: String) : Option[MyModel] = {
val myModel = MyModel.create.title(v)
myModel.validate match {
case Nil => {myModel.save();Some(myModel)}
case xs => {S.error(xs);None}
}
}
Snippet
def doSomething(): JsCmd = MyBusinessTransaction(v) match {
case Some(v) => //do something for UI, such as replace the old value
case None => //notice what's wrong. I could code fadeOutErrors(5 seconds, 1 second) if want, but should I code every where?
}
I think it's better could configure this at one place but not code every where.
Thanks
Leave a comment
on 2010-02-06 19:51 *
By github.importer
Imported from GitHub: http://github.com/dpp/liftweb/issues/235/find
(In revision:66e9cb3370e3c2f466642dfedaf4d568cc3a2721) Closes #235. Adds JsRules as a place to aggregate common constants related to JavaScript. added first two JsRules related to Fading HTML elements
Branch: master
Branch: master
on 2010-04-20 17:37 *
By Peter Robinett
Child association with ticket #485 was added