CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 GetLink() -> SetLink() Problem

Print topic Send  topic

Author Message
Elmar

Posts: 17
Posted: 10/23/2005, 11:31 AM

Hi There!

I have a strange situation using a grid.
In every row there is one column with a link to a detail page.
The link target page is defined in the link label properties.

In the 'beforeShowRow' Event (tp_preset_einheit_BeforeShowRow) I do a Database lookup to get an additional parameter that Iīd like to pass with the link.

This code only works with every other row. In the first row it prints just fine, in second row there is no link at all. I first wondered if I might have to initialize a parameter or so (see debug echo output).

What am I doing wrong here? I just donīt get it.

Code:
$pageLink = $tp_preset_einheit->bezeichnung->GetLink()."?tp_preset_einheit_id=".$einheit;
$tp_preset_einheit->bezeichnung->SetLink( $pageLink );

echo "********************************<br>";
echo "* $pageLink <br>";
echo "********************************<br>";


Echo output:
********************************
* tp_preset_einheit_maint.php?tp_preset_einheit_id=1*
********************************
********************************
* tp_preset_einheit_maint.php?tp_preset_einheit_id=1?tp_preset_einheit_id=2*
********************************
********************************
* tp_preset_einheit_maint.php?tp_preset_einheit_id=8*
********************************
********************************
* tp_preset_einheit_maint.php?tp_preset_einheit_id=8?tp_preset_einheit_id=9*
********************************
********************************
* tp_preset_einheit_maint.php?tp_preset_einheit_id=10*
********************************
********************************
* tp_preset_einheit_maint.php?tp_preset_einheit_id=10?tp_preset_einheit_id=11*

Seems like it sometimes resets the link and sometimes not?! How do I get It right? I would simply like to add a parameter to the link.

Best regards,
Elmar
View profile  Send private message
Walter Kempees
Posted: 10/23/2005, 2:31 PM

Check your grid builder options, you are using "Alternate rows"
I'm pretty sure you do and then every grid element is doubly named.
for instance id and alt_id
So in your BeforeShowRow you are only doing half the job.

Go to HTML mode you will see the {label} {alt_label} in the respective
rows.
Go to source mode and you'll see

Hope you understand me and it helps

Greetz,
Walter
Elmar

Posts: 17
Posted: 10/24/2005, 3:26 AM

Hi Walter,

first of all - thanks for your suggestions. Unfortunantly I am not using alternate rows. In HTML there ist only one row entry:

<!-- BEGIN Row -->
<tr class="Row">
<td><a href="{bezeichnung_Src}">{bezeichnung}</a> </td>
<td style="TEXT-ALIGN: right">{t_art_id} </td>
<td style="TEXT-ALIGN: right">{t_stufe_id} </td>
<td>{titel_lang_1} </td>
<td>{titel_lang_2} </td>
<td>{titel_lang_3} </td>
<td>{titel_lang_4} </td>
</tr>
<!-- END Row -->

Any other suggestions? Anyone?

Thanks,
Elmar
View profile  Send private message
Walter Kempees
Posted: 10/24/2005, 4:08 AM

Hallo Elmar
Es tut mir leid.
Sorry it didnot help, I now realize I did not look at the end of your
message.
I stopped reading where your wrote "What am I doing wrong here? I just donīt
get it."

Walter
Walter Kempees
Posted: 10/24/2005, 4:30 AM

I am looking at this for some time now but I need more code.
It doesn't seem complete.
Please specify more detail:
Page name
Page details
The complete BeforeShowRow
The Table definition or at least the fields og the DBRow.
It looks like $tp_preset_einheit->bezeichnung is not reset to it's database
value but to the last SetLink value
From the BeforeShowRow we can see how you are using the global and the
DBlookup.




