NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: kashiash on May 24, 2010, 09:02:12 AM

Title: how to get parent page name in form page ?
Post by: kashiash on May 24, 2010, 09:02:12 AM
i need to know parent name in form page
i try check vaulues on init form routine:
   p_web.GetSessionValue('_ParentProc')
   p_web.formsettings.parentpage
   p_web.GetValue('_ParentProc')

and every of above retur empty string  - why ?
Title: Re: how to get parent page name in form page ?
Post by: kevin plummer on May 24, 2010, 03:55:28 PM
Try

p_web.GetValue('_ParentProc') early on in your code like pre-update, insert or start of procedure etc and if you get a value prime a session variable with the value
Title: Re: how to get parent page name in form page ?
Post by: Bruce on May 24, 2010, 09:54:27 PM
The parent of a page is usually set for you and stored in loc:parent
so You can just use loc:parent in your code in _most_ embed points.

cheers
Bruce
Title: Re: how to get parent page name in form page ?
Post by: kashiash on May 24, 2010, 10:08:26 PM
Bruce
as i see in source loc:parent is declared for browse procedure
for form this variable is not declared

To Kevin:
i copy code into pre insert and pre update embeds, but also get empty string ;(
Title: Re: how to get parent page name in form page ?
Post by: kevin plummer on May 24, 2010, 11:35:11 PM
The other option is just create your own Session Variable. I have one called 'ReturnURL' which I use for all sorts of things.
Title: Re: how to get parent page name in form page ?
Post by: kashiash on May 24, 2010, 11:41:17 PM
Yes its a option but ...
 system know where should return after ok or cancel .. somewhere this information is stored and i want to get this value and use it. the extra variables and extra code make program more complicated nad less flexible
Title: Re: how to get parent page name in form page ?
Post by: Bruce on May 25, 2010, 12:56:21 AM
Hi Jacek,

So, if I understand you right, what you really want to know is the URL that the Save / Cancel button will go to?
When (in what embeds) are you needing to use this item?
the URL for the save button is in loc:formaction, the URL for the cancel button is in loc:formactioncancel.


The "parent page" is typically used for a control embedded on a page - so it's not "where it came from" but rather the name of the container it's currently on.

Cheers
Bruce

Title: Re: how to get parent page name in form page ?
Post by: kashiash on May 25, 2010, 01:22:38 AM
Unfortunatelly  you not understand me (its my bad english ;()
i open the same form from few other browses or forms
and in almost all cases i want to back to caller but in two cases i want to go to other then parent page.
here i can 2 ways:
1. in each procedure i set returnurl as sugested Kevin , but i have to modify each parent procedure
2 in called page i check who me call and if its specific parent then i change return page to new page (instead parent) - but here i need to know who is my parent

the second solution looks better for me but i cannot determine parent
here is my problem
any ideas?
Title: Re: how to get parent page name in form page ?
Post by: Poul on May 26, 2010, 09:57:52 AM
if i understand

Code: [Select]
  IF p_web.getPageName(p_web.RequestReferer)   = 'someform'   
     ! do magic stuff when you come this webpage

  END     
 

place near the the end of init.
Title: Re: how to get parent page name in form page ?
Post by: kashiash on May 26, 2010, 01:14:58 PM
BINGO ;)
thanks a lot