NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Devan

Pages: 1 [2] 3 4 ... 16
16
Web Server - Ask For Help / Re: Browse not saving data back to database?
« on: February 11, 2014, 10:42:38 PM »
Thanks for the replies Kevin & Bruce.

Bruce - good call about the timing of the screenshots.  It turns out that the web screenshot was AFTER they found the missing data in the report.  I was amazed that the pricing appeared again AFTER it was zero in the database.

I checked the code again, and there IS a routine being called when the browse fields are being built.  Upon the Value::Routine embed for the LIN:Price field, a procedure gets called to calculate the default item price (It is a stupidly LONG and complicated pricing calculation).

I am thinking that this price is getting kludged at some other point when saving?

In the Value::Routine for the LIN:LineTotal field, I have a simple formula which is just LIN:LineTotal = LIN:Price * LIN:Quantity

I am assuming the LineTotal value is zero because at that point, the Price field was also zero.

Is this the best embed point(s) to be pre populating the pricing for the line items?  Should I be using a different validation embed point perhaps?

Note: These are the only two embedded bits of code in the entire browse procedure.


17
Web Server - Ask For Help / Re: send sms using WinEvent on a web app
« on: February 11, 2014, 10:34:08 PM »
Robert,

Rather than worrying about setting up a GSM modem etc. on the server so you can send SMS via WinEvent, I'd actually look at a service provider such as Clickatell.com, who allow you to send SMS messages via HTTP or SMTP.

That way you can stick with just NetTalk and not have to worry about hardware etc. - just send an HTTP request to the Clickatell service with the SMS info and it will all get taken care of.  Cheaper than paying normal Telco 'per message' SMS fees in a lot of cases too.

Clickatell is global, but most countries have localised services as well which are usually even cheaper.  Here in Australia, I use SMSBroadcast.com.au.  It took me less than 30 minutes to add SMS capability to one of my Clarion apps recently.

Hope this helps,
Devan

18
Web Server - Ask For Help / Browse not saving data back to database?
« on: February 10, 2014, 06:09:01 PM »
Just got a very concerning heads up from one of my clients that they are experiencing an issue with a NetTalk app I wrote for them.  They have shown me instances where a Browse screen (order form) does not appear to be saving SOME information back to the back end SQL database.

There is no real extra coding etc. on the browse that I think could be doing it - pretty standard NetWebBrowse embedded in a form.

As you can see on the attached screenshots - ALL the lines have quantity, price and line total, yet when we print the order report, two of the lines STILL have the quantity, but no price and line total?!?  Checking the database shows that the price and line total of those order lines are zero!

Seems to be intermittent.  This particular site has been up for over a year, but the problem seems to have raised it's head in the past few months, around the time I did an upgrade for them using 7.31 (or thereabouts) of NetTalk.

Anyone else seen this, or can shed some light on why this may be happening?

Cheers,
Devan



[attachment deleted by admin]

19
Web Server - Ask For Help / Re: Possible bug in lookups?
« on: February 10, 2014, 03:54:03 AM »
Hey Bruce,

Just wondering if this issue has been resolved in the latest build?

I've checked through the history logs on the website, but nothing jumped out at me...

Cheers,
Devan

20
Hey all, just thought I might try and see if we can get an open discussion going on the comparative strengths and weaknesses of different web application frameworks.

In recent months, I've been involved in creating several web apps using a Ruby framework.  No, not Ruby on Rails, but one called Padrino, which is based on Sinatra.

Overall, I found the Ruby syntax to be quite elegant - in a similar way that I think the Clarion syntax is also elegant.

Here are my findings so far...

THE GOOD:

* MVC - Biggest advantage I can see to Rails/Padrino etc. is the separation of the data models from the rendered views etc.  The MVC (Model/View/Controller) methodology took a bit of getting used to, but once I figured it out, it became quite a productive process to create new pages and tie them all back to the back end data models.  Like Clarion, the MVC paradigm allows for different back ends to be interchanged.

* Environments - I love the way that Rails/Padrino allows you to switch between development, testing and production environments, including creating and managing separate data sets for each stage of the development process.  I can freely create junk testing data in 'development' mode, then switch to 'production' and check reports in the live database without fear of overwriting the wrong database.  Just one system flag to change between environments.

* Rendering engines - I like the way that these frameworks can use different 'engines' for rendering the final HTML.  I am particularly enjoying using HAML as a markup language.  The 'View' paradigm really makes in a cinch to create chunks of HTML and arrange them on a page.  This is probably the BIGGEST advantage of NetTalk that I am really enjoying.  I like that you can create code snippets in NetTalk too, but it is a lot more difficult to 'see' the big picture of how the whole page will eventually look when you have lots of snippets that are inserted into a page programatically.  If we could pull all the page rendering code out into a separate templating system in NetTalk, I will be in heaven!

