01: package simpleorm.simplewebapp.core;
02:
03: import simpleorm.simplewebapp.core.WFieldGroup;
04: import simpleorm.simplewebapp.context.WPageContext;
05: import simpleorm.simplewebapp.core.WMenuItemGlobal;
06:
07: /**
08: * The FieldGroup that contains the fields in the body of a list.<p>
09: * There can be multiple WPageletLists, but each one contains exactly one WFieldGroupList
10: * see WPageEvents.onListRow()
11: */
12: public class WFieldGroupList extends WFieldGroup {
13:
14: public WFieldGroupList(String name) {
15: super (name);
16: }
17:
18: public void setAnchorHRefFields(WField... fields) { // Maybe move later
19: //WMenuItemGlobal pitem = getPage().getPageStructure().getPageItem();
20: WPageletList plet = (WPageletList) getPagelet();
21: WPageContext ctx = getPage().getPageContext();
22: WMenuItemGlobal refedItem = plet.getListCrudItem();
23: if (refedItem != null) {// ie. nowhere to go
24: String url = refedItem.getAbsoluteUrl(getPage());
25: //String from = pitem.getAbsoluteUrl(getPage());
26: //url = ctx.addParameterToUrl(url, "_W_Referer", from + "");
27: for (WField inner : fields)
28: url = ctx.addParameterToUrl(url, inner.getHtmlName(),
29: inner.getValue() + "");
30: for (WField outer : fields)
31: outer.setAnchorHRef(url);
32: }
33: }
34: }
|