Passing values to a LINKSCREEN in PH Web

Bodger, Simon Simon.Bodger@cognos.com
Thu, 28 Jun 2001 20:23:51 -0400


Did you use NODATA for the designer procedure?

-----Original Message-----
From: Edis, Bob [mailto:bob.edis@fleetpride.com]
Sent: June 28, 2001 8:16 PM
To: 'powerh-l@list.swau.edu'
Subject: RE: Passing values to a LINKSCREEN in PH Web


Thanks Simon

I tried a designer procedure like you said but when I click on it, the
screen flickers bit and nothing else happens! :(

Can I use debug with PH Web screens?

Regards,
Blue

-----Original Message-----
From: Bodger, Simon [mailto:Simon.Bodger@cognos.com]
Sent: Thursday, June 28, 2001 7:14 PM
To: 'Edis, Bob'; 'powerh-l@list.swau.edu'
Subject: RE: Passing values to a LINKSCREEN in PH Web


Hi Bob 

I confess I've not fully read through all you supplied in detail, but it
sounds as if you're getting your Client Side (in this case JavaScript in the
browser) and Server Side (in this case PowerHouse Web) slightly mixed up.

The values passed in the <A HREF..> link are generated on the SERVER, and by
having the user enter a value and immediately clicking the link, you never
go back to the server and get the link regenerated to reflect the changed
value.

Instead of having your users click on a link after entering the value,
consider giving them a button instead.  You could then change your
LINKSCREEN to a DEFER LINKSCREEN within a designer procedure linked to that
button.  You may also need to code ACCEPT statements for all the values you
pass.

Have fun.

Simon.

-----Original Message-----
From: Edis, Bob [mailto:bob.edis@fleetpride.com]
Sent: June 28, 2001 7:32 PM
To: 'powerh-l@list.swau.edu'
Subject: Passing values to a LINKSCREEN in PH Web


G'day all, again

Ok, so now my JavaScript is 'maybe' resolved.  What I'm trying to do is call
one screen from another like so.

Screen A.
User enters a customer id, finds related records in results list and data is
loaded for selected record (happens to be a cheque).
User enters an invoice number (temp item) on screen and clicks link to
subscreen (screen B) to see invoice detail (actually could be several
records as invoice number is not unique).  There user selects invoice record
and is taken to a posting screen to apply part or all of the cheque value to
the selected invoice (screen C).

In screen A the logic is:

QKS
...
TEMP t_invoice_nbr     VARCHAR*15 RESET AT STARTUP
TEMP t_invoice         CHAR*01 INIT "Y"
...
FIELD t_invoice_nbr LABEL "Invoice #:"  &
  LOOKUP ON post_invoice                &
  MESSAGE "*E* Invoice not found!"
FIELD t_invoice        NOLABEL
...
LINKSCREEN pc_select_invoice LABEL "Select Invoices"                &
           ACTION "SEARCH"                                          &
           PASSING corp_cust_id     AS "POST_INVOICE:corp_cust_id", &
                   t_invoice_nbr    AS "POST_INVOICE:invoice_nbr",  &
                   check_nbr        AS "t_check_nbr",               &
                   check_date       AS "t_check_date",              &
                   amount           AS "t_check_amount",            &
                   amount_applied   AS "t_amount_applied",          &
                   amount_open      AS "t_amount_open",             &
                   t_invoice_status AS "t_invoice_status",          &
                   check_key        AS "t_check_key",               &
                   t_invoice,                                       &
                   t_sort_inv_nbr

