use of org.olat.core.gui.components.form.flexible.impl.NameValuePair in project OpenOLAT by OpenOLAT.
the class URLBuilder method openXHRNoResponseEvent.
public StringOutput openXHRNoResponseEvent(StringOutput sb, String urlEnding, NameValuePair... commands) {
sb.append("o_XHRNFEvent('").append(uriPrefix);
encodeParams(sb, AJAXFlags.MODE_TOBGIFRAME);
sb.append("/");
if (StringHelper.containsNonWhitespace(urlEnding)) {
sb.append(urlEnding);
}
sb.append("'");
commandParameters(sb, commands);
// no response marker
commandParameters(sb, new NameValuePair(Window.NO_RESPONSE_PARAMETER_MARKER, Window.NO_RESPONSE_VALUE_MARKER));
return sb;
}
use of org.olat.core.gui.components.form.flexible.impl.NameValuePair in project OpenOLAT by OpenOLAT.
the class MediaCollectorComponentRenderer method render.
@Override
public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
MediaCollectorComponent cmp = (MediaCollectorComponent) source;
sb.append("<a class='o_portfolio_collector' ");
if (cmp.getItem() == null) {
ubu.buildHrefAndOnclick(sb, null, true, false, true, new NameValuePair(VelocityContainer.COMMAND_ID, "pfcollect"));
}
sb.append("><i class='o_icon o_icon-lg o_icon_eportfolio_add'> </i></a>");
}
use of org.olat.core.gui.components.form.flexible.impl.NameValuePair in project OpenOLAT by OpenOLAT.
the class FlexiTableClassicRenderer method renderHeader.
private void renderHeader(StringOutput sb, FlexiTableComponent ftC, FlexiColumnModel fcm, Translator translator) {
String header = getHeader(fcm, translator);
sb.append("<th");
// append sort key to make column width set via css
if (fcm.getSortKey() != null) {
sb.append(" class='o_col_").append(fcm.getSortKey()).append("'");
}
sb.append(">");
// sort is not defined
if (!fcm.isSortable() || fcm.getSortKey() == null) {
sb.append(header);
} else {
FlexiTableElementImpl ftE = ftC.getFlexiTableElement();
Boolean asc = null;
String sortKey = fcm.getSortKey();
SortKey[] orderBy = ftE.getOrderBy();
if (orderBy != null && orderBy.length > 0) {
for (int i = orderBy.length; i-- > 0; ) {
if (sortKey.equals(orderBy[i].getKey())) {
asc = new Boolean(orderBy[i].isAsc());
}
}
}
Form theForm = ftE.getRootForm();
if (asc == null) {
sb.append("<a class='o_orderby' href=\"javascript:").append(FormJSHelper.getXHRFnCallFor(theForm, ftC.getFormDispatchId(), 1, true, true, true, new NameValuePair("sort", sortKey), new NameValuePair("asc", "asc"))).append("\">");
} else if (asc.booleanValue()) {
sb.append("<a class='o_orderby o_orderby_asc' href=\"javascript:").append(FormJSHelper.getXHRFnCallFor(theForm, ftC.getFormDispatchId(), 1, true, true, true, new NameValuePair("sort", sortKey), new NameValuePair("asc", "desc"))).append("\">");
} else {
sb.append("<a class='o_orderby o_orderby_desc' href=\"javascript:").append(FormJSHelper.getXHRFnCallFor(theForm, ftC.getFormDispatchId(), 1, true, true, true, new NameValuePair("sort", sortKey), new NameValuePair("asc", "asc"))).append("\">");
}
sb.append(header).append("</a>");
}
sb.append("</th>");
}
use of org.olat.core.gui.components.form.flexible.impl.NameValuePair in project openolat by klemens.
the class SelectSectionsCellRenderer method render.
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
if (cellValue instanceof SharedItemRow) {
SharedItemRow itemRow = (SharedItemRow) cellValue;
List<AssessedBinderSection> sections = itemRow.getSections();
if (sections != null && sections.size() > 0) {
FlexiTableElementImpl ftE = source.getFlexiTableElement();
String id = source.getFormDispatchId();
Form rootForm = ftE.getRootForm();
boolean expand = itemRow.isExpandSections();
for (int i = 0; i < sections.size(); i++) {
if (i > 0) {
if (expand)
target.append("<br />");
else
target.append(" | ");
}
NameValuePair pair1 = new NameValuePair("select-section", Integer.toString(row));
NameValuePair pair2 = new NameValuePair("section", Integer.toString(i));
String jsCode = FormJSHelper.getXHRFnCallFor(rootForm, id, 1, true, true, pair1, pair2);
target.append("<a href=\"javascript:").append(jsCode).append(";\"").append(">");
if (expand) {
target.append(StringHelper.escapeHtml(sections.get(i).getSectionTitle()));
} else {
target.append(i + 1);
}
target.append("</a>");
}
NameValuePair pair = new NameValuePair("expand-section", Integer.toString(row));
String jsCode = FormJSHelper.getXHRFnCallFor(rootForm, id, 1, true, true, pair);
target.append(" <a href=\"javascript:").append(jsCode).append(";\"").append(">");
if (itemRow.isExpandSections()) {
target.append("<i class='o_icon o_icon-sm o_icon_expand'> </i>");
} else {
target.append("<i class='o_icon o_icon-sm o_icon_compress'> </i>");
}
target.append("</a>");
}
}
}
use of org.olat.core.gui.components.form.flexible.impl.NameValuePair in project openolat by klemens.
the class MediaCollectorComponentRenderer method render.
@Override
public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) {
MediaCollectorComponent cmp = (MediaCollectorComponent) source;
sb.append("<a class='o_portfolio_collector' ");
if (cmp.getItem() == null) {
ubu.buildHrefAndOnclick(sb, null, true, false, true, new NameValuePair(VelocityContainer.COMMAND_ID, "pfcollect"));
}
sb.append("><i class='o_icon o_icon-lg o_icon_eportfolio_add'> </i></a>");
}
Aggregations