01: /*
02: * Created on 21 Sep 2006
03: */
04: package uk.org.ponder.rsf.util.html;
05:
06: import uk.org.ponder.rsf.components.UIComponent;
07: import uk.org.ponder.rsf.components.UIOutput;
08: import uk.org.ponder.rsf.util.RSFUtil;
09: import uk.org.ponder.rsf.view.ViewRoot;
10:
11: public class RSFHTMLUtil {
12: public static final String ELEMENT_ID_TO_FOCUS = "elementIDToFocus";
13:
14: public static void setElementToFocus(UIComponent tofocus) {
15: ViewRoot root = RSFUtil.findViewRoot(tofocus);
16: UIOutput tofocusel = (UIOutput) root
17: .getComponent(ELEMENT_ID_TO_FOCUS);
18: if (tofocusel == null) {
19: tofocusel = UIOutput.make(root, "elementIDToFocus");
20: }
21: tofocusel.setValue(tofocus.getFullID());
22: }
23: }
|