Uniface User Forum

 View Only
  • 1.  Finding the current painted occurrence

    PARTNER
    Posted 01-04-2023 05:11

    Hi

    Version 10.4.02.005 working in client.
    We don't think this is possible but I am asking here in the hope that someone can point out the obvious thing we have missed.

    The scenario is a multi-occurrence entity painted on the form with lots of records retrieved.  We would like to know which of the painted occurrences the current occurrence is being displayed within. So, basically, we would like to know whether the current occurrence of, say, 20, is being displayed in the 5th painted occurrence or the 6th or 7th etc.

    Thanks in advance

    David



    ------------------------------
    David Hepworth
    Uniface Community Edition Shared Account
    US
    ------------------------------


  • 2.  RE: Finding the current painted occurrence

    Posted 01-04-2023 07:12
    Edited by Gianni Sandigliano 01-04-2023 07:12

    Hi David,

    I feel I understand what you are asking for but lets double check it:

    First: obviously you know $curocc(ENTITY) giving back the current occurrence for your multi-occurrence entity.
    Your question related to current painted occurrence could be generated from this doubt: why current occurrence is not always visible when my procScript code is moving through retrieved occurrences? Please let me know if I am right.

    Have you tried already show instruction?

    Regards,
    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------



  • 3.  RE: Finding the current painted occurrence

    PARTNER
    Posted 01-04-2023 09:16
    Hi Gianni
    Thanks for taking the time to respond.  I did search before I posted but it shows how useless my searching ability is or perhaps how bad I am at picking search terms.  It is indeed our issue, while it is very clever, i am pretty sure we are not going to use the suggested idea and will have to come up with something else (we are not entirely sure it would work every time anyway because wouldn't the format trigger only fire once when the field is first shown?).  Its such a shame, as we usually find with Uniface, so close to doing something cool and you fall at the final hurdle.

    Thanks again,
    David

    ------------------------------
    David Hepworth
    Uniface Community Edition Shared Account
    US
    ------------------------------



  • 4.  RE: Finding the current painted occurrence

    PARTNER
    Posted 01-04-2023 10:05
    Hi David, 
    What are you actually trying to set which requires the current painted occurrence number? I presume you are using $painterdfieldproperties to set the size or something? I don't know of anything else which requires a painted occurrence number.
    Regards, 
    Iain

    ------------------------------
    Iain Sharp
    Head of Technical Services
    Pci Systems Ltd
    Sheffield GB
    ------------------------------



  • 5.  RE: Finding the current painted occurrence

    PARTNER
    Posted 01-04-2023 10:53

    Hi Iain

    After saying we didnt want to do something hacky, we were trying to do something a bit hacky.  I left a lot of guff out of my original post to try and not confuse the issue.

    Basically our software is used by externals so we are attempting to keep keep an existing UI.  The screen in question currently has approx 20 painted occurrences of a dummy entity which could be showing up to a few thousand records depending on the scenario.  As it stands, we have a popup type form which is opened from a button on the occurrence and shows a few extra details for the current record.  The popup opens downleft (I think) from the button so it is obviously "attached" to the specific button and therefore occurrence and it closes when focus is lost.
    Roll forward to now we have a requirement where some of that data on the popup can be changed and it needs to be validated. All well and good except that the validation routine pops up a form that asks a few questions.  This validation form opens behind the popup form which is obviously not acceptable UI.
    We have changed the form to a standard form but are now trying to replicate it opening in the same place in relation to the button clicked.  We can newinstance the form with DIMENSION defined but we need to work out YPOS depending on the painted occurrence number of the button clicked.

    Its not the end of the world, we will just have to make it a "normal" form but it seems such a shame considering how close we can get.

    Cheers

    David

    Tribal Group



    ------------------------------
    David Hepworth
    Uniface Community Edition Shared Account
    US
    ------------------------------



  • 6.  RE: Finding the current painted occurrence

    ROCKETEER
    Posted 01-04-2023 11:03

    Hi Iain,

    Did you already try to open another popup? This should work. But maybe I am missing something obvious here.

    Cheers,
    Daniel



    ------------------------------
    Daniel Iseli
    Principal Technical Support Engineer
    Uniface Services
    Rocket Software, Switzerland
    ------------------------------



  • 7.  RE: Finding the current painted occurrence

    PARTNER
    Posted 01-04-2023 11:06
    Hmm, yes, tricksy. 
    If you make the validation form 'secondary', does it then appear over the popup window? 
    Not sure if you can do secondary/modal..... 

    regards, 
    Iain

    ------------------------------
    Iain Sharp
    Head of Technical Services
    Pci Systems Ltd
    Sheffield GB
    ------------------------------



  • 8.  RE: Finding the current painted occurrence

    PARTNER
    Posted 01-04-2023 11:19

    Hi Daniel, Iain, Gianni
    Thanks for your responses,
    I am hoping we have missed something obvious!

    I will get both of those suggestions attempted tomorrow and let you know.  We have to be careful because we are plugging in to an existing validation process so we have to be careful how we change that.  It may well be that technically it works in this scenario but doesn't in existing implementations so we shall see how it goes.  Thanks for the suggestions.

    Cheers

    David

    Tribal Group



    ------------------------------
    David Hepworth
    Uniface Community Edition Shared Account
    US
    ------------------------------



  • 9.  RE: Finding the current painted occurrence

    PARTNER
    Posted 01-05-2023 04:59

    Hi

    I know you will have been waiting for the outcome of our tests with baited breath.
    First, the idea of using a popup over the other popup.  Other than a few layout issues that occur this seems to work well... if you only have one monitor.  If you open the application on the second monitor, the second popup appears on the primary monitor.
    Second, was using a "secondary" form.  As far as we can currently tell this seems to work perfectly in all scenarios that the validation form runs so we might have a solution here.

    Thanks again for these suggestions and taking the time to respond.

    Cheers

    David

    Tribal Group



    ------------------------------
    David Hepworth
    Uniface Community Edition Shared Account
    US
    ------------------------------



  • 10.  RE: Finding the current painted occurrence

    Posted 01-04-2023 10:55

    Hi David,

    having confirmed my understanding as correct I can tell the question you are raising was already raised in the past, before Uniface joined Rocket family; I do not remember exactly the answer but it could be something like "Uniface runtime does NOT have full control over the entity window".

    Regarding the other issue you've mentioned in your answer "format trigger only fire once when the field is first shown?":
    the answer is clearly defined into documentation:

    FORMAT: Activated before displaying or printing the field and after Deformat.

    For manipulation each time the (not anymore formatted) field is becoming active you can use "Field gets focus" trigger.

    Hope it helps.

    Regards,
    Gianni



    ------------------------------
    Gianni Sandigliano
    IT
    ------------------------------