NetTalk Central

Author Topic: Insert button on browse  (Read 3077 times)

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Insert button on browse
« on: January 05, 2011, 02:00:10 PM »
Hi Bruce-

Per the earlier discussion about the browse that has view/insert/change/delete as columns in the browse. Would it be possible to add an option to include the record id in the action? If you recall, this browse creates records in a separate table and I need the ID when inserting a new record. If I click on the row first before pressing the insert it works. I am currently overriding the value::Insert routine code as follows:

       packet = clip(packet) & p_web.CreateStdBrowseButton(Net:Web:SmallInsertButton,'BrowseBenefits',p_web.AddBrowseValue('BrowseBenefits','PRitm',PRitm:Key_PRItemID),,loc:FormPopup,'UpdateBenefit') & '<13,10>'

(though I had to duplicate the entire routine)

Thanks,
Gordon

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Insert button on browse
« Reply #1 on: January 05, 2011, 02:20:41 PM »
Ugh!

That doesn't work. The CreateStdBrowseButton also keeps the ID from being pushed out.

Please let me know how to work around this.

Thanks,
Gordon

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Insert button on browse
« Reply #2 on: January 05, 2011, 10:15:42 PM »
Yeah, an Insert isn't gonna push the rowId, because by definition an Insert doesn't have a RowId.

However the RowId is set in the SessionValue when the user clicks on a row.
ie if you have say a BrowseCustomers, and there's a Cus:Id field (in the Customers primary key)
then the SessionValue of Cus:Id is set when the row is clicked.

So in the form you're gonna get the RowId not from a parameter, but rather from the Cus:Id Session Value.

Cheers
Bruce



Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Insert button on browse
« Reply #3 on: January 06, 2011, 12:38:35 PM »
Hi Bruce-

I am using the SessionValue of the primary key from the table in the browse. The problem is that the insert button is part of the browse (not separate buttons across the bottom of the browse). If I first click on the row and then the insert button, the insert works. If I just click on the insert button in the desired row, whatever row is highlighted is inserted.

I can't use buttons across the bottom, because the insert is only available for certain rows.

Perhaps if clicking on the button would first select the row and then perform the button action this would work.

Hope this makes sense.

Regards,
Gordon

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Insert button on browse
« Reply #4 on: January 06, 2011, 01:15:47 PM »
Here's an image of the browse.

[attachment deleted by admin]

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Insert button on browse
« Reply #5 on: January 31, 2011, 08:52:57 PM »
Hi Bruce-

This is still an issue in 5.13. Pressing the insert button (see prior image) without first highlighting the row passes to the update procedure the wrong value for the primary key. I'm using GSV to get the value from the browse. Is there another way of getting which row is being processed? I thought of using an "Other" button, but this won't do a popup.

Thanks for the help.
Gordon

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Insert button on browse
« Reply #6 on: February 01, 2011, 02:56:24 AM »
I've tweaked the _small_ (ie "in row") Insert button for version 5.15, so that the Row ID is passed as part of the button press.

so check in 5.15 (when it's up) and you should be ok.

cheers
Bruce

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Insert button on browse
« Reply #7 on: February 01, 2011, 07:36:28 AM »
Thanks!
Gordon

Gordon Holfelder

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Insert button on browse
« Reply #8 on: February 02, 2011, 04:19:48 PM »
Works great in 5.15.
Thanks again,
Gordon