Listbox In Field Dependency

Hi ,

I use Field dependency to get the dynamic value . If I choose type of BizCtrl (BizCtrl is a field which contain the dynamic value) is Text , the dynamic value display ok. But  If I choose Type is Listbox , BizCtrl don't show anything. Can you help me ?

Thank

Jeny, please show the

Jeny, please show the metadata of the listbox control. Or if you can drop an email to support@phpopenbiz.org for further discussion. Thanks.

- support

Hi support In the BizForm

Hi support

In the BizForm which I post , I use Type of FieldName CurrencyId is Textarea , the value of this field display ok . But If I use Type is Listbox , it don't display anything. Can you tell me what 's wrong when I use Type Listbox in this case ?

Thanks

For Listbox, its list of

For Listbox, its list of values are from "SelectFrom". You need to set different value in control's SelectFrom or override control's GetFromList method.

- support

Here is My metadata . In

Here is My metadata . In this case ,  the value of currency_id is depended on sal_grd_code .

This is BO

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<BizDataObj Class="BizDataObj" DBName="" Description="" IdGeneration="Identity" Name="BOHrEmpBasicsalary" OtherSQLRule="" Package="hr.Pim.EmployeeInformation.Admin.Salary.test" SearchRule="" SortRule="" Table="hs_hr_emp_basicsalary">
     <BizFieldList>
        <BizField Column="hs_hr_emp_basicsalary_id" DefaultValue="" Name="Id" Type="Number"/>
       
        <BizField Column="sal_grd_code" DefaultValue="" Name="SalGrdCode" Type="Text"/>
       
<BizField Column="currency_id" DefaultValue="" Name="CurrencyId" SQLExpr="" Type="Text"/>
       
</BizFieldList>     
   <TableJoins>     
</TableJoins>
   <ObjReferences>  
   </ObjReferences>
</BizDataObj>
 

This is BizForm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<BizForm BizDataObj="BOHrEmpBasicsalary" Class="FMHrEmpBasicsalary" Description="" Name="FMHrEmpBasicsalary" Package="hr.Pim.EmployeeInformation.Admin.Salary.test" PageSize="10" SearchRule="" Title="" jsClass="jbForm">
   <DisplayModes>
   <Mode DataFormat="array" InitMode="" Name="QUERY" TemplateFile="edit.tpl"/>
      <Mode DataFormat="array" InitMode="" Name="EDIT" TemplateFile="edit.tpl"/>
      <Mode DataFormat="array" FormatStyle="" InitMode="" Name="NEW" TemplateFile="edit.tpl"/>
      <Mode DataFormat="block" FormatStyle="tbl" InitMode="" Name="READ" TemplateFile="list_salary.tpl"/>
   </DisplayModes>    
       <BizCtrlList>
        <BizCtrl DisplayMode="EDIT" DisplayName="Id" Enabled="N" FieldName="Id" Hidden="" Name="bctrl_id"/>
       
       

<BizCtrl DisplayMode="EDIT|NEW" DisplayName="Pay Grade" Enabled="" FieldName="SalGrdCode" HTMLAttr="" Name="bctrl_sal_grd_code" SelectFrom="BOHrSalaryGrade[SalGrdName:SalGrdCode]">
<EventHandler Event="onchange" Function="getCurrencyName()" FunctionType="" Name="onchange"/>
</BizCtrl>
        <BizCtrl DisplayMode="NEW" DisplayName="Currency " Enabled="" FieldName="CurrencyId" Name="bctrl_currency_id" Type="Textarea"/>
    </BizCtrlList>
   <Toolbar>
       <Control Access="WRITE" Caption="Edit" DisplayMode="READ" Enabled="" Function="EditRecord()" HTMLAttr="" Height="" Image="edit.gif" Name="btn_edit" Style="" Type="Button" Width=""/>
     
      <Control Access="WRITE" Caption="Save" DisplayMode="EDIT|NEW" Enabled="" Function="SaveRecord()" HTMLAttr="" Height="" Image="" Name="btn_save" PostAction="" Style="" Type="Button" Width=""/>
     
      <Control Access="WRITE" Caption="Delete" DisplayMode="READ" Function="DeleteRecord()" Image="delete.gif" Name="btn_delete" Style="" Type="button"/>
      <Control Access="WRITE" Caption="Cancel" DisplayMode="EDIT|NEW|QUERY" Enabled="" Function="Cancel()" HTMLAttr="" Height="" Image="" Name="btn_cancel" Style="" Type="Button" Width=""/>
      <Control Caption="New" DisplayMode="READ" Function="NewRecord()" Hidden="N" Image="new.gif" Name="btn_new" Type="Button"/>
<Control Access="" Caption="Default Query" DisplayMode="READ" Enabled="N" Function="RefreshQuery()" Image="refresh.gif" Name="btn_refresh" Required="Y" Style="" Type="button"/>     
   </Toolbar>
   <Navbar>
   <Control Access="" Caption="Last" DisplayMode="" Enabled="" Function="GotoPage(-1)" HTMLAttr="" Height="" Image="nextlast.gif" Name="btn_last" Style="" Type="Button" Width=""/>
   <Control Access="" Caption="Next" DisplayMode="" Enabled="" Function="NextPage()" HTMLAttr="" Height="" Image="next.gif" Name="btn_next" Style="" Type="Button" Width=""/>
   <Control Access="" Caption="Previous" DisplayMode="" Enabled="" Function="PrevPage()" HTMLAttr="" Height="" Image="prev.gif" Name="btn_prev" Style="" Type="Button" Width=""/>
   <Control Access="" Caption="First" DisplayMode="" Enabled="" Function="GotoPage(1)" HTMLAttr="" Height="" Image="prevfirst.gif" Name="btn_first" Style="" Type="Button" Width=""/>  
</Navbar>
</BizForm>
 

and this is  FMHrEmpBasicsalary.php

<?php

class FMHrEmpBasicsalary extends BizForm
{
     
    public function getCurrencyName()
    {   
        global $g_BizSystem;
        $recArr = array();
        $salname = $g_BizSystem->GetClientProxy()->GetFormInputs('bctrl_sal_grd_code');
        $sql = "SELECT hs_hr_currency_type.currency_name
                FROM hs_hr_currency_type INNER JOIN hs_pr_salary_currency_detail
                ON hs_hr_currency_type.currency_id = hs_pr_salary_currency_detail.currency_id
                WHERE hs_pr_salary_currency_detail.sal_grd_code = '$salname'";
        $db = $g_BizSystem->GetDBConnection();
        $resultSet = $db->query($sql);
        if ($resultSet === false) {
             $err = $db->ErrorMsg();   
             return null;
        }
       
        $this->ReadInputRecord($recArr);   
        $recArr['CurrencyId']= ''; 
        while ($sqlArr = $resultSet->Fetch())
        {
            $recArr['CurrencyId'] .= $sqlArr[0]."\n";
        }       
     
           $this->UpdateActiveRecord($recArr);
            if ($this->m_OnSortField) {
         $this->SetSortFieldFlag($this->m_OnSortField, null);
         $this->m_OnSortField = null;
         $this->GetDataObj()->ClearSortRule();
      }
   
      $this->m_ClearSearchRule = true;
      return $this->ReRender();
          
    }
}

?>

 

Please show us your metadata

Please show us your metadata configuration. Thanks.

- support