Skip to content

Commit

Permalink
SAK-28966: Announcements > Reorder option not persistent on update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmw6s authored and bjones86 committed Jul 23, 2018
1 parent 14a0427 commit 1b9335c
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,14 @@ public void buildSortedContext(VelocityPortlet portlet, Context context, RunData

context.put("announcementItemRangeArray", viewValues);
}
// context.put("jsfutil", JsfUtil.this);

if (sstate.getAttribute("updating_sort") == Boolean.TRUE) {
state.setCurrentSortedBy(SORT_MESSAGE_ORDER);
state.setCurrentSortAsc(false);
sstate.setAttribute(STATE_CURRENT_SORTED_BY, SORT_MESSAGE_ORDER);
sstate.setAttribute(STATE_CURRENT_SORT_ASC, Boolean.FALSE);
sstate.setAttribute("updating_sort", Boolean.FALSE);
}

} // buildSortedContext

Expand Down Expand Up @@ -4324,6 +4331,9 @@ public void doReorderUpdate(RunData rundata, Context context)
String peid = ((JetspeedRunData) rundata).getJs_peid();
SessionState sstate = ((JetspeedRunData) rundata).getPortletSessionState(peid);

// set updating_sort state so state.getCurrentSortedBy() and state.getCurrentSortAsc() can be reset after buildSortedContext() finishes
sstate.setAttribute("updating_sort", Boolean.TRUE);

// Storing the re-ordered sequence of the announcements
if (state.getIsListVM())
{
Expand Down

0 comments on commit 1b9335c

Please sign in to comment.