NetTalk Central

Author Topic: How to trap delete BEFORE deletion warning message/Invididual browse row options  (Read 5755 times)

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
1) I need to trap a delete action before the warning message is displayed, but I cannot find where the the clicking on the Delete button is processed to abort it.

2) I'm trying to set up a browse so that on different rows, I can disable the change/delete buttons. I see in the browse template/form tab where you can have conditional row definitions but couldn't get them to work. Is there an example file? Also the filter condition I was trying to enter was to compare to p_web values, ie. p_web.GSV('Value1') NOT= p_wsb.GSV('Value2'). The syntax of this became very complex and I'm not sure that I got it right. An example?

Regards,

Mark

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
1) use predelete embed on the update form, check what you want and issue an exit if you want to abort

2) I think you would need to set a session value on the buttons and then in the loop where it builds the browse set this session value based on your condition

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
>> I need to trap a delete action before the warning message is displayed

The user clicks the button in the browser, and the warning message appears in the browser. This is all done in the browser - no server interaction at all. So if they can see the button, then they will get the message. (Later on, you can decide _not_ to actually delete the record, but that's another story.)

>> I'm trying to set up a browse so that on different rows, I can disable the change/delete buttons.

a) on the form tab set the conditions for the change and delete buttons. However set the checkbox here so that the change and delete buttons are not generated above, or below, the browse.

If your condition uses fields that are in the browse, then you don't use GSV's here. ie
inv:paid = true
would be fine.

b) add in-row change and delete buttons on the list of browse fields. These will use the condition mentioned earlier.

Cheers
Bruce

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
I added the change/delete buttons to the end of each browse row as well as the conditional display of them. This gives me the solution I want except for one minor BUG that was uncovered. Adding a conditional display affects not only the browse row but also is applied to the header. I was able to override the generated code with an OMIT/ENDOMIT, but I think the header should always show (after all you're adding a condition which presumably will be true some of the time) or have another tick option added to display/not display the header.

FYI, I'm working on a biiiiggggg netweb project right now, so you may be hearing a lot from me LOL

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
can you please post a screen-shot of _which_ conditional you're using?

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
I found that the lack of the icon in a cell altered the cell color and sometimes the browse fields, as well as confusing the header. So I changed the code to just disabling the icon when necessar. The header is thus unaffected. So I don't have an example to show you unfortunately.

However, I did find that adding buttons with the standard actions (ie not Other) do NOT allow their disabling, which is unfortunate. To add an Update or Delete button that can be disabled, I have to add it with the action as Other, and then add a bunch of template options (icon, form update, action, etc.) to make it work like a standard button.

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
>> However, I did find that adding buttons with the standard actions (ie not Other) do NOT allow their disabling, which is unfortunate.

the disabling options for standard buttons exist on the FORM tab. You'll see there a mini-tab, on for each button, including a condition for the button. These conditions are applied to each in-row button.

cheers
Bruce

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
I was aware of the Condition field, but as near as I can tell it generates code indicating only whether the field is displayed or not. How do I enter a flag for just disabling the icon? When I use the disable option for a non-standard button as discussed earlier in the thread, the generated code adds a disabled flag as one of the trailing parameters in the packet.

Thanks and I do appreciate your help,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
I'm not sure you're thinking of the same condition as me.
I'm talking _specifically_ about the options on the FORM tab.

I recommend you check out the "buttons" example for all kinds of different buttons used in a browse.

cheers
Bruce