$o - Setting Reference to Instance Variable

Ben Butler ben.butler at w16.co.uk
Thu Jul 18 21:04:41 EDT 2013


Hi Kelly,

Many thanks.  I think my problem is that I can only use Field Reference 
rather than Item Reference as a Parameter variable.  As I only want to 
work with Client Side methods, my types are limited and I can not use 
Field Reference.

My work around is to regig my code and use a generic scratch variable to 
construct my list into and then switch / case it after the fact into 
=myscratchvar the correct instance variable - then I wont need to use 
any variable redirection.

Where I am going with this is returning multiple JSON formatted lists 
into a single string and then parsing it out into multiple "parameter" 
instance variables with an associated method call to process my returned 
data.

So it is looking like:

AJAX call to PHP -> PHP returns JSON formatted string -> My Hack Forces 
it into Omnis String Instance Variable and Triggers Timer Function -> 
Timer Function Parses string to split JSON into multiple lists -> Timer 
Calls Specific method to process the returned data in my variable heap.

This allows my AJAX calls to parse very specific and known multi 
var/value and multi list response from the PHP server in a single AJAX 
call.  The transport for the data is handled outside of the Omnis client 
and then pushed back in and timer processing is then tripped to parse 
the returned string.  I haven't yet tackled binary transport.  The aim 
is to abstract all Omnis client to Omnis server coms and send via 
Javascript for method calling and data exchange, with all application 
logic being client side only with data exchange to the "server" via 
Javascript calls.

Thanks

Ben



Everything is executing exclusively client side.


On 18/07/2013 23:46, Kelly Burgess wrote:
> Hi Ben,
>
>> Set reference irDataList to $root.$iremoteforms.jsContacts.$ivars.ilDataList0
> My approach is to add a method to the remote form and let the form instance set the reference.
>
> Do $iremoteforms.jsContacts.$getListRef(irDataList)
>
> $getListRef
> Parameter pListField  type field reference
> ;
> Set reference pListField to ilDataList0.$ref
>
> (I add the .$ref with object type instance variables, and I'm guessing you'd want it with a list var too, but maybe you don't need it.)
>
> Hope that helps,
>
> Kelly
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>




More information about the omnisdev-en mailing list