
Andreas Pfeiffer
Forum Replies Created
-
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, 1 month ago by
Andreas Pfeiffer.
-
This reply was modified 2 years, 1 month ago by
-
ah – now I see what you mean.
You do not want to turn the grid, you want to turn the data – making rows to columns and vice versa.
You would need to change your data in the list. Depending on the SQL server that you use, check out the pivot SQL function.
Best,
Andreas
-
Sorry, I am still not getting it.
Do you mean to turn the complete grid 90 degrees?
-
Hello Angelo,
Complex grids in windows do have a horizontal header as well as a vertical header. Check out the properties “showhorzheader” and “showvertheader”.
Or do I misinterpret your question?
Best,
Andreas
-
Hi Angelo,
Omnis Studio 11 comes with a new client command “subformpaletteshow” that does this. There is a small sample app in the JS section of the samples in the HUB that demonstrates how to use it.
Hope that helps.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorJune 8, 2023 at 12:07 pm in reply to: Omnis Studio’s security credentials in the Microsoft enterprise world.Hi Vik,
have a look at the new LDAP worker in Omnis Studio 11: https://www.omnis.net/developers/resources/onlinedocs/ExtendingOmnis/07webcomms.html#ldap-worker-object
Best,
Andreas
-
This reply was modified 2 years, 1 month ago by
Andreas Pfeiffer.
-
This reply was modified 2 years, 1 month ago by
-
Hi Angelo,
Are you talking about web forms or window classes?
Best,
Andreas
-
This reply was modified 2 years, 1 month ago by
Andreas Pfeiffer.
-
This reply was modified 2 years, 1 month ago by
-
Hi Allan,
You can use $rowcsscol property of the grid. This allows you to specify an extra column in your list that takes the name for a CSS class which can change the color of your list lines.
Check out the „row styles“ section in the documentation: https://www.omnis.net/developers/resources/onlinedocs/WebDev/03jscomps.html#row-styles
Best,
Andreas
-
This reply was modified 2 years, 2 months ago by
Andreas Pfeiffer.
-
This reply was modified 2 years, 2 months ago by
-
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.
-
Hello Angelo,
Attached please find a small sample library that contains an object class that you can use to pivot any list. There is also a test window that loads a list of classes from that library to demonstrate how it works.
One word of warning: It is expensive. So I would like to recommend using pivot functions when loading the data via SQL. That will be much quicker if there are many data.
There is also a pitfall when you have a localised Omnis. I made some hard coded commas in there. This will fail if your parameter separator is set to something else, i.e. semicolon.
Hope this helps.
Best regards,
Andreas
-
For small lists you might be able to do this within Omnis. Give me a little time. I will provide a little sample library.
-
Sorry, I can only see HTM tags. Can you send a picture how it should look like?
Thanks.