I'll try to reply below.
On Sun, Mar 23, 2014 at 2:31 PM, Raul Miller <[email protected]> wrote:
> Let's slow down a bit and try to think about what you are really trying to
> do here.
>
> First, though, I have an issue here, with the concept of "in the server".
> There is certainly a perspective where "only be one jhrajax in the server
> for any jdoajax() sent by the client" is valid. It's an approximation - but
> a good enough approximation if we manage our expectations properly.
>
>
I'll take that as a qualified "Yes" answer to my question. There are
multiple jhrajax's in my app, but only one that replies to the "command"
input. Others reply to color changes and viewport choices. But, what I am
trying to zero in on, is that the server cannot just "spray" several
jhrajax responses to the client; the client has to initiated the request
with a exactly one jdoajax(), right? So the client is not going to ever be
able to accept extra jhrajax's that were not expressly requested. Or, if
that is wrong, then I would like to be told about how it is done, because
that may be the only solution to my problem.
> Meanwhile when I look at your definition of paint in tgsjhs.ijs I see this
> line:
> drawpathlist =. {:DrawPathList
>
> In other words paint is currently implemented to only paint a part of the
> picture. Why?
>
> No, paint produces turtle images (avatars?) as well as paths in the big
for. loop. It is actually creating 3D points defining triangle corners and
face normals.
> On the other hand, when I look at tgsjhsutil.h I see you are using 'paint'
> in a variety of places.
>
> That is the very issue for my problem: paint is ubiquitous and yet somehow
all of those paints' (plural and possessive) results must be collected into
one package, in their order of creation, to be sent back to the client.
> I think if you just arranged to draw all of DrawPathList you'd get the
> visual effect that I think you are looking for. Usually, that is - you are
> counting on the browser to queue its requests in the order they were
> generated, and that might glitch in some browsers. Still, it should work as
> a first approximation, and I think that that would be a worthwhile
> exercise.
>
I think this point might need some revision, now that you know the paints
produce avatars, too.
> Meanwhile, to achieve what I think you are trying to achieve (which is a
> step-by-step style), ... actually I can think of a lot of ways to
> accomplish that. One fun way involves using jQuery's deferred objects. This
> allows you to lay out your javascript code so that the sequence-over-time
> is laid out physically using a structure rather like if/then/else
> statements (but it's really more like working with J gerunds, using the
> "gerund-like-objects" to allow code to pick up and continue after receiving
> a response from the server).
>
> Maybe this is exactly what I need.
I found this example. http://jsfiddle.net/ehynds/Mrqf8/
I opened my console, I think. So far this is what I see in the console.
[Log] I fire once BOTH ajax requests have completed! (show, line 33)
[Error] Failed to load resource: the server responded with a status of 500
(Internal Server Error) (random.js, line 0)
I don't get it. But the name "deferred objects" sounds good for my needs.
Is it a way to overcome my expectation of the need for a 1-1 relationship
between jhrajax's and jdoajax()'s ? I have no experience with Jsquery.
> Maybe some of this helps?
>
>
Absolutely, it helps. Do you still think deferred objects is the way to go,
and there is no hope for accomplishing my goal using J features?
Thanks, very much,
> Thanks,
>
> --
> Raul
>
>
--
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm