Hola, aquí la solución. Es fácil.
selectnombre = SELECT(OPTGROUP(*opcions, _label="grupo"), _name="selNombre",
_id="selNombre",
_multiple="multiple")
Saludos!!
El lunes, 15 de febrero de 2010, 10:19:18 (UTC+1), hamdy.a.farag escribió:
>
> Hi
>
> I read this post
>
>
I will include OPTGROUP in trunk and some version of your patch.
Massimo
On Apr 24, 1:17 pm, Iceberg wrote:
> Hi Massimo,
>
> May I have your opinion about following patch?
>
> If you don't like it but just because you really hate to add a
> OPTGROUP helper, please tell me, I think I can adjust
Hi Massimo,
May I have your opinion about following patch?
If you don't like it but just because you really hate to add a
OPTGROUP helper, please tell me, I think I can adjust my patch to work
without a native OPTGROUP helper. It is up to you.
Regards,
Iceberg
On Apr21, 3:57pm, Iceberg wrote:
That is better, but still not good enough because form.accepts(...,
keepvalues=True) has no effect.
Anyway, Massimo gave enough hint for the correct direction. Here comes
my patch to html.py
__all__.append('OPTGROUOP') # Finally we have native OPTGROUP support!
class OPTGROUP(DIV):
tag = 'opt
Now I see the problem:
do this
class MYSELECT(SELECT):
def _fixup(self): pass
and use MYSELECT
On Apr 20, 10:41 pm, Iceberg wrote:
> Massimo's answer makes sense but does not entirely solve the problem.
>
> Using SELECT(...) instead of TAG.SELECT(...) in my previous sample
> code, does not
Massimo's answer makes sense but does not entirely solve the problem.
Using SELECT(...) instead of TAG.SELECT(...) in my previous sample
code, does not render proper html output. There are two unnecessary
blank option with wrong value.
I guess SELECT(...) need to be fixed to support TAG.OPTGROUP(
you must user SELECT and not TAG.SELECT. The former is derived from
INPUT an knows how to process options, tha latter is simply derived
from a DIV and does not.
On Apr 17, 1:08 pm, Iceberg wrote:
> Hi Denes and/or Massimo,
>
> I just pick up this old post
> fromhttp://groups.google.com/group/web
Hi Denes and/or Massimo,
I just pick up this old post from
http://groups.google.com/group/web2py/browse_frm/thread/971433920541935a
I used the code suggested by Denes, e.g. using TAG.SELECT and
TAG.OPTGROUP.
The code shows proper drop-down box but, after form.accepts(...) the
form.vars.my_field
So for future reference:
you can create OPTGROUPs with TAG.OPTGROUP
but do NOT use it with the SELECT helper,
you must use TAG.SELECT as in the following example:
def index():
OG=TAG.OPTGROUP
g1=[ OPTION( r.name, _value=r.id ) for r in
db(db.person.age<=30).select() ]
g2=[ OPTION(
true. Use TAG.select
On Feb 17, 10:06 am, DenesL wrote:
> Problem is that you can not use TAG.optgroup because it does not work
> with the SELECT helper.
>
> Here is a little example:
>
> def index():
> OG=TAG.OPTGROUP
> g1=[ OPTION( r.name, _value=r.id ) for r in
> db(db.person.age<=30).
Problem is that you can not use TAG.optgroup because it does not work
with the SELECT helper.
Here is a little example:
def index():
OG=TAG.OPTGROUP
g1=[ OPTION( r.name, _value=r.id ) for r in
db(db.person.age<=30).select() ]
g2=[ OPTION( r.name, _value=r.id ) for r in
db(db.person.a
Please let' snot proliferate these.
Use TAG.optgroup
On Feb 15, 3:19 am, "hamdy.a.farag" wrote:
> Hi
>
> I read this post
> http://groups.google.com/group/web2py/browse_thread/thread/f9967ef715...
>
> and I didn't find optgroup in html.py either
>
> so why not adding it since from time to time
12 matches
Mail list logo