HTML
<input type="hidden" size="1"  name="T_INVOICE"
value="<!--PH:VALUE:T_INVOICE-->">
...
<table width="60%" cellpadding="0" cellspacing="0" frame="void">
<tr>
<td align="right">
<B><I>Invoice Number&nbsp;</i></b>
</td>
<td width="18">
<input type="text" size="14" name="t_invoice_nbr"
value="<!--PH:VALUE:t_invoice_nbr-->">
</td>
<td align="left">
<A
HREF="/cgi-bin/phcgi.exe?PH_QKC=pc_select_invoice&amp;PH_APP=CORPCUST_APP&am
p;PH_HTML=pc_select_invoice.htm&amp;PH_ACTION=Search&amp;POST_INVOICE:corp_c
ust_id=<!--PH:LINKVALUE:POST_CHECK:corp_cust_id-->&amp;POST_INVOICE:invoice_
nbr=<!--PH:LINKVALUE:T_INVOICE_NBR-->&amp;t_check_nbr=<!--PH:LINKVALUE:POST_
CHECK:check_nbr-->&amp;t_check_date=<!--PH:LINKVALUE:POST_CHECK:check_date--
>&amp;t_check_amount=<!--PH:LINKVALUE:POST_CHECK:amount-->&amp;t_amount_appl
ied=<!--PH:LINKVALUE:POST_CHECK:amount_applied-->&amp;t_amount_open=<!--PH:L
INKVALUE:POST_CHECK:amount_open-->&amp;t_invoice_status=<!--PH:LINKVALUE:T_I
NVOICE_STATUS-->&amp;t_invoice=Y&amp;t_check_key=<!--PH:LINKVALUE:POST_CHECK
:check_key-->"><font color="#FFFF80">Select Specific Invoice</font>
</A></font>
</td>
</tr>
</table>

In screen B the logic is:

QKS
...
TEMP t_invoice CHAR*01 RESET AT STARTUP
...
FILE post_invoice IN cidb PRIMARY                &
     HTMLKEY corp_cust_id                        &
     HTMLFIELD corp_cust_id, customer_id,        &
               invoice_nbr, po_nbr,              &
               amount, date_invoice,             &
               source_system, branch_id
ACCESS VIA     corp_cust_id, invoice_nbr         &
       USING   corp_cust_id, invoice_nbr         &
       ORDERBY customer_id, branch_id            &
       REQUEST corp_cust_id, invoice_nbr, t_invoice  
...
FIELD Corp_cust_id        OF post_invoice PREDISPLAY LABEL "Corp ID  "
...
FIELD invoice_nbr         OF post_invoice PREDISPLAY LABEL "Inv Nbr  "
...

PROCEDURE INITIALIZE
BEGIN
...
  ACCEPT t_search_thread
  ACCEPT t_ph_loadid
  ACCEPT t_invoice
END

HTML 
<tr>
<td>Corp Cust Id</td>
<td><input type="text" size="11" name="POST_INVOICE:Corp_cust_id"
value="<!--PH:VALUE:POST_INVOICE:Corp_cust_id-->"></td>
</tr>
<tr>
<td>Invoice Nbr</td>
<td><input type="text" size="15" name="POST_INVOICE:invoice_nbr"
value="<!--PH:VALUE:POST_INVOICE:invoice_nbr-->"></td>
</tr>
<tr>
...
<input type="hidden" size="1"   name="T_INVOICE"
value="<!--PH:VALUE:T_INVOICE-->">

Now for the problem.

When the user enters an invoice number in the t_invoice_nbr field and clicks
on the link, the value for POST_INVOICE:invoice_nbr is not being passed.
How do I make the screen pass this value?

Here is what is being passed at run-time:

<A
HREF="/cgi-bin/phcgi.exe?PH_QKC=pc_select_invoice&amp;PH_APP=CORPCUST_APP&am
p;PH_HTML=pc_select_invoice.htm&amp;PH_ACTION=Search&amp;POST_INVOICE:corp_c
ust_id=0&amp;POST_INVOICE:invoice_nbr=&amp;t_check_nbr=98765&amp;t_check_dat
e=06/10/01&amp;t_check_amount=546.87&amp;t_amount_applied=0&amp;t_amount_ope
n=546.87&amp;t_invoice_status=&amp;t_invoice=Y&amp;t_check_key=4"><font
color="#FFFF80">Select Specific Invoice</font></A></font>

Man, I feel like I'm back in school learning PH Web; it's sooo different to
standard programming in PH4GL.

Regards,
Blue


= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.