Hi Mitch. I'm assuming you're using T4. The documentation is a bit scattered here, as it took me a while to find something to link to. (I'm still using T3.)
Anyway, your properties are being created as "transient" by Tapestry. You need to add persistence to your properties, either by using the <property> tag in your .page file, or using annotations. Have a look at the Hello World tutorial in the QuickStart: http://tapestry.apache.org/tapestry4/QuickStart/directlink.html Property persistence (and the <property> tag) is discussed here: http://tapestry.apache.org/tapestry4/UsersGuide/state.html Annoations in T4: http://tapestry.apache.org/tapestry4/tapestry-annotations/index.html#Persist Cheers, Nick. Mitch Rice wrote: > Please forgive my newbness, > > I am trying to create a page that will allow a user to edit a record > retrieved from the database. I would like to populate the individual text > fields in the html with information about the account that is being edited. > So far I have been able to populate the fields, however once changes are > submitted the updated value returns null on subsequent pages. The only > time > they evaluate correctly is when I change the expression > "Account.accoutName" > to "accountName" in the accountName component, but in that case, the > textfields do not pre-populate. > > > This is the relevant code that I have thus far: > > EditAccount.html > > <form action="" jwcid="updateForm"> > <p>Account Name: <input type="text" jwcid="accountName" /> > <input type="submit" value="Update Account"/></p> > </form> > > EditAccount.page > > <component id="updateForm" type="Form"> > <binding name="listener" expression="listeners.updateAccountInfo"/> > </component> > <component id="accountName" type="TextField"> > <binding name="value" expression="Account.accountName"/> > </component> > > <property-specification name="Account" type="com.myapp.bodao.Account" > persistent="yes"/> > <property-specification name="accountName" type="java.lang.String"/> > > EditAccount.java > > public abstract Account getAccount(); > public abstract String getAccountName(); > > public abstract void setAccount(Account account); > public abstract void setAccountName(String accountName); > > public void updateAccountInfo(IRequestCycle cycle) throws Exception { > > // Code that will go out and update the record in the database > > Somehow, I need to make the variable go both to the html (which I can do, > and then have the updated value returned for processing) Would someone be > willing to point out what I might be doing wrong. Or point me in the > direction of some code that does the same basic thing. I have found plenty > of code that involves editing records, but none of them involve > pre-populating fields that need to be edited with information from the > database. > > Thanks > mitch > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
