Skip to content

Commit

Permalink
fix for MID-8200 (bad ordering, first set the repo/resource search an…
Browse files Browse the repository at this point in the history
…d after that create the panel)
  • Loading branch information
katkav committed Oct 12, 2022
1 parent a654e55 commit 7185f83
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ public boolean isVisible() {

@Override
public void onClick(AjaxRequestTarget target) {
updateSearchButtons(true, target, initRepoContent(ResourceContentPanel.this.getObjectWrapperModel()));
updateSearchButtons(true);
replaceContentPanel(target, initRepoContent(ResourceContentPanel.this.getObjectWrapperModel()));
}
};

Expand All @@ -304,7 +305,8 @@ public void onClick(AjaxRequestTarget target) {

@Override
public void onClick(AjaxRequestTarget target) {
updateSearchButtons(false, target, initResourceContent(ResourceContentPanel.this.getObjectWrapperModel()));
updateSearchButtons(false);
replaceContentPanel(target, initResourceContent(ResourceContentPanel.this.getObjectWrapperModel()));
}

};
Expand All @@ -313,19 +315,21 @@ public void onClick(AjaxRequestTarget target) {

}

private void updateSearchButtons(boolean repoSearch, AjaxRequestTarget target, Panel newPanel) {
private void updateSearchButtons(boolean repoSearch) {
getContentStorage(kind, SessionStorage.KEY_RESOURCE_PAGE_REPOSITORY_CONTENT).setResourceSearch(!repoSearch);
getContentStorage(kind, SessionStorage.KEY_RESOURCE_PAGE_RESOURCE_CONTENT).setResourceSearch(!repoSearch);

resourceContentSearch.getObject().setResourceSearch(!repoSearch);
this.isRepoSearch = repoSearch;
updateResourceContentSearch();

}

private void replaceContentPanel(AjaxRequestTarget target, Panel newPanel) {
Form mainForm = getMainForm();
mainForm.addOrReplace(newPanel);
target.add(mainForm);
target.add(get(ID_RESOURCE_CHOICE_CONTAINER_SEARCH));

}

private Form getMainForm() {
Expand Down

0 comments on commit 7185f83

Please sign in to comment.