このエラーが何であるかはよくわかりません。見回すと、データベース宣言と関係があるはずです。データベースのさまざまなフィールドを選択することで、ウィジェットにドロップダウンボックスを作成しようとしています。さまざまなマスクが選択され、後のページでさまざまなウィジェットを作成できるようになります。
私がエラーだと思うコードの部分は次のとおりです。
$this->build("p4a_db_source", "login")
->setTable("meetingrooms")
->addJoin("login.meetingrooms",
"login.meetingrooms.MeetingRoom = login.meetingrooms.MeetingRoom",
array('position'=>'Ident'))
->addOrder("position")
->load();
$this->setSource($this->login);
$this->firstRow();
$this->build('p4a_field','location')
->setSource('login')
->setLabel('location')
->setValue('Please Select...')
->setType('select')
->setWidth(60);
$this->weight->label->setWidth(60);
以前の質問と似た質問ですが、コードがまったく異なりますが、これは修正がはるかに簡単なはずです。助けてくれてありがとう。
Stacktrace(致命的なエラー:468行目のC:\ xampp \ htdocs \ p4a \ p4a \ objects \ widgets \ field.phpの非オブジェクトでメンバー関数getPk()を呼び出す)は、エラーが発生しているので、問題の原因が正確にわからない、
残りのコード(前のものを含む)は次のとおりです。
class main_dashboard_mask extends P4A_Base_Mask
{
public function __construct()
{
parent::__construct();
$this->setTitle("Dashboard");
$this->build('p4a_field','MeetingRooms');
$this->MeetingRooms->setLabel("This is the meeting room label");
$this->build('p4a_button', 'continue')
->setLabel('Continue?')
->implement("onclick", $this, "change");
$this->build('p4a_field','booking')
->setlabel('Viewing?')
->setType('checkbox')
->setValue(true);
$this->booking->label->setTooltip('If you are booking a meeting room, check this box');
$this->build("p4a_db_source", "login")
->setTable("meetingrooms")
->addJoin("login.meetingrooms",
"login.meetingrooms.MeetingRoom = login.meetingrooms.MeetingRoom",
array('position'=>'Ident'))
->addOrder("position")
->load();
$this->setSource($this->login);
$this->firstRow();
$this->build('p4a_field','location')
->setSource('login')
->setLabel('location')
->setValue('Please Select...')
->setType('select')
->setWidth(60);
$this->weight->label->setWidth(60);
$this->Meetingrooms();
}
private function Meetingrooms()
{
$this->build('P4A_fieldset', 'widgetframe')
->anchor($this->location)
->anchorLeft($this->booking)
->anchorLeft($this->continue)
->setLabel('Meeting Room Bookings');
}
}