Skip to content

Commit 26095ad

Browse files
committed
checkbox bug fixed
1 parent 364809a commit 26095ad

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

Ajax/semantic/html/collections/form/HtmlForm.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,17 @@ public function submitOn($event,$identifier,$url,$responseElement){
224224
return $this;
225225
}
226226

227+
public function submitOnClick($identifier,$url,$responseElement){
228+
return $this->submitOn("click", $identifier, $url, $responseElement);
229+
}
230+
231+
public function addSubmit($identifier,$value,$CssStyle=NULL,$url=NULL,$responseElement=NULL){
232+
$bt=$this->addButton($identifier, $value,$CssStyle);
233+
if(isset($url) && isset($responseElement))
234+
$this->submitOnClick($identifier, $url, $responseElement);
235+
return $bt;
236+
}
237+
227238
/**
228239
* Callback on each valid field
229240
* @param string $jsCode

Ajax/semantic/html/collections/form/HtmlFormFields.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static function radios($name, $items=array(), $label=NULL, $value=null, $
101101
foreach ( $items as $val => $caption ) {
102102
$itemO=new HtmlFormRadio($name."-".$i++, $name, $caption, $val, $type);
103103
if ($val===$value) {
104-
$itemO->getField()->getField()->setProperty("checked", "");
104+
$itemO->getField()->setProperty("checked", "");
105105
}
106106
$fields[]=$itemO;
107107
}

Ajax/semantic/html/collections/form/traits/CheckboxTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait CheckboxTrait {
99
public abstract function addToPropertyCtrl($name, $value, $typeCtrl);
1010

1111
public function setType($checkboxType) {
12-
return $this->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants());
12+
return $this->getHtmlCk()->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants());
1313
}
1414

1515
/**
@@ -34,9 +34,9 @@ public function attachEvents($events=array()) {
3434
public function getField(){
3535
return $this->content["field"]->getField();
3636
}
37-
37+
3838
public function getHtmlCk(){
3939
return $this->content["field"];
4040
}
41-
41+
4242
}

Ajax/semantic/traits/SemanticHtmlModulesTrait.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Ajax\semantic\traits;
44

5-
use Ajax\semantic\html\collections\form\HtmlFormCheckbox;
65
use Ajax\semantic\html\base\constants\CheckboxType;
76
use Ajax\semantic\html\modules\HtmlRating;
87
use Ajax\semantic\html\modules\HtmlProgress;
@@ -26,7 +25,7 @@ public abstract function addHtmlComponent($htmlComponent);
2625
* @return HtmlCheckbox
2726
*/
2827
public function htmlCheckbox($identifier, $label=NULL, $value=NULL, $type=NULL) {
29-
return $this->addHtmlComponent(new HtmlFormCheckbox($identifier, $label, $value, $type));
28+
return $this->addHtmlComponent(new HtmlCheckbox($identifier, $label, $value, $type));
3029
}
3130

3231
/**

0 commit comments

Comments
 (0)