Search the web
Sign In
New User? Sign Up
ClearSilver
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Multiptle lines of output   Message List  
Reply | Forward Message #1236 of 1347 |
Re: Multiptle lines of output

Brandon Long(blong@...)@2008.12.09 15:22:30 -0800:
> x =
> for (type, hostname, ipaddr, t) in dnsdata:
> ncgi.hdf.setValue("Entry.%d.type" % x, type)
> ncgi.hdf.setValue("Entry.%d.hostname" % x, hostname)
> ncgi.hdf.setValue("Entry.%d.ipaddr" % x, ipaddr)
> ncgi.hdf.setValue("Entry.%d.time" % x, t)
>
> Then, in the template:
>
> <form action=>
> <?cs each:entry = Entry ?>
> <input type=text name="entry.<?cs var:name(entry) ?>.type"
> value="<?cs var:html_escape(entry.type) ?>">
> <input type=text name="entry.<?cs var:name(entry) ?>.hostname"
> value="<?cs var:html_escape(entry.hostname) ?>">
> <input type=text name="entry.<?cs var:name(entry) ?>.ipaddr"
> value="<?cs var:html_escape(entry.ipaddr) ?>">
> <input type=text name="entry.<?cs var:name(entry) ?>.time"
> value="<?cs var:html_escape(entry.time) ?>">
> <?cs /each ?>
> </form>
>
> And then, to read them back:
>
> node = ncgi.hdf.getChild("Query.entry")
> dnslist = []
> while node != None:
> dtype = node.getValue("type", "")
> hostname = node.getValue("hostname", "")
> ipaddr = node.getValue("ipaddr", "")
> t = node.getValue("time", "")
> dnslist.append( (dtype, hostname, ipaddr, t) )
> node = node.next()
>
> Obviously, you'll probably use different input elements, and you
> need to actually validate the results, but that's the basic gist.

Thanks, that makes sense, but I still can't seem to get values out of
HDF (empty). Is there a way to dump the whole HDF for debugging?

Thanks.




Fri Dec 12, 2008 3:17 pm

strangepics
Offline Offline
Send Email Send Email

Forward
Message #1236 of 1347 |
Expand Messages Author Sort by Date

Hi. I am trying to figure out how to display multiple lines of several values. I know this is basic and done all the time in CGIs, but I am having trouble...
Dan
strangepics
Offline Send Email
Dec 6, 2008
4:21 pm

... I'm not sure what you're trying to do, exactly, but: foo.hdf: Option.1 = Foo Option.2 = Bar Option.3 = Baz foo.cs: <form action=/foo.do> <?cs each:opt =...
Brandon Long
blong42
Offline Send Email
Dec 7, 2008
5:19 am

... Sorry, let me try to explain better. The file is really irrelevant, it could be a database instead. If it were a database, I would read a row from a table,...
Dan
strangepics
Offline Send Email
Dec 9, 2008
6:39 pm

... x = for (type, hostname, ipaddr, t) in dnsdata: ncgi.hdf.setValue("Entry.%d.type" % x, type) ncgi.hdf.setValue("Entry.%d.hostname" % x, hostname) ...
Brandon Long
blong42
Offline Send Email
Dec 9, 2008
11:22 pm

... Thanks, that makes sense, but I still can't seem to get values out of HDF (empty). Is there a way to dump the whole HDF for debugging? Thanks....
Dan
strangepics
Offline Send Email
Dec 12, 2008
3:17 pm

... Actually I had a bug. It works now. However I have trouble understanding how it works (in the template). Thanks....
Dan
strangepics
Offline Send Email
Dec 12, 2008
4:42 pm

There are some debugging HDF values which we use to cause the HDF contents to be dumped into the rendered page. ...
David Jeske
jeskeca
Offline Send Email
Dec 12, 2008
8:14 pm

... Thanks!...
Dan
strangepics
Offline Send Email
Dec 14, 2008
5:14 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help