1

このエラーが何であるかはよくわかりません。見回すと、データベース宣言と関係があるはずです。データベースのさまざまなフィールドを選択することで、ウィジェットにドロップダウンボックスを作成しようとしています。さまざまなマスクが選択され、後のページでさまざまなウィジェットを作成できるようになります。

私がエラーだと思うコードの部分は次のとおりです。

$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');
}

}
4

3 に答える 3

1

私はあなたがオブジェクトを取得していないと思います。そのため、非オブジェクトのエラーが発生します。getPk()メソッドを呼び出しているオブジェクトを出力するだけです。有効なオブジェクトの場合は、そのメソッドのみを呼び出します。

于 2012-10-23T11:25:46.867 に答える
1

私はそれを手に入れました、申し訳ありませんが私は正しい場所を探していましたが、私が間違っていた場所がわかりませんでした...

コードがあった前の場所->

 $this->setSource($this->login);
$this->firstRow();
$this->build('p4a_field','location')
->setSource('login') // <- this is the error(the Pk variable hasn't been set here)
->setLabel('location')
->setValue('Please Select...')
->setType('select')     
->setWidth(60);
$this->weight->label->setWidth(60);
$this->Meetingrooms();

修正は->

 ->setSource($this->login)

助けてくれてありがとう=]

于 2012-10-23T14:06:12.410 に答える
0

完全なスタックトレースがありますか?このエラーを正確に生成するコード行は何ですか?

$object->getPk()とにかく、が呼び出されるコードを見つける必要があります。エラーは、..である関数->getPk()を使用しようとしていることを意味します。$objectnull

于 2012-10-23T11:25:36.343 に答える