on 05-18-2011 1:41 PM
I do some code on load a FORM from srf file and get trouble in catch the event for et_FORM_LOAD.
pls help to check my code and figure out my root cause:
(1) srf file
<Application>
<forms>
<action type="add">
<form appformnumber="-1"
FormType="-1" type="4" BorderStyle="4"
uid="Z_PUR_PoExportForm"
(2) code for menu
class PoExportMenus : B1XmlFormMenu
{
private static readonly string FORM_XML_FILE = "PoExportForm.srf";
private static readonly string MENU_UID = "Z_PUR_PoExportMenu";
public PoExportMenus() : base()
{
MenuUID = MENU_UID;
LoadXml(FORM_XML_FILE);
}
[B1Listener(BoEventTypes.et_MENU_CLICK, false)]
public virtual void OnAfterMenuClick(MenuEvent pVal)
{
LoadForm();
}
}
(3) AddOn Form event process
class PoExportForm : B1Form
{
public PoExportForm() : base()
{
this.FormType = "Z_PUR_PoExportForm";
}
[B1Listener(BoEventTypes.et_FORM_LOAD, true)]
public virtual bool OnBeforFormLoad(ItemEvent pVal)
{
SAPbouiCOM.Form oForm = B1Connections.theAppl.Forms.Item(pVal.FormUID);
// ADD YOUR ACTION CODE HERE ...
System.Windows.Forms.MessageBox.Show("OK");
return true;
}
}
when I debug my AddOn code, I can not see a window popup the OK message.
Should I put the processing code by B1Event instead of B1Form?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.