Andreas Pfeiffer
Forum Replies Created
-
Do you open the same or another form?
-
$multipleclasses is set to kFalse and the $destruct is not executed of the formerly used subform when you assign another $classname?
-
So if I understand you right you are using a subform component to display different subforms there. And within that form you are using a subformset. But for some reason it does not run into the $destruct method of the subform?
Please check if $multipleclasses of the subform field is set to kTrue. Make it kFalse and you should then then see the $desctruct of the subform to be executed when you assign a new $classname.
If $multipleclasses is kTrue that would mean that you can maintain several instances at the very same time. So any instance that has been constructed will stay alive until you either close it manually or close the main form that contains the subform component. That means in return that when re-assigning a classname that has been used before will also not execute the $construct of that subform either.
I figured it is easier in most cases to leave this property to kFalse.
Best,
Andreas
-
This reply was modified 1 year, 2 months ago by
Andreas Pfeiffer.
-
This reply was modified 1 year, 2 months ago by
-
Hi Martin,
Not sure what you are trying to do. Are you saying that you are executing the subformset_remove within the $construct of a form? If so, why?
Best,
Andreas
-
Hi Martin,
subformset_add() does not open a subform. It adds a subform set. subformset_formadd() opens a subform. That said you would need to use subformset_formremove() to remove the subform from the subformset.
However if you prefer using those popup forms for modeless forms I would recommend subformdialogshow instead. In that case you do not need to deal with a subformset but the form is modal only. Closing such a subform can then be done using subformdialogclose.
Best,
Andreas
-
This reply was modified 1 year, 2 months ago by
Andreas Pfeiffer.
-
This reply was modified 1 year, 2 months ago by
-
Hi Martin,
I wonder why you would want to close the Omnis server? That means someone would need to re-start it again when the next user wants to connect to your application.
If you just want to log out from the application and your first form is the logon form why not simply refreshing the browser using a button? You could do the following in a $event method of a button: Make the $event method client executed (context menu) and use this code:
On evClick
JavaScript:location.reload();
That would refresh the browser and hence it would go into the first form, which is hopefully the logon form.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorAugust 15, 2024 at 10:06 am in reply to: Error: Exception occurred/Cannot read propertiesHi Allan,
I would try to run this in Omnis Studio 11.1. As far as I know the error handling has improved there. I could imagine that one of the objects might complain that there is no data to be shown.
I hope this helps.
Best,
Andreas
-
This reply was modified 1 year, 3 months ago by
Andreas Pfeiffer.
-
This reply was modified 1 year, 3 months ago by
-
Andreas Pfeiffer
AdministratorAugust 9, 2024 at 12:24 pm in reply to: Remove Tab From Within Tab PaneYou are welcome!
-
Andreas Pfeiffer
AdministratorAugust 8, 2024 at 2:55 pm in reply to: Remove Tab From Within Tab PaneKevin,
Yes – I always assume that you are using the latest Omnis Studio version when you do not specify in your question.
There are some new properties in Omnis Studio 11.1 that did not exist in 10.22. You could upgrade couldn’t you?
Otherwise you could do it manually and drag the objects from the panes right to the one you want to remove onto a 2nd page pane temporarily page by page and moving them one page to the left.
I would not just hide the page because if you know you do not want to have them anymore it would clutter your code by still having them.
I hope this helps.
Best,
Andreas
-
Andreas Pfeiffer
AdministratorAugust 7, 2024 at 3:27 pm in reply to: Remove Tab From Within Tab PaneDo you want to hide the tab or remove it entirely?
If you just want to hide the tab a quick way would be to add a $construct to the tab pane with the following code:
Do $cfield.$showpane(2,kFalse) ## hides tab number 2
If you want to remove a tab in-between you can use the movetab property in the property manager to move all panes to the left from the one that you want to remove, so that the one is the last pane. Then you can delete all objects on that pane and set the tabcount to tabcount-1.
Make sure to remove the objects in that tab before you reduce the tabcount.
Hope this helps.
Best,
Andreas
-
This reply was modified 1 year, 3 months ago by
Andreas Pfeiffer.
-
This reply was modified 1 year, 3 months ago by
-
Awesome! This is great!
Have a nice evening then.
Best,
Andreas
-
subformset_remove
This is documented here: https://www.omnis.net/developers/resources/onlinedocs/WebDev/02jsremoteforms.html#subform-sets-1
Best,
Andreas
-
Martin,
This is because closing the form does not close the subformset. You also would need to close the subformset.
Best,
Andreas
-
Martin,
sure subformset_formremove does not remove the subformset. it is not supposed to remove the subformset. Only the subform within the set.
If you use this command you would need to specify the subformset name and the form id as a row parameter so that subformset_formremove understands which form in within subformset to be removed.
Best,
Andreas
-
Martin,
Yes – when your code is inside the table class you can refer to that same instance using $cinst. For example: $cinst.name refers to the name column of your row or list variable if your code is inside that table class.
But when you want to refer to the instance variable outside of that table class, i.e. from within the form, I would recommend not to prefix the instance variable. For example:
$cinst.iDataRow.name ## would certainly refer to the name column within iDataRow but you lose the tokenisation of that variable. It is better to omit $cinst for this matter.
The same is true for task variables. Some people prefix a task variable with $ctask which is also not a good idea for the same reason.
Hope this explanation helps.
Best,
Andreas