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