NetTalk Central

Author Topic: Looking for embed point on webform  (Read 5808 times)

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Looking for embed point on webform
« on: April 04, 2012, 01:19:21 PM »
I have one browse shown on two separate tabs on a webform procedure.  Where do I put the code to pass a parameter to the browse from each tab on the form?   I think I will be using SetSeesionValue on the form and GetSessionValue on the browse.

Thanks,
Sukhendu

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #1 on: April 04, 2012, 03:09:06 PM »
Hi Sukhendu,

What is the embed going to do? I.e. is it going to be part of the browse filter or the browse heading or something else?

Regards,
Trent

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Looking for embed point on webform
« Reply #2 on: April 04, 2012, 03:23:08 PM »
Hard to say as I'm not sure either what you are trying to do but if you have a browse on a form just under where you set the procedure name (your browse) you can set parameters.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Looking for embed point on webform
« Reply #3 on: April 04, 2012, 09:54:08 PM »
I don't think you can have the same browse on 2 separate tabs. ie the same browse multiple times on the same page. My suspicion is that you'll get really weird behavior.

That's because the session values for a browse would be "shared" with the session values for the other browse.

In this situation you may be better off with 2 separate browse procedures.

cheers
Bruce

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #4 on: April 05, 2012, 08:13:14 AM »
Tab1 - BrowseClients with ClientTypeFlag = 1 (client type Customer)
Tab2 - BrowseClients with ClientTypeFlag = 2 (client type Supplier)

It seems from Bruce's comment that I should create two separate browses.

How about if I put two buttons on the webform: one for Customer and the other for supplier.  And have only one browse procedure: Is this do-able? If yes then where do I embed the ClientTypeFlag on the form?

Kevin - I'm looking for an example on parameter passing between procedures.


Thanks,
Sukhendu


« Last Edit: April 05, 2012, 08:19:12 AM by sukhendu »

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #5 on: April 05, 2012, 05:05:55 PM »
Hi Sukhendu,

You can do this with either Buttons or a Dropdown:

In the 'Client-Side' tab of the Buttons/Dropdown, insert a Reset Prompt/Value for the Browse, check 'Send new value to server' and in the 'Server Code' set the Session Value. If you use Buttons then set the Session Value on form load. If you use a Dropdown then prime the Dropdown in the Form 'Priming' tab.

In the Browse do the GSV in the 'Set Filter' embed i.e.
ThisView{prop:filter} = 'table:field = '& p_web.GSV('ClientType')

Regards,
Trent

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Looking for embed point on webform
« Reply #6 on: April 05, 2012, 09:22:57 PM »
exactly right Trent!

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #7 on: April 06, 2012, 01:06:00 AM »
Thanks Bruce  :)

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #8 on: April 09, 2012, 07:50:59 AM »
Hi Trent,

Thanks for your reply.  I'm using buttons on the form. You mentioned to set the session value on:  'Send new value to server' and in the 'Server Code' set the Session Value.  And set the session value again on form load: If you use Buttons then set the Session Value on form load

Does this mean that I have to set the session value twice?

When I set the session value in the 'Server Code' embed, it goes under validate routine '5 Add Server side code here' , it does not work.  I'm still struggling with finding the correct embed point on the form that has multiple buttons.  Example: Button1: p_web.SetSessionValue('pCliType',1) and Button2: p_web.SetSessionValue('pCliType',2)

Thanks - Sukhendu

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #9 on: April 09, 2012, 01:57:35 PM »
Hi Sukhendu,

Yes you will be setting the Session Value twice, once when the Form loads so that the Browse has a filter to start with, and the second time when the user clicks one of the buttons to change the browse filter.

The Form Load embed could be 'Before Heading' or 'Before SubHeading' because these happen before the Browse is loaded.

You could put 'p_web._Trace(ThisView{prop:Filter})' code in the Browse Set Filter embed under the filter code to see what the Browse is filtering on and if the SSV is working at both embed points.

Regards,
Trent

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Looking for embed point on webform
« Reply #10 on: April 09, 2012, 08:03:36 PM »
Hi trent,

just 1 tip:
>> You could put 'p_web._Trace(ThisView{prop:Filter})' code in the Browse Set Filter embed under the filter code to see what the Browse is filtering on

There's now a template option (checkbox) to turn this on. I do it a lot, so it was easier to make it a template option than write the line of code each time.

cheers
Bruce

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #11 on: April 09, 2012, 08:54:16 PM »
Good idea :) I might start using that too instead of my 'debug' statements.

sukhendu

  • Jr. Member
  • **
  • Posts: 92
    • View Profile
    • Email
Re: Looking for embed point on webform
« Reply #12 on: April 10, 2012, 09:58:21 AM »
Thank you Trent and Bruce for your help.

I find passing simple flags using procedure name with ?myFlag=value much easier.

Sukhendu