which uses the entity info as its selection value
* @param array $pageUrl the url which on which the ajax custom group load takes place
+ * @param $beforeTriggering code to execute before actual element triggering
* @return void
*/
- function customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl) {
+ function customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, $beforeTriggering = NULL) {
//add the custom set
$return = $this->addCustomGroupField($customSets);
list($entity, $entityData) = explode('_', $entityType);
$elementType = CRM_Utils_Array::value('type', $customData['triggerElement'], 'select');
$elementName = CRM_Utils_Array::value('name', $customData['triggerElement']);
+ if ($beforeTriggering) {
+ call_user_func($beforeTriggering);
+ }
if ($elementType == 'select') {
//reset the select box, so triggering of ajax only happens
//WRT input of value in this function
function testAjaxCustomGroupLoad() {
$this->webtestLogin();
+
+ $this->enableComponents(array('CiviCampaign'));
$triggerElement = array('name' => 'campaign_type_id', 'type' => 'select');
$customSets = array(
array('entity' => 'Campaign', 'subEntity' => 'Referral Program', 'triggerElement' => $triggerElement),
);
$pageUrl = array('url' => 'member/add', 'args' => 'reset=1&action=add&context=standalone');
- $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl);
+
+ //case where we should fire certain
+ //ui actions which helps triggering possible
+ $test = $this;
+ $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl,
+ function() use ($test) {
+ $test->select('membership_type_id_0', 'value=1');
+ }
+ );
}
}
\ No newline at end of file