Site hosted by Angelfire.com: Build your free website today!


PLEX WORLD

OBSYDIAN, COOL:PLEX, ADVANTAGE PLEX, ALLFUSION PLEX, CA PLEX, AND RELATED TECHNOLOGY




 


Click here to add PLEX WORLD. WEBSYPLEX: SOLUTIONS TO COMMON PLEX/WEBSYDIAN TASKS to your list of favorites

 
The intended audience for this document is OBSYDIAN (Cool:Plex) developers with intermediate and advance experience and who have already covered the introductory lessons on Websydian. Items, terms, and words in italics are concepts that can be found in Windows/Cool:Plex (Advantage Plex)/Websydian documentation

If you cannot find the solution to your problem try the online Websydian Documentation.

If you have questions, don't hesitate to drop me an email. I provide on-demand remote (100% via the internet) hourly consulting for the entire Development and Project Lifecycles at the best cost in the market.

Developed by: Lucio Gayosso, MIS/M, BS, PLEX Expert (1999-2010)

 

  1. How can I define a call to an Event Handler after a Page Geneerator has already been defined/customized?

    On the HTML Form add a button and define the link as a JavaScript function. Look at the following example:

    <a href="JavaScript:bEmail();"><img src="images/_fnavEmail.jpg" border="0" onMouseOver="window.status='';return true;" onMouseOut="window.status='';return true;">

    Somehwere on your form the function bEmail() needs to be defined:

    function bEmail() {
    SelectOrder(document.OrderGrid);
    document.BBp9F.submit();
    }

    In this case "BBp9" is the Implementation Name of the Event Handler not associated Originally to the calling Page Generator. Obviously, there must be a call from the Dispatcher for the Event Handler to be used.

  2. How can I send an Email with a Plex generated function?

    Use the following Source Code:

    "Send Customer Correspondence" Script Engine VBScript Parameters:

    Primary E-mail (Char,35 -OBMAPI/Name-)
    Subject Line (Char,50)
    Feedback Message (Char, 1024 -FIELDS/LongDescription-)
    Administrator E-mail (Char, 50)
    Secondary E-mail (Char,35 -OBMAPI/Name-)
    SMTP Delivery Method (Char, 1 -FIELDS/Status-) Values: *CDO (literal C), *ESSMTP (literal E)
    SMTP Domain (Char, 255 -FIELDS/ShortDescription-)
    SMTP Server (Char, 100 -FIELDS/ShortDescription-)
    SMTP Port Number (Num,4 -FELDS/Number-)

    Source Code:

    Dim StrEmail
    Dim StrSubject
    Dim StrBody
    Dim StrAEmail
    Dim StrCC
    Dim DeliveryMethod
    Dim SMTPServer
    Dim Domain

    StrEmail = trim(&(1:))
    StrSubject = trim(&(2:))
    StrBody = trim(&(3:))
    StrAEmail = trim(&(4:))
    StrCC = trim(&(5:))

    if StrCC = Chr(34) or StrCC = "" Then
    StrCC = ""
    end if

    DeliveryMethod = trim(&(6:))
    SMTPServer = trim(&(8:))
    Domain = trim(&(7:))

    if DeliveryMethod = "E" Then

    set Mail = CreateObject("EsSmtp.EsSmtpCtrl.1")

    If StrCC <> "" Then
    Mail.CCDestinationAddress = StrCC
    end if

    Mail.SourceAddress = StrAEmail
    Mail.DestinationAddress = StrEmail
    Mail.Subject = StrSubject
    Mail.MailData = StrBody
    Mail.SMTPServer = SMTPServer
    Mail.Domain = Domain
    Mail.Port = &(9:)

    Mail.SendMail

    set Mail = Nothing

    else

    Set objNewMail = CreateObject("CDONTS.NewMail")

    If StrCC <> "" Then objNewMail.Cc = StrCC

    objNewMail.From = StrAEmail
    objNewMail.To = StrEmail
    objNewMail.Subject = StrSubject
    objNewMail.Body = StrBody

    objNewMail.Send

    set objNewMail = Nothing

    end if

    Note:

    Messaging services (MAPI)

    COOL:Plex class library analogue: These patterns provide much of the same functionality as the OBMAPI class library. The message system is the backbone for all e-mail and network communication on Windows. The message system is a collection of Windows operating system objects and dynamic link libraries.

