NetTalk Central

Author Topic: Hiding Insert/Change/Delete buttons based on a value in the highlighted record  (Read 7269 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Clarion8 NT7.25
Hi Bruce
In the CIDC Nettalk seminar I asked how I could hide/unhide these buttons based on a value in the highlighted record
Example
If I do not want to allow a change on a record if the value is (say) REC:status = 2
As I understood it from you on the Form tab of the Browse in the Show Buttons change I would check the include Change Button and put a Condition for it to appear in the Condition field.
Firstly: what should the format be? I have added the REC:Status to the View Fields.
'REC:Status <> 2'
or REC:Status <> 2
or p_web.GSV('REC:Status') <> 2
Secondly, and vitally,  when I put a trace in the GenerateUpdateButtonsBelow routine in the Start of "Set jQuery Update Buttonset Options" embed point which is where this condition appears this trace only appears once while a browse is being generated. Selecting different rows do not call this routine again which means (as I understand it) that it cannot be testing the highlighted record to determine if the change button should be included or hidden.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
welcome back Bruce. Really enjoyed the presentation. Anxiously waiting the downloads so I can review (and improve my coding  :)
Bump
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
downloads should be up soonish Terry. It gets changed into download form by playing it through a converter from the stream - so takes at least 2 full days to do. And it's unlikely to be the next 2 days <g>. You can of course access the streams immediately.

condition is clarion code, so
REC:Status <> 2

It appears in GenerateUpdateButtonsAbove, GenerateUpdateButtonsBelow and the value::fieldname routine (if there are inline buttons)
Because the condition is based on the row it doesn't make sense to put a change button below the brows as well - use the in-row change button instead.




terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Thanks Bruce. Yes makes sense. I couldn't see any changes to the button below as I moved from record to record
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186