Re: [twsocket] Post command...
On Apr 14, 2008, at 14:12, zayin wrote: > This is the quick solution. Since the protocol is "stateless", there > is > really no way to say "Success, now reload the page" -- the browser > needs to > *give* the client the page to reload it. I meant that the *server* needs to give the client the page to reload it. Sorry, dZ. -- DZ-Jay [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
Hi dZ, Thanks for the information. Ciao, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, April 14, 2008 12:29 PM To: twsocket@elists.org Subject: Re: [twsocket] Post command... zayin wrote: > I do not know enough about all the HTML codes to know if I am missing some. > Like "refresh current page" or reload or simple "acknowledge do nothing". There are no such responses. The response codes are typically status codes as a result of the request (error, success, file-not-found, file-found-somewhere-else, etc.). In your case, a successful processing should reply with 200, which means "success". However, this is only the response header, you still need the body. If you leave it blank, the browser will just display a blank page, which is even worse. > It appears that the only solution is to just retransmit the complete page > after the button is pressed. This is the quick solution. Since the protocol is "stateless", there is really no way to say "Success, now reload the page" -- the browser needs to *give* the client the page to reload it. The alternative is to do it in JavaScript, which may be more difficult. -dZ. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
zayin wrote: > I do not know enough about all the HTML codes to know if I am missing some. > Like "refresh current page" or reload or simple "acknowledge do nothing". There are no such responses. The response codes are typically status codes as a result of the request (error, success, file-not-found, file-found-somewhere-else, etc.). In your case, a successful processing should reply with 200, which means "success". However, this is only the response header, you still need the body. If you leave it blank, the browser will just display a blank page, which is even worse. > It appears that the only solution is to just retransmit the complete page > after the button is pressed. This is the quick solution. Since the protocol is "stateless", there is really no way to say "Success, now reload the page" -- the browser needs to *give* the client the page to reload it. The alternative is to do it in JavaScript, which may be more difficult. -dZ. -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
Hello, Thanks for the response. Yes, I understand the interaction. I do not know enough about all the HTML codes to know if I am missing some. Like "refresh current page" or reload or simple "acknowledge do nothing". It appears that the only solution is to just retransmit the complete page after the button is pressed. Yes? Thanks, Mark -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
Mark, First you need to understand how HTTP works: It is a stateless protocol, and it works in a "request-response" cycle. The "stateless" part means that it doesn't retain any information about any previous requests or responses, and that every request is treated as a completely new one. The second part means that when the client sends a request, the browser returns a response. When you use a browser as a client, a "request" is any URL you enter in the address bar or hyperlink you click on, which is sent to the server; and this causes a "response" from the server, which, depending on the type of resource it returns, is treated in a specific way. For instance, an HTML resource is rendered as a web page, and a JPEG resource is rendered as an image. Every request expects a response, this is the way the protocol was designed, so there is no clear way to say to the server "Do this and then don't give me anything back". But then whatever the server gives back to the browser, the browser will try to interpret it as best as it can -- even if you make the server return an empty resource, the browser will just display an empty web page. This is clearly not what you want. For this reason what is typically done is that when a page requests some processing from the server that should "return nothing" or "cause no change", the server returns the original content so that the browser can render it equally as if nothing happened. That's what I was showing how to do. This is a typical "state-machine" type of application, where depending on the "state" of the application (either first request, or form post), the server does something different. An alternative is to not use the browser directly to perform the request for processing, but to use JavaScript, as Francois suggested. This way, whatever the server responds -- and it will *always* respond with something -- you can throw it away or interpret it as you want (using JavaScript). The point is that in order for the browser to stop "waiting", the server has to respond with something -- *anything* (even an empty response body, just the headers); and whatever it responds with, the browser will try to act upon it. A web application is not the same as a Win32 application. dZ. zayin wrote: > Hi, > > Thanks for the information. > > What I am looking to do is just stop the client browser from waiting. I do > not want to change the page. > > In the two environments I am testing in, at present, IE and Mozilla, after > the user presses the "accept" button the browser waits for a reply. With IE > the tabsheet title shows a spinning circle. With Mozilla it sets the cursor > to the pointer+hourglass. > > After the HandlePostedData I do not know what to send to handle the client > so the client stop this "wait" mode. > > Ciao, > > Mark > > > > -----Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of [EMAIL PROTECTED] > Sent: Monday, April 14, 2008 10:54 AM > To: twsocket@elists.org > Subject: Re: [twsocket] Post command... > > Mark, > If what you want is to let the user know that processing has > completed, what you need to do is quite simple, old school CGI processing: > You change the rendered output to reflect the results of processing. > > After finishing processing, change a variable, say, "resultString", > and display it in the rendered output. You can have something like: > > // Notice the call to GetResultString() to inject server output. > AnswerString(Flags, > '', { Default Status '200 OK' } > '', { Default Content-Type: text/html } > '', { Default header } > '' + >'' + > '' + TitleString + '' + >'' + >'' + >GetResultString(resultString) + >'' + > //accept command action > 'Tag:' + tagName + ' ' + cBackButton + '' + > 'High Limit: ' + highEU + '' + > 'Low Limit: ' + lowEU + '' + > '' + > '' + > '' + > ' value="Accept"/>' + >'' + > ''); > > // --- > > Function GetResultString(str: String): String Begin > If (str <> '') Then > Result := 'Server Responded: '+ str > Else > Result := ''; > End If > End; > > // -- END > > When
Re: [twsocket] Post command...
Hi, Thanks for the information. What I am looking to do is just stop the client browser from waiting. I do not want to change the page. In the two environments I am testing in, at present, IE and Mozilla, after the user presses the "accept" button the browser waits for a reply. With IE the tabsheet title shows a spinning circle. With Mozilla it sets the cursor to the pointer+hourglass. After the HandlePostedData I do not know what to send to handle the client so the client stop this "wait" mode. Ciao, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, April 14, 2008 10:54 AM To: twsocket@elists.org Subject: Re: [twsocket] Post command... Mark, If what you want is to let the user know that processing has completed, what you need to do is quite simple, old school CGI processing: You change the rendered output to reflect the results of processing. After finishing processing, change a variable, say, "resultString", and display it in the rendered output. You can have something like: // Notice the call to GetResultString() to inject server output. AnswerString(Flags, '', { Default Status '200 OK' } '', { Default Content-Type: text/html } '', { Default header } '' + '' + '' + TitleString + '' + '' + '' + GetResultString(resultString) + '' + //accept command action 'Tag:' + tagName + ' ' + cBackButton + '' + 'High Limit: ' + highEU + '' + 'Low Limit: ' + lowEU + '' + '' + '' + '' + '' + '' + ''); // --- Function GetResultString(str: String): String Begin If (str <> '') Then Result := 'Server Responded: '+ str Else Result := ''; End If End; // -- END When the page is first rendered, the GetResultString() function will return an empty string because the resultString hasn't been set. And when the data is posted and processed, it will display the new string. This is pretty much how more complex and sophisticated frameworks, like ASP.NET, Java-Struts, and PHP handle dynamically generated pages. What Francois was offering was a more "modern" and popular approach, usually called AJAX, where your web page sends requests to the server on a separate channel, using JavaScript, then parses the output, and dynamically changes the document displayed. It does the same thing without "refreshing" the entire document. However, as you stated, this may not work in exactly the same way on every browser, and depends too much on client-side processing, which is prone to errors and abuse. -dZ. zayin wrote: > Hi, > > This all has to be done in HTML only. > > This is my first HTML programming task so, I do not know how to "make the > command from an invisible frame or layer". > > This is the page. > > AnswerString(Flags, > '', { Default Status '200 OK' } > '', { Default Content-Type: text/html } > '', { Default header } > '' + >'' + > '' + TitleString + '' + >'' + >'' + >'' + //accept command action > 'Tag:' + tagName + ' ' + cBackButton + '' + > 'High Limit: ' + highEU + '' + > 'Low Limit: ' + lowEU + '' + > '' + > '' + > '' + > '' + >'' + > ''); > > Can you advise? -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
Mark, If what you want is to let the user know that processing has completed, what you need to do is quite simple, old school CGI processing: You change the rendered output to reflect the results of processing. After finishing processing, change a variable, say, "resultString", and display it in the rendered output. You can have something like: // Notice the call to GetResultString() to inject server output. AnswerString(Flags, '', { Default Status '200 OK' } '', { Default Content-Type: text/html } '', { Default header } '' + '' + '' + TitleString + '' + '' + '' + GetResultString(resultString) + '' + //accept command action 'Tag:' + tagName + ' ' + cBackButton + '' + 'High Limit: ' + highEU + '' + 'Low Limit: ' + lowEU + '' + '' + '' + '' + '' + '' + ''); // --- Function GetResultString(str: String): String Begin If (str <> '') Then Result := 'Server Responded: '+ str Else Result := ''; End If End; // -- END When the page is first rendered, the GetResultString() function will return an empty string because the resultString hasn't been set. And when the data is posted and processed, it will display the new string. This is pretty much how more complex and sophisticated frameworks, like ASP.NET, Java-Struts, and PHP handle dynamically generated pages. What Francois was offering was a more "modern" and popular approach, usually called AJAX, where your web page sends requests to the server on a separate channel, using JavaScript, then parses the output, and dynamically changes the document displayed. It does the same thing without "refreshing" the entire document. However, as you stated, this may not work in exactly the same way on every browser, and depends too much on client-side processing, which is prone to errors and abuse. -dZ. zayin wrote: > Hi, > > This all has to be done in HTML only. > > This is my first HTML programming task so, I do not know how to "make the > command from an invisible frame or layer". > > This is the page. > > AnswerString(Flags, > '', { Default Status '200 OK' } > '', { Default Content-Type: text/html } > '', { Default header } > '' + >'' + > '' + TitleString + '' + >'' + >'' + >'' + //accept command action > 'Tag:' + tagName + ' ' + cBackButton + '' + > 'High Limit: ' + highEU + '' + > 'Low Limit: ' + lowEU + '' + > '' + > '' + > '' + > '' + >'' + > ''); > > Can you advise? -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
Hello, This has to run on every browser on every platform known to mankind. The consideration was sticking only to HTML reduces the risk of future problems. Ciao, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois Piette Sent: Monday, April 14, 2008 9:54 AM To: ICS support mailing Subject: Re: [twsocket] Post command... > This all has to be done in HTML only. Please explain why you can't use JavaScript. -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be - Original Message - From: "zayin" <[EMAIL PROTECTED]> To: "'ICS support mailing'" Sent: Monday, April 14, 2008 4:09 PM Subject: Re: [twsocket] Post command... > Hi, > > This all has to be done in HTML only. > > This is my first HTML programming task so, I do not know how to "make the > command from an invisible frame or layer". > > This is the page. > > AnswerString(Flags, > '', { Default Status '200 OK' } > '', { Default Content-Type: text/html } > '', { Default header } > '' + >'' + > '' + TitleString + '' + >'' + >'' + >'' + //accept command action > 'Tag:' + tagName + ' ' + cBackButton + '' + > 'High Limit: ' + highEU + '' + > 'Low Limit: ' + lowEU + '' + > '' + > '' + > '' + > '' + >'' + > ''); > > Can you advise? > > Thanks, > > Mark > > > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Francois Piette > Sent: Monday, April 14, 2008 2:33 AM > To: ICS support mailing > Subject: Re: [twsocket] Post command... > > > This is all plain HTML without any additions. > > > > I receive an HTML submit command and I am handling it the onPostData > > callback and all is well. I parse the data do the internal calls and > > life > is > > good. > > > > I have one issue. I do not know what to answer. I do not want the > > browser page to change or move to another page or really do anything. > > I just need > to > > send an acknowledgement and I do not know how. > > > > Without the acknowledgement the browser sits waiting. > > This is a client side issue. > Any command sent by the browser needs a reply. > If you don't want to have the displayed page changed by the reply, make the > command from an invisible frame or layer, or from JavaScript using the > xmlHttpRequest object. > > Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html > -- > [EMAIL PROTECTED] > Author of ICS (Internet Component Suite, freeware) Author of MidWare > (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
> This all has to be done in HTML only. Please explain why you can't use JavaScript. -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be - Original Message - From: "zayin" <[EMAIL PROTECTED]> To: "'ICS support mailing'" Sent: Monday, April 14, 2008 4:09 PM Subject: Re: [twsocket] Post command... > Hi, > > This all has to be done in HTML only. > > This is my first HTML programming task so, I do not know how to "make the > command from an invisible frame or layer". > > This is the page. > > AnswerString(Flags, > '', { Default Status '200 OK' } > '', { Default Content-Type: text/html } > '', { Default header } > '' + >'' + > '' + TitleString + '' + >'' + >'' + >'' + //accept command action > 'Tag:' + tagName + ' ' + cBackButton + '' + > 'High Limit: ' + highEU + '' + > 'Low Limit: ' + lowEU + '' + > '' + > '' + > '' + > '' + >'' + > ''); > > Can you advise? > > Thanks, > > Mark > > > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Francois Piette > Sent: Monday, April 14, 2008 2:33 AM > To: ICS support mailing > Subject: Re: [twsocket] Post command... > > > This is all plain HTML without any additions. > > > > I receive an HTML submit command and I am handling it the onPostData > > callback and all is well. I parse the data do the internal calls and > > life > is > > good. > > > > I have one issue. I do not know what to answer. I do not want the > > browser page to change or move to another page or really do anything. > > I just need > to > > send an acknowledgement and I do not know how. > > > > Without the acknowledgement the browser sits waiting. > > This is a client side issue. > Any command sent by the browser needs a reply. > If you don't want to have the displayed page changed by the reply, make the > command from an invisible frame or layer, or from JavaScript using the > xmlHttpRequest object. > > Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html > -- > [EMAIL PROTECTED] > Author of ICS (Internet Component Suite, freeware) Author of MidWare > (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
Hi, This all has to be done in HTML only. This is my first HTML programming task so, I do not know how to "make the command from an invisible frame or layer". This is the page. AnswerString(Flags, '', { Default Status '200 OK' } '', { Default Content-Type: text/html } '', { Default header } '' + '' + '' + TitleString + '' + '' + '' + '' + //accept command action 'Tag:' + tagName + ' ' + cBackButton + '' + 'High Limit: ' + highEU + '' + 'Low Limit: ' + lowEU + '' + '' + '' + '' + '' + '' + ''); Can you advise? Thanks, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francois Piette Sent: Monday, April 14, 2008 2:33 AM To: ICS support mailing Subject: Re: [twsocket] Post command... > This is all plain HTML without any additions. > > I receive an HTML submit command and I am handling it the onPostData > callback and all is well. I parse the data do the internal calls and > life is > good. > > I have one issue. I do not know what to answer. I do not want the > browser page to change or move to another page or really do anything. > I just need to > send an acknowledgement and I do not know how. > > Without the acknowledgement the browser sits waiting. This is a client side issue. Any command sent by the browser needs a reply. If you don't want to have the displayed page changed by the reply, make the command from an invisible frame or layer, or from JavaScript using the xmlHttpRequest object. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Post command...
> This is all plain HTML without any additions. > > I receive an HTML submit command and I am handling it the onPostData > callback and all is well. I parse the data do the internal calls and life is > good. > > I have one issue. I do not know what to answer. I do not want the browser > page to change or move to another page or really do anything. I just need to > send an acknowledgement and I do not know how. > > Without the acknowledgement the browser sits waiting. This is a client side issue. Any command sent by the browser needs a reply. If you don't want to have the displayed page changed by the reply, make the command from an invisible frame or layer, or from JavaScript using the xmlHttpRequest object. Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] Author of ICS (Internet Component Suite, freeware) Author of MidWare (Multi-tier framework, freeware) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Post command...
Hello, This is all plain HTML without any additions. I receive an HTML submit command and I am handling it the onPostData callback and all is well. I parse the data do the internal calls and life is good. I have one issue. I do not know what to answer. I do not want the browser page to change or move to another page or really do anything. I just need to send an acknowledgement and I do not know how. Without the acknowledgement the browser sits waiting. Ideas? Thanks, Mark -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be