Hi Matt,

Once again, thanks for your help.

At 11:02 AM 28/06/2004 -0400, Matt Feifarek wrote:
I'm not sure what "pr" is, but I'm assuming it's output.

Yes, it is a shortcut for self.writeln.

What's happening in your code is that your're outputting the field before you give it choices. So, the tag will not reflect the changes that you made after you output it.

Set your choices before you output the tags.

That did it. Many thanks.

CLIFFORD ILKAY wrote:

Hi,

I am trying to bind the results of a database query to a FormKit SelectField. Here is my code:

################
newForm.addField(Fields.SelectField('groupType',label="Group Type"))

# get group types using a SQLObject select() method
groupTypes = GrpType.select(orderBy=GrpType.q.description)

pr('''\t<tr><td>%s</td>''' % newForm.groupType.label())
pr('''\t<td>%s</td></tr>''' % newForm.groupType.tag())
for theGroupType in groupTypes:

newForm.groupType.addChoice(theGroupType.id,theGroupType.description)
################

The select field renders but there is no data in the field. I can print theGroupType.id and theGroupType.description to an HTML table without a problem so I know I have data. What am I missing?

Regards,

Clifford Ilkay
Dinamis Corporation
3266 Yonge Street, Suite 1419
Toronto, Ontario
Canada M4N 3P6

Tel: 416-410-3326



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to