Jump to content

AntonioCuomo

uniGUI Subscriber
  • Posts

    170
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by AntonioCuomo

  1. I take up the topic of a post a few weeks ago trying to be clearer on the problem.

    I wrote an app for geolocation by inserting the script in the onclick event of the button, in the ajaxrequest event the reading of the data returned by the call.

    If I log in with loalhost: 8078, the event click and the CurrentPosition event are detected with the latitude and longitude values.

    If I log in with 192.168.1.9:8100 (local ip of the pc) or from a browser on the internet, only the click event is detected.
    The source of the test is attached.

     

    Projectgeoloca.zip

  2. in a unigui windows application I want to insert the geolocation of the pc with the following source.

    procedure TMainForm.UniBitBtn1AjaxEvent(Sender: TComponent; EventName: string;
      Params: TUniStrings);
    begin
    UniMemo1.Lines.Add(eventname);

    if EventName = 'CurrentPosition' then
       begin
        UniMainModule.latidu := Params['lat'].Value;
        UniMainModule.longi  := Params['lng'].Value;

        if accedi(StrToInt(UniNumberEdit1.text), uniedit3.Text, UniEdit2.text) = 0 then
                                                                   UniForm1.ShowModal();
       end;
    end;

    procedure TMainForm.UniBitBtn1Click(Sender: TObject);
    begin
    unisession.AddJS(
     'if (navigator.geolocation) { ' +
        '  navigator.geolocation.getCurrentPosition( function(position) { ' +
        '    ajaxRequest(MainForm.uniBitBtn, "CurrentPosition" ,' +
        '      ["lat=" + position.coords.latitude, ' +
        '       "lng=" + position.coords.longitude, ' +
        '      ]);' +
        '    })' +
        '} else {alert("Geolocation is not supported.");}'
    );

    //if accedi(StrToInt(UniNumberEdit1.text), uniedit3.Text, UniEdit2.text) = 0 then
    //                                                           UniForm1.ShowModal();
    end;

    In the test procedure it works and detects the CurrentPosition event, when I transfer the source in my application unibitbtn ajaxevent detects only the click event and not CurrentPosition

  3. I have a button generated by pay pal and loaded into UniURLFrame.I wish I could copy into single details and err variables that are returned by java functions:

         }]
            });
          },
          onApprove: function(data, actions) {
            return actions.order.capture().then(function(details) {
              alert('Transaction completed by ' + details.payer.name.given_name + '!');
            });
          },
          onError: function(err) {
            console.log(err);
          },
        }).render('#paypal-button-container');
      }

    Is possible?

     

  4. j have a component unihtmlframe with this code in HTML property:

     

    <div id="paypal-button-container"></div>
    <script src="https://www.paypal.com/sdk/js?client-id=**************************************t=true" data-sdk-integration-source="button-factory"></script>
    <script>
      paypal.Buttons({
          style: {
              shape: 'rect',
              color: 'gold',
              layout: 'horizontal',
              label: 'subscribe'
          },
          createSubscription: function(data, actions) {
            return actions.subscription.create({
              'plan_id': 'P-76T5030983848210BL6GXPMY'
            });
          },
          onApprove: function(data, actions) {
            alert(data.subscriptionID);
          }
      }).render('#paypal-button-container');
    </script>

     

    This is a button Paypal.

    This code run with old component (and run in demo) but after upgrade this code not run.

    if j copy the component in demo and past in my form run.

     

     

  5. I entered client-id in servermodule, idkey and secretkey in osbutton and the paypal button is displayed. when I click the button the paypal page appears for a moment and disappears (aboutblank page). with my credentials the demo works perfectly while my applocation does not.

×
×
  • Create New...