Andreas Pfeiffer
Forum Replies Created
-
Andreas Pfeiffer
AdministratorAugust 8, 2023 at 6:05 pm in reply to: Hourly notifications in my web appNo worries. Have fun.
Let me know if you have further question.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorAugust 8, 2023 at 5:50 pm in reply to: Hourly notifications in my web appYour code is a little bit confusing.
The “open push” is required on the client. It is for opening the push channel. You do not need to do this for every push.
However I wonder why you would need to push from the server if you are using a timer. So what would you do if the client connection is broken?
Wouldn’t it be easier using a client side timer and then simply call the method that loads the new data? See here: https://omnis.net/developers/resources/onlinedocs/WebDev/03jscomps.html#timer-control
Best,
Andreas
-
Andreas Pfeiffer
AdministratorAugust 8, 2023 at 5:13 pm in reply to: Hourly notifications in my web appHi Greg,
What kind of notification do you mean?
Omnis supports push notification which is documented here: https://omnis.net/developers/resources/onlinedocs/WebDev/02jsremoteforms.html#push-connections
But also notifications for the JS Wrapper. Please see here: https://filestore.omnis.net/temp/230808180805/PushNotifications.3.0.x.pdf
There is also notification in the session object of the PostgreSQL Omnis DAM: https://omnis.net/developers/resources/onlinedocs/Programming/09serv.html#notification-channels
Does this help?
Best,
Andreas
-
Andreas Pfeiffer
AdministratorJuly 31, 2023 at 7:46 am in reply to: Omnis Studio Community macOS no longer starts after "Force Quit"Hello David,
It could be that if you accidentally created some code, i.e. an infinity loop in a $construct that Omnis will just show a spinning wheel, i.e. and seems unresponsive.
However there are several techniques you can use to come around such a situation.
By default Omnis Studio 11 will open all libraries that have not been closed the last time when Omnis has been shut down. That said it will then also try to run the library that might have the tricky loop. You can change this in the config.json file that sits inside the Omnis /studio folder in the application support folder. See also: https://www.omnis.net/developers/resources/onlinedocs/Programming/02libsandclasses.html#starting-omnis-with-a-file
Another way to not run any code in the library is holding down the “option” key when opening the library.
There is also a keyboard shortcut “Cmnd+Opt+I” that would allow to interrupt code execution in an endless loop. See also https://www.omnis.net/developers/resources/onlinedocs/Programming/04debug.html#keyboard-shortcuts
I hope this helps.
Best,
Andreas
-
Hi Franco,
There is a property in the config.json file which you can change either in the file directly or using the new editor that opens when you click on “Edit configuration” in the lower left corner of the Omnis Studio browser.
It is in the IDE section and is called “restoreOpenLibsAtStartup”. Just set it to kFalse and you have the previous behaviour.
There is also a “openStartupTaskWhenRestoringOpenLibrary” which allows you to not instantiate the Startup_Task if the library is automatically opened.
Also see page 91 of the Whatsnew.pdf file: https://www.omnis.net/developers/resources/download/manuals/Whatsnew11.pdf
I hope this helps.
Best,
Andreas
-
This reply was modified 2 years, 4 months ago by
Andreas Pfeiffer.
-
This reply was modified 2 years, 4 months ago by
-
Hi Mischa,
If the subform field width is smaller than 768 it will take the next smaller layout breakpoint.
Regarding your code generation I thought it might be worth to put an interface into a superclass of your subforms. Without any coding in the main form you could probably do something like this:
in the $construct of your subform (or better its superclass) put the following code:
Set reference lClassRef to $cinst.$container().$class
Calculate iDataName as lClassRef.$objs.[$cinst.$field].$dataname
Now you have the $dataname which could be used like this:
Calculate iTest as $cinst.$container().[iDataName]
From now on you could use $cinst.$container().[iDataName] to get or set the value.
I hope that makes any sense.
Best,
Andreas
-
Hi Mischa,
The layout breakpoint is the minimum size of your layout. That means when the width of the browser reaches the next layout breakpoint it will change to the next layout breakpoint. So for example if you have a 320 and a 768 layout breakpoint then the 320 is shown until the browser reaches 768. Once the browser widths is 768 minimum it will use that one.
Regarding the automated creation of a method it actually has two sides of a coin. I would assume that this code is harder to maintain. You could think of the Omnis class that the method definitions will already be stored in the library and the elegance of Omnis is that it exposes the methods graphically that are linked to the object. When you do this dynamically you remove this feature. But anyhow, I am glad that it works for you now. 🙂 There is also another downside to this. If you need to make a method client executed then you cannot create it dynamically because Omnis translates those methods into JavaScript in that moment when the class is saved (Cmd/Ctr-S).
Regarding the click event behind the label field please check if the label is active and enabled.
I hope this helps.
Best,
Andreas
-
Hi Mischa,
How many layout breakpoints does the subform have? Maybe worth deleting the bigger one?
Best,
Andreas
-
Hi Mischa,
You can take subforms as separate instances and thus they ought to be and work independently. This is why I would not use the technic to access a field from the main form directly. That would mean a subform can only be used in the context of a single main form.
That said you can obviously build interfaces between the subform and a main form. For example when a subform is constructed it might want to know the ID of the main form. Therefore I would possible have a superclass that contains a $getID method and the can then get the ID of the main form like this:
Do $cinst.$load($cinst.$container().$getID())
This could be in the $construct of the subform (or its superclass) that then calls its own $load using the ID of the container form.
I especially like this technique when the $multipleclass of the subform component is set to kFalse. That makes it easier to just load the subform each time another subform is loaded.
The other direction is also possible, calling a method within the subform from the main form:
Do $cinst.$objs.mySubform.$subinst().$load($cinst.$getID())
However the problem here is that you can only do this once the subform is fully loaded. Some people try to assign a new $classname and in the same stack they then try to call a method within the subform. That will not work because the stack has to be finished before you can access that instance.
You can check this out with the little app I designed for the Madagascar event: https://www.omnis.net/community/forums/forum/discussion/contacts-web-application/
In that application each subform has the same superclass and the superclass will then call its $load method when the form constructs. The readme file says that you would need to copy the htm files from that source. If using Omnis Studio 11, don’t do this as the htm source is slightly different. This was just because of the different font that I was using.
I hope this helps.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorJune 9, 2023 at 12:11 pm in reply to: Recipe: how to upload multiple documents in Javascript using drag&dropHi Christoph,
check out the new Omnis Studio 11 JS File upload / download sample in the HUB.
Best,
Andreas
-
This reply was modified 2 years, 6 months ago by
Andreas Pfeiffer.
-
This reply was modified 2 years, 6 months ago by
-
Hi Mischa,
I did enter an ER.
Best,
Andreas
-
Hi Mischa,
Yes – if you have only one layout breakpoint it will always use this one.
Before Omnis Studio 11 the minimum number of layout breakpoints was two. For this purpose you could have changed the $layouttype property to kLayoutTypeSingle. However I think with Omnis Studio 11 it is kinda obsolete now because we can now have only one layout even though the $layouttype is set to kLayoutTypeResponsive. The beauty of this approach is that your subforms can share the same super classes. If the layout type is not the same you can actually not.
One more about $cclass. It will work – but when it comes to inheritance you might get the wrong class. So $cinst.$class is probably what you want to get the reference of the class. Otherwise if your code is within the superclass you would get the reference to the superclass.
I also tested making a reference variable that points to the variable that is used in the main form in the $dataname of the subform component. Unfortunately this is not supported. You cannot assign an item reference to the $dataname of a component. However you can have the reference and then have some code to assign or read from that item reference.
I am glad that your issues are now resolved.
Best regards,
Andreas
-
Hi Mischa,
The subform is part of the main form – yes and no. Looking at it from an OO perspective it is its own object (instance) and therefore communication between those two supposed to be via a public interface (public methods).
In case of your example you could do the following:
Place a public method behind your subform field, e.g. $getValue which returns the data you need to deal within your subform field.
Then in the $construct of the subform you can access this method like this:
Do $cinst.$field().$getValue() Returns iValue
So instead using the $dataname you would then have a public method that allows you to communicate with the main form.
I hope this helps.
Best,
Andreas
-
Hi Angelo,
I noticed there is still a glitch. It startet to fail if the list has much more lines because the Do command could not handle the length of the argument. Therefore I changed it using a row variable for adding the line which seems to work much better.
Please see attached lib.
Best,
Andreas
-
now – also works for other language settings. Please see attached.