Re: Attribute-Select
Thorsten Weber <[email protected]> Fri, 12 Mar 2010 10:49:53 +0100
| Newsgroups | gmane.comp.cms.zms.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Christian
I did something similar like this:
1.) in dictionary there are numerous entries like:
getLangStr('RT_1',lang)
getLangStr('RT_2',lang)
etc...
2.) then I filled the select input (meta_id: RT_value) of custom obj from dictionary
<dtml-call "REQUEST.set('RT',[])">
<dtml-let lang_dict="getLangDict()">
<dtml-in lang_dict>
<dtml-comment><!-- RECIPE TIME --></dtml-comment>
<dtml-if "_['sequence-item']['key'].find('RT_') > -1">
<dtml-call "REQUEST['RT'].append([getLangStr(_['sequence-item']['key'],lang),getLangStr(_['sequence-item']['key'],lang)])">
</dtml-if>
</dtml-in>
</dtml-let>
<dtml-return "REQUEST['RT']">
3.) for output in dtml like always:
<dtml-if "getObjProperty('RT_value',REQUEST)">
<p><dtml-var "getObjProperty('RT_value',REQUEST)"></p>
</dtml-if>
hope this helps.
Thorsten
Am 12.03.2010 um 09:33 schrieb Christian Adolphi | meditix GmbH:
> Hello ZMS-Developers,
>
> I need an attribute inside a custom object, that uses a select input,
> which is dynamically filled with a method. I tried it with DTML, but I
> got this error:
>
> ...
> __traceback_info__: getObjInput
> * Module <string>, line 0, in ?
> * Module Products.zms._objattrs, line 541, in getObjInput
> * Module Products.zms._objattrs, line 481, in getObjAttrInput
> * Module Products.zms._objattrs, line 305, in getObjOptions
> IndexError: string index out of range
>
> It has to do with the search of the display strings for the select
> options and the language keys "OPT_*", I think.
>
> Any suggestions?
>
> Thank you very much.
>
> Christian Adolphi
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>