* View independence - Related to my point above, I found it SO much easier to integrate third party templates that are available for sale out there into my Padrino projects that I did into my NetTalk projects.  I like that you can opt to use a Bootstrap framework, or even a WordPress one with some mods.  I like the themes that are provided in NT, but I would really like to be able to pull a third party one off the shelf and have it work quickly and easily.


THE "I'M STILL NOT SURE"

* ORMs - Object Relational Models.  In one aspect, I find them great.  I can add or change fields in a model file and then run a 'migrate' task to make on the fly changes to the actual database.  Very much like a Clarion dictionary sync.  The ORM also contains all the relationships between the model object, which aren't really as intuitive as you first think, but eventually make sense.

I LOVE: That you don't have to write SQL any more, even for complex multi table joins.  If I wanted the invoice date, I would just ask for:

Code: [Select]
invoice.date
which I could place on a view to show the user.  What astounded me is how easy it was to do complex things, such as finding out the total cost of all line items belonging to the current invoice.  It is as easy as:

Code: [Select]
invoice.invoice_detail.sum(:item_total)
where 'invoice_detail' is the child model for 'invoice' and ':item_total' is the symbol pointing to the table column 'item_total'.

I HATE: That some of the SQL generated by the ORM and sent to the back end is quite inefficient.  Also ORMs seem to have great difficulty interpreting custom Views that you might have created yourself, or even legacy databases that a rigid in nature.


THE BAD

Still haven't found anything REALLY bad here that I think is worthy of mention, but I am sure I may come across some as I delve deeper into this world.




Given that Bruce has talked about NetTalk evolving into a more of a 'stand alone' product which is not necessarily linked to Clarion, I am wondering if things such as MVC, ORMs etc. are part of the roadmap.

How about others out there in the NetTalk world?  Anyone dabbled in other frameworks?  How have you found them?

Just to clarify, I still love and use NetTalk for a lot of projects - I just thought I would share my discoveries as I venture out into other parts of the web development world.

NOTE: If you want to check out

21
What is your back end database?

We had a NetTalk site that used MySQL on the back end that used to crash quite a lot.  Ended up upgrading the MyODBC driver from v3 to v5 which reduced the crashing, but it still happens from time to time.  The GPF Reporter logs always seem to point to the MYODBC.DLL as the cause (or at least the last call before the GPF)...

22
Web Server - Ask For Help / Re: Custom CSS and Javascript includes?
« on: January 11, 2014, 09:26:42 PM »
Scrub second question - I figured out an alternate way of doing the popups just within NT (using NetWebForm)

23
Web Server - Ask For Help / Re: Custom CSS and Javascript includes?
« on: January 11, 2014, 02:57:05 PM »
Ah! Thanks Bruce - this worked perfectly.

The only other thing is the widget initialisation code that goes with this library that has to be in the $(document).ready() section.

I've put it in the PageFooterTag procedure as an embed point, and it seems to work *sometimes*.

It's a jQuery lightbox plugin, and when I open a browse with images on it, the very first click doesn't pop a lightbox up, but subsequent clicks work perfectly.  Either there is another event handler that is interrupting that first click (happens when I open the browse or PgUp/PgDn to a new page and click on an image), or the initialisation code isn't getting called when it first opens?!?




24
Web Server - Ask For Help / Custom CSS and Javascript includes?
« on: January 11, 2014, 01:35:15 AM »
Hey all,

I am trying to incorporate a 3rd party Lightbox functionality into my NT7 project.

The Lightbox developers say I just need to include one CSS and one JS file into my site and it is all good to go.  I went to the 'Action' properties on my IndexPage which is the main page of my site, and under the 'Scripts' and 'CSS Class' tabs, I added in the relevant JS and CSS files.

Now, when I go to my site, under the main home page, I see the two custom included CSS and JS files in the <head> section, but as soon as I open another Browse or Form, they disappear!

How can I make these custom included files persist through ALL pages on my site?

Thanks,
Devan

25
Web Server - Ask For Help / Pop up images on a browse
« on: January 08, 2014, 06:52:25 PM »
We've just been approached by a client to design an ecommerce style system using NetTalk.

One thing they *insist* on is the list of products contain a thumbnail image of the product, which is trivial to do, but they also want a full size image to pop up whenever the user moves the cursor over the thumbnail.

