Skip to content

Commit

Permalink
SAK-34012 fix cancel button and missing wicket id (sakaiproject#5424)
Browse files Browse the repository at this point in the history
  • Loading branch information
steveswinsburg authored and ottenhoff committed Mar 23, 2018
1 parent 6afa6d9 commit d2fc729
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.head.OnLoadHeaderItem;
import org.apache.wicket.markup.html.WebComponent;
import org.sakaiproject.component.cover.ServerConfigurationService;
import org.sakaiproject.gradebookng.business.util.FormatHelper;
import org.sakaiproject.gradebookng.tool.panels.BasePanel;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
* Panel that renders the course grade chart
*/
public class GbCourseGradeChart extends BasePanel {
public class GbCourseGradeChart extends WebComponent {

private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h2><wicket:message key="settingspage.main.heading">Gradebook Setup</wicket:mess

<div>
<input type="button" wicket:id="submit" class="active" wicket:message="value:button.savechanges" />
<input type="button" wicket:id="cancel" wicket:message="value:button.cancel" />
<input type="submit" wicket:id="cancel" wicket:message="value:button.cancel" />
</div>
</form>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.JavaScriptHeaderItem;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.CompoundPropertyModel;
import org.sakaiproject.component.cover.ServerConfigurationService;
Expand Down Expand Up @@ -224,14 +225,15 @@ public void onError(final AjaxRequestTarget target, final Form<?> form) {
form.add(submit);

// cancel button
final AjaxButton cancel = new AjaxButton("cancel") {
final Button cancel = new Button("cancel") {
private static final long serialVersionUID = 1L;

@Override
public void onSubmit() {
setResponsePage(GradebookPage.class);
}
};

cancel.setDefaultFormProcessing(false);
form.add(cancel);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<wicket:panel>

<canvas id="gradingSchemaChart"></canvas>
<canvas wicket:id="gradingSchemaChart" id="gradingSchemaChart"></canvas>

<div>
<input type="button" class="button_color" wicket:id="done" wicket:message="value:button.done" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3 class="panel-title">
<!-- chart -->
<div>
<div wicket:id="noStudentsWithGradesMessage" class="messageInstruction">There are no students with grades</div>
<canvas id="gradingSchemaChart"></canvas>
<canvas wicket:id="gradingSchemaChart" id="gradingSchemaChart"></canvas>
</div>

<!-- stats -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public boolean isVisible() {

// chart
this.chart = new GbCourseGradeChart("gradingSchemaChart", getCurrentSiteId());
add(this.chart);
settingsGradingSchemaPanel.add(this.chart);
}

/**
Expand Down

0 comments on commit d2fc729

Please sign in to comment.