I am having trouble passing parameters to page link while creating Tree with
click-able links. This is how my code look like.
1) I have Pojo ValueWrapper which has two member variables label and
pageName. Constructor of ValueWrapper takes label and pagename. I have one
RootNode with ValueWrapper("ROOT", null) and then i am appending many
children node which has clickable links. The Tree component I have created
using tapestry Tree component looks like this.
public class PortalAccessTree extends UserSessionManagement {
@InjectComponent
private Tree tree;
@SuppressWarnings("unused")
@Persist
@Property
private ValueWrapper valueWrapper;
@SetupRender
void initializeValue() throws VCloudException
{
if(getUser().getRootNode().getChildren().size() == 0) {
PortalHelperUtil.prepareAccessTree(getUser().getRootNode(),
getUser().getPrimaryUser().getCloudManagerUsers());
}
}
public TreeModel<ValueWrapper> getValueWrapperModel() {
ValueEncoder<ValueWrapper> encoder = new
ValueEncoder<ValueWrapper>() {
public String toClient(ValueWrapper value) {
return value.getUuid();
}
public ValueWrapper toValue(String clientValue) {
return getUser().getRootNode().seek(clientValue);
}
};
return new DefaultTreeModel<ValueWrapper>(encoder, new
ValueWrapperTreeModelAdapter(), getUser().getRootNode().getChildren());
}
/**
* Clear Action link on PortalAccessTree.tml invokes this method.
*/
void onActionFromClear() {
tree.clearExpansions();
}
}
2) I have 3 pages in code.
* OrganizationPage
* OrganizationUsagePage
* OrganizationReportPage
3) What I want to do is pass parameters to the page link which I tried by
doing this.
ValueWrapper("Manage Org", "OrganizationPage" + "?orgId=1");
When i start my application and try to expand tree. It immediately
gives me error message saying
page cannot be found with pageName "organizationpage?orgId=1".
If I do this ValueWrapper("Manage Org", "OrganizationPage"); that
works perfectly fine but then I don't know how to pass orgId to
OrganizationPage in that case.
4) My OrganizationPage contains proper definition to accept request
parameter.
@Property
@ActivationRequestParameter("orgId")
private String orgId;
I want to pass parameters to the clickable link which should take me to my
desired tapestry page with request parameter/value passed on it. Is it
possible to do so? I couldn't find a single example on Tapestry Tree which
does that.
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/Tapestry-Tree-Links-with-parameter-tp5714100.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]