Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 97,637
» Latest member: r666cr7top
» Forum threads: 2,426
» Forum posts: 11,371

Full Statistics

Online Users
There are currently 956 online users.
» 3 Member(s) | 950 Guest(s)
Applebot, Bing, Google, 789win01dev1vn, blogkienthuckeonhacaii5, sunwincomskin

Latest Threads
WebApplication.IP change ...
Forum: IntraWeb General Discussion
Last Post: MJS@mjs.us
09-11-2026, 09:49 PM
» Replies: 1
» Views: 136
Hook/callback to handle t...
Forum: IntraWeb General Discussion
Last Post: Lenfors
09-08-2026, 09:03 AM
» Replies: 0
» Views: 124
Reproducible IIS crash in...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
09-08-2026, 01:48 AM
» Replies: 0
» Views: 141
The packages IW16.xx inc...
Forum: IntraWeb General Discussion
Last Post: hsbelli
09-03-2026, 11:46 AM
» Replies: 2
» Views: 431
Redirection issues with F...
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 10:03 AM
» Replies: 0
» Views: 216
Source Code
Forum: IntraWeb General Discussion
Last Post: magosk
08-31-2026, 08:11 AM
» Replies: 3
» Views: 605
TContenthandler requires ...
Forum: IntraWeb General Discussion
Last Post: valmeras
08-30-2026, 02:35 AM
» Replies: 0
» Views: 207
TIWjQDBGrid erratic behav...
Forum: IntraWeb General Discussion
Last Post: alex.trejo@tttnet.com.mx
08-20-2026, 05:12 PM
» Replies: 8
» Views: 2,185
Change Language DataTable
Forum: IntraWeb General Discussion
Last Post: Rigoberto Mercedes
08-19-2026, 03:21 PM
» Replies: 1
» Views: 338
How to terminate HTTP Thr...
Forum: Indy
Last Post: rlebeau
08-14-2026, 08:01 AM
» Replies: 5
» Views: 949

 
  Icons in TIWURLWindow
Posted by: JuergenS - 07-18-2023, 04:27 PM - Forum: IntraWeb General Discussion - Replies (6)

Hi Alexandere,

i want to cache .jpg, .png, .gif and .ico graphics in a TIWURLWindow component.

Unfortunately, this only works with the first 3 graphic types.

Icons are NOT displayed in the TIWURLWindow component, instead the graphics file is downloaded to the user's machine without prompting.

Is there an explanation ?

Regards
Jürgen



Attached Files
.zip   IconInURLWindow.zip (Size: 24.9 KB / Downloads: 2)
Print this item

  Refactoring old code
Posted by: Alexandre Machado - 07-18-2023, 05:54 AM - Forum: IntraWeb General Discussion - Replies (2)

An IntraWeb user asked me some help to refactor an old IW application that he is maintaining, written by someone else. I asked him permission to publish parts of the code because I find it valuable to learn a thing or two.

