| Welcome, Guest |
You have to register before you can post on our site.
|
| Online Users |
There are currently 1408 online users. » 1 Member(s) | 1404 Guest(s) Applebot, Bing, Google, cribinmipim1980
|
| Latest Threads |
WebApplication.IP change ...
Forum: IntraWeb General Discussion
Last Post: MJS@mjs.us
09-11-2026, 09:49 PM
» Replies: 1
» Views: 214
|
Hook/callback to handle t...
Forum: IntraWeb General Discussion
Last Post: Lenfors
09-08-2026, 09:03 AM
» Replies: 0
» Views: 169
|
Reproducible IIS crash in...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
09-08-2026, 01:48 AM
» Replies: 0
» Views: 183
|
The packages IW16.xx inc...
Forum: IntraWeb General Discussion
Last Post: hsbelli
09-03-2026, 11:46 AM
» Replies: 2
» Views: 492
|
Redirection issues with F...
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 10:03 AM
» Replies: 0
» Views: 252
|
Source Code
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 08:11 AM
» Replies: 3
» Views: 656
|
TContenthandler requires ...
Forum: IntraWeb General Discussion
Last Post: valmeras
08-30-2026, 02:35 AM
» Replies: 0
» Views: 230
|
TIWjQDBGrid erratic behav...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
08-20-2026, 05:12 PM
» Replies: 8
» Views: 2,259
|
Change Language DataTable
Forum: IntraWeb General Discussion
Last Post: Rigoberto Mercedes
08-19-2026, 03:21 PM
» Replies: 1
» Views: 370
|
How to terminate HTTP Thr...
Forum: Indy
Last Post: rlebeau
08-14-2026, 08:01 AM
» Replies: 5
» Views: 998
|
|
|
| IdHTTP Post problem |
|
Posted by: BartKindt - 07-11-2019, 10:46 PM - Forum: Indy
- Replies (1)
|
 |
I am trying to post weather data to the OpenWeatherMap API server.
They use a RESTful server (API 3.0).
The documentation on this is totally incomplete.
Using a third-party program called 'ARC' and a lot of research, I discovered that in addition to adding the KEY to the URL, it is also required that *before* the HTTP Request the same KEY is send, which in this ARC program is called an 'Action', with a 'Name' and a 'value'.
In another application reference on the Internet the same name+value where added in what was called the 'Params' of this application.
The only Params I have been able to find in the IdHTTP Client is here:
IdHTTP1.Request.Authentication.Params.AddValue('appid',APIKey);
But this cannot be done because the 'Authentication' is not created.
And when I try to create it manually, I get a
[dcc32 Warning] Unit1.pas(224): W1020 Constructing instance of 'TIdAuthentication' containing abstract method 'TIdAuthentication.DoNext'
I am not even sure if this is the right location for this 'name' + 'Key'.
The OpenWeatherMap API does not do any negotiation; When the HTTP Post is not excactly correct, it just gives a '400' and disconnects.
OnAuthorisation and OnSelectAuthorisation are never called.
How am I to add these values to the HTTP Post, *before* the body containing JSON data is send?
|
|
|
| Advice about where put a code to websocket |
|
Posted by: cprmlao@hotmail.com - 07-10-2019, 03:08 PM - Forum: IntraWeb General Discussion
- Replies (5)
|
 |
Hi,
I have many iw forms, all inherited from a standard iwform(TIWFormStd).
I have a MasterTemplate html to all my IWForms.
I have my websocket server component in servercontroller module(I don´t know if this is the better place)
I need the websocket client available in all forms, because my app has a chat to users.
In that MasterTemplate, I have the next script code to connect to websocket server:
Code: <script>
function wschat()
{
if (!ws || ws.state()!='open'){
ws = new sgcWebSocket('ws://127.0.0.1:5414/auth/url/admin/1234');
}
ws.on('open', function(evt){
console.log(ws.state())
});
ws.on('message', function(evt){
console.log(evt.message)
})
}
wschat()
</script>
My problem is that when I open a new iwform, I allways release the old iwform. As the old form is released, the websocket connection in the frontend is destroyed as well and recreated when the new IWForm is active.
I´d like to know some suggestions about where I can put the websocket client code to avoid it.
Regards, Luiz
|
|
|
| IdDateTimeStamp gives strange result |
|
Posted by: jollytall - 07-09-2019, 10:20 AM - Forum: Indy
- Replies (1)
|
 |
