NetTalk Central

Author Topic: Create a button which does an action without changing the URL  (Read 5394 times)

monceau

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Create a button which does an action without changing the URL
« on: November 05, 2007, 08:48:31 PM »
Hi,

I'm programming my first website using WebServer technology.
I wanted to know how could i create a button, "subscribe" for instance, which launch a procedure on the server to add the current user to the subscriber table and just refresh the page , without redirectionning the URL to a new page.
I didn't find yet a way to use a procedure which is not associated to another webpage.

I hope that I've been clear enough.   :-\
Thank you in advance for the time you'll spend reading my post.

Philippe.
 

Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Create a button which does an action without changing the URL
« Reply #1 on: November 06, 2007, 02:56:09 PM »
Phillipe, I'm having some problems figuring out _where_ to put the button code so it shows up near the other buttons, but I wonder if your answers might be in this wki article I just ran across: http://www.nettalkcentral.com/index.php?option=com_openwiki&Itemid=40&id=calling_nettalk_forms_from_a_button

MikeG
Mike Grigsby
Credify Systems
Central Oregon, USA

monceau

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Create a button which does an action without changing the URL
« Reply #2 on: November 06, 2007, 10:43:05 PM »
Thank you very much Mike.

Thanks to the wiki article I see more clearly where I have to tend toward.
but stil...l the aim  is to launch a netwebsource procedure directly on the onclick= of the button tag.
for instance this solution

 onclick=”window.open(’BrowseCustomers’,’_blank’)”

opens a window

and in this one:

p_web.CreateButton('submit','Subscribe','','SmallButton',loc:formname,p_web._MakeURL(clip(loc:formaction)&'?'&p_web._noColon('RPTIR:InstanceID')&'='& clip(loc:field) & '&PressedButton='&clip('Subscribe'))

the MakeURL function redirects our page to a new page (the netwebsource which contains the procedure to execute).

But I think that a javascript funtion which redirects immediatly my page to the previous page with a "window.location="frame_src.htm"" on the onload() might work.
I'll let you know.

thank very much again and good luck with your buttons

Philippe.


monceau

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Create a button which does an action without changing the URL
« Reply #3 on: December 02, 2007, 04:53:09 PM »
I did it, but with a "submit"
I'm gone enumerate all the details of the creation of my procedure even if there some are useless.
-the procedure called by the button has to be a NetWebPage

-in the html tab :
     a routine called 'body' located "inside the page"
<body onload="load()">
</body>
     another routine called 'head' located "inside head"
<script type="text/javascript">
function load()
{
window.location="../ReportMaintenance"
}
</script>

 -in Advanced tab : tick "No <body> tag"

 And the clarion code to execute in the "Processed code" embedded point

It works for me, when I click the button the navigator goes to the page with the clarioncode, execute the code and come back to the main page immediatly with the main page refreshed.

I hope it's gonna help. good luck.


Mike Grigsby

  • Sr. Member
  • ****
  • Posts: 380
    • Yahoo Instant Messenger - onthedotsoftware
    • View Profile
    • MyHomeAssets! Software (among others)
Re: Create a button which does an action without changing the URL
« Reply #4 on: December 13, 2007, 07:21:24 PM »
Philippe, this was very helpful. I was having a problem where the dynamic page header was showing on the page though. So I moved the "head" to After <body> and it seems to have solved the problem. Thanks! MikeG
Mike Grigsby
Credify Systems
Central Oregon, USA