I know there are various jQuery etc. libraries that can do this, but just wanted to throw it out there to the general NT user group to see if anyone has a library or system that works well with NT?

In writing this, I am thinking that the hover option might not be best, as they are also talking about using this on iPads for field service agents, so I think we will have to go with clicking/tapping on the thumbnail to zoom in...

Thanks,
Devan

26
Web Server - Ask For Help / Possible bug in lookups?
« on: December 09, 2013, 07:58:28 PM »
Hey all,

I have a simple order entry NT7 site.  Got the usual Order Items browse with a button to 'Add' a new line which goes to an Item Add NetWebForm.  On this form is the field for the Product Code (read only), with a Lookup button that calls a Product List NetWebBrowse so that the user can search/select an item.

Now, we've noticed that many users click on the lookup button to bring up the list, then they type in a search filter which returns NO results in the browse.  Problem is - they tend to click the 'Select' button to close the window.

This tends to return garbage(?) data back to the product code field.  It is usually 6 to 8 uppercase alphabetic characters.  I am assuming it is some sort of hash being generated by NT in the background.

No problems if they [Esc] or click the 'x' to close the browse window.  Only if they click 'Select'.

My question is - is it possible to disable the 'Select' button if a search filter returns no records?  If not, is there a condition that I could apply in the browse properties to disable/hide that button when there are no records to choose?

Thanks,
Devan

27
NetTalk is great for building browser based apps, but we still will work on a lot of Win32 based apps here at my company, and have found a way to incorporate a lot of NetTalk based features to make our apps run better.

Because I do a lot of development work on Mac OS X as well, I have become somewhat used to the nifty 'Growl' notification engine on that platform - whereby many different apps can post system wide notifications in a beautiful, non intrusive way.

Imagine my surprise and delight when I discovered that there was a Growl implementation for Windows as well.  http://www.growlforwindows.com/gfw/

To summarise - Growl is a totally customisable system 'alert' window.  The alert windows can be shaped to look like pretty much anything you want, and they can slowly morph into view discreetly and then fade out again.  They can even be made sticky, and will neatly cascade for you if you don't respond to them immediately.  The system even keeps a log of all old messages so you can go back and audit them later.  You can even have icons and images in the notifications and even incorporate callbacks so that users can take action by clicking on the notification window.

We have switched to using Growl for alert messages on nearly all our apps now.  Our users love it as they are not as intrusive as a normal app message, yet they still catch their attention.

As an example - we have an app we designed for a Pawn/Loan shop.  Whenever they go to add a new pawn contract for an existing customer, and the customer has any outstanding contracts that are overdue, we flash up a Growl notice about the overdues.  This doesn't actually interrupt their workflow while they are entering a contract at all, but they don't miss the little box that fades in and fades out at the top of the screen while they are working.

How did we integrate Growl?  Well, really just by using the NetTalk WebClient template.  It is that easy.  I have included a small test app with this post that you can explore.

The first thing you have to do is to download and install Growl For Windows from http://www.growlforwindows.com/gfw/.  This is a once only step on each PC that you want Growl notifications on.

Then in your app, you really need two procedures.  One to REGISTER your app with Growl, and one to SEND the Growl notifications themselves.

Growl uses a proprietary GNTP protocol on port 23053.  It is really a slightly customised HTTP protocol.  The actual code to register your app is as follows:

Code: [Select]
! Send the Registration
Window{PROP:Hide} = 1
LOC:Packet = 'GNTP/1.0 REGISTER NONE<13,10>'
LOC:Packet = Clip(LOC:Packet) & 'Application-Name: ' & Clip(pAppName) & '<13,10>'
If Clip(pAppIcon) <> '' ! If the icon was not omitted, add it
LOC:Packet = Clip(LOC:Packet) & 'Application-Icon: ' & Clip(pAppIcon) & '<13,10>'
End
LOC:Packet = Clip(LOC:Packet) & 'Notifications-Count: 1<13,10>'

! Blank line
LOC:Packet = Clip(LOC:Packet) & '<13,10>'

LOC:Packet = Clip(LOC:Packet) & 'Notification-Name: General Notification<13,10>'
LOC:Packet = Clip(LOC:Packet) & 'Notification-Enabled: True<13,10>'
LOC:Packet = Clip(LOC:Packet) & '<13,10,13,10>'

