1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.renderkit.html.scarborough.standard.tag;
21
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24 import org.apache.myfaces.tobago.component.Attributes;
25 import org.apache.myfaces.tobago.renderkit.LayoutComponentRendererBase;
26 import org.apache.myfaces.tobago.renderkit.util.RenderUtils;
27
28 import javax.faces.component.UIComponent;
29 import javax.faces.context.FacesContext;
30 import java.io.IOException;
31
32 public class SelectReferenceRenderer extends LayoutComponentRendererBase {
33
34 private static final Logger LOG = LoggerFactory.getLogger(SelectReferenceRenderer.class);
35
36 public void encodeEnd(FacesContext facesContext,
37 UIComponent component)
38 throws IOException {
39 String referenceId = (String)
40 component.getAttributes().get(Attributes.FOR);
41 UIComponent reference = component.findComponent(referenceId);
42
43 reference.getAttributes().put(Attributes.RENDER_RANGE_EXTERN,
44 component.getAttributes().get(Attributes.RENDER_RANGE));
45
46 RenderUtils.encode(facesContext, reference);
47
48 reference.getAttributes().remove(Attributes.RENDER_RANGE_EXTERN);
49 }
50
51 }
52