There is need to show all parts of one area. I created new form PMCContractAreasDialog. When I click on specific contract line into contract form it should open new form and show all parts of one area. In sum there should be same like on contract line. But every time when I click on button form is empty. Am I missing something ?
[Form]
public class PMCContractAreasDialog extends FormRun
{
[FormObservable]
date currWorkingDate;
[FormObservable]
boolean commonAreasRead;
PMERentalObjectAreaValueCl tmpRentalAreaCl;
PMETmpRentalObjectArea tmpArea;
public void init ()
{
super();
pmcContractLine_ds.linkActive();
}
public void activate(boolean _active)
{
PMCContractArea contractArea;
AmountMST sumContractArea;
pmcContractLine_ds.readCommonAreas(pmcContractLine);
h1_h2.realValue(pmcContractLine_ds.h1_h2(pmcContractLine));
efa.realValue(pmcContractLine_ds.efa(pmcContractLine));
bfa.realValue(pmcContractLine_ds.bfa(pmcContractLine));
mfa.realValue(pmcContractLine_ds.mfa(pmcContractLine));
sumArea.realValue(h1_h2.realValue() + efa.realValue() + bfa.realValue() + mfa.realValue());
}
[DataSource]
class PMCContract
{
public int active()
{
int ret;
ret = super();
return ret;
}
}
[DataSource]
class PMCContractLine
{
public int active()
{
int ret;
ret = super();
return ret;
}
display PMEAreaCommonBuildingSum BFA(PMCContractLine _contractLine)
{
if (commonAreasRead)
{
if (_contractLine.RentalObjectId)
{
return PMERentalObjectAreaCl::getRentalObjectCommonAreaBuildingSum(_contractLine.RentalObjectId, currWorkingDate, tmpArea, false);
}
else
{
return 0;
}
}
return 0;
}
void readCommonAreas(PMCContractLine _contractLine)
{
if (!commonAreasRead)
{
if (pmcContractLine.RentalObjectId)
{
tmpRentalAreaCl = new PMERentalObjectAreaValueCl();
tmpRentalAreaCl.clear();
tmpRentalAreaCl.getRentalObjectAreas(_contractLine.RentalObjectId, PMGUser::find().currDate());
tmpArea.setTmpData(tmpRentalAreaCl.getTempTable());
commonAreasRead = true;
}
}
}
//BP Deviation Documented
display PMEAreaCommonSectionSum EFA(PMCContractLine _contractLine)
{
if (commonAreasRead)
{
if (_contractLine.RentalObjectId)
{
return PMERentalObjectAreaCl::getRentalObjectCommonAreaSectionSum(_contractLine.RentalObjectId, currWorkingDate, tmpArea, false);
}
else
{
return 0;
}
}
return 0;
}
//BP Deviation Documented
display PMEAreaTotal H1_H2(PMCContractLine _contractLine)
{
if (commonAreasRead)
{
if (_contractLine.RentalObjectId)
{
return PMERentalObjectAreaCl::getRentalObjectMainAreaSectionSum(_contractLine.RentalObjectId, currWorkingDate, tmpArea, false);
}
else
{
return 0;
}
}
return 0;
}
//BP Deviation Documented
display PMEAreaTotal MFA(PMCContractLine _contractLine)
{
if (commonAreasRead)
{
if (_contractLine.RentalObjectId)
{
return PMERentalObjectAreaCl::getRentalObjectCommonAreaFixedSum(_contractLine.RentalObjectId, currWorkingDate, tmpArea, false);
}
else
{
return 0;
}
}
return 0;
}
}
[DataSource]
class PMCContractArea
{
public void delete()
{
super();
this.updateLines();
}
public void write()
{
super();
this.updateLines();
}
void updateLines()
{
;
PMCContractArea::updateLineAreas(pmcContractArea.ContractId, pmcContractArea.RentalObjectId);
}
}
}