NetTalk Central

Author Topic: Buttons  (Read 5320 times)

DonnieS

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Buttons
« on: January 14, 2010, 01:37:31 PM »
I want to place buttons that will link to procedures in the app and am
studying example 28.  How do I 'place' the button where I want it to be on
the screen?

--
Donnie S.

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Buttons
« Reply #1 on: January 14, 2010, 06:18:21 PM »
Firstly use FireFox and download FireBug - this way you can inspect all elements on your web page.

Everything is laid out in Tables - using Firebug you can visualize this better (although you can't actually see it)

After that is is a bit of trial and error, adding blank fields, spanning fields, ticking and unticking end last on line and last in cell. It can get a bit tedious but once you understand how it works it does get easier....

As far as I know this is the only way but I could be wrong.

HTH's

Kevin

DonnieS

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Re: Buttons
« Reply #2 on: January 14, 2010, 07:10:56 PM »
Kevin, I use WYSIWG WebBuilder 6 to do my html screens - linking the buttons to procedures is what I am trying to do.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Buttons
« Reply #3 on: January 14, 2010, 08:14:02 PM »
Hi Donnie,

So the buttons are created outside of the nettalk dynamic stuff - right?

In which case just give the button the appropriate URL for the page you want to go to.

But I'm not sure what you mean by "place". If you're using external stuff then placement is usually done using CSS.
If you're adding a button to a form, or browse, then placement depends on the position of the form field, plus a number of other settings.

Perhaps a more concrete example will help us be more specific. Whip up a mock screen shot and post it here so we can see what you have in mind.

cheers
Bruce


DonnieS

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Re: Buttons
« Reply #4 on: January 14, 2010, 08:29:32 PM »
Hi Donnie,

So the buttons are created outside of the nettalk dynamic stuff - right?

In which case just give the button the appropriate URL for the page you want to go to.

But I'm not sure what you mean by "place".


The 'place' is I just want to control where the button goes on the screen - but I think that to do that, I will just create the screen in html, put the buttons where I want them.  What I havent learned yet is how to pass information/entries from events or 'fields' in an html constructed page, to the clarion code below. 

Rob Mikkelsen

  • Full Member
  • ***
  • Posts: 107
    • Yahoo Instant Messenger - flashpott
    • View Profile
    • Email
Re: Buttons
« Reply #5 on: January 16, 2010, 09:25:04 AM »
Donnie,

I am not a NetTalk expert by any means, but this is what I found during my trial and error efforts.

EXECUTING CLARION CODE ON A PAGE

One thing to consider is that the Clarion code gets executed as the page loads; therfore, all decisions must be made before the page is created.  What I have done with some success is to link back to the same page and pass the event in the URL that I am trying to execute.  For instance, if I wanted to run the routine "Say Hello" then I would put the following on my button on the page (assuming that the button is on "indexpage"):

<form action="Indexpage" method="post"><input type="hidden" name="whatnow" value="sayhello" /><input type="submit" class="testbutton" name="Say Hello!" /></form>

Then on indexpage in the appropriate embed location, add the following:

IF CLIP(p_Web.GetValue('whatnow"))='sayhello' THEN
  DO SayHello
END!IF

In procedure routines, add the following code:

SayHello  ROUTINE
  packet=CLIP(Packet) & '<br />Hello there!'
  EXIT

If you need to retain the data longer than the first screen you must save it in the session queue because as soon as the page is delivered the thread ends and the value queue is deleted.  Since forms are a two pass, two thread process, I recommend writing the data to the session queue as soon as you read it.

Please do not take any of the code above as properly working code - I usually get the syntax of the submit button wrong.  It should, however, help you try to get your head wrapped around this web stuff.  The BIGGEST difference between web and app development is that unless you do some javascript programming, you need to know what you are going to do when you get to the page and that any input your program requires needs to be passed to another page for processing, but that page you pass it to could be the same page and interpreted as the page is being built.

PLACEMENT ON THE SCREEN

Bruce is correct - CSS is required to tweak the actual placement of an object on the screen (in addition to the order in which the HTML is generated).  However, this is not a real difficult task if you use the right CSS editor.

While some people like to use FireBug which is a free add-on tool to Firefox and works quite well, I prefer to use Stylizer from Skybound Software (http://www.skybound.ca).  It cleans your CSS code so every line is compliant, lets you easily create compliant CSS tags simply by pointing to the element you want to adjust, setting the specificity of the rule by clicking on the necessary parents and classes, and then clicking "add to rule".  The presentation adjusts automatically as you change the CSS for the screen.  It is pretty awesome and well worth the $89 cost of the software.  I believe they have a 30 day test period of the full functionality before it cripples itself to basic functionality, but I was so impressed I ordered it the first day I had it.

Good luck!

Rob

DonnieS

  • Newbie
  • *
  • Posts: 21
    • View Profile
    • Email
Re: Buttons
« Reply #6 on: January 17, 2010, 04:38:28 PM »
Rob, great info, thanks.  I think our approach is the same - thanks for the info about CSS.

Donnie