Hi there, I'm new in Zope, and I have some problems. The first: <dtml-var standard_html_header> <dtml-in expr="select_sql(qry_table='localitate', qry_fields='locID, localitate')"> <dtml-if expr="locid == locid_form"> <h3><dtml-var locid></h3><br><dtml-var locid_form><br><br> <dtml-else> <dtml-var locid><br><dtml-var locid_form><br><br> </dtml-if> </dtml-in> I get the <dtml-var locid_form> from a DTML Document. The goal is to highlight one line from the list. The second is related to the 1'st one : I have this select list: <select name=tipos size="3"> <dtml-in expr="select_sql(qry_table='tipOS', qry_fields='tipOS, descriere')"> <option value="&dtml-tipos;"><dtml-var descriere> </dtml-in> </select> I'd like to have a default selection, based on a input parameter. I fugured that it will be something like this: <select name=locid> <dtml-in expr="select_sql(qry_table='localitate', qry_fields='locID, localitate')"> <dtml-if expr="locid == locid_form" <option value="&dtml-locid;" selected><dtml-var localitate> <dtml-else> <option value="&dtml-locid;"><dtml-var localitate> </dtml-if> </dtml-in> </select> but it's not working, like I thought it would. So I need some help wit this, I allready RTFM, for a couple of time. Thanx. Bubu
=?ISO-8859-1?Q?Sz=E9kely_Csaba?= writes:
... The first:
... <dtml-if expr="locid == locid_form"> ...
I get the <dtml-var locid_form> from a DTML Document. Not sure, I understand this:
"locid_form" is a DTML Document that returns the value you want to compare against "locid"? If this interpretation is true, the you must call the DTML object (you should usually avoid DTML Document and use DTML Methods, or even Python Scripts). The best way is <dtml-if expr="locid == _.render(locid_form)">
The second is related to the 1'st one : ... You are on the right way. When you solved 1, your approach for 2 will work (though it could be shorted, by just putting the "selected" in a "dtml-if" and not the complete "option" element.)
Dieter
participants (2)
-
Dieter Maurer -
Székely Csaba