Discussion:
Using IW to display list of links
(too old to reply)
Jerry Keys
2008-02-14 05:24:40 UTC
Permalink
I have a database of web site addresses (URLs). I have built a functioning
IntraWeb app in Delphi 2007 that successfully queries the database and gets
the URLs that match my selection criteria. My program is slightly similar in
concept to a Google search result. What I have not figured out how to do is
this...

I want to display the URLs of the result set so that the user can click on
any of the URLs and go to the web site.

I could use the IWURL object, but my result set of URLs will vary in
number -- sometimes it will be a few, sometimes a lot. My understanding of
the IWURL is that I would need to populate the web page with a bunch of them
and then assign actual URL addresses to individual IWURL objects. This
cannot be the best or only way to do this.

Also, if there many URLs it would be nice to programmatically show a set
number of them the page and show a "next" link to the next page.
Alternatively, it would be great if a IWMemo could be populated with
clickable URLs, or a IWGrid since those can have vertical scroll bars. But
they do not seem to have a property for populating them with clickable URL
values.

Thanks for you help.

Jerry
Zoren Lendry
2008-02-14 06:38:07 UTC
Permalink
Post by Jerry Keys
I have a database of web site addresses (URLs). I have built a functioning
IntraWeb app in Delphi 2007 that successfully queries the database and gets
the URLs that match my selection criteria. My program is slightly similar in
concept to a Google search result. I have not figured out how to do is this...
I want to display the URLs of the result set so that the user can click on
any of the URLs and go to the web site.
I could use the IWURL object, but my result set of URLs will vary in
number -- sometimes it will be a few, sometimes a lot. My understanding of
the IWURL is that I would need to populate the web page with a bunch of them
and then assign actual URL addresses to individual IWURL objects. This
cannot be the best or only way to do this.
Also, if there many URLs it would be nice to programmatically show a set
number of them the page and show a "next" link to the next page.
Alternatively, it would be great if a IWMemo could be populated with
clickable URLs, or a IWGrid since those can have vertical scroll bars. But
they do not seem to have a property for populating them with clickable URL
values.
This is very easy, and you have lots of options. Let me outline the
first few that come to mind, in no particular order:

1) it is as easy to create components at run-time in IntraWeb as it is
in regular Delphi. Figure out your starting top position on the page,
store it, and then loop for as many as you wish to show, setting the
Parent and Owner properly, incrementing the y-axis variable. Of course
you will have to do your own paging. I actually prefer Arcana's
TArcIWEnhURL.

2) Since your data is already in the database, simply show it in a grid,
hiding the grid lines. Have one of the columns be the URL. Using TMS's
data-aware grid for IW, you can set that column to be a link. The paging
is handled for you.

3) I don't work much with the non-data-aware grids, but I'm sure one of
them would work just fine, maybe even handle the paging for you.

Hope this helps,

Loren sZendre
Jerry Keys
2008-02-14 16:35:24 UTC
Permalink
Thanks Zoren. I will experiment with your suggestions.

By the way, I looked at the Arcana web site and used their search function
to look for the TArcIWEnhURL component but the search result was empty. Just
to be certain their search function is working, I used their search function
to search for TArcIWScreenInfo (one of the components they display on their
open source pack page) and it did find a reference for that.

Thanks again!

