Is this what you want: #save the form values to the session for f in form1.fields(): self.session().value(f,f.value().strip())
def getSessionValues(self):
''' restore the form values from the session'''
currentValues = {}
for f in self.form1.fields():
if self.session().hasValue(f.name()) and not self.request().hasValue(f.name()):
#if we have the value in the session, but the user did not just submit it
currentValues[f.name()] = self.request().value(f.name())
form1.seed( currentValues )
-Aaron
toshi-O wrote:
Thank you for reply. I'm sorry to my vague question. I installed FormKit in my Linux yesterday. I am interested in SeedingExample.
(snippet) -------------------------------------------------- class SeedingExample(FormKitMixIn,Page):
def __init__(self): Page.__init__(self) f = self.form = Form.Form( ) self.addForm( f )
f.addField( Fields.TextField('text1') ) f.addField( Fields.TextField('text2') ) f.addField( Fields.WebKitSubmitButton(name="submit",label=" Proceed ") )
def awake(self, transaction): Page.awake(self, transaction) bogusData = { 'text1':'Already, some text', 'text2':'text text everywhere', } self.form.seed( bogusData )
def sleep(self,transaction): self.resetForms() Page.sleep(self,transaction)
## form submission and actions - standard WebKit stuff ## def actions(self): return ['submit']
def submit(self): # we don't care about what happens with good data... pass ------------------------------------------------------------------------ --- How can I set session value from form's value dynamically? self.session().setValue("text1","Already,some text") self.session().setValue("text2","text text everywhere")
I don't know this is possible or impossible at all. I might misunderstand about session.
Your say that submit is working correctly?
self.response().sendRedirect(URL/next class) OK?
If all forms are in the same web page, I need not use session. I have multiple pages, therefore I need session. In the last page I want to show all forms. Then I can submit to another class. My windows sample as follows, http://pdf.sytes.net/session/KAKU_A1.asp
Toshio Onishi
-------------------------------------------------------
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
-------------------------------------------------------
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
