Aggregates to the supplied chain (the HTML body), the HTML code for presenting a form. This will present the whole form so everything from the opening <form> tag to the closing </form> antitag. The HTML for the form is actually vested with the form definition so generating HTML for a form reference is a matter of .... Returns: None

Return TypeFunction nameArguments
voidhdsFormref::Generate(hzChain&,hzHttpEvent*,uint32_t&,)

Declared in file: hzDissemino.h
Defined in file : hdsGenerate.cpp

Function Logic:

0:START 1:unknown 2:items 3:unknown 4:items 5:nLine 6:pFormdef 7:unknown 8:items 9: No text 10:unknown 11:x url 12:unknown 13:items 14:items 15:unknown 16:items 17:items 18:relLn pE 19:unknown 20:pVE items 21:unknown 22:items 23:unknown 24:items 25:items 26: No text

Function body:

void hdsFormref::Generate (hzChain& C)hzHttpEvent* pE, uint32_t& nLine, 
{
   //  Aggregates to the supplied chain (the HTML body), the HTML code for presenting a form. This will present the whole form so everything from the
   //  opening <form> tag to the closing </form> antitag.
   //  
   //  The HTML for the form is actually vested with the form definition so generating HTML for a form reference is a matter of ....
   //  
   //  Arguments: 1) C  The HTML output chain
   //     2) pE  The HTTP event being responded to
   //     3) nLine Line number tracker (controls NL printing)
   //  
   //  Returns: None
   _hzfunc("hdsFormref::Generate") ;
   hzList<hdsVE*>::Iter    ih ;    //  Html entity iterator
   hdsFormdef*     pFormdef ;      //  Actual form referenced
   hdsVE*          pVE ;           //  Html entity
   hzString        url ;           //  URL from hdsApp map m_FormRef2Url
   uint32_t        nV ;            //  Visual entity iterator
   uint32_t        relLn ;         //  Relative line
   uint32_t        x ;             //  Tab controller
   if (m_Line != nLine)
   {
       C.AddByte(CHAR_NL) ;
       for (x = m_Indent ; x ; x--)
           C.AddByte(CHAR_TAB) ;
       nLine = m_Line ;
   }
   pFormdef = m_pApp->m_FormDefs[m_Formname] ;
   if (!pFormdef)
   {
       C.Printf("<p>ERROR: NULL FORM DEF</p>\n") ;
       return ;
   }
   if (pFormdef->m_nActions == 1)
   {
       x = m_pApp->m_FormRef2Url.First(this) ;
       url = m_pApp->m_FormRef2Url.GetObj(x) ;
       if (m_flagVE & VE_MULTIPART)
           C.Printf("<form name=\"%s\" method=\"POST\" action=\"%s\" onsubmit=\"return ck%s()\" enctype=\"multipart/form-data\">\n",
               *m_Formname, *url, *m_Formname) ;
       else
           C.Printf("<form name=\"%s\" method=\"POST\" action=\"%s\" onsubmit=\"return ck%s()\">\n", *m_Formname, *url, *m_Formname) ;
   }
   else
   {
       if (m_flagVE & VE_MULTIPART)
           C.Printf("<form name=\"%s\" method=\"POST\" enctype=\"multipart/form-data\">\n",
               *m_Formname, *url, *url) ;
       else
           C.Printf("<form name=\"%s\" method=\"POST\">\n", *m_Formname, *url, *url) ;
   }
   relLn = nLine ;
   pE->m_pContextForm = this ;
   for (nV = 0; nV < pFormdef->m_VEs.Count() ; nV++)
   {
       pVE = pFormdef->m_VEs[nV] ; pVE->Generate(C, pE, relLn) ;
   }
   if (nLine != m_Line)
   {
       C.AddByte(CHAR_NL) ;
       for (x = m_Indent ; x ; x--)
           C.AddByte(CHAR_TAB) ;
   }
   C << "</form>\n" ;
}