Robert Shera
|
| Posted: 09/13/2007, 6:04 PM |
|
I would like to be able to open a popup window with the details of a
record by clicking on a field (displayed as a link) in a grid displaying
all the records for the table. (Users have asked for this in preference
to just opening in a new window/tab.)
I have used the techniques from the example pack "popup list" elsewhere,
but I can't work out to do it from a grid.
My basic problem is how to get the value of the linked field to pass as
the paremeter for the URL in the Window.Open java script. (If java
script is the way to do it.)
Environment is php / mysql.
Any suggestions would be appreciated.
Rob
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 09/13/2007, 11:44 PM |
|
Hi,
I think that with JavaScript something like this should work:
<script language="JavaScript">
function OpenPopUp(linkhref)
{
var FieldValue;
var win=window.open(linkhref, "SomeWindow", "left=150,top=100,width=640,height=510,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
win.focus();
}
</script>
...
<a href=... onclick="OpenPopUp(this.href);return false;">
Or without JavaScript you can specify the name of a new window in the "target" property of the link, for example by adding it manually in the HTML or in the "Format" tab of the properties window/panel. You can just enter any name, say "SomeWindow" as the target.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Robert Shera
|
| Posted: 09/14/2007, 12:34 AM |
|
Hi Peter
Thanks for that, but the problem is more getting the linkhref bit
correct (sorry, didn't explain it well originally). From a grid, I need
to be able to do something like
var win=window.open("whatever.php?s_keyvalue=codexxx", "SomeWindow",
..etc)
My issue is how to get the parameter value for 'codexxx'. I've tried
s_keyvalue={control name from grid} but this seems to return the value
from the last entry being displayed (eg entry 25 if there are 25 per
page, entry 10 if there are 10 per page etc).
Rob
peterr wrote:
> Hi,
>
> I think that with JavaScript something like this should work:
>
> <script language="JavaScript">
> function OpenPopUp(linkhref)
> {
> var FieldValue;
> var win=window.open(linkhref, "SomeWindow",
> "left=150,top=100,width=640,height=510,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes");
> win.focus();
> }
> </script>
>
> ..
>
> <a href=... onclick="OpenPopUp(this.href);return false;">
>
>
> Or without JavaScript you can specify the name of a new window in the "target"
> property of the link, for example by adding it manually in the HTML or in the
> "Format" tab of the properties window/panel. You can just enter any name, say
> "SomeWindow" as the target.
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 09/14/2007, 1:01 AM |
|
Rob,
Both above solutions should work OK if the link itself is configured correctly and works without JavaScript or popups. Therefore I have to assume that your link is not working properly even with standard pages (not popups).
In such case you would need to open the "Href Source" property of your link in CCS and on the "Parameters" tab configure the parameter that you want to pass to the next page. For example:
Source Type = DataSource Column
Parameter Source = (database field name)
Parameter Name = (parameter name that you want to pass to next page)
After testing your page without popups and confirming that it work OK, then you can apply any of the above 2 solutions.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Robert Shera
|
| Posted: 09/14/2007, 4:55 AM |
|
Peter
Thanks, you are quite right. I think I had done something funny to my
form while trying to get things to work. Tested your solutions on
another form and they worked perfectly.
I was going round in circles looking for a complicated solution when
there was a perfectly simple one.
Ah well, filled in a few hours I suppose :)
Thanks again.
Rob
peterr wrote:
> Rob,
>
> Both above solutions should work OK if the link itself is configured correctly
> and works without JavaScript or popups. Therefore I have to assume that your
> links not working properly even with standard pages (not popups).
> In such case you would need to open the "Href Source" property of your link in
> CCS and on the "Parameters" tab configure the parameter that you want to pass to
> the next page. For example:
> Source Type = DataSource Column
> Parameter Source = (database field name)
> Parameter Name = (parameter name that you want to pass to next page)
>
> After testing your page without popups and confirming that it work OK, then you
> can apply any of the above 2 solutions.
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.yessoftware.com/
>
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 09/14/2007, 10:58 AM |
|
Happens to me all the time 
Just glad you got it to work now.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|