CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Puzzle : mailto link.

Print topic Send  topic

Author Message
kmc
Posted: 05/06/2001, 9:01 PM

Suppose two tables, Main and Users.

In the Main table is a foreign key to Users table, having

USERS table
Fields are :
ID
User Name
User email

I want to show in Main Table's Gridform the User Name from the Users table,
with the User Name when clicked acting as a mailto:

I know I could bring both user fields to the main grid
- but client (sensibly) wants the name to act as the mailto initiator
- there is no space for separate email in the grid she wants to present.

Can anyone pass me a clue if I can achieve this within CC v1.1.16,
without going to edit templates?

TIA
kmc

CodeCharge
Posted: 05/07/2001, 9:33 PM

You may try including the Email field as a hidden field on the form, but use
it in your "Before Show" Event, like:

fldname="<a href=mailto:" & fldemail & ">" & fldname & "</a>"


"kmc" <kmcook@tasmail.com> wrote in message
news:9d56lu$c5s$1@mail.tankhill.com...
> Suppose two tables, Main and Users.
>
> In the Main table is a foreign key to Users table, having
>
> USERS table
> Fields are :
> ID
> User Name
> User email
>
> I want to show in Main Table's Gridform the User Name from the Users
table,
> with the User Name when clicked acting as a mailto:
>
> I know I could bring both user fields to the main grid
> - but client (sensibly) wants the name to act as the mailto initiator
> - there is no space for separate email in the grid she wants to present.
>
> Can anyone pass me a clue if I can achieve this within CC v1.1.16,
> without going to edit templates?
>
> TIA
> kmc
>
>

kmc
Posted: 05/07/2001, 11:55 PM

Thanks, but the Main table does not have the email field, the Users table
has that. I am working from the Main table, not the Users table.

I have already 'joined' the tables to display the User Name in the MainTable
GridForm - so that a real name appears in the grid, as required by client.

Now I want to make that 'real name' respond with a mailto: when clicked.

If I add the users key-field a second time to the Main grid, then mark it
hidden, as you suggest, CC does not permit a join to the User table to pick
up the
email address there.

Looks like another one for the "wish it could' list.

kmc










CodeCharge
Posted: 05/08/2001, 12:41 AM

Yes, I understood your orginal request. I was just pointing that you can try
adding the lookup label field but making it hidden.
Well, this didn't work, but keep an open mind :-)

Here are couple additional solutions:
1. Keep in mind that you can put almost any code that you would manually
write, into the Event section.
Modify the example in previous message to obtain the email address
programmatically.
For example in ASP:
uemail = DLookUp("users", "user_email", "user_id=" & flduser_id)
fldproject_id="<a href=mailto:" & uemail & ">" & flduser_id & "</a>"
To prove the point, I actually modified the Bug tracking example, by
changing the "priority_id" field to Hidden on the Default page grid, and
added such "Before Show" event:
test = DLookUp("priorities", "priority_desc", "priority_id=" &
fldpriority_id)
fldproject_id="<a href=mailto:" & test & ">" & fldproject_id & "</a>"
Now the Bug Tracking example doesn't show the Priority column, but it shows
the Project column with links to mailto:(priority desc)

2. Second solution is to use SQL query to read all the data you need.
Instead of using the Table as the basis of your grid, use an SQL query that
obtains all fields that you need, than try adding a hidden field to your
form, which in such case could contain the email. Then add the "Before Show"
Event as mentioned in previous message.
fldname="<a href=mailto:" & fldemail & ">" & fldname & "</a>"
You may specify the SQL query in the Form Properties / SQL tab. This will be
used instead of the table.

Adam S.
CodeCharge Support


"kmc" <kmcook@tasmail.com> wrote in message
news:9d859r$72m$1@mail.tankhill.com...
> Thanks, but the Main table does not have the email field, the Users table
> has that. I am working from the Main table, not the Users table.
>
> I have already 'joined' the tables to display the User Name in the
MainTable
> GridForm - so that a real name appears in the grid, as required by client.
>
> Now I want to make that 'real name' respond with a mailto: when clicked.
>
> If I add the users key-field a second time to the Main grid, then mark it
> hidden, as you suggest, CC does not permit a join to the User table to
pick
> up the
> email address there.
>
> Looks like another one for the "wish it could' list.
>
> kmc
>
>
>
>
>
>
>
>
>
>
>

kmc
Posted: 05/08/2001, 5:52 PM

Thanks Adam.

If someone else works the Bug Track example to get an understanding, add one
more step...
Mark the Field properties for project_id as HTML.

kmc



   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.