• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

dynamic JSF components question

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I can't seem to make my dynamic component appear on the page...

Here's the code in my backing bean:

UIComponent component;
/**
* @return Returns the component.
*/
public UIComponent getComponent() {
return component;
}
/**
* @param component The component to set.
*/
public void setComponent(UIComponent component) {
this.component = component;
}

public void populateComponent()
{
component = new UIPanel();
Application application = FacesContext.getCurrentInstance().getApplication();
UICommand output = (UICommand) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
output.setId("c2");
output.setValue("Test");

getComponent().getChildren().add(output);
}


public BackingBeanTest()
{
populateComponent();
}



Here's the code in my jsp page:
<f:view>
<h:form>
<BODY>
<h:panelGrid columns="4" binding="#{BackingBeanTest.component}" id="myGrid">
</h:panelGrid>
</BODY>
</h:form>
</f:view>


I dont get an error message. The component just doesn't appear on the page.. Help!
 
JP Estrada
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok i got it...

I have to add an HtmlOutputText to my commandLink for the commandLink to appear:

link.getChildren().add(otext);

 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic