<html>
<body>
<font size=3>In general, if you have a unit of work in progress, then any
objects you read during that unit of work will be registered
automatically. Registering more than once should do no harm, as long as
the object was registered before it was modified.<br><br>
I don't know why you would be having that particular problem, but I don't
know exactly what the methods commit: and and the callback does. It would
depend on the flow of control. If seaside is blocking, then the unit of
work won't have committed, so I would expect the changes to be seen.
However, if Seaside lets your process keep going when you register the
callback, then presumably it will have already fallen through, and
committed the unit of work before any changes were made.<br><br>
So you'd need to either be using Seaside API's that &quot;block&quot; the
calling process. Or you'd need to begin the unit of work here, and commit
it explicitly later. So, for example, I think it might work if you put
the call to commit the unit of work in the callback for the submit
button. Although you might have to do some fiddling in case it gets
called more than once due to continuations or other mechanisms.<br><br>
At 12:53 PM 8/12/2007, Rajeev Lochan wrote:<br>
<blockquote type=cite class=cite cite="">Hi Ron,<br>
I tried to implement what you hinted, no progress.<br><br>
I changed my code to <br><br>
html<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; form: [self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
commit: [temp := self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each persistentId = '1'].<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self session register: temp.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html textInput value: temp title;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [:value | temp title: value].<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html submitButton<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [self session register: temp];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
text: 'Update']] <br><br>
<br>
I am registering before change as you said, but doesnt change the title.
(I am registering twice though)<br><br>
<br>
But, even if I dont register the object, before changing. It does update
if I use normal setter technique. (Snippet below) <br><br>
html<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; form: [self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
commit: [temp := self session<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each persistentId = '1']. <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
temp title: 'some Title'.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html submitButton<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [self session register: temp];<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
text: 'Update']]<br><br>
<br><br>
<br>
In Glorp Tutorial by Roger Whitney, he updated in just unitOfWork and
also without registering it.<br><br>
&quot;&nbsp;&nbsp; A UnitOfWork will keep track of the changes we make in
objects. The following will retrieve a <br>
person, change the first name of person and then write the changes back
to the database.<br><br>
session beginUnitOfWork.<br>
foundPerson := session readOneOf: Person where: [:each | each firstName =
'Jose']. <br>
foundPerson firstName: 'RamJet'.<br>
session commitUnitOfWork<br><br>
When we start a UnitOfWork it records all the objects we read from the
database. When the<br>
UnitOfWork is committed it writes all the changed objects back to the
database.&quot;<br><br>
<br>
As much I understand, it has something to do with <br>
self session commit:[ ........... html textInput value: callback:
...........] <br><br>
<br>
BTW, I am not using Magritte in my proposed application. So Ramon's
Active Record for Magritte would possibly not help me much.<br><br>
Thanks in advance.<br><br>
<br>
On 8/12/07, <b>Ron Teitelbaum</b>
&lt;<a href="mailto:Ron@usmedrec.com">Ron@usmedrec.com</a></font>&gt;
wrote:<br>

<dl><br>

<dd><font size=2 color="#000080">Hi Rajeev,<br>
</font><font size=3><br>
</font>
<dd><font size=2 color="#000080">&nbsp;<br>
</font><font size=3><br>
</font>
<dd><font size=2 color="#000080">You need to register the object before
you make changes to it.&nbsp; The registration tells Glorp to track
changes to your object. <br>
</font><font size=3><br>
</font>
<dd><font size=2 color="#000080">&nbsp;<br>
</font><font size=3><br>
</font>
<dd><font size=2 color="#000080">Hope that helps!<br>
</font><font size=3><br>
</font>
<dd><font size=2 color="#000080">Ron Teitelbaum<br>
</font><font size=3><br>
</font>
<dd><font size=2 color="#000080">&nbsp;<br>
<hr>
<div align="center"></font></div>

<dd><font face="Tahoma" size=2>From:</b>
<a href="mailto:seaside-bounces@lists.squeakfoundation.org">
seaside-bounces@lists.squeakfoundation.org</a>
[<a href="mailto:seaside-bounces@lists.squeakfoundation.org" eudora="autourl">
mailto:seaside-bounces@lists.squeakfoundation.org</a>] On Behalf Of
</b>Rajeev Lochan<br>

<dd>Sent:</b> Sunday, August 12, 2007 11:52 AM<br>

<dd>To:</b> Seaside - general discussion<br>

<dd>Subject:</b> [Seaside] Glorp-Seaside-callback not Working<br>
</font><font size=3><br>
</font>
<dd><font face="Times New Roman, Times" size=3>&nbsp;<br>
</font><br>

<dd><font face="Times New Roman, Times" size=3>Dear Seasiders,<br>

<dd>I followed Ramon's Blog of porting seaside to postgreSQL using Glorp.
<br>

<dd>I have now created 2 components. In one, you can enter the details of
the form (which are in the form of textInput and textArea) and are
registered upon submitting a button. This part works well. <br><br>

<dd>Now, in the second component, I want to edit(update) the entries I
have created earlier. I use textInput and textArea again for this, and
when I edit and submit using a button (register the model) , the update
doesnt seem to work. <br><br>

<dd>I have observed one thing here, the update doesnt seem to work in
textInput value: callback:<br><br>

<dd>A snippet is code is here.(which doesnt update the title)<br><br>
<br>

<dd>self session<br>

<dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commit: [temp := self
session <br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost<br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each title = '1'].<br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
html textInput value: temp title;<br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
callback: [:value | temp title: value]. <br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self session register: temp]<br><br>
<br><br>

<dd>A snippet which uses simple setter technique and is updated.<br><br>

<dd>self session<br>

<dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commit: [temp := self
session<br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
readOneOf: BlogPost<br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
where: [:each | each title = '1'].<br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
temp title: 'some Title'.<br>

<dd>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
self session register: temp].<br><br>
<br><br>

<dd>Anticipating your help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>
<br><br>
<br>

<dd>-- <br>

<dd>Rajeev Lochan<br><br>

<dd>Co-founder, AR-CAD.com<br><br>

<dd><a href="http://www.ar-cad.com">http://www.ar-cad.com</a><br>

<dd>+91 9243468076 (Bangalore)<br>

<dd>080 65355873 <br>
</font><br>

<dd>_______________________________________________<br>

<dd>Seaside mailing list<br>

<dd><a href="mailto:Seaside@lists.squeakfoundation.org">
Seaside@lists.squeakfoundation.org </a><br>

<dd>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" eudora="autourl">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" eudora="autourl">
 </a><br><br>

</dl><br><br>
<br>
-- <br>
Rajeev Lochan<br><br>
Co-founder, AR-CAD.com<br><br>
<a href="http://www.ar-cad.com">http://www.ar-cad.com</a><br>
+91 9243468076 (Bangalore)<br>
080 65355873 <br>
_______________________________________________<br>
Seaside mailing list<br>
Seaside@lists.squeakfoundation.org<br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" eudora="autourl">
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>
</blockquote></body>
<br>
<div>--</div>
<div>Alan Knight [|], Cincom Smalltalk Development</div>
<div>knight@acm.org</div>
<div>aknight@cincom.com</div>
<div><a href="http://www.cincom.com/smalltalk" EUDORA=AUTOURL>
http://www.cincom.com/smalltalk</a></div>
</html>