
Andreas Pfeiffer
Forum Replies Created
-
Andreas Pfeiffer
AdministratorDecember 2, 2024 at 12:32 pm in reply to: Issues with Cross-platform app deployment in DallasSo what are the specific issues you are struggling?
Best,
Andreas
-
Andreas Pfeiffer
AdministratorNovember 22, 2024 at 12:28 pm in reply to: Show subformdialog command parametersMartin,
I made you a small sample library (attached). It can also be opened using the Community Edition of Omnis Studio 11.1
Of course you can use a parameter to send information into the dialog form. However it becomes complicated if you want to re-load the detail form if something changes in the calling form. Ok – in that instance that cannot happen because the dialog form is modal.
But as soon as it gets a little bit more complicated – for example you want to send an entire row, it is much easier using an API. Also you cannot send any binary data (i.e. pictures). They would need to be converted into base64. However this is possible when sending messages.
I implemented a small API into the jsTest form that returns the entire row of the data list as well as in the other direction. That way you can also send information back to your calling form easily.
So when the user presses the “save” button in the dialog form it sends back the entire row into the container. You can see that when you change the street in the dialog and press the button.
For implementing a proper API you will soon realise that you always need the same methods, i.e. $getIdent, $setIdent etc. It might be clever to have a superclass which actually has those methods in place. That way every inherited class will have them already.
The example also shows how to pass the parameter properly. It shows it as a title above the fields.
I hope that makes sense.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorNovember 26, 2024 at 1:44 pm in reply to: Show subformdialog command parametersHi Martin,
I added two buttons in the detail form that allow to step forward or backwards through the list. With those buttons you can see how messaging can actually perform between the dialog form and the underlying container. It not only steps through the records it also disables the previous button if there is no previous record or disables the next button if it already shows the last record of the list.
Have fun!
Best regards,
Andreas
-
-
Andreas Pfeiffer
AdministratorNovember 22, 2024 at 8:24 am in reply to: Show subformdialog command parametersHi Martin,
Try the following:
Calculate lParam as con(kSq,’jsMyRemoteForm’,kSq)
Do $cinst.$clientcommand(“subformdialogshow”,row(‘jsDialogSelectFieldSearchResult’,lParam,stgettext(‘search_result’),$cwind.$width*0.7,$cwind.$height*0.7))
The parameter that you want to pass needs to be in quotes.
Btw. from within your dialog form, i.e. from its $construct you can always use $cinst.$container() to reference the calling form. For example if you need a value, you can create a public method in the calling form, i.e. $getIdent, and then from the $construct of the subform you can use this to ask for the ID like this:
Do $cinst.$container().$getIdent() Returns lIDent
I hope this helps.
Best,
Andreas
-
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 10 months, 1 week ago by
Andreas Pfeiffer.
-
This reply was modified 10 months, 1 week ago by
Andreas Pfeiffer.
-
This reply was modified 10 months, 1 week 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 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