"Walter Kempees" <kempe819@planet.nl> schreef in bericht
news:djifbe$lg6$1@news.codecharge.com...
> Hallo Elmar
> Es tut mir leid.
> Sorry it didnot help, I now realize I did not look at the end of your
> message.
> I stopped reading where your wrote "What am I doing wrong here? I just
> donīt get it."
>
> Walter
>
>
>
>
> "Elmar" <Elmar@forum.codecharge> schreef in bericht
>news:5435cb6f2d4177@news.codecharge.com...
>> Hi Walter,
>>
>> first of all - thanks for your suggestions. Unfortunantly I am not using
>> alternate rows. In HTML there ist only one row entry:
>>
>> <!-- BEGIN Row -->
>> <tr class="Row">
>> <td><a href="{bezeichnung_Src}">{bezeichnung}</a> </td>
>> <td style="TEXT-ALIGN: right">{t_art_id} </td>
>> <td style="TEXT-ALIGN: right">{t_stufe_id} </td>
>> <td>{titel_lang_1} </td>
>> <td>{titel_lang_2} </td>
>> <td>{titel_lang_3} </td>
>> <td>{titel_lang_4} </td>
>> </tr>
>> <!-- END Row -->
>>
>> Any other suggestions? Anyone?
>>
>> Thanks,
>> Elmar
>> ---------------------------------------
>> Sent from YesSoftware forum
>> http://forums.codecharge.com/
>>
>
>

_Elmar
Posted: 10/24/2005, 4:52 AM

Dear Walter,
I really donīt want to cause to much work for you.
I probably just donīt have enough knowledge about the CC-Internals.

Anyway, here are the complete sources for this problem:

*************** HTML Page (tp_preset_einheit_list) ****************

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>{res:tp_preset_einheit}</title>
<link href="Styles/SandBeach/Style.css" type="text/css" rel="stylesheet">
</head>
<body>
<!-- BEGIN Grid tp_preset_einheit -->
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td valign="top">
<table class="Header" cellspacing="0" cellpadding="0" border="0">
<tr>
<td class="HeaderLeft"><img src="Styles/SandBeach/Images/Spacer.gif" border="0"></td>
<th>{res:CCS_GridFormPrefix} {res:tp_preset_einheit}
{res:CCS_GridFormSuffix} </th>

<td class="HeaderRight"><img src="Styles/SandBeach/Images/Spacer.gif" border="0"></td>
</tr>
</table>

<table class="Grid" cellspacing="0" cellpadding="0">
<tr class="Caption">
<th>
<!-- BEGIN Sorter Sorter_bezeichnung --><a href="{Sort_URL}">{res:bezeichnung}</a>
<!-- BEGIN Asc_On --><img src="Styles/SandBeach/Images/Asc.gif" border="0"><!-- END Asc_On -->
<!-- BEGIN Desc_On --><img src="Styles/SandBeach/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_bezeichnung --></th>

<th>
<!-- BEGIN Sorter Sorter_t_art_id --><a href="{Sort_URL}">{res:t_art_id}</a>
<!-- BEGIN Asc_On --><img src="Styles/SandBeach/Images/Asc.gif" border="0"><!-- END Asc_On -->
<!-- BEGIN Desc_On --><img src="Styles/SandBeach/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_t_art_id --></th>

<th>
<!-- BEGIN Sorter Sorter_t_stufe_id --><a href="{Sort_URL}">{res:t_stufe_id}</a>
<!-- BEGIN Asc_On --><img src="Styles/SandBeach/Images/Asc.gif" border="0"><!-- END Asc_On -->
<!-- BEGIN Desc_On --><img src="Styles/SandBeach/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_t_stufe_id --></th>

<th>
<!-- BEGIN Sorter Sorter_titel_lang_1 --><a href="{Sort_URL}">{res:titel_lang_1}</a>
<!-- BEGIN Asc_On --><img src="Styles/SandBeach/Images/Asc.gif" border="0"><!-- END Asc_On -->
<!-- BEGIN Desc_On --><img src="Styles/SandBeach/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_titel_lang_1 --></th>

