Oh...I think I found the reason...Thanks for the help
The reason is in my code
The binding to submit button is previous to binding to checkbox.
if the order is changed...it would work correctly
--~--~-~--~~~---~--~~
You received this message because you
Ah, yes. The bindings are processed in order, so the submit button has to
come last or it will fire before other bindings.
Derek
On Sat, Apr 25, 2009 at 12:38 AM, sailormoo...@gmail.com
sailormoo...@gmail.com wrote:
Oh...I think I found the reason...Thanks for the help
The reason is in
Glad you got it working :-)
Cheers, Tim
On Apr 25, 7:38 am, sailormoo...@gmail.com sailormoo...@gmail.com
wrote:
Oh...I think I found the reason...Thanks for the help
The reason is in my code
The binding to submit button is previous to binding to checkbox.
if the order is
Just a small clarification if I may.The binding order do not really
matter in terms of user's functions mapping. However the functions
mapped are called in the HTTP parameters order sent by the browser.
Br's,
Marius
On Apr 25, 3:53 pm, Derek Chen-Becker dchenbec...@gmail.com wrote:
Ah, yes.
So if I wanted to put a submit button at the top of the form instead of
(or in addition to) the bottom, how would I do that?
Chas.
marius d. wrote:
Just a small clarification if I may.The binding order do not really
matter in terms of user's functions mapping. However the functions
mapped
If you were going to do that I would suggest a hybrid approach. Use regular
HTML input tags for the submit in your form in the template and make your
last bound function execute the form processing function. So the template
could look like:
lift:My.snippet form=POST
input type=submit value=Hit
I just had another idea. You could add a guard field in your form using
SHtml.hidden and have it set a var to true:
var doForm = false
bind(...
guard - SHtml.hidden(() = doForm = true),
submit - SHtml.submit(...))
Then the submission function *would* get called twice, but you could
Or a third idea. Use a hidden to execute your processing function. From the
first example:
lift:My.snippet form=POST
input type=submit value=Hit Me! /
form:name /
form:desc /
form:call /
input type=submit value=Hit Me! /
/lift:My.snippet
And your snippet would look like:
class My {
Clever.
Derek Chen-Becker wrote:
If you were going to do that I would suggest a hybrid approach. Use
regular HTML input tags for the submit in your form in the template and
make your last bound function execute the form processing function. So
the template could look like:
My cup runneth over...
Derek Chen-Becker wrote:
Or a third idea. Use a hidden to execute your processing function. From
the first example:
lift:My.snippet form=POST
input type=submit value=Hit Me! /
form:name /
form:desc /
form:call /
input type=submit value=Hit Me! /
Thanks Timothy, but can you give an example of checkbox, because no
matter what I try, the binding function of checkbox doesn't seem to be
called when checkbox is set. I tried some trivious binding function,
but it's no effect still.
--~--~-~--~~~---~--~~
You
The example from the lift book doesn't work.
Listing 4.4: A checkbox example
SHtml.checkbox(false, if (_) frobnicate(), Full(snazzy), class -
woohoo)
and mine is
bind(entry, xhtml,
test_mode - SHtml.checkbox(false, if (_) option_list
= option_list ::: List(FlagEnum.TEST_MODE),
A checkbox should look like this:
var booleanThing: Boolean = false
def another(xhtml: NodeSeq): NodeSeq = {
bind(c,xhtml,
checkbox - SHtml.checkbox(booleanThing, booleanThing = _) %
(class - myCSSclass)
)
}
Cheers, Tim
On Apr 24, 2:16 am, sailormoo...@gmail.com
What doesn't work about the example? Do you get a compilation error, or it
just doesn't do what you want?
Derek
On Thu, Apr 23, 2009 at 7:16 PM, sailormoo...@gmail.com
sailormoo...@gmail.com wrote:
The example from the lift book doesn't work.
Listing 4.4: A checkbox example
I didn't get a compilation error, but the function in the checkbox
(Boolean) = Any doesn't seem to be called
bind(c,xhtml,
checkbox - SHtml.checkbox(booleanThing, booleanThing = _) %
(class - myCSSclass)
)
As the example, booleanThing is always false no matter if I clicked
the
You might find this helpful: http://is.gd/sfyT
Cheers, Tim
On Apr 23, 4:28 am, sailormoo...@gmail.com sailormoo...@gmail.com
wrote:
Hello:
And about the checkbox..
bind(entry, xhtml,
test_mode - SHtml.checkbox(false, if (_) option_list
= option_list :::
Hey,
this is a classic mistake as its not well documented - radio is unlike
any other bind, check out my example here:
http://gist.github.com/99713
Cheers, Tim
On Apr 22, 2:43 am, sailormoo...@gmail.com sailormoo...@gmail.com
wrote:
Hello:
var sex = M
val sex_map =
Thanks for the help ^.^
And if I want the choices are dynamic, what should I do ?
For example, there could be 3 radios, or maybe 5 radios.
I still cannot understand the mechanism of lift, but may I make such
binding?
def example(xhtml: NodeSeq): NodeSeq = bind(entry, xhtml,
radio - table{
Hello:
And about the checkbox..
bind(entry, xhtml,
test_mode - SHtml.checkbox(false, if (_) option_list
= option_list ::: List(FlagEnum.TEST_MODE), id-test_mode))
I have a option_list of List[FlagEnum.Value] for saving the options
(note : I have over 40 checkboxs), I am
19 matches
Mail list logo