
Andreas Pfeiffer
Forum Replies Created
-
Martin,
Just inherit an object class from the worker you want to work with. You would need to create an object class and then go to the $superclass property and choose the right worker object. Each class has now its own $completed method that you can override.
However the question would be why you would like to use a timer worker for a remote form? Since the worker run on server only it might be better to use a timer component on the form rather an object class – depending on what you want to do.
There is also a challenge when you run a worker on the server to get the information back to the client. You would need to push the data to the client if the worker runs asynchronously. If the worker does not run asynchronously then you can use $cinst.$container().$myMethod to access a method of the container (the remote form) that runs the worker object (assuming the worker object is an instance variable).
I hope this makes sense.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorNovember 7, 2024 at 11:28 am in reply to: Custom Font on Web remote formsHello Minh,
Yes – you can do this.
To make the font accessible in Omnis you would need to download the font and install it on your macOS if not done already.
Then in your library look at the system class #WIWFONTS, open it to modify and add a new line with your font name. For example add “Montserrat” to macOS column as well as the JavaScript column. You can also add more fonts to the JavaScript column as fallback fonts if you like.
These are the two steps to make the font available in your remote form design. You can now use this font in the $font property of your fields or in your field styles if you like. The latter one might make more sense.
But – to make the font also work on your website you would need to do additional steps:
Open the htm file that you want to use. Note for testing it will make a copy from the jstempl.htm file that is in your html folder. So make the change there and delete the htm file that it might have created with the name of your remote form.
Open this file with a text editor and have a look at this line:
<link href="fonts/roboto-flex/roboto-flex.css" rel="stylesheet">
So you would need to add a similar line that either points to your local fonts in your html/fonts folder or you could also point to a css somewhere in the web to embed your font:
<link href="
https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet">If you want to have them locally you can create your own CSS file – I called it “montserrat.css” which has a similar content just like the sample that you see for Roboto but pointing to your own fonts.
For example it could look like this one:
@font-face {
font-family: 'Montserrat';
src: url('Montserrat-VariableFont_wght.ttf') ;
}Having my own CSS file (“montserrat.css”) I had to add this line to the htm file:
<link href="fonts/montserrat/montserrat.css" rel="stylesheet">
I hope this helps.
Best regards, Andreas
-
This reply was modified 8 months, 4 weeks ago by
Andreas Pfeiffer.
-
This reply was modified 8 months, 4 weeks ago by
Andreas Pfeiffer.
-
This reply was modified 8 months, 4 weeks ago by
-
Andreas Pfeiffer
AdministratorOctober 29, 2024 at 1:36 pm in reply to: Undefined datagrid customformat columnMartin,
One more thing.
Is this a user defined grid? If so, make sure that the $columndatacol property of each column fits with the column name of the list column.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorOctober 29, 2024 at 9:53 am in reply to: Undefined datagrid customformat columnHi Martin,
Are you using the internal methods, i.e. $select? If so, can you check if the schema class is assigned to the $sqlclassname property and that the schema class has the columns that you expect?
Best,
Andreas
-
Andreas Pfeiffer
AdministratorOctober 23, 2024 at 12:31 pm in reply to: Direct channel to further improving help resources?Hi Uwe,
This is what the IDEAS section is all about. If you have any ideas to improve either Omnis Studio or the documentation please feel free to post it there. Those topics will be reviewed regularly from the team in UK.
Best,
Andreas
-
Hi Paul,
I just saw it and removed it.
Best,
Andreas
-
Hi Martin,
I would use the timer component rather the timer object. The timer control could then check an instance variable that is set pushed from the other object to the client.
If the other object runs asynchronously then it would need to push the result and the instance variable. I’d rather recommend to run the other object synchronously as it does not require a push thought.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorNovember 11, 2024 at 7:59 am in reply to: jsProgressBar Control – not really controlling progress…Hi Martin,
You can run code on the client that is in remote object classes. However you cannot run code that needs to run on a server. For example all the worker objects can run on the server only because this code cannot be translated into JavaScript code. Or to look this from the other side: The worker objects are not available on the client. It would need to be JavaScript only.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorNovember 10, 2024 at 12:40 pm in reply to: jsProgressBar Control – not really controlling progress…Martin,
A client-side method can call a server side method. There is an automated approach. When you have another client-side method with the suffix return, it will automatically be called after the server side method with the same basic name has been finished. See also here https://www.omnis.net/developers/resources/onlinedocs/WebDev/02jsremoteforms.html#return-methods
-
Andreas Pfeiffer
AdministratorNovember 4, 2024 at 10:35 am in reply to: Undefined datagrid customformat columnMartin,
I don’t think so. However you can easily test it by omitting this code temporarily and see if it has any effect.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorOctober 30, 2024 at 12:44 pm in reply to: Undefined datagrid customformat columnshould be the column name only.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorOctober 23, 2024 at 9:37 am in reply to: jsProgressBar Control – not really controlling progress…Uwe,
You are welcome.
To make it clear. You do not need to have an Omnis REST server to make a push message to the client. There are two steps to send a push message.
1. the remote form instance that will receive the push should open its channel. You can do this in the $construct of the form:
Do $cinst.$openpush()
2. When you want to push you need a reference to that remote form instance. Then you can send a push like this:
Do $itasks.theOtherTask.$iremoteforms.myForm.$pushdata(row(‘something’))
or – if you want to send it to the same task instance as you are in:
Do $iremoteforms.myForm.$pushdata(row(‘something’))
or – if your code is already in that instance:
Do $cinst.$pushdata(row(‘something’))
3. The form that will receive the push (i.e. myForm) has a $pushed method that you would need to override. This method needs to be client executed and will receive the row from the $pushdata.
So for example if you have a busy loop running on the server you could do a push to the client by executing $pushdata to that instance. However there is still no way to interrupt that loop I am afraid since Omnis is busy running this loop.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorOctober 23, 2024 at 8:29 am in reply to: jsProgressBar Control – not really controlling progress…Uwe,
The reason why you are not able to stop the loop might be because Omnis is busy running the loop and you try to interfere this from the outside.
I would like to recommend a different approach. Let the loop run outside of the remote task, i.e. using a worker, a different thread (if in multithreaded mode) or even on a different Omnis instance. So the task will run completely in the background. This has the advantage that the user can continue working in your application.
Once the task has finished you could then send a push to the client, i.e. making a red button become visible so that the user knows that the task is done and by clicking the button making the result visible.
What do you think?
Best,
Andreas
-
Andreas Pfeiffer
AdministratorOctober 22, 2024 at 7:39 am in reply to: jsProgressBar Control – not really controlling progress…Uwe,
I haven’t tried this yet but you might be able to push a call to the client.
In theory that could do the trick.
Best,
Andreas
-
They are saved in the PDF folder location as you already mentioned. From there you can use the file object as Uwe already mentioned to pick them up again.