why when using 2 checkbox, the latest change or click is applied, the 
previous one is ignore to store in the session value? 
let say, i have two unchecked checkbox name : bevel and gosok_halus, when i 
click for all checkbox, first : bevel and then second click : gosok_halus, 
the value that been updated in session is gosok_halus is on the session 
storage, yet the bevel is remain unchecked after i refresh the page.
already tried onclick instead of onchange but got the same result, tried to 
remove ':eval' in ajax callback but got the same result. 
any idea how to make ajax callback with more than one checkbox in web2py 
way?
*e,g,*
*controllers*
def callback_4(session_order):
counter = int(request.vars.counter)
if request.vars.action == 'adjust_bevel':
id = int(request.vars.id)
quantity = int(request.vars['quantity_%s' % counter] )
bevel = request.vars.bevel
gosok_halus = request.vars.gosok_halus
if bevel == 'on':
bevel = ''
session_order[counter] = id, quantity, bevel, gosok_halus
elif bevel == '':
bevel = 'on'
session_order[counter] = id, quantity, bevel, gosok_halus
if request.vars.action == 'adjust_gosok_halus':
id = int(request.vars.id)
quantity = int(request.vars['quantity_%s' % counter] )
bevel = request.vars.bevel
gosok_halus = request.vars.gosok_halus
if gosok_halus == 'on':
gosok_halus = ''
session_order[counter] = id, quantity, bevel, gosok_halus
elif gosok_halus == '':
gosok_halus = 'on'
session_order[counter] = id, quantity, bevel, gosok_halus

*views*
        <td>
            {{if bevel == 'on':}}
            <form>
                <input type="checkbox" name="{{='bevel_%s' % counter}}" 
value="{{=bevel}}" checked
                onchange="ajax('{{=URL(link_callback, vars = dict(counter = 
counter, id = id, 
                bevel = bevel, gosok_halus = gosok_halus, action = 
'adjust_bevel') ) }}', 
                ['{{='quantity_%s' % counter}}'], ':eval' )" />
            </form>
            {{else:}}
            <form>
                <input type="checkbox" name="{{='bevel_%s' % counter}}" 
value="{{=bevel}}"
                onchange="ajax('{{=URL(link_callback, vars = dict(counter = 
counter, id = id, 
                bevel = bevel, gosok_halus = gosok_halus, action = 
'adjust_bevel') ) }}', 
                ['{{='quantity_%s' % counter}}'], ':eval' )" />
            </form>
            {{pass}}
        </td>
        <td>
            {{if gosok_halus == 'on':}}
            <form>
                <input type="checkbox" name="{{='gosok_halus_%s' % 
counter}}" value="{{=gosok_halus}}" checked
                onchange="ajax('{{=URL(link_callback, vars = dict(counter = 
counter, id = id, 
                bevel = bevel, gosok_halus = gosok_halus, action = 
'adjust_gosok_halus') ) }}', 
                ['{{='quantity_%s' % counter}}'], ':eval' )" />
            </form>
            {{else:}}
            <form>
                <input type="checkbox" name="{{='gosok_halus_%s' % 
counter}}" value="{{=gosok_halus}}"
                onchange="ajax('{{=URL(link_callback, vars = dict(counter = 
counter, id = id, 
                bevel = bevel, gosok_halus = gosok_halus, action = 
'adjust_gosok_halus') ) }}', 
                ['{{='quantity_%s' % counter}}'], ':eval' )" />
            </form>
            {{pass}}
        </td>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to