This is the original code (with some variable name changes so it can't be back traced):

Code:
function CreateSelectHtml(var idComboBox, key, year, enabled, action: String):String;
var
  html: WideString;
  qryList: TFDQuery;
begin
  Result     := '';
  qryList := TFDQuery.Create(Nil);
  qryList.Connection := Controller.ConexaoEscola;
  try
    qryList.close;
    qryList.sql.Clear;
    qryList.SQL.Add(' Select distinct ');
    qryList.SQL.Add('   A.grade ');
    qryList.SQL.Add(' , A.code ');
    qryList.SQL.Add(' , A.description');
    qryList.SQL.Add(' FROM ESCW019 A ');
    qryList.SQL.Add(' WHERE A.year = :year');
    qryList.ParamByName('year').AsString := year;
    qryList.Open;


    html := '';

    html := html + '<select class="comboselect2"  id="'+idComboBox+'" style="width:100%"  '+enabled+' onchange='+action+'>' + SLineBreak;
    if key = '' then
      html := html + '   <option value="" selected="selected">Select</option>' + SLineBreak
    else
      html := html + '   <option value="" >Select</option>' + SLineBreak;

   qryList.First;
    while not qryList.Eof do
    begin
    if (key <> '') and (qryList.FieldByName('code').AsString = key) then
      html := html + '        <option value="'+qryList.FieldByName('code').AsString+'" selected="selected">'+qryList.FieldByName('desc').AsString+'</option> ' + SLineBreak
    else
      html := html + '        <option value="'+qryList.FieldByName('code').AsString+'">'+qryList.FieldByName('desc').AsString+'</option> ' + SLineBreak;
      qryList.Next;
    end;
      html := html + '</select> ' + SLineBreak;
    qryList.Close;

    Result := html;

  finally
    qryList.Free;
  end;
end;

He asked me what I would consider to change in code like this.

Here's my code review rant list  Big Grin

1- There is no reason to use WideStrings. WideString should be used in COM and when calling Windows API directly. Other than that, no reason.

2- Setting the SQL: Each time qryList.SQL.Add() is called, a whole bunch of methods and events are triggered. Some events may even trigger Database requests (we never know). Don't do this. Set the SQL at once using a single Add() or, what I do, qryList.SQL.Text := 'bla bla bla'

3- String concatenation in a loop: Always a bad idea. You can get better performance using something like our TStrBuilder (declared in unit IW.Common.StrBuilder)

4- Using FieldByName() inside a tight loop. FieldByName performance has improved but it won't ever be as efficient as having the field reference to use directly. Use FieldByName() 1 time to get the field reference and then use it inside the loop.

5 - DataSet loop: As a rule of thumb, use DataSet.DisableControls..DataSet.EnableControls when looping a DataSet. You possibly don't know the implementation details of the DataSet. In this case you don't know if DisableControls will improve the performance or not. It does make a big difference in ADO DataSets, for instance.

6- One query field is not used at all

7 - Several statements have no reason to exist. Query.Close before destroying it, SQL.Clear just after creating the query, and various others.

Tomorrow I'll publish the code I wrote to replace this, keeping the same functionality and method signature.

Print this item

  Product Support
Posted by: jimmy11 - 07-12-2023, 05:19 AM - Forum: IntraWeb General Discussion - Replies (8)

Hi,
Aside from this forum, do you have any other line of support? If yes (hopefully) can someone please let me know?
Thanks

Print this item

  Another nice demo published
Posted by: Alexandre Machado - 07-11-2023, 09:49 PM - Forum: IntraWeb General Discussion - Replies (1)

Hi guys,

We've just published another demo that is extensively requested by our users.

https://github.com/Atozed/IntraWeb/tree/...orProgress

Basically it shows how to use together an IWMonitor and a IWProgressBar to display the progress of a long duration task executed by a background thread.

The demo is simple but complete. There are several features working nicely together to do what it does.

Please notice that even though the IWMonitor requests data from the server (the completed percentage of the process) there is no session locking going on here. The request/response cycle lightweight and very fast.

Enjoy  Big Grin

Print this item

  Another nice demo published
Posted by: Alexandre Machado - 07-11-2023, 02:27 AM - Forum: IntraWeb General Discussion - No Replies

Hi guys,

We've just published another demo that is extensively requested by our users.

https://github.com/Atozed/IntraWeb/tree/...orProgress

Basically it shows how to use together an IWMonitor and a IWProgressBar to display the progress of a long duration task executed by a background thread.

The demo is simple but complete. There are several features working nicely together to do what it does.

Please notice that even though the IWMonitor requests data from the server (the completed percentage of the process) there is no session locking going on here. The request/response cycle is lightweight and very fast.

Enjoy  Big Grin

Print this item

  Odd behavior with grid controls created at runtime
Posted by: PaulWeem - 07-10-2023, 12:06 PM - Forum: IntraWeb General Discussion - Replies (4)

Hi Alexandre,

I have an odd behavior with grid controls created at runtime.

In the attached example, I have two grids.
Grid1 is filled in the OnCreate of the Form, Grid2 is filled when the corresponding button is clicked.

When changing the controls in Grid1, clicking the Check Button shows the actual state(s) / value(s) of the Grid1 controls in Memo1.
But after changing and checking the controls in Grid2, Memo2 still shows the original state(s) / value(s) of the controls Grid2.

My questions:
1. Is this by design (I hope not)?
2. Am I doing something wrong?
3. Is this a bug and can it be fixed?

This not only applies to an IWGrid but also to an IWDBGrid.

I’m using Delphi 11.3 with IntraWeb 15.3.10.

Hope you can help me!

Cheers, Paul



Attached Files
.zip   GridControls.zip (Size: 92.28 KB / Downloads: 2)
Print this item

  IntraWeb 15.3.10 is out!
Posted by: Alexandre Machado - 07-10-2023, 09:31 AM - Forum: IntraWeb General Discussion - No Replies

There is a new update available:

https://www.atozed.com/2023/07/intraweb-15-3-10/

Also don't forget to check the new demo that we have just released: 

https://www.atozed.com/forums/thread-3363.html

Enjoy  Big Grin

Print this item

  New demo has been published
Posted by: Alexandre Machado - 07-10-2023, 09:30 AM - Forum: IntraWeb General Discussion - Replies (6)

A new demo has been published showing some new features introduced on version 15.3.10 that we have just released:

https://github.com/Atozed/IntraWeb/tree/...i/IWLocker

This has been a (very) frequent request from users that allow more control over the "page locking mechanism" (aka loading animation) in IntraWeb applications. 

Some users go a long way in order to have a customized version on their application. We believe that the new feature will eliminate the need for complicated 3rd party libraries and workarounds (yes, I'm talking to you, "HoldOn" user  Tongue ).

Enjoy  Big Grin

Print this item

  Problem to create a modal form - SOLVED
Posted by: StephB - 07-05-2023, 02:23 PM - Forum: IntraWeb General Discussion - Replies (15)

Dear all,
I tries to add a modal form to my intraweb app and I don't understand what is my mistake.
The structure of my app is :
- a home page to display my records
- a card template to design my records. Each card has a button to call the modal I need
- optional, an additionnal form to manage the modal. I would like to use an external form to avoid having an instance of the modal in each card I have to create.

For my modal, I tried to use a region inside my card or the optionnal additionnal modal form, and in each case the modal is created but it's empty.
[Image: empty_modal_za86nw.png]

I tried to set the ContentElement programmatically or using the Object Inspector, same result.
In the Object Inspector, I can select a component from my external form.
[Image: content_modal_ylnq58.png]
But I can use the same syntax when I want to assigned it at runtime, I have to create an object first. Is it the correct way to do that ?

This is the expected result :
[Image: expected_modal_ptgijh.png]

I attached a test case, hope somebody can have a look on it and help me to understand how i have to design this.

Regards,
Stéphane



Attached Files
.zip   modal.zip (Size: 29.29 KB / Downloads: 16)
Print this item

Bug Visibilty of components doesn't seem to work properly with async component creation
Posted by: CantuStange - 07-05-2023, 01:22 PM - Forum: IntraWeb General Discussion - Replies (2)

Hello,
I've encountered a problem with the visibility of components when creating and destroying other components in async events.
It seems like IntraWeb is generating duplicate style tags for components that changed styles but remained in the page and that breaks their visibility.

I attached a Delphi project that simulates the problem:

  1. Press "Create components".
  2. Press "Destroy components".
  3. The IWtest region (below the red label) is no longer visible even though it should be.
The "List IW Styles" button should list the duplicate styles mentioned above.
If the page is reloaded the region appears as expected.

Am I doing something incorrect in the code or is this a bug?
If it is a bug, is there a workaround or fix in future versions of IntraWeb (I'm using IntraWeb 15.2.69)?



Attached Files
.zip   AsyncComponentsTest.zip (Size: 55.21 KB / Downloads: 4)
Print this item