<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Does anyone have any advice for this scenario:<br>
<br>
Updating one object via an ajax form, but with the ability to create new form elements on the fly.<br>
<br>
It should work a little like this:<br>
<br>
I fill out a form input, hit a button, and another appears. Fill out
the new one, hit a button, etc., etc. Each time the button is pushed
that element would be saved.<br>
<br>
Thanks,<br>
RS<br><br>&gt; Date: Sun, 12 Jul 2009 22:09:03 +0100<br>&gt; Subject: Re: [Seaside] jQuery html rendering<br>&gt; From: jfitzell@gmail.com<br>&gt; To: seaside@lists.squeakfoundation.org<br>&gt; <br>&gt; It may work sometimes, but certain things will not work. #updateRoot:<br>&gt; for example, will not be called for that component or any component<br>&gt; contained within it. In 2.8, I think callbacks won't work for those<br>&gt; components.<br>&gt; <br>&gt; Even lazy initialization is not really good enough - it may work<br>&gt; sometimes but updateRoot: and others certainly won't be called during<br>&gt; the first request. Also, you shouldn't modify backtracked component<br>&gt; state during rendering, so you may need to be careful there when using<br>&gt; lazy initialization too (off the top of my head, I can't remember if<br>&gt; that same restriction applies during javascript rendering callbacks,<br>&gt; though - it may not).<br>&gt; <br>&gt; I'm not certain that these things are causing your problems, but it's<br>&gt; the most obvious thing that jumps out at me. If you aren't persisting<br>&gt; the components, you really don't need a component. In 2.9, make a<br>&gt; subclass of WAPainter instead - those don't need to be persisted. In<br>&gt; 2.8, you could try just subclassing Object and implementing #renderOn:<br>&gt; but it may or may not give you everything you need.<br>&gt; <br>&gt; If making that change fixes your problem (or you discover that you<br>&gt; *do* need components and therefor *do* need to be persisting them)<br>&gt; then we've found the issue. Otherwise, if you prepare a simple example<br>&gt; that we can file in and debug someone may be able to help further.<br>&gt; <br>&gt; Julian<br>&gt; <br>&gt; On Sun, Jul 12, 2009 at 7:18 PM, Robert Sirois&lt;watchlala@hotmail.com&gt; wrote:<br>&gt; &gt; Thanks, Julian. I am a bit confused, though.<br>&gt; &gt;<br>&gt; &gt; &nbsp;&nbsp;&nbsp; html anchor<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; onClick: ((html jQuery: '#contentArea') html: [:r | r render:<br>&gt; &gt; (RPSSCreator new)]);<br>&gt; &gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; with: 'Create a new survey'.<br>&gt; &gt;<br>&gt; &gt; I have been using code like this in a few areas, and it works just fine. The<br>&gt; &gt; object just needs to persist until it does its job, then I can move along in<br>&gt; &gt; whatever process.<br>&gt; &gt;<br>&gt; &gt; I can't seem to get some of my components to render in this way... I get:<br>&gt; &gt; 'MessageNotUnderstood: RPSSSurveyItemComponent&gt;&gt;nil'. As far as I can tell,<br>&gt; &gt; there is nothing different about it (than the others), and I am not sending<br>&gt; &gt; any messages to it except #new. WACounter, etc. work fine in its place.<br>&gt; &gt;<br>&gt; &gt; As far as #children goes, I havn't been including everything there because<br>&gt; &gt; the page is remaining relatively static. 'RPSSSurveyItemComponent' is a<br>&gt; &gt; WAComponent subclass, but I'm just using it to generate survey components,<br>&gt; &gt; so for each new survey item I will need a new instance.<br>&gt; &gt;<br>&gt; &gt; Is lazy initializing good enough for creating these objects in advance when<br>&gt; &gt; it comes to jQuery?<br>&gt; &gt;<br>&gt; &gt; Thanks,<br>&gt; &gt; RS<br>&gt; &gt;<br>&gt; &gt;&gt; Date: Sun, 12 Jul 2009 08:22:03 +0100<br>&gt; &gt;&gt; Subject: Re: [Seaside] jQuery html rendering<br>&gt; &gt;&gt; From: jfitzell@gmail.com<br>&gt; &gt;&gt; To: seaside@lists.squeakfoundation.org<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Components are persistent objects. You can't create them on the fly as<br>&gt; &gt;&gt; throw-aways (in particular they need to be returned from your<br>&gt; &gt;&gt; #children method). See the recent discussion about components,<br>&gt; &gt;&gt; painters, and renderable objects on this list.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; You either need to create the component earlier and store it somewhere<br>&gt; &gt;&gt; or not use a component here (if you don't need the object to persist,<br>&gt; &gt;&gt; you don't need a component).<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Julian<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; On Sun, Jul 12, 2009 at 12:25 AM, Robert Sirois&lt;watchlala@hotmail.com&gt;<br>&gt; &gt;&gt; wrote:<br>&gt; &gt;&gt; &gt; clickFunctionNew: html<br>&gt; &gt;&gt; &gt; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ^((html jQuery: '#newArea') html: [:r | r render:<br>&gt; &gt;&gt; &gt; ((RPSSSurveyItemComponent new) newInputOn: self inputType; yourself)]).<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Could someone please explain to me why this does not work? If I replace<br>&gt; &gt;&gt; &gt; the<br>&gt; &gt;&gt; &gt; class 'RPSSSurveyItemComponent' with some like a string 'blah', it runs<br>&gt; &gt;&gt; &gt; fine. Am I to understand that I cannot render components (the<br>&gt; &gt;&gt; &gt; aforementioned<br>&gt; &gt;&gt; &gt; class is a WAComponent subclass with the proper 'renderContentOn:'<br>&gt; &gt;&gt; &gt; method)<br>&gt; &gt;&gt; &gt; like a can do with standard Seaside callbacks?<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Thanks!<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; RS<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; ________________________________<br>&gt; &gt;&gt; &gt; Windows Live™: Keep your life in sync. Check it out.<br>&gt; &gt;&gt; &gt; _______________________________________________<br>&gt; &gt;&gt; &gt; seaside mailing list<br>&gt; &gt;&gt; &gt; seaside@lists.squeakfoundation.org<br>&gt; &gt;&gt; &gt; http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; _______________________________________________<br>&gt; &gt;&gt; seaside mailing list<br>&gt; &gt;&gt; seaside@lists.squeakfoundation.org<br>&gt; &gt;&gt; http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br>&gt; &gt;<br>&gt; &gt; ________________________________<br>&gt; &gt; Lauren found her dream laptop. Find the PC that’s right for you.<br>&gt; &gt; _______________________________________________<br>&gt; &gt; seaside mailing list<br>&gt; &gt; seaside@lists.squeakfoundation.org<br>&gt; &gt; http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br>&gt; &gt;<br>&gt; &gt;<br>&gt; _______________________________________________<br>&gt; seaside mailing list<br>&gt; seaside@lists.squeakfoundation.org<br>&gt; http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br><br /><hr />Lauren found her dream laptop.  <a href='http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290' target='_new'>Find the PC that’s right for you.</a></body>
</html>