GROWL:ApplicationName = Clip(pAppName)
ThisNetGrowlRegister.Init()
ThisNetGrowlRegister.AsyncOpenUse = 1
ThisNetGrowlRegister.AsyncOpenTimeOut = 1000 ! 10 Seconds
ThisNetGrowlRegister.InActiveTimeout = 2000 ! 20 Seconds
ThisNetGrowlRegister.Open('127.0.0.1', 23053)


And for sending a notification, it is as easy as:

Code: [Select]
! Send the Notification
Window{PROP:Hide} = 1
LOC:Packet = 'GNTP/1.0 NOTIFY NONE<13,10>'
LOC:Packet = Clip(LOC:Packet) & 'Application-Name: ' & Clip(GROWL:ApplicationName) & '<13,10>'
LOC:Packet = Clip(LOC:Packet) & 'Notification-Name: General Notification<13,10>'
LOC:Packet = Clip(LOC:Packet) & 'Notification-Title: ' & Clip(pNotificationTitle) & '<13,10>'
LOC:Packet = Clip(LOC:Packet) & 'Notification-Text: ' & Clip(pNotificationMessage) & '<13,10>'
! Check if sticky flag omitted
LOC:Packet = Clip(LOC:Packet) & 'Notification-Sticky: ' & Choose(pNotificationSticky, 'True', 'False') & '<13,10>'
If Clip(pNotificationIcon) <> '' ! If the icon was not omitted, add it
LOC:Packet = Clip(LOC:Packet) & 'Notification-Icon: ' & Clip(pNotificationIcon) & '<13,10>'
End

LOC:Packet = Clip(LOC:Packet) & '<13,10,13,10>'

ThisNetGrowlNotify.Init()
ThisNetGrowlNotify.AsyncOpenUse = 1
ThisNetGrowlNotify.AsyncOpenTimeOut = 1000 ! 10 Seconds
ThisNetGrowlNotify.InActiveTimeout = 2000 ! 20 Seconds
ThisNetGrowlNotify.Open('127.0.0.1', 23053)

You will note that here we are sending the notifications to 127.0.0.1 on the local machine, but YES, you can actually send Growl notifications to OTHER machines on the network.  For example, if one of the workstations suffers a database failure, you can send a Growl notification to the sysadmin on the server PC etc.  Even simple 'chat' applications are possible without having to fuss over designing an interface.

The other beauty is that each workstation or operator can customise the way they see the Growl notifications.  Some may want a simple 'bubble' popup.  Others may want an iPhone style box, some may like the traditional OS X style.  There are tons of styles in the public domain, and you can make your own as well. http://www.growlforwindows.com/gfw/displays.aspx

Check the sample app here for more details.  Feel free to lift the code and incorporate into your own apps as we do.

Cheers,
Devan

[attachment deleted by admin]

28
Hey Bruce,

I've attached some screen shots to this email showing the strange form behaviour.  You can see at the top of the form that the previous student name is retained in the header too.

The Surname is NOT the primary key.  I have an auto incrementing Integer for that.  The back end is MySQL.  The browse list is default sorted by Surname though, which IS a key but not the primary key specified on the form etc.

Cheers,
Devan


[attachment deleted by admin]

29
Just got a report today from a client using an NT site that we only just upgraded to 7.2 last week.  They are entering in a student into the database with the Irish surname of O'Sullivan.

Problem is, when they do this, they cannot then find the student again in the Student Browse locator by typing in "O'Sullivan".  It comes up with 0 results.  They can however, type in "Sullivan" and because the Locator is a "contains" locator, the record comes up.

However, when they select to [Change] the student details, the update form either throws an error that the record is not found in the primary key, or it brings up a blank record, and the form itself is all always messed up as the CSS for the 6 tabs don't kick in and the form is displayed as a continuous running form with all the tabs under each other.  The [Ok] and [Cancel] buttons also don't work.  Only happens for any student with a forward single tick in their surname.

(I found some older students in there with the forward ticks in their name, and they exhibit the same behaviour which was never reported by the client before, so I only assume that it used to work okay under NT 6.x but broke under 7.x ???)

Conclusion:  NetTalk hates Irish names... :)

I have worked around this for now by changing the names in the database to use back ticks (`) instead of forward ticks in the name and things seem to be working again, but perhaps we need to code the templates defensively against this for the future?

Time for another pint of the black stuff...

30
Web Server - Ask For Help / Re: Strange button behaviour in NT7
« on: September 30, 2013, 10:55:40 PM »
Addendum:  I should point out that the site worked perfectly in NT6.  I recently recompiled using the NT7 templates after doing some enhancements to the site (not the button or this page), and the problems seems to have started since then.

Pages: 1 [2] 3 4 ... 16