Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Want simple JS demo
#11
(08-18-2019, 06:55 AM)DanBarclay Wrote: Hi Kristy,

I downloaded the demo Jose provided and tried it here, it works fine.  I'm running IW 15.1.2, just haven't installed 15.1.3 yet, but that shouldn't matter.

If you run the demo, exactly what are you seeing?
Run the demo, you should see a button and textbox.  Textbox will contain the default text "IWEdit1".
When you press the button it will execute the callback, replacing the "IWEdit1" with "something", and also show the notification.

Where does your execution break down?

Hi Dan,

I don't know how to setup http.sys environment. Everytime I tried to IW test base on http.sys, windows blue screen appear. So I just copy and paste the code Jose given.

The code can show the timezone offset value right in IWEDIT1.
But if I try to assign IWedit1.text to IWlabel.caption, IWbutton.caption... Its nothing changed.
Actually I want to get this value other than ask user to set their local time. Daylight saving time is also a cause.
It seem that show value on IWedit1 but also destroy the internal structure. I can't get the value to backend process.
That my facing problem.

Oh No!

Just simple as below also not work?
(Windows 10 Home + Delphi 10.3.2 + Intraweb 15.1.3)

procedure TIWForm1.IWButton1Click(Sender: TObject);
begin
WebApplication.ShowMessage('12345678');
end;

Which version can be work for production?
(May be never having! At least never having completed manual)
(No wonder users are getting less and less.)
Reply
#12
You don't need to know anything about httpsys.  The demo Jose provided should run as it is.  Just open the project in Delphi and run it.  What does it do?

If you want to replace the code with standalone startup then in LeoBruno project file:
Replace IWStartHSys with IWStart in uses.
Replace TIWStartHSys.Execute(True) with TIWStart.Execute(True)

It works fine either way.  In fact, until you mentioned it I hadn't even noticed it was httpsys.

Dan
Reply
#13
"Everytime I tried to IW test base on http.sys, windows blue screen appear"

There is nothing in IW that would cause a Windows blue screen in any modern version of Windows. It sounds like there is something else wrong on your Windows. Generally since XP and especially Vista, only a low level driver or the OS itself can BSOD.

IntraWeb errors will be presented as displayable messages or in an error log file.
Reply
#14
(08-18-2019, 07:47 AM)Kristy Wrote:
(08-18-2019, 06:55 AM)DanBarclay Wrote: Hi Kristy,

I downloaded the demo Jose provided and tried it here, it works fine.  I'm running IW 15.1.2, just haven't installed 15.1.3 yet, but that shouldn't matter.

If you run the demo, exactly what are you seeing?
Run the demo, you should see a button and textbox.  Textbox will contain the default text "IWEdit1".
When you press the button it will execute the callback, replacing the "IWEdit1" with "something", and also show the notification.

Where does your execution break down?

Hi Dan,

I don't know how to setup http.sys environment. Everytime I tried to IW test base on http.sys, windows blue screen appear. So I just copy and paste the code Jose given.

The code can show the timezone offset value right in IWEDIT1.
But if I try to assign IWedit1.text to IWlabel.caption, IWbutton.caption... Its nothing changed.
Actually I want to get this value other than ask user to set their local time. Daylight saving time is also a cause.
It seem that show value on IWedit1 but also destroy the internal structure. I can't get the value to backend process.
That my facing problem.

Oh No!

Just simple as below also not work?
(Windows 10 Home + Delphi 10.3.2 + Intraweb 15.1.3)

procedure TIWForm1.IWButton1Click(Sender: TObject);
begin
  WebApplication.ShowMessage('12345678');
end;

Which version can be work for production?
(May be never having! At least never having completed manual)
(No wonder users are getting less and less.)


JNP's demo works fine and should work fine in any IW 15.x version.
I wonder what's the problem you are facing. Several users are running Http.sys applications in production for several months and there is not a single report of problems due Http.sys.

Have you tried a simple Indy SA server? What's the error you are getting?
Reply
#15
(08-18-2019, 09:45 PM)Alexandre Machado Wrote: JNP's demo works fine and should work fine in any IW 15.x version.
I wonder what's the problem you are facing. Several users are running Http.sys applications in production for several months and there is not a single report of problems due Http.sys.

Have you tried a simple Indy SA server? What's the error you are getting?

I tried that on my new Dell notebook, brought at three week ago.
Flash install Delphi 10.3.2 + Intraweb 15.1.3
http.sys will hang then windows blue screen
indy SA server is work
but WebApplication.ShowMessage('12345678'); no message show and no error message.
Jose's demo work as display, but can't assign value to variable.
Try VCL windows application, everything ok.
Reply
#16
What is the exact version (including build number) of your Windows and the language used?

I'll test Jose's demo as Indy SA and let you know the results
Reply
#17
(08-19-2019, 03:14 AM)Kristy Wrote:
(08-18-2019, 09:45 PM)Alexandre Machado Wrote: JNP's demo works fine and should work fine in any IW 15.x version.
I wonder what's the problem you are facing. Several users are running Http.sys applications in production for several months and there is not a single report of problems due Http.sys.

