NetTalk Central

Author Topic: nt-small-button class not being applied sometimes  (Read 3947 times)

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
nt-small-button class not being applied sometimes
« 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" >&#160;</button>
<script type="text/javascript">jQuery(function() {jQuery("#BusinessNotesButtonPRLT").button({text: false,icons: {primary:'ui-icon-note'}});});</script>
</div>

[attachment deleted by admin]

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: nt-small-button class not being applied sometimes
« Reply #1 on: April 12, 2010, 03:05:02 PM »
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.

David

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: nt-small-button class not being applied sometimes
« Reply #2 on: April 13, 2010, 04:52:42 AM »
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.

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: nt-small-button class not being applied sometimes
« Reply #3 on: April 13, 2010, 08:41:21 AM »
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?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: nt-small-button class not being applied sometimes
« Reply #4 on: April 14, 2010, 07:53:49 AM »
>> 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/) 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