Hi
How to uncheck header checkbox from Grid(Celltable) ?
I used following CustomHeaderCheckBox and passed checkboxcell to it.
Whenever I am checked/unchecked headerCheckbox then all checkbox present in
that columns are checked/unchecked accordingly
public class CustomHeaderCheckBox extends Header<Boolean> implements
> HasText{
> private boolean value;
> private ChangeValue changeValue;
> private String text = "";
>
> public CustomHeaderCheckBox(CheckboxCell cell) {
> super(cell);
> }// end constructor
>
> @Override
> public Boolean getValue() {
> return value;
> }// end getValue
>
> @Override
> public void setText(String text) {
> if (text == null)
> text = "";
> this.text = text;
> }
>
> @Override
> public String getText() {
> return text;
> }
>
> public void setChangeValue(ChangeValue changeValue) {
> this.changeValue = changeValue;
> }
>
> @Override
> public void onBrowserEvent(Context context, Element elem,
> NativeEvent event) {
> Event evt = Event.as(event);
> int eventType = evt.getTypeInt();
> switch (eventType) {
> case Event.ONCHANGE:
> value = !value;
> if (changeValue != null)
> changeValue.changedValue(context.getColumn(), value);
> break;
> }// end switch
> super.onBrowserEvent(context, elem, event);
> }// end onBrowserEvent
>
> @Override
> public void render(Context context, SafeHtmlBuilder sb) {
> super.render(context, sb.appendEscaped(text));
> }// end render
>
> // Checkbox changed Handler
>
> public interface ChangeValue {
> void changedValue(int columnIndex, Boolean value);
> }
> }
>
Column<Record, Boolean> checkBoxColumn = new Column<Record, Boolean>(new
> CheckboxCell(true, false)) {
> @Override
> public Boolean getValue(Record object) {
> // Did some operation here
> }
>
CheckboxCell cell = new CheckboxCell();
>
CustomHeaderCheckBox customHeaderCheckBox = new CustomHeaderCheckBox(cell);
> customHeaderCheckBox.setChangeValue(new HeaderCheckBoxValueChange()); //
> handler
>
> cellTable.addColumn(checkBoxColumn, customHeaderCheckBox);
>
I want to uncheck header checkbox on pagination.
Is there any way to do it? How to ?
--
Best Regards,
Vaibhav Bhalke
<http://about.me/vaibhavbhalke>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.