Jerry
Post by Jerry Keys
I have a database of web site addresses (URLs). I have built a
functioning IntraWeb app in Delphi 2007 that successfully queries the
database and gets the URLs that match my selection criteria. My program
is slightly similar in concept to a Google search result. I have not
figured out how to do is this...
I want to display the URLs of the result set so that the user can click
on any of the URLs and go to the web site.
I could use the IWURL object, but my result set of URLs will vary in
number -- sometimes it will be a few, sometimes a lot. My understanding
of the IWURL is that I would need to populate the web page with a bunch
of them and then assign actual URL addresses to individual IWURL objects.
This cannot be the best or only way to do this.
Also, if there many URLs it would be nice to programmatically show a set
number of them the page and show a "next" link to the next page.
Alternatively, it would be great if a IWMemo could be populated with
clickable URLs, or a IWGrid since those can have vertical scroll bars.
But they do not seem to have a property for populating them with
clickable URL values.
This is very easy, and you have lots of options. Let me outline the first
1) it is as easy to create components at run-time in IntraWeb as it is in
regular Delphi. Figure out your starting top position on the page, store
it, and then loop for as many as you wish to show, setting the Parent and
Owner properly, incrementing the y-axis variable. Of course you will have
to do your own paging. I actually prefer Arcana's TArcIWEnhURL.
2) Since your data is already in the database, simply show it in a grid,
hiding the grid lines. Have one of the columns be the URL. Using TMS's
data-aware grid for IW, you can set that column to be a link. The paging
is handled for you.
3) I don't work much with the non-data-aware grids, but I'm sure one of
them would work just fine, maybe even handle the paging for you.
Hope this helps,
Loren sZendre
Zoren Lendry
2008-02-14 18:23:30 UTC
Permalink
Post by Jerry Keys
By the way, I looked at the Arcana web site and used their search function
to look for the TArcIWEnhURL component but the search result was empty. Just
to be certain their search function is working, I used their search function
to search for TArcIWScreenInfo (one of the components they display on their
open source pack page) and it did find a reference for that.
The TArcIWEnhURL is part of the EliteSuite component pack. It installs
so nicely! (you used to have to install lots of packages) And the price
is very reasonable. I find that for serious IW work, I cannot live
without Arcana and TMS's IW components.

Loren sZendre
Jerry Keys
2008-02-15 15:58:52 UTC
Permalink
Zoren ,

Thanks again for your suggestions. I played with you first suggestion
(creating instances of TIWURL at runtime), and that does work. When running
the app in a browser and clicking on one of the displayed links (from a
IWURL component) it takes my browser to the specified web site. That is
great.

However, when I click the browser's back button it does not go back to the
IW app, it just reloads the web page of the destination web site. This
appears to be happening because the actual page before the destination web
site looks like it is an intermediate "page" (or action) created by the IW
app that actually does the sending of the browser to the destination web
site. I can get back to the IW app, but in order to do so I need to click on
the back button's history and select the page of the IW app previous to this
"intermediate page".

Is there anything that can be done to circumvent this behavior so that users
of my app will be able to go back to the IW app after going to one of the
destination web sites?

Thanks for all you input with this.

Jerry
Post by Jerry Keys
I have a database of web site addresses (URLs). I have built a
functioning IntraWeb app in Delphi 2007 that successfully queries the
database and gets the URLs that match my selection criteria. My program
is slightly similar in concept to a Google search result. I have not
figured out how to do is this...
I want to display the URLs of the result set so that the user can click
on any of the URLs and go to the web site.
I could use the IWURL object, but my result set of URLs will vary in
number -- sometimes it will be a few, sometimes a lot. My understanding
of the IWURL is that I would need to populate the web page with a bunch
of them and then assign actual URL addresses to individual IWURL objects.
This cannot be the best or only way to do this.
Also, if there many URLs it would be nice to programmatically show a set
number of them the page and show a "next" link to the next page.
Alternatively, it would be great if a IWMemo could be populated with
clickable URLs, or a IWGrid since those can have vertical scroll bars.
But they do not seem to have a property for populating them with
clickable URL values.
This is very easy, and you have lots of options. Let me outline the first
1) it is as easy to create components at run-time in IntraWeb as it is in
regular Delphi. Figure out your starting top position on the page, store
it, and then loop for as many as you wish to show, setting the Parent and
Owner properly, incrementing the y-axis variable. Of course you will have
to do your own paging. I actually prefer Arcana's TArcIWEnhURL.
2) Since your data is already in the database, simply show it in a grid,
hiding the grid lines. Have one of the columns be the URL. Using TMS's
data-aware grid for IW, you can set that column to be a link. The paging
is handled for you.
3) I don't work much with the non-data-aware grids, but I'm sure one of
them would work just fine, maybe even handle the paging for you.
Hope this helps,
Loren sZendre
Zoren Lendry
2008-02-15 17:46:12 UTC
Permalink
Post by Jerry Keys
However, when I click the browser's back button it does not go back to the
IW app, it just reloads the web page of the destination web site. This
appears to be happening because the actual page before the destination web
site looks like it is an intermediate "page" (or action) created by the IW
app that actually does the sending of the browser to the destination web
site. I can get back to the IW app, but in order to do so I need to click on
the back button's history and select the page of the IW app previous to this
"intermediate page".
Is there anything that can be done to circumvent this behavior so that users
of my app will be able to go back to the IW app after going to one of the
destination web sites?
Yeah, you have to use the "UseTarget" property (set it to True). Then
fill out the TargetOptions to your heart's content.