Have you tried a simple Indy SA server? What's the error you are getting?

I tried that on my new Dell notebook, brought at three week ago.
Flash install Delphi 10.3.2 + Intraweb 15.1.3
http.sys will hang then windows blue screen
indy SA server is work
but WebApplication.ShowMessage('12345678'); no message show and no error message.
Jose's demo work as display, but can't assign value to variable.
Try VCL windows application, everything ok.

Some fresh code for the demo Jose provided for you.  Replace his two procedures with the following.  They do things  more than once, different ways, but provide your original request for timezone offset in addition to showing the callback with comments.

Code:
procedure TIWForm1.clbkGridSel(aParams: TStrings );
begin
  // value of "Selection was sent by callback function, get it from parameters
  fGridSelection := aParams.Values['Selection'];

  // Now put it back into the IWEdit1 control if you want (or use it here on the Delphi side).
  //   It is in a Delphi variable now so do what you want with it.
  WebApplication.
  CallBackResponse.
    AddJavaScriptToExecuteAsCDATA( 'document.getElementById("IWEDIT1").value = "' + fGridSelection + '"' );

  //  Show the value on the way out.
  WebApplication.ShowNotification( fGridSelection );
  // Put the timezone offset as caption of the button, on the server side
  IWButton1.caption:=fGridSelection;
  webapplication.showmessage('1234 for fun');
end;

procedure TIWForm1.IWButton1AsyncClick(Sender: TObject;
  EventParams: TStringList);
begin

  // Use the async click to execute a callback function on the browser side.
  //  Compute and send Timezone Offset minutes and pass as parameter
  //  Also put it in IWEdit1, using javascript on the browser side.
  WebApplication.
  CallBackResponse.
    AddJavaScriptToExecute(
  'var d = new Date();' + sLineBreak +
  'var tn = d.getTimezoneOffset();' + sLineBreak +
  'document.getElementById("IWEDIT1").value = tn;' + sLineBreak+
  'ajaxCall("clbkGridSel", "Selection="+tn, false);'
  );

end;

It's not pretty or efficient, but see if that helps understanding.

Dan
Reply
#18
My Notebook config:
Dell Inspiron 5480
Intel Core i5-8265U 1.60GHz, 24GB Ram
Windows 10 64bits Home Edition, v.1903.18362.295 (Taiwan)

(08-19-2019, 03:35 AM)DanBarclay Wrote: Some fresh code for the demo Jose provided for you.  Replace his two procedures with the following.  They do things  more than once, different ways, but provide your original request for timezone offset in addition to showing the callback with comments.

Code:
procedure TIWForm1.clbkGridSel(aParams: TStrings );
begin
  // value of "Selection was sent by callback function, get it from parameters
  fGridSelection := aParams.Values['Selection'];

  // Now put it back into the IWEdit1 control if you want (or use it here on the Delphi side).
  //   It is in a Delphi variable now so do what you want with it.
  WebApplication.
  CallBackResponse.
    AddJavaScriptToExecuteAsCDATA( 'document.getElementById("IWEDIT1").value = "' + fGridSelection + '"' );

  //  Show the value on the way out.
  WebApplication.ShowNotification( fGridSelection );
  // Put the timezone offset as caption of the button, on the server side
  IWButton1.caption:=fGridSelection;
  webapplication.showmessage('1234 for fun');
end;

procedure TIWForm1.IWButton1AsyncClick(Sender: TObject;
  EventParams: TStringList);
begin

  // Use the async click to execute a callback function on the browser side.
  //  Compute and send Timezone Offset minutes and pass as parameter
  //  Also put it in IWEdit1, using javascript on the browser side.
  WebApplication.
  CallBackResponse.
    AddJavaScriptToExecute(
  'var d = new Date();' + sLineBreak +
  'var tn = d.getTimezoneOffset();' + sLineBreak +
  'document.getElementById("IWEDIT1").value = tn;' + sLineBreak+
  'ajaxCall("clbkGridSel", "Selection="+tn, false);'
  );

end;

It's not pretty or efficient, but see if that helps understanding.

Dan
Dan,

The code is nothing show, no pop up message, IWedit1 nothing changed value.
No any error message. Silent like in deep ocean.
Reply
#19
Using Windows 10 Home, I think IIS is not installed by default but can be installed. I think it will be under Programs and Features. I'm not certain but I doubt HTTP.sys will be installed unless you install IIS.

The project should still work using Indy with the changes I provided in an earlier message (IWStart).

Others may have more info on using HTTPSys on Windows 10.

Dan
Reply
#20
(08-19-2019, 05:14 AM)DanBarclay Wrote: Using Windows 10 Home, I think IIS is not installed by default but can be installed.  I think it will be under Programs and Features.  I'm not certain but I doubt HTTP.sys will be installed unless you install IIS.

The project should still work using Indy with the changes I provided in an earlier message (IWStart).

Others may have more info on using HTTPSys on Windows 10.

Dan

I have IIS installed before.
So I uninstall it to see what's differ.
Same as result.
Sigh!

Create fresh new project.
just try to show webapplication.showmessage() and assign value, work!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)