X-CGP-ClamAV-Result: CLEAN X-VirusScanner: Niversoft's CGPClamav Helper v1.22.2a (ClamAV engine v0.102.2) X-Junk-Score: 0 [] X-KAS-Score: 0 [] From: "Samuel Pelletier" Received: from fortimail.cybercat.ca ([216.13.210.77] verified) by post.selbstdenker.com (CommuniGate Pro SMTP 6.3.3) with ESMTPS id 25337031 for webobjects-dev@wocommunity.org; Sat, 30 Jan 2021 14:51:58 +0100 Received-SPF: none receiver=post.selbstdenker.com; client-ip=216.13.210.77; envelope-from=samuel@samkar.com Received: from [192.168.3.105] (modemcable070.93-179-173.mc.videotron.ca [173.179.93.70]) (user=samuel%samkar.com mech=PLAIN bits=0) by fortimail.cybercat.ca with ESMTP id 10UDpWk4020358-10UDpWk5020358 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 30 Jan 2021 08:51:32 -0500 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: [WO-DEV] Communication between 2 different browers (but same application) Date: Sat, 30 Jan 2021 08:51:31 -0500 References: To: WebObjects & WOnder Development In-Reply-To: Message-Id: <89F215F0-2428-4BCB-AD3E-286362809F4D@samkar.com> X-Mailer: Apple Mail (2.3608.120.23.2.4) X-FEAS-AUTH-USER: samuel%samkar.com Hi Markus, Sorry for the delay, my original message bounced du to large size = (syntax colored code...) I just did something like this yesterday! As Dennis wrote, you need to adjust based on your needs. In my case, I = wanted to integrate a simple barcode scanner to a custom WO app used for = a small retail store inventory, I wanted a wireless barcode scanner = connected to the server to eliminate the complexity of bluetooth pairing = and the less than optimal user interaction possible when using a web app = and a device on the browser computer. My solution is very simple but only works as is on a single instance = application and uses pooling. My scanner is connected to a Raspberry Pi that send the code to a direct = action. My system can support multiple scanners. By default, received = codes are simply discarded. When I want to use a scanner, the component register an handler to a = scanner (found by a name) with the method that should receive the code. = To implement the user interface, I use a AjaxLongResponse. The principle = is simple, the content of AjaxLongResponse is refreshed every second by = default until isRunning is false. Hope you will find your answer with Dennis and this, you have 2 = solutions with completely opposite requirements and scallability. Regards, Samuel Here is the html used to edit the UPC code for a product = (AjaxLongResponse is a specialized AjaxUpdateContainer) : Component Java code : public boolean waitingForCode() { return waitingForCode; } public WOActionResults waitForCode() { waitingForCode =3D true; BarCodeScanner.withName("sam").registerHandler(new = BarCodeScanner.Handler() { @Override public boolean keepHandlerAfterProcessingCode(String = code) { format().setCodeUPC(code); save(); waitingForCode =3D false; return false; } }); return null; } My handler returns true if it should remain registered (to scan a list = of item for example). The direct action send the scanned code with this: BarCodeScanner.withName(scannerName).processCode(newCode); BarCodeScanner.java public class BarCodeScanner { static private Mapscanners =3D new = HashMap<>(); private String name; private Handler handler; =09 public BarCodeScanner(String name) { this.name =3D name; } static public BarCodeScanner withName(String name) { BarCodeScanner scanner =3D scanners.get(name); if (scanner =3D=3D null) { scanner =3D new BarCodeScanner(name); scanners.put(name, scanner); } return scanner; } =09 public String name() { return name; } =09 public void registerHandler(Handler handler) { this.handler =3D handler; } =09 public void processCode(String code) { if (handler !=3D null) { if (handler.keepHandlerAfterProcessingCode(code) = =3D=3D false) { handler =3D null; } } } =09 public static abstract class Handler { public abstract boolean = keepHandlerAfterProcessingCode(String code); } } > Le 28 janv. 2021 =C3=A0 03:26, Markus Ruggiero (rucotec) = a =C3=A9crit : >=20 > I need some conceptual help. >=20 > Let=E2=80=99s say you have a browser open to a Wonder app (component = based session). Imagine you go to a different computer and open another = session (maybe via direct action) to the same application. I want to = have a button (or some such) in the first window that when clicked = communicates to that second independent window and enables some form = fields there. The user then submits data to the application from that = second window. The first window registers the submission and continues = with the user interaction. >=20 > How would you do something like this? Is this possible at all? = Possibly the second login could be from a mobile device and the = presented browser page does not allow to do more interaction with the = application than just enter some data and submit. The first session is = required do wait for the data (or a cancel) and can then proceed. >=20 > Thanks for any ideas / help > =E2=80=94markus=E2=80=94 >=20 >=20 >=20 >=20 > Markus Ruggiero >=20 > rucotec GmbH web https://rucotec.ch > Steinenvorstadt 79 email markus.ruggiero@rucotec.ch > 4051 Basel / Switzerland mobile +41 79 508 4701 >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20