Loren sZendre
Jerry Keys
2008-02-15 16:49:25 UTC
Permalink
Zoren, thanks for the information. I am new to IntraWeb (obviously) -- and I
am evaluating it to decide if I want to purchase the commercial version
(currently using bundled version with Delphi 2007). The support with the
paid version would be helpful. But until then I really appreciate your help
and that of others on this newsgroup.

Jerry
... Yeah, you have to use the "UseTarget" property (set it to True). Then
fill out the TargetOptions to your heart's content.
Loren sZendre
Zoren Lendry
2008-02-15 18:03:29 UTC
Permalink
Post by Jerry Keys
Zoren, thanks for the information. I am new to IntraWeb (obviously) -- and I
am evaluating it to decide if I want to purchase the commercial version
(currently using bundled version with Delphi 2007). The support with the
paid version would be helpful. But until then I really appreciate your help
and that of others on this newsgroup.
You're welcome. In spite of how amazing the IW technology is, we might
still have chosen not to use it for some newer projects if Atozed wasn't
so actively developing the product. I have posted certain bugs, as well
as some requests to extend their Ajax support to areas where it did not
yet apply, and they have been very aggressive at implementing my ideas.
I am very comfortable with their trend of enhancing the product, and so
we are using it for almost all our web work.

And as a bonus, Arcana and TMS have been aggressively enhancing their
components for IW. It's like Christmas day every two weeks or so, it
seems. :)

Loren
Rita
2008-02-17 18:30:44 UTC
Permalink
Post by Zoren Lendry
2) Since your data is already in the database, simply show it in a grid,
hiding the grid lines. Have one of the columns be the URL. Using TMS's
data-aware grid for IW, you can set that column to be a link. The paging
is handled for you.
Zoren nice tip mate but how do u switch the grid lines off I have been up
and down they must be there somewhere ?

Rita

adam brett
2008-02-15 01:17:49 UTC
Permalink
If you set an IWLabel's "PlainText" property to true you can even write a
simple

For i := 0 to Dataset.RecordCount-1 do
begin
Label.Text := Label.Text + '<a
href="'+Dataset.FieldByName('URL').asString+'">'+Dataset.FieldByName('URL').asString
+'</a><br>;
Dataset.Next;
end;


This just creates standard HTML on the resulting page. If you add CSS tags
you can then style this as you see fit.

Adam Brett
Jerry Keys
2008-02-15 16:02:44 UTC
Permalink
Adam, thanks for your suggestion. I will try this out as soon as possible.
What you suggest sounds exactly like what I would like to do. I did not know
setting an IWLable's "Plain Text" property to true would result in allowing
me to "insert" HTML onto the app (there is so much for me to learn about
IntraWeb!). I am hoping this will be the solution to the problem I mentioned
in my "thank you" to Zoren that I wrote just a few minutes before this post.

Thanks again!

Jerry
Post by adam brett
If you set an IWLabel's "PlainText" property to true you can even write a
simple
For i := 0 to Dataset.RecordCount-1 do
begin
Label.Text := Label.Text + '<a
href="'+Dataset.FieldByName('URL').asString+'">'+Dataset.FieldByName('URL').asString
+'</a><br>;
Dataset.Next;
end;
This just creates standard HTML on the resulting page. If you add CSS tags
you can then style this as you see fit.
Adam Brett
Loading...