I’m trying to make Widgets using P4A Application framework and i have a reflectively sound code up to the last mask, This should make a widget that produces gives the user the ability to move to another mask which should perform a different function, the error origionates from line 28 where the code is;
->load($this->locations);
I believe its extending the class but i am unsure, any help… the rest of the code is as follows
class main_dashboard_mask extends P4A_Base_Mask
{
public $locations = array(
array('value'=>'area1','description'=>'area one'),
array('value'=>'area2','description'=>'area two'),
array('value'=>'area3','description'=>'area three'),
);
public function __construct()
{
parent::__construct();
$p4a = p4a::singleton();
$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_Array_Source", "location")
->getPk("value")
->load($this->locations);
$this->build('p4a_field','location')
->setLabel('location')
->setValue('area1')
->setType('select')
->setSource($this->location)
->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');
}
}
any help would be appreciated =].
Okay try this, it might be better for you.
here’s the code:
good luck 🙂
thanks for accepting my brilliance xx