0

An outputpanel (primefaces 3.4.1) have binding attribute

<p:outputPanel layout="block" autoUpdate="true" binding="#{bean.outputPanel}"/>

In the bean htmlInputText created dynamically and attached with outputpanel

Outputpanel Getter method

private OutputPanel outputPanel=new OutputPanel();

public final OutputPanel getOutputPanel() {
        outputPanel = (OutputPanel) app
                .createComponent(OutputPanel.COMPONENT_TYPE);
        return outputPanel;
    }

htmlInputText Binding

outputPanel.getChildren().add(new HTMLInputText());

This generates a inputtext perfectly but after creating a inputtext if I refresh the page its getting disappeared. Even for an ajax request if I update the outputpanel components getting disappeared.

Vasil Lukach
  • 3,658
  • 3
  • 31
  • 40
Brahma Krish
  • 51
  • 2
  • 8
  • Why do you need to create components dynamically? – Luiggi Mendoza Apr 23 '13 at 04:57
  • i am creating gui editor like dotnet, while drag and drop i need to create components dynamically – Brahma Krish Apr 23 '13 at 05:03
  • If I were you, I would use plain HTML instead of creating JSF components on the fly. – Luiggi Mendoza Apr 23 '13 at 05:14
  • plain html how you render on jsf page according to my company jsf our framework but i am allowed to use html components(on the fly only) but the page should be .xhtml – Brahma Krish Apr 23 '13 at 05:18
  • You can use plain HTML on Facelets i.e. `
    `. Note that you can use plain HTML to help building your site. If you really *need* to use JSF, then you can use `jsfc` attribute as shown here: [Should I use Facelets “jsfc” attribute?](http://stackoverflow.com/q/2337908/1065197). Still, I don't think JSF is the technology for this purpose.
    – Luiggi Mendoza Apr 23 '13 at 05:25
  • Thanks for the help but using jsfc i can render a html component as a jsf component is that right in that case i am actually rendering jsf components thats not the problem but why its getting disappeared – Brahma Krish Apr 23 '13 at 05:39
  • As I've said at the end of my last comment, I don't think JSF is the right technology for the task at hand. Note that there is no silver bullet technology that will work on everything you think it could. By the way, in the end you will only have a giant String of HTML (and possibly CSS) code that you can easily render using ``. – Luiggi Mendoza Apr 23 '13 at 05:41
  • thanks Luiggi Mendoza i tried when i was start the project. Any way thanks for your help friend. – Brahma Krish Apr 23 '13 at 05:47
  • can you suggest some technologies to obtain this task – Brahma Krish Apr 23 '13 at 05:51
  • 1
    AFAIK, JavaScript/jQuery. – Luiggi Mendoza Apr 23 '13 at 06:02

0 Answers0