I might have missed something, but tried a very simple code:
procedure TForm1.Button1Click(Sender: TObject);
begin
IdDateTimeStamp1.SetFromTDateTime(Now);
memo1.lines.add(DateTimeToStr(Now));
memo1.lines.add(IdDateTimeStamp1.AsISO8601Calendar);
end;
and got the result:
9-7-19 12:06:56
2020-8-10T12:06:56,
i.e. the Year, the Month and the Day are all +1 compared to the real one. I tried other dates and always this offset.
Any idea?
I use Debian 9, Gnome 3.22.2, Lazarus 2.0.2., FPC 3.0.4, on 64 bit.
|
|
|
| on resize for regions? |
|
Posted by: pete@pdmagic.com - 07-07-2019, 09:40 PM - Forum: IntraWeb General Discussion
- Replies (2)
|
 |
Standard HTML+JS only provides resize events for windows and frames. However Intraweb also resizes controls using the align functionality. (e.g. when a splitter is used)
There are a couple of places where I've embedded content that needs to be notified of resize so they can redraw themselves. I've got the following code in one such place:
Code: window.resize(function(){
CurDgm.PanZoom.resize();
CurDgm.PanZoom.fit();
CurDgm.PanZoom.center();
});
That code works as expected when the browser is resized. However, when a splitter is used that causes the containing region to change size, that function will not be called.
Is there an IW event handler I can hook to to call this code when a region changes size?
Thanks!
|
|
|
| Custom control inherited from IWControls |
|
Posted by: LeoBruno - 06-29-2019, 12:39 AM - Forum: IntraWeb General Discussion
- Replies (2)
|
 |
Hi:
I´m developing some IWControls inherited from TIWEdit.
I would like to ask for help, since I´m having a few problems with the inherited controls in design time.
I must say that I´m using IW 14 bundled version (delphi 10.3), so no access to the source code avaiable.
1# - Inherited controls doesn´t look like their parents in design time. (see picture attached). (solved, see the post bellow)
2# - Not possible to assign ScriptAvents through a method called by other property setter.
There is a boolean property, and based on it´s value a method gets some javascripts in order to be set at scriptevents.
The boolean property setter, after defining the property value, calls the method to add the script events.
The method is being called properly, but before adding the new scripts, is necessery to delete the old ones.
If the old scriptevents are not deleted, the new one is not added.
So, the SetJavaScripts method, looks like this:
procedure TLBIWXEditFloat.SetJavaScripts(aAllowNegative: boolean);
var
_Idx: Integer;
_OnKeyDown: TStringList;
begin
_Idx := Self.ScriptEvents.IndexOf('onKeyDown');
if _Idx > 0 then
Self.ScriptEvents.Delete(_Idx);
_OnKeyDown := TLBXIntraWebJs.GetScrptEdtFloatOnKeyDown(aAllowNegative);
try
Self.ScriptEvents.Add('onKeyDown', _OnKeyDown.Text);
finally
_OnKeyDown.Free;
end;
end;
The problem is that in design time, "Self.ScriptEvents.IndexOf('onKeyDown')" always returns -1, therefore is impossible to delete the scriptevent, preventing to add the new one.
AllowNegative setter looks like this:
procedure TLBIWXEditFloat.SetAllowNegative(const Value: Boolean);
begin
FAllowNegative := Value;
Self.SetJavaScripts(Value);
end;
What am I missing?
Thanx in advance!
|
|
|
|