The MAPI dynamic link library is a central component in the message system. This library contains programs that serve as the glue between message stores, address books, service providers, the MAPI client, and end-user applications.

Message stores are files containing e-mail messages. Address books contain user specified e-mail address information. Service providers are software applications that are the gateways to and from the message system. Microsoft Mail, Microsoft Fax, and Microsoft Network are examples of service providers.

The messaging services in the WINAPI pattern library enable COOL:Plex applications to create and send e-mail messages through the same interface as the Microsoft Exchange client.

The messaging patterns are:

  1. How can I insert an Input field on an HTML form that shows/hides dinamically based on some parameter (input field to the Page Generator function)?

    Solution: The INPUT TYPE property on an HTML form controls how fields (elements) are displayed and its capabilitites. You need to be able to control this property by using a field that will set its value based on some logic defined on the Action Diagram of your Page Generator. Follow these steps:

    1. Define a field in your model to control the INPUT TYPE of the elements on the HTML form. In this case a field "USR Input Type 2" was created:
      USR Input Type 2 is A Narrative, length 8, values: HIDDEN, IMAGE, RADIO, TEXT, INPUT, CHECKBOX. USR Input Type 2 Impl NME InpuTyp2
    2. Modify the Page Generator function for the form where you want to control the INPUT TYPE of your fields. Add the "USR Input Type 2" field to WSYDETAILS and define the logic to set its value (for example in the Edit Point 0 Process input ):
      Based on Input Employee Number set field to display/hide Positioner field
      If Position<Employee Nbr> == WorkFields<Master User>
          Set WsyDetails<USR Input Type 2> = <USR Input Type 2.INPUT>
      Else
          Set WsyDetails<USR Input Type 2> = <USR Input Type 2.HIDDEN>
      In this example the field "Input Type 2" will be used to control displaying/hiding a Positioner field on an HTML page based on the user that logs on the system. A Master Users will allow displaying the Positioner.
    3. Modify your HTML form to have the new field control the visibility of your field (modification of INPUT TYPE)
      <!-- 07/22/02 Lucio Gayosso. Modification of HTML form to allow a field to hide/show dinamically. -->
      <INPUT TYPE="/(InpuTyp2)" NAME="IssuNumb" VALUE="0">

  2. How can I validate an Input ISO date that is placed on an HTML form (this ISO DAte also displays an initial value stored in the database)? In addition, the date format displayed for the ISO DAte on the HTML form does not correspond to the format we would like users to enter the dates.
    Solution: Convert the ISO Date to a Structure field and display the components on the HTML form in the user-friendly format. On the submission of the form validate each structure field and reconvert to ISO to store in the database

    Here are detailed steps on how to do this:


  3. How can I trigger the same Event Handler on the same HTML form passing different values for the same processing parameter? (Cool: Plex 4.5/Websydian)

    Solution: Create different JavaScripts to define the different values for the Parameter. In this example a Page Generator is invoqued through the same Event Handler that contains a Parameter ("Order Change Type") that is set through different buttons that where each defines of of the different values an Order can take: Pickup, Unpick, Cancel, and Reinstate:

    Buttons to trigger the same FORM SUBMIT operation but with different status values:

    <TABLE>
    <tr>
    <td><a href="JavaScript:bPickUp();"><img src="images/_fnavPickedUp.jpg" border="0" width="120" height="22" onMouseOver="window.status='';return true;" onMouseOut="window.status='';return true;"></a></td>
    <td><a href="JavaScript:bCancel();"><img src="images/_fnavCancelOrd.jpg" border="0" onMouseOver="window.status='';return true;" onMouseOut="window.status='';return true;"></a></td>
    <td><a href="JavaScript:bUnPick();"><img src="images/_fnavUnPick.jpg" border="0" onMouseOver="window.status='';return true;" onMouseOut="window.status='';return true;"></a></td>
    <td><a href="JavaScript:bReinstate();"><img src="images/_fnavReinstate.jpg" border="0" onMouseOver="window.status='';return true;" onMouseOut="window.status='';return true;"></a></td>
    </tr>
    </TABLE>


    JavaScripts to handle each Button request:

    <SCRIPT language="JavaScript">
    function bUnPick() {
    SelectOrder(document.OrderGrid);
    document.Process.ChngType.value="2";
    document.Process.submit();
    }

    function bCancel() {
    SelectOrder(document.OrderGrid);
    document.Process.ChngType.value="4";
    document.Process.submit();
    }

    function bPickUp() {
    SelectOrder(document.OrderGrid);
    document.Process.ChngType.value="5";
    document.Process.submit();
    }

    function bReinstate() {
    SelectOrder(document.OrderGrid);
    document.Process.ChngType.value="8";
    document.Process.submit();
    }
    </SCRIPT>

    Each script defines dfferent value for the same parameter field "Order Change Type". When a button is pressed the associated JavaScript is executed. In this example each script in turn calls another function "SelectOrder()" that takes a sinlge parameter (in this case the Grid on the form) to get the values of the row selected (see the example on how to create a selectable Grid on this page).

    After the Grid is read and the "order Change Type field" is set based on the selection made (document.Process.ChngType.value=VALUE) the form is submitted (document.Process.submit())

    When the form is submitted, the following Common Form submission Method is executed:

    <FORM METHOD="POST" ACTION="./webfulf.exe" NAME="Process">
    <INPUT TYPE="HIDDEN" NAME="WSYD_SID" VALUE="/(WSYDHIDDEN)/(WSYD_SID)">
    <INPUT TYPE="HIDDEN" NAME="WSYD_EVENT" VALUE="BB198F">
    <INPUT TYPE="HIDDEN" NAME="OrderNum" VALUE="0">
    <INPUT TYPE="HIDDEN" NAME="StoreID" VALUE="/(StoreID)">
    <INPUT TYPE="HIDDEN" NAME="CartAct" VALUE="/(CartAct)">
    <INPUT TYPE="HIDDEN" NAME="CartStat" VALUE="/(CartStat)">
    <INPUT TYPE="HIDDEN" NAME="SchPckDt" VALUE="/(WebDat2)">
    <INPUT TYPE="HIDDEN" NAME="SchPckTm" VALUE="/(WebTim2)">
    <INPUT TYPE="HIDDEN" NAME="PosOrder" VALUE="/(PosOrder)">
    <INPUT TYPE="HIDDEN" NAME="ChngType" VALUE="0">
    </FORM>

    On the Form Submission method "BB198F" is the PLEX's Implementation Name of the Event Handler that will process the request of all buttons.

  4. How can I build/send an email message that changes its contents basd on input parameters? (Plex 4.5/Websydian)

    Solution: This will require the creation of a "Template" where "replacement parameters" will be included as part of the body of the message. This will take the form of the substitution tags of the Websydian HTML forms.

    The detailed steps are:

  5. How can I create a selectable Grid without having to create Grid Events? (Grid Events code is added to each row on the Grid and a Button to trigger it must exist on each row). Cool: Plex 4.5 / Websydian 2.5

    Solution: This will require some work on the generated HTML forms.

    Example:

    <form method="post" action="./webfulf.exe" name="BBp7F">
    <input type="HIDDEN" name="WSYD_SID" value="/(WSYDHIDDEN)/(WSYD_SID)">
    <input type="HIDDEN" name="WSYD_EVENT" value="BBp7F">
    <input type="HIDDEN" name="OrderNum" value="0">
    <input type="HIDDEN" name="SkuNum" value="">
    <input type="HIDDEN" name="Size" value="">
    <input type="HIDDEN" name="ProdColor" value="">
    <input type="HIDDEN" name="WtOrderd" value="0">
    <input type="HIDDEN" name="PosOrder" value="/(PosOrder)">
    <input type="HIDDEN" name="StoreID" value="/(StoreID)">
    <input type="HIDDEN" name="SchPckDt" value="/(WebDat1)">
    <input type="HIDDEN" name="SchPckTm" value="/(WebTim1)">
    <input type="HIDDEN" name="CartAct" value="/(CartAct)">
    <input type="HIDDEN" name="ProdDs1" value="/(ProdDs1)">
    <td><a href="JavaScript:Substitute()"><IMG SRC="images/_fnavSub.jpg" border="0"></a></TD>

    Where BBp7F is the Implementation Name of the Event Handler that will trigger a new HTML Page load based on the values of the selected GRID record. The TAG <a href="JavaScript:Substitute()"> represents the call to the Substitute() function in JavaScript code.

    <SCRIPT LANGUAGE="JavaScript">

    function Substitute() {
    SelectItem(document.GRID);
    document.BBp7F.submit();
    }

    function SelectItem(form) {
    if (form.SkuNum.length)
    {
    for (Count = 0; Count < form.SkuNum.length; Count++) {
    if (form.SkuNum[Count].checked)
    break;
    }
    document.BBp7F.SkuNum.value=form.SkuNum[Count].value;
    document.BBp7F.WtOrderd.value=form.WtOrderd[Count].value;
    document.BBp7F.ProdColor.value=form.ProdColor[Count].value;
    document.BBp7F.Size.value=form.Size[Count].value;
    document.BBp7F.OrderNum.value=form.OrderNum[Count].value;
    document.BBp7F.ProdDs1.value=form.ProdDs1[Count].value;
    document.CANCEL.SkuNum.value=form.SkuNum[Count].value;
    document.CANCEL.WtOrderd.value=form.WtOrderd[Count].value;
    document.CANCEL.ProdColor.value=form.ProdColor[Count].value;
    document.CANCEL.Size.value=form.Size[Count].value;
    document.CANCEL.OrderNum.value=form.OrderNum[Count].value;
    document.NOT.SkuNum.value=form.SkuNum[Count].value;
    document.NOT.WtOrderd.value=form.WtOrderd[Count].value;
    document.NOT.ProdColor.value=form.ProdColor[Count].value;
    document.NOT.Size.value=form.Size[Count].value;
    document.NOT.OrderNum.value=form.OrderNum[Count].value;
    }
    else
    {
    document.BBp7F.SkuNum.value=form.SkuNum.value;
    document.BBp7F.WtOrderd.value=form.WtOrderd.value;
    document.BBp7F.ProdColor.value=form.ProdColor.value;
    document.BBp7F.Size.value=form.Size.value;
    document.BBp7F.OrderNum.value=form.OrderNum.value;
    document.BBp7F.ProdDs1.value=form.ProdDs1.value;
    document.CANCEL.SkuNum.value=form.SkuNum.value;
    document.CANCEL.WtOrderd.value=form.WtOrderd.value;
    document.CANCEL.ProdColor.value=form.ProdColor.value;
    document.CANCEL.Size.value=form.Size.value;
    document.CANCEL.OrderNum.value=form.OrderNum.value;
    document.NOT.SkuNum.value=form.SkuNum.value;
    document.NOT.WtOrderd.value=form.WtOrderd.value;
    document.NOT.ProdColor.value=form.ProdColor.value;
    document.NOT.Size.value=form.Size.value;
    document.NOT.OrderNum.value=form.OrderNum.value;
    }

    }

    </SCRIPT>

    Several things need to be noted:

    1. Substitute() call a function SelectItem(form) where the parameter being passed is the actual grid document.GRID. After returnign from the function BBp7F is submitted.
    2. SelectItem(form) uses a Counter to locate the Grid record the user selects
    3. A control SkuNum[Count] needs to be added to the Websydian generated HTML form (on the GRID region) to allow the end-user selection.

  6. What are the different ways that WEBSYDIAN displays information on an HTML page? What variables need to be modified to implement each one of these modes

    Solution: There are 4 ways in which WEBSYDIAN presents data on an HTML page: Read only data, Empty fields for Input, Populated fields fo Input, and Hidden fields. The variables that need to be populated on each case:

    DATA TYPE
    WHEN TO USE
    VARIABLES TO MODIFY
    Read-only fields To display data (informational use) Populate WSYDETAIS on Page Generators
    Empty fields for Input End-user data maintenance (creation) Populate WebInput on Event Handler
    Pre-loaded fields for Input End-user data maitenance (update)

    Populate WebInput on Event Handler
    Populate WSYDETAILS on Page Generator

    Hidden values To pass values from page to page or change the state of fields

    Populate Webinput on Event Handler
    Populate HIDDEN on Event Handler

    Populate WSYDETAILS on Event Handler

     

  7. When running the dispatcher for a new application deployed on the same PC used for development the following error is returned: "CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP header. The headers it return are:". No additional messages and the application does not launch. (Plex 4.5 Bld 38, Websydian 2.5, IIS as Web Server)

    Solution: Some Plex run-time file (for the tool execution) was conflicting with IIS. Just closed Plex and the application executed correctly.

    This message was generic but it could also be produced if some Plex run-time for the web application are missing. Additional information can be obtained per these Websydian notes:

    If you receive a CGI error or experience other problems when you try to run your Websydian application on a Windows-based Web Server, this might be caused by missing COOL:Plex run-time DLL's and language files. The CGI error message could e.g. be:

    The specified CGI application misbehaved by not returning a complete set of HTTP headers.
    The headers it did return are:

    Consult your COOL:Plex manual chapter 17 "Deploying Windows client application" to learn which DLL's and other files are needed in your run-time environment. These files must be copied to a folder, from where they can be loaded, e.g. the same folder where your Websydian EXE-file is located.

    Try to run the COOL:Plex Websydian application directly through NT Explorer (or a similar file browser). Then the exact name of any missing DLL's or other load problems will be reported in an error dialog box.

  8. How can I validate the structure of an email adress (Plex 4.5.0 Bld 29/Websydian 2.5)

    Solution: Use the following VBScript Source Code

    Check valid Email structure


    &(1:) = 0
    &(1:) = instr(1,&(2:),"@")
    if &(1:) > 0 then
    &(1:) = instr(1,&(2:),".")
    end if


    Where:


    &(1:) = Email Validity (FIELDS/Number)
    &(2:) = Email Address (OBMAPI/Address)


    The Source Code will check validity based on the structure: string@string.string

  9. Why does opening a Websydian Function Action Diagram takes much more than other Plex functions? (Plex 4.5 and previous versions, Websydian 3.0 and previous releases)

    Solution: Analyzis by some developers is pointing out into some of the metalogic used in the validation. Follow these thread (EDGE Forums) to update on this issue and check some proposed worked arounds: Time to open AD or time to generate


  10.  
     
     

    Do you have any problem/solution you would like to share? Send me an e-mail and I'll get it posted.
    If you found any information interesting or useful please mention it on the Guestbook on the main page of Plex world.
    If you could contribute to keep this site free, personal checks or paypal payment are gladly accepted (no matter how small the contribution)

    Developed by: Lucio Gayosso (1999-2004)





     
     


    You are visitor

    Email: l_gayosso@hotmail.com



    Home


    Background music: Tangerine Dream's "Riding the Lizard overland"

    Use the controls to Stop, Start, Play the music

     
    Listen to: R@DIO DIMENSION and let your mind fly...
    Escucha: R@DIO DIMENSION y deja a tu mente volar...