Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum Contacts Web Application

Tagged: 

  • Contacts Web Application

    Posted by Andreas Pfeiffer on December 4, 2022 at 12:13 pm

    This is the Contacts Web Application created as a demo version for the Madagascar ODC event. You can download and run it with the Omnis Studio Community Edition 10.22 Build 31896 or higher.

    It works with the attached SQLite database but you can also run it against PostgreSQL server. Just copy the tables using Omnis Studio SQL Browser and change the database login inside the remote task.

    For instruction please read attached readme.txt file.

    Have fun and let me know if you have any issues running it.

    Feel free to use this as a basis for your own web application.

    Best,

    Andreas 😀

    Andreas Pfeiffer replied 4 months, 1 week ago 5 Members · 36 Replies
  • 36 Replies
  • Francesco Parisi

    Member
    December 9, 2022 at 9:26 am

    Ciao Andreas,

    a question on the login page.

    I can’t figure out what the “email” and “password” entry fields are.

    They look like the union of a label and an entry, where are the properties?

    Where are they configured?

    Thank you

    Francesco

  • Andreas Pfeiffer

    Administrator
    December 9, 2022 at 9:49 am

    Hi Francesco,

    It might be that the label and the entry field is grouped. To get its properties just ungroup those, please.

    Best,

    Andreas

  • Francesco Parisi

    Member
    December 9, 2022 at 10:01 am

    Ok, stupid me,

    I hadn’t really thought about it.

    Thank you

    Francesco

    • Andreas Pfeiffer

      Administrator
      December 9, 2022 at 10:14 am

      No worries.

      Have fun!

      Best,

      Andreas

  • Deleted User

    Deleted User
    July 26, 2023 at 9:09 am

    Thats a neat application!

  • Martin Obongita

    Member
    August 14, 2023 at 4:11 pm

    Hi Andreas,

    How do you append the date picker control in the “birthdate” entry field?

    Regards, Martin

    • Andreas Pfeiffer

      Administrator
      August 15, 2023 at 10:12 am

      Hello Martin,

      There is a property $inputtype which needs to be set to kJSInputtypeDate. Also there are $datepickermode, $datepickeroptions and $datepickerpopupstyle where you can control how this is going to look.

      I hope this helps.

      Best,

      Andreas

      • Martin Obongita

        Member
        August 15, 2023 at 2:20 pm

        Hi Andreas,

        The online documentation keeps referring to: “On Windows, the Server Management Library can display a tray icon; to
        enable the icon, you need to add the “showTrayIcon” item to the
        “servermgmt” section of the config.json file and set it to true. If omitted, or set to false, the servermgmt.lbs does not show a tray icon.” Where are these files .lbs & config.json located in my Omnis installation? I have searched for it but they cannot be found.

        Martin.

        • Andreas Pfeiffer

          Administrator
          August 16, 2023 at 7:38 am

          Hi Martin,

          Sorry, I have overseen your question regarding config.json and servermgmt.lbs.

          In Omnis Studio 11 you will find the library in the Omnis package (on macOS) /Applications/Omnis\ Studio\ 11\ 35439.app/Contents/MacOS/webserver/servermgmt.lbs

          On Windows it is here: C:\Program Files\Omnis Software\OS 11 35439 x64\webserver

          I will add a documentation fault as it was different in Omnis Studio 10.22

          The config.json file is located in the /studio folder within your app support. Alternatively you can use the little button on the left bottom in your Omnis Studio Browser and pick “edit configuration”. That will allow you to change the content of your config.json file from within Omnis. Here is the reference: https://www.omnis.net/developers/resources/onlinedocs/WebDev/07Deployment.html#server-configuration

          I hope this helps.

          Best,

          Andreas

          • Martin Obongita

            Member
            August 16, 2023 at 8:20 am

            Hi Andreas,

            I do not see “config.json” file in my installation folder for both version 10.22 & 11. I’m running OS Win 10 64 bit Omnis WebDev.

            Please look at the attached screengrab of my Omnis installation:

            • Andreas Pfeiffer

              Administrator
              August 16, 2023 at 9:12 am

              The application support is not in the Program Files folder.

              On Windows go to: c:\user\yourUserName\AppData\Local\Omnis Software\OS 11 35439 x64\studio

          • Martin Obongita

            Member
            August 16, 2023 at 8:43 am

            You said, “Alternatively you can use the little button on the left bottom in your Omnis Studio Browser.” I can’t seem to see this tiny button in my Omnis browser.

  • Martin Obongita

    Member
    August 14, 2023 at 5:17 pm

    Hi Andreas,

    I also wish to know how you defined the tooltip in the email entry field: “Please include @ in the email”. Because I do not see this tooltip in the properties of the object.

    Regards, Martin.

    • Andreas Pfeiffer

      Administrator
      August 15, 2023 at 10:21 am

      Hi Martin,

      Actually there is no tooltip.

      You might refer to the error handler though? When you press the “save” button it will call the $save method of the table class. The $save method of the table class then calls the $check method of that instance. In that case the $check method of the taPersons is overridden and therefore it checks which fields are mandatory. It also saves the error text and the field name that caused the error. Back in the form if the $save fails it will then load the error text and the field name and show the error directly on that field. So this follows the OO rules and puts the business rules ($check) into the table class instance. See also this tech note I wrote a while ago: https://www.omnis.net/developers/resources/technotes/tnjs0008.jsp

      Is this what you are asking for?

      Best,

      Andreas

      • Martin Obongita

        Member
        August 15, 2023 at 2:16 pm

        Thank you Andreas. Your explaining is straight to the point. Another question I have. The buttons have text properties starting with $st.save. How are you assigning the language using this $st to the file “madagascar.tsv” ?

  • Andreas Pfeiffer

    Administrator
    August 15, 2023 at 2:59 pm

    Hi Martin,

    This is because the string table is assigned in the $stringtable property of the remote task that is being used.

    Note when using Omnis Studio 11 you could also use the $label property of the entry field using this “$st.” notation. Here is the documentation about using string tables in remote forms: https://www.omnis.net/developers/resources/onlinedocs/WebDev/06localization.html#localizing-remote-forms

    Normally the browsers language locale is used. However if the user wants he can change the language using the language menu in the logon remote form. It contains some code to change the language. It is a client executed method that reloads the browser with a different language.

    Hope this helps.

    Best,

    Andreas

    • Martin Obongita

      Member
      August 15, 2023 at 4:30 pm

      You are so helpful, Andreas, making Omnis a very easy language to learn.

      • Andreas Pfeiffer

        Administrator
        August 15, 2023 at 4:32 pm

        You are welcome.

        Best,

        Andreas

        • Martin Obongita

          Member
          August 16, 2023 at 8:36 am

          Hi Andreas,

          In the subform “jsFileList”, the complex grid does not seem to display the buttons view & download, when I test the main form. What am I missing?

          Regards, Martin.

          • Andreas Pfeiffer

            Administrator
            August 16, 2023 at 10:14 am

            Hi Martin,

            I suppose no data are in the complex grid. Hence the buttons will not show up.

            If you want to present data you can do the following:

            Add a folder in the Omnis App Support inside the /omnispdf folder and call it “Madagascar”. Then place PDF files there. Those are the one that will be displayed for every of the contacts. Possibly you would need to load the data differently because it would not make sense to present the same files for all contacts.

            To change this: go to the $load method of taFileList. This table class is used in that specific subclass. Then you could probably add some SQL that loads the file list and the pathnames from SQL if you have the information there. But note that only the /omnispdf folder is allowed for downloading. If you need a different folder then you would need to give permission via getpdfFolders in the server section of the config.json file.

            Best,

            Andreas

            • Martin Obongita

              Member
              August 16, 2023 at 10:27 am

              A great answer, Sir. I am happy.

            • Andreas Pfeiffer

              Administrator
              August 16, 2023 at 11:26 am

              No worries. Have a great day!

              Best,

              Andreas

            • Martin Obongita

              Member
              August 17, 2023 at 9:45 am

              Hi Andreas,

              In your Omnis_Academy manual working with “cucina_piccola.lbr”, Exercise 27 page 64, I have an issue with redraw when I test “jsOutlet” and click on the list. The selection works ok on current line by changing its color. But somehow other random lines also change their colors to the color of the current line. If I step through my code, I notice that in the $event method of the grid, when it finishes executing the code, the stack jumps to the construct of the remote task. But in your $event method, after finishing executing the code, your stack jumps to the $load method. How do I resolve this redraw issue?

              Martin.

            • Andreas Pfeiffer

              Administrator
              August 17, 2023 at 12:00 pm

              Hi Martin,

              What chapter in the training manual do you refer?

              BTW. Do you mind not mixing the threads?

              Thanks and best regards,

              Andreas

            • Martin Obongita

              Member
              August 17, 2023 at 7:38 pm

              sorry about that. I have started a new thread.

  • Martin Obongita

    Member
    August 22, 2023 at 2:19 pm

    Hi Andreas,

    In the contacts web app, source icon selection, how do I include: SET Madagascar in my library?

    Martin.

    • Andreas Pfeiffer

      Administrator
      August 22, 2023 at 2:37 pm

      Hi Martin,

      I am not sure if I understand you well.

      Do you mean where to copy the icon folder? It is described in the readme.txt file.

      Does that help?

      Best,

      Andreas

  • Martin Obongita

    Member
    September 11, 2023 at 8:16 pm

    Hi Andreas,

    In the $construct method of the jsPerson remote form, you have these lines of code:

    If $cinst.$container().$getID.$cando()

    Do $cinst.$load($cinst.$container().$getID())

    End If

    1.Please explain what $cando() function does.

    2.How does this line execute? Do $cinst.$load($cinst.$container().$getID())

    Thank you. Martin O.

  • Andreas Pfeiffer

    Administrator
    September 12, 2023 at 6:34 am

    Hi Martin,

    $cando() is an inbuilt method that proves if a certain method is available. In this specific case it checks if the $getID() of the container can be executed.

    The container can be either the container form that contains the subform instance or it can be the form that opened the popup form.

    So the $load will be called with an argument that is the id from the container.

    I hope that makes sense.

    Best,

    Andreas

  • Andreas Pfeiffer

    Administrator
    September 19, 2023 at 10:21 am

    If you want to use Omnis Studio 11 please do not replace the HTM file as described in the readme.txt file.

    Best,

    Andreas

  • Philip Tulett

    Member
    December 10, 2023 at 5:45 pm

    Hi Andreas,

    Have you tried using the servermgmt.lbr with JS Client Serial Number ?

    It does not load/run correctly.

    Works fine when using the developer serial numbers.

    I have just sent an email to Omnis UK Support on this.

    Kind regards

    Phil

    • Andreas Pfeiffer

      Administrator
      December 11, 2023 at 8:32 am

      Hi Phil,

      Yes – please contact the support for this.

      Best,

      Andreas

Log in to reply.