NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: David on April 12, 2010, 10:38:57 AM
-
NT5.PR11
When adding an 'Other' button to a NetWebBrowse, sometimes the class is not being applied. I have some browses where it works and others where it does not. Below is an example of template generated code where the nt-small-button shows. But, the web browser source does not have the class applied to the button.
---------- Clarion Template Generated Code -----------
packet = clip(packet) & p_web.CreateButton('submit','BusinessNotesButton','',Choose('' <> '',p_web.combine(p_web.site.style.BrowseOtherButtonWithText,'nt-small-button'),p_web.combine(p_web.site.style.BrowseOtherButtonWithOutText,)),loc:formname,p_web._MakeURL(clip('browsebusinessnotes.html') & '&' & p_web._noColon('BUS:BusinessID')&'='& p_web.escape(BUS:BusinessID) & ''),clip('_self'),,,loc:disabled,'',,,,'view notes',1,'note')
------------ web browser view source -----------------------------
<div id="div1756640797_div" class="adiv"><button type="button" name="BusinessNotesButton" id="BusinessNotesButtonPRLT" value="" onclick="document.BrowseBusiness_frm.action='browsebusinessnotes.html?BUS__BusinessID=14&PressedButton=BusinessNotesButton'; document.BrowseBusiness_frm.target='_self'; dsb(BrowseBusiness_frm,BusinessNotesButton,'BusinessNotesButton','BUS__BusinessID','14');" title="view notes" > </button>
<script type="text/javascript">jQuery(function() {jQuery("#BusinessNotesButtonPRLT").button({text: false,icons: {primary:'ui-icon-note'}});});</script>
</div>
[attachment deleted by admin]
-
It could be that on the screen shot you showed the button type was Submit not Other. I think I recall some browsers handling the submit button differently.
-
Good suggestion. I changed the button from Submit to Button and the nt-small-button class was then applied to the buttons in the browse. However, I am getting inconsistent results because some of my browses have buttons that are set to submit and they work fine and others do not. So I think something else is going on.
-
Choose('' <> '',p_web.combine(p_web.site.style.BrowseOtherButtonWithText,'nt-small-button'),p_web.combine(p_web.site.style.BrowseOtherButtonWithOutText,)),loc:formname,p_web._MakeURL(clip('browsebusinessnotes.html')
evaluates to false so 'nt-small-button' wouldn't be generated
WAG, i do not have nettalk5 but what is the significance of
use javascript styled buttons in this context?
-
>> WAG, i do not have nettalk5 but what is the significance of use JavaScript styled buttons in this context?
In nettalk 4 the buttons on a page are generated by the browser, they are native browser (and hence usually native OS) button controls. They look the way they look.
In NetTalk 5 the buttons can be replaced with "javascript" buttons which have more flexibility, and more styling options than the native buttons. If you go here (http://jqueryui.com/demos/button/ (http://jqueryui.com/demos/button/)) you'll get some idea of what is possible. Also the buttons get their style from the theme your site is using so they look more in keeping with the rest of the site.
Cheers
Bruce