Jump to content

MOGSY

Members
  • Posts

    216
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by MOGSY

  1. 9 hours ago, robinhodemorais said:

    Hello, in unigui I have how to create an api?
    For example, I needed to send a post to an api in unigui in json, when the third party application send unigui will handle that json.

    how can i do it, researched it and found it a little choppy about OnHTTPDocument, but nothing concrete, can someone help me?

    This is very usful for many situations.

    Regards

  2. I would like to use different marker on UniMap.

    Following code "https://jsfiddle.net/MuhammadArslan/faqok0c9/19/" gives extension to leaflet marker.

     

    leaflet_numbered_markers.css


    .leaflet-div-icon {
        background: transparent;
        border: none;
    }

    .leaflet-marker-icon .number{
        position: relative;
        top: -37px;
        font-size: 12px;
        width: 25px;
        text-align: center;
    }


    leaflet_numbered_markers.js


    L.NumberedDivIcon = L.Icon.extend({
        options: {
        // EDIT THIS TO POINT TO THE  (or your own marker)
        iconUrl: '<%= image_path("leaflet/marker_hole.png") %>',
        number: '',
        shadowUrl: null,
        iconSize: new L.Point(25, 41),
            iconAnchor: new L.Point(13, 41),
            popupAnchor: new L.Point(0, -33),
            /*
            iconAnchor: (Point)
            popupAnchor: (Point)
            */
            className: 'leaflet-div-icon'
        },

        createIcon: function () {
            var div = document.createElement('div');
            var img = this._createImg(this.options['iconUrl']);
            var numdiv = document.createElement('div');
            numdiv.setAttribute ( "class", "number" );
            numdiv.innerHTML = this.options['number'] || '';
            div.appendChild ( img );
            div.appendChild ( numdiv );
            this._setIconStyles(div, 'icon');
            return div;
        },

        //you could change this to add a shadow like in the normal marker if you really wanted
        createShadow: function () {
            return null;
        }
    });

    I would much appreciate it if one shows how to impliment it in UniGui.

    Thank you.

  3. Hi

    I have external third party applications that send information to our application and I would like to receive and process them.

    I have added two project here to similate this, one is the client that sends a JSON object, and the server receive it.

    The information that I recieve, although it is possible to see that information has been recieved correctly, it is not possible to process it. I tried to populate say an UniEdit box with that information and it appears that is does not recognise the UniEdit box as "undefined!" 

    If I use the same process within one UniGui App, "having both server and client in the same app" it works OK. In the server app press the Post button and will populate both memo and edit box, however the same information is not populated if is comming from the third party app "the client app here"

    If you are testing could please run the Server app on port 8077 and the client on port 8088.

    Is it possible to initiate an event when the server receive the JSON object to process the data?

    The client app generally is not our app and it is always third party and we have no control over it except we receive the message and need to process it.

    Thank you.

    idHttpServer.7z

    ihHttpClient.7z

  4. Hi

    I would appreciate if one could show how to post a message to a particular session, or invoke a function in a particular session.

    I would like to run a function in a session and this happens when I get an external message in the server module.

    Thanks

    • Like 1
    • Upvote 1
  5. Hi

    I get occasional error message when placing a component or even editting in UniGui, any similar experience if so how did you resolve it.

    Example, I got the following error when pasting text into "UniHTMLFrame" HTML Text.

    image.thumb.png.ed12bf03a07ce06335c47c4f31709668.png

    image.png

    image.png

  6. Thank you very much Ron

    what are "uniMainModule.corsPort", "EventID" and "uniMainModule.operator" ?

    UniSession.AddJS('$.get("http://127.0.0.1:'+uniMainModule.corsPort+'?event='+inttostr(EventID)+'&op='+uniMainModule.operator+'", function( data ){' +
         ' ajaxRequest(TransactionForm.form, ["cashRegisterEvent"], { response : data });  '+
       ' }); ');
  7. Hi

    Following code "https://jsfiddle.net/MuhammadArslan/faqok0c9/19/" gives extension to leaflet marker, these markers can allow UniMap Marker to have ID's on the marker. I would much appreciate it if one shows how to impliment it in UniGui.

    Thank you.

     

    leaflet_numbered_markers.css


    .leaflet-div-icon {
        background: transparent;
        border: none;
    }

    .leaflet-marker-icon .number{
        position: relative;
        top: -37px;
        font-size: 12px;
        width: 25px;
        text-align: center;
    }


    leaflet_numbered_markers.js


    L.NumberedDivIcon = L.Icon.extend({
        options: {
        // EDIT THIS TO POINT TO THE  (or your own marker)
        iconUrl: '<%= image_path("leaflet/marker_hole.png") %>',
        number: '',
        shadowUrl: null,
        iconSize: new L.Point(25, 41),
            iconAnchor: new L.Point(13, 41),
            popupAnchor: new L.Point(0, -33),
            /*
            iconAnchor: (Point)
            popupAnchor: (Point)
            */
            className: 'leaflet-div-icon'
        },

        createIcon: function () {
            var div = document.createElement('div');
            var img = this._createImg(this.options['iconUrl']);
            var numdiv = document.createElement('div');
            numdiv.setAttribute ( "class", "number" );
            numdiv.innerHTML = this.options['number'] || '';
            div.appendChild ( img );
            div.appendChild ( numdiv );
            this._setIconStyles(div, 'icon');
            return div;
        },

        //you could change this to add a shadow like in the normal marker if you really wanted
        createShadow: function () {
            return null;
        }
    });


    usage.js
    //Note that the text could also be letters instead of numbers if that's more appropriate
    var marker = new L.Marker(new L.LatLng(0, 0), {
        icon:    new L.NumberedDivIcon({number: '1'})
    });

  8. Hi

    I have tried sending httprequest as shown in the following using UniHTMLFrame. If I use a gateway the message is sent correctly, however if it sent directly it only sends "Option" issue with Cross-Origin Resource Sharing (CORS).

    How is possible to overcome this and not use a gateway?

    Thanks

     

    <script>
        var request = new XMLHttpRequest();

        var HTTPServerIP = "192.168.1.10";
        var HTTPServerPORT = "8765";
        var HTTPServerVersion = "V6";
        var HTTPServerURL =
          "http://" +
          HTTPServerIP +
          ":" +
          HTTPServerPORT +
          "/API2/CITYGUIDE/" +
          HTTPServerVersion +
          "/";
          var ContentType = "application/json";
        var versionID = "v5";

        request.open('POST', HTTPServerURL);
        request.setRequestHeader("Content-Type", ContentType);
        request.setRequestHeader("authorization", 'BASIC TWFyYW5keTpDaXR5R3VpZGU=');
        request.responseType = 'json'
        request.send(JSON.stringify({ "command":"Testing","Message":"This is test message"

           }))
       </script>
     

×
×
  • Create New...