Skip to content

Commit

Permalink
Add disable Binding
Browse files Browse the repository at this point in the history
  • Loading branch information
ishimoto committed Jul 14, 2012
1 parent 7046000 commit 805fcf9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<binding name="string"/>
<binding defaults="Boolean" name="isHorizontal"/>
<binding defaults="Boolean" name="mini"/>
<binding defaults="Boolean" name="disabled"/>
</wo>
</wodefinitions>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RadioButton : WOGenericElement {
name = wrapperElementID;
id = id;
value = index;
otherTagString = isCurrentItemSelected;
otherTagString = otherTagString;
}

LABEL : WOGenericContainer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.webobjects.appserver.WOContext;
import com.webobjects.woextensions.WORadioButtonMatrix;

import er.extensions.foundation.ERXStringUtilities;

@SuppressWarnings("serial")
public class ERQMRadioList extends WORadioButtonMatrix {

Expand Down Expand Up @@ -39,4 +41,18 @@ public String id() {
return wrapperElementID + String.valueOf(index);
}

public String otherTagString() {
String s = super.isCurrentItemSelected();

if(valueForBooleanBinding("disabled", false)) {
if(!ERXStringUtilities.stringIsNullOrEmpty(s)) {
s += " ";
} else {
s = "";
}
s += "disabled";
}

return s;
}
}

0 comments on commit 805fcf9

Please sign in to comment.