<th>
<!-- BEGIN Sorter Sorter_titel_lang_2 --><a href="{Sort_URL}">{res:titel_lang_2}</a>
<!-- BEGIN Asc_On --><img src="Styles/SandBeach/Images/Asc.gif" border="0"><!-- END Asc_On -->
<!-- BEGIN Desc_On --><img src="Styles/SandBeach/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_titel_lang_2 --></th>

<th>
<!-- BEGIN Sorter Sorter_titel_lang_3 --><a href="{Sort_URL}">{res:titel_lang_3}</a>
<!-- BEGIN Asc_On --><img src="Styles/SandBeach/Images/Asc.gif" border="0"><!-- END Asc_On -->
<!-- BEGIN Desc_On --><img src="Styles/SandBeach/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_titel_lang_3 --></th>

<th>
<!-- BEGIN Sorter Sorter_titel_lang_4 --><a href="{Sort_URL}">{res:titel_lang_4}</a>
<!-- BEGIN Asc_On --><img src="Styles/SandBeach/Images/Asc.gif" border="0"><!-- END Asc_On -->
<!-- BEGIN Desc_On --><img src="Styles/SandBeach/Images/Desc.gif" border="0"><!-- END Desc_On --><!-- END Sorter Sorter_titel_lang_4 --></th>
</tr>

<!-- BEGIN Row -->
<tr class="Row">
<td><a href="{bezeichnung_Src}">{bezeichnung}</a> </td>
<td style="TEXT-ALIGN: right">{t_art_id} </td>
<td style="TEXT-ALIGN: right">{t_stufe_id} </td>
<td>{titel_lang_1} </td>
<td>{titel_lang_2} </td>
<td>{titel_lang_3} </td>
<td>{titel_lang_4} </td>
</tr>
<!-- END Row -->
<!-- BEGIN NoRecords -->
<tr class="NoRecords">
<td colspan="7">{res:CCS_NoRecords} </td>
</tr>
<!-- END NoRecords -->
<tr class="Footer">
<td colspan="7"><a href="{tp_preset_einheit_Insert_Src}">{res:CCS_InsertLink}</a> 
<!-- BEGIN Navigator Navigator -->
<!-- BEGIN First_On --><a href="{First_URL}">|<</a> <!-- END First_On -->
<!-- BEGIN Prev_On --><a href="{Prev_URL}"><<</a> <!-- END Prev_On --> {Page_Number}
{res:CCS_Of} {Total_Pages} 
<!-- BEGIN Next_On --><a href="{Next_URL}">>></a> <!-- END Next_On -->
<!-- BEGIN Last_On --><a href="{Last_URL}">>|</a> <!-- END Last_On --><!-- END Navigator Navigator --></td>
</tr>
</table>
</td>
</tr>
</table>
<!-- END Grid tp_preset_einheit -->
<p> </p>
<p><br>
 </p>
</body>
</html>

**************** END HTML PAGE *************************




**************** BeforeShowRow *************************

//tp_preset_einheit_BeforeShowRow @13-3117D3DE
function tp_preset_einheit_BeforeShowRow(& $sender)
{
$tp_preset_einheit_BeforeShowRow = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $tp_preset_einheit; //Compatibility
//End tp_preset_einheit_BeforeShowRow

//Custom Code @55-2A29BDB7
// -------------------------
$Conn = New clsDBMySQL();

// Die Trainer-ID soll später aus der User-Session geholt werden
$trainer = $tp_preset_einheit->DataSource->f('trainer_id');
$einheit = $tp_preset_einheit->DataSource->f('tp_preset_einheit_id');

// Sportart: aus der ID wird eine Sportart
$sportart = CCDLookUp("bezeichnung", "t_art", "t_art_id =".$Conn->TOSql( $tp_preset_einheit->t_art_id->GetValue(),ccsInteger ), $Conn);
$tp_preset_einheit->t_art_id->SetValue( $sportart );

// Belastungsstufe: aus der ID wird eine Stufe
$belastungsstufe = CCDLookUp("bezeichnung", "t_stufe", "trainer_id=".$trainer." AND t_stufe_id =".$Conn->TOSql( $tp_preset_einheit->t_stufe_id->GetValue(),ccsInteger ), $Conn);
$tp_preset_einheit->t_stufe_id->SetValue( $belastungsstufe );

$Conn->close();

$pageLink = $tp_preset_einheit->bezeichnung->GetLink()."?tp_preset_einheit_id=".$einheit;
$tp_preset_einheit->bezeichnung->SetLink( $pageLink );

echo "********************************<br>";
echo "* $pageLink*<br>";
echo "********************************<br>";

// -------------------------
//End Custom Code

//Close tp_preset_einheit_BeforeShowRow @13-8BB7E275
return $tp_preset_einheit_BeforeShowRow;
}

**************** END BeforeShowRow *************************


**************** SQL for relevant Table *************************

CREATE TABLE `tp_preset_einheit` (
`tp_preset_einheit_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`trainer_id` BIGINT(20) DEFAULT NULL,
`t_art_id` BIGINT(20) DEFAULT NULL,
`t_stufe_id` BIGINT(20) DEFAULT NULL,
`bezeichnung` VARCHAR(255) DEFAULT NULL,
`titel_lang_1` VARCHAR(255) DEFAULT NULL,
`titel_lang_2` VARCHAR(255) DEFAULT NULL,
`titel_lang_3` VARCHAR(255) DEFAULT NULL,
`titel_lang_4` VARCHAR(255) DEFAULT NULL,
`inhalt_lang_1` TEXT,
`inhalt_lang_2` TEXT,
`inhalt_lang_3` TEXT,
`inhalt_lang_4` TEXT,
PRIMARY KEY (`tp_preset_einheit_id`),
UNIQUE KEY `tp_preset_einheit_id` (`tp_preset_einheit_id`),
UNIQUE KEY `name` (`bezeichnung`),
UNIQUE KEY `titel_lang_1` (`titel_lang_1`),
UNIQUE KEY `titel_lang_2` (`titel_lang_2`),
UNIQUE KEY `titel_lang_3` (`titel_lang_3`),
UNIQUE KEY `titel_lang_4` (`titel_lang_4`))TYPE=MyISAM ;

COMMIT;

INSERT INTO `tp_preset_einheit` (`tp_preset_einheit_id`, `trainer_id`, `t_art_id`, `t_stufe_id`, `bezeichnung`, `titel_lang_1`, `titel_lang_2`, `titel_lang_3`, `titel_lang_4`, `inhalt_lang_1`, `inhalt_lang_2`, `inhalt_lang_3`, `inhalt_lang_4`) VALUES
(1,1,2,2,'test',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(2,1,1,1,'test1',NULL,NULL,NULL,NULL,'test32',NULL,NULL,NULL),
(8,2,1,1,'xxy',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(9,1,2,1,'testxx',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(10,1,2,1,'blaa','asdasd',NULL,NULL,NULL,'sadasd',NULL,NULL,NULL),
(11,1,2,1,'fasel',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);

**************** END SQL for relevant Table *************************
Walter Kempees
Posted: 10/24/2005, 4:26 PM

I have been playing with it but I must say you are in the wrong forum, this
is not CCS 2 PhP you are using Beta 3.
It can be done but I am mixed up now and it's late so maybe tomorrow.
_Elmar
Posted: 10/25/2005, 12:13 PM

Thatīs right, I am using Beta 3 but I supposed it is more of a PHP Handling problem than a beta 3 Problem.

Sorry for that!

Elmar
Walter Kempees
Posted: 10/25/2005, 12:45 PM

O yes, I wasnt backing out, no way.
But checking the source snippets you send my approach would be different and
I got messed up in a sort of revolving thinking process.
O well, Pill's.
I'll have another look but my health is keeping me from spending too much
energy at the moment.
Sorry Later


"_Elmar" <_Elmar@forum.codecharge> schreef in bericht
news:5435e83c607037@news.codecharge.com...
> Thatīs right, I am using Beta 3 but I supposed it is more of a PHP
> Handling
> problem than a beta 3 Problem.
>
> Sorry for that!
>
> Elmar
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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