use of org.apache.tapestry5.annotations.SetupRender in project tapestry-5 by apache.
the class RenderableProvider method setup.
@SetupRender
void setup() {
Renderable r = new Renderable() {
public void render(MarkupWriter writer) {
writer.element("strong");
writer.write("A message provided by the RenderableProvider component.");
writer.end();
}
};
environment.push(Renderable.class, r);
}
use of org.apache.tapestry5.annotations.SetupRender in project tapestry-5 by apache.
the class ImportWorker method processClassAnnotationAtSetupRenderPhase.
private void processClassAnnotationAtSetupRenderPhase(PlasticClass componentClass, MutableComponentModel model) {
Import annotation = componentClass.getAnnotation(Import.class);
if (annotation != null) {
PlasticMethod setupRender = componentClass.introduceMethod(TransformConstants.SETUP_RENDER_DESCRIPTION);
decorateMethod(componentClass, model, setupRender, annotation);
model.addRenderPhase(SetupRender.class);
}
}
use of org.apache.tapestry5.annotations.SetupRender in project tapestry-5 by apache.
the class ExceptionDisplay method setupRender.
void setupRender() {
ExceptionAnalysis analysis = analyzer.analyze(exception);
stack = analysis.getExceptionInfos();
}
use of org.apache.tapestry5.annotations.SetupRender in project tapestry-5 by apache.
the class GridRows method setupRender.
void setupRender() {
GridDataSource dataSource = gridModel.getDataSource();
int numberOfRowsRequiredToShowCurrentPage = 1 + (currentPage - 1) * rowsPerPage;
int numberOfRowsRequiredToFillCurrentPage = currentPage * rowsPerPage;
int availableRowsWithLimit = dataSource.getAvailableRows(numberOfRowsRequiredToFillCurrentPage);
if (numberOfRowsRequiredToShowCurrentPage > availableRowsWithLimit) {
int maxPages = ((availableRowsWithLimit - 1) / rowsPerPage) + 1;
currentPage = maxPages;
}
startRow = (currentPage - 1) * rowsPerPage;
endRow = Math.min(availableRowsWithLimit - 1, startRow + rowsPerPage - 1);
dataRowIndex = startRow;
boolean recordingStateInsideForm = !volatileState && formSupport != null;
recordStateByIndex = recordingStateInsideForm && (encoder == null);
recordStateByEncoder = recordingStateInsideForm && (encoder != null);
}
use of org.apache.tapestry5.annotations.SetupRender in project tapestry-5 by apache.
the class AjaxFormLoop method setupRender.
void setupRender(MarkupWriter writer) {
pushContext();
iterator = source == null ? Collections.EMPTY_LIST.iterator() : source.iterator();
Link removeRowLink = resources.createEventLink("triggerRemoveRow", context);
Link injectRowLink = resources.createEventLink("injectRow", context);
injectRowLink.addParameter(RequestConstants.FORM_CLIENTID_PARAMETER, formSupport.getClientId());
injectRowLink.addParameter(RequestConstants.FORM_COMPONENTID_PARAMETER, formSupport.getFormComponentId());
// Fix for TAP5-227 - AjaxFormLoop dont work well inside a table tag
Element element = writer.getElement();
this.wrapper = element.getAttribute("data-container-type") != null || element.getAttribute("data-remove-row-url") != null || element.getAttribute("data-inject-row-url") != null ? writer.element("div") : null;
writer.attributes("data-container-type", "core/AjaxFormLoop", "data-remove-row-url", removeRowLink, "data-inject-row-url", injectRowLink);
}
Aggregations