use of org.apache.tapestry5.http.Link in project tapestry-5 by apache.
the class Element method getChildMarkup.
/**
* @return the concatenation of the String representations {@link #toString()} of its children.
*/
public final String getChildMarkup() {
PrintOutCollector collector = new PrintOutCollector();
writeChildMarkup(getDocument(), collector.getPrintWriter(), null);
return collector.getPrintOut();
}
use of org.apache.tapestry5.http.Link in project tapestry-5 by apache.
the class Node method toString.
/**
* Invokes {@link #toMarkup(PrintWriter)}, collecting output in a string, which is returned.
*/
@Override
public String toString() {
PrintOutCollector collector = new PrintOutCollector();
toMarkup(collector.getPrintWriter());
return collector.getPrintOut();
}
use of org.apache.tapestry5.http.Link in project tapestry-5 by apache.
the class AppComponentEventLinkTransformer method transformComponentEventLink.
public Link transformComponentEventLink(Link defaultLink, ComponentEventRequestParameters parameters) {
Link link = defaultLink.copyWithBasePath("/event");
for (String name : defaultLink.getParameterNames()) {
link.removeParameter(name);
}
Locale locale = persistentLocale.get();
if (locale != null) {
link.addParameter("x:locale", locale.toString());
}
link.addParameter("x:type", parameters.getEventType());
addEventContext(link, "x:ec", parameters.getEventContext());
addEventContext(link, "x:pac", parameters.getPageActivationContext());
link.addParameter("x:page", parameters.getActivePageName());
link.addParameter("x:id", parameters.getNestedComponentId());
if (!parameters.getActivePageName().equals(parameters.getContainingPageName()))
link.addParameter("x:container", parameters.getContainingPageName());
return link;
}
use of org.apache.tapestry5.http.Link in project tapestry-5 by apache.
the class ActionLinkTest method click_link.
@Test
public void click_link() {
tester = new PageTester(TestConstants.APP2_PACKAGE, TestConstants.APP2_NAME);
Document doc = tester.renderPage("TestPageForActionLink");
Element link = doc.getElementById("link1");
doc = tester.clickLink(link);
assertTrue(doc.toString().contains("You chose: 123"));
}
use of org.apache.tapestry5.http.Link in project tapestry-5 by apache.
the class SaxTemplateParser method classicParameter.
/**
* Handler for Tapestry 5.0's "classic" <t:parameter> element. This
* turns into a {@link org.apache.tapestry5.internal.parser.ParameterToken}
* and the body and end element are provided normally.
*/
private void classicParameter(TemplateParserState state) {
String parameterName = getSingleParameter("name");
if (InternalUtils.isBlank(parameterName))
throw new TapestryException("The name attribute of the <parameter> element must be specified.", getLocation(), null);
ensureParameterWithinComponent(state);
tokenAccumulator.add(new ParameterToken(parameterName, getLocation()));
processBody(state.insideComponent(false));
}
Aggregations