AjaxRadio

112 views
Skip to first unread message

Julio

unread,
May 17, 2013, 10:55:42 PM5/17/13
to lif...@googlegroups.com
Hello Everyone,

I was successfully able to implement an ajaxRadio example with simple css-sel binding. 

My problem is that I don't know what will be the radio options during page load, only after an ajaxSubmit returns a parameter that will be used to generate the options.

What is the easiest way to bind ajaxRadios after page load?


Thank you, Julio

Mariano Lucchetta

unread,
May 18, 2013, 1:54:53 AM5/18/13
to lif...@googlegroups.com
Hi try the following


Best Regards

Julio

unread,
May 18, 2013, 3:01:56 PM5/18/13
to lif...@googlegroups.com
Mariano,

Thank you! idMemoize is what I needed.

Is it possible to bind a ChoiceHolder instead of a ChoiceItem? I have an unknown amount of options. I was able to prepend radio options via JsCmd with ajax working, but lift's wiring would not work.

Thank you, Julio

Mariano Lucchetta

unread,
May 18, 2013, 9:17:23 PM5/18/13
to lif...@googlegroups.com
You can call .toForm method from ChoiceHolder.

Julio

unread,
May 18, 2013, 10:05:28 PM5/18/13
to lif...@googlegroups.com
Mariano,

I tried that but wiring does not work. I'll try to post a sample.

Thank you, Julio

Julio

unread,
May 18, 2013, 10:54:53 PM5/18/13
to lif...@googlegroups.com

Julio

unread,
May 19, 2013, 1:06:17 PM5/19/13
to lif...@googlegroups.com
I figured the problem was I did something wrong with wiring and apparently I did.

val hello = ValueCell("")
val place = ValueCell("")

val msg = hello.lift{h =>  s"${h} ${place}"} // prints Hello ValueCell() (although using valuecell to print value is suggested: http://simply.liftweb.net/index-6.1.html#toc-Section-6.1)

Tried these but nothing.
val msg = hello.lift{h => place.lift{p => s"${h} ${p}"}} // prints FuncCell1(ValueCell(),<function1>)
val msg = hello.lift{h =>  s"${h} ${place.get}"} // prints Hello World (but place radio group does not update properly)

What's the right way of assigning a FuncCell to 2 ValueCells?

On Saturday, May 18, 2013 10:54:53 PM UTC-4, Julio wrote:
https://github.com/jcabrra/Lift-AjaxRadio-Wiring

Julio

unread,
May 23, 2013, 7:47:10 PM5/23/13
to lif...@googlegroups.com
Any hints?

Richard Dallaway

unread,
May 24, 2013, 6:43:16 AM5/24/13
to liftweb
Hey Julio - what effect are you trying to achieve? I can't figure it out from your question.



Any hints?
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Julio

unread,
May 24, 2013, 12:37:53 PM5/24/13
to lif...@googlegroups.com
I'm trying to concatenate 2 valuecell strings with Lift's Wiring. 

Julio

unread,
May 24, 2013, 12:37:54 PM5/24/13
to lif...@googlegroups.com
I'm trying to concatenate 2 valuecell strings with Lift's Wiring. 

On Friday, May 24, 2013 6:43:16 AM UTC-4, Richard Dallaway wrote:

Richard Dallaway

unread,
May 24, 2013, 12:59:30 PM5/24/13
to liftweb
This any use?

Welcome to Scala version 2.9.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import net.liftweb.common._
import net.liftweb.common._

scala> import net.liftweb.util._
import net.liftweb.util._

scala> import net.liftweb.util.Helpers._
import net.liftweb.util.Helpers._

scala> val x = ValueCell("Hello")
x: net.liftweb.util.ValueCell[java.lang.String] = ValueCell(Hello)

scala> val y = ValueCell("World")
y: net.liftweb.util.ValueCell[java.lang.String] = ValueCell(World)

scala> val z = (x lift y) { _ + _ }
z: net.liftweb.util.Cell[java.lang.String] = FuncCell2(ValueCell(Hello),ValueCell(World),<function2>)

scala> z.get
res0: java.lang.String = HelloWorld
     
scala> x.atomicUpdate( _ => "Hi")
res1: x.ValueType = Hi

scala> z.get
res2: java.lang.String = HiWorld


Julio

unread,
May 24, 2013, 3:26:22 PM5/24/13
to lif...@googlegroups.com
Yes, That works. Thank you. I wasn't aware you could use the lift method like that.
Reply all
Reply to author
Forward
0 new messages