Hello,
With this code, I am able to return one image based off of a dropdown selection. Any ideas on how to return multiple images (I have attempted to create an ArrayList with the images and use the UI:Repeat tag to render it back to my view, but I was unsuccessful. Here is my current code now, which works but only returns one image. Any ideas on what approach to take to get more than one image?
Java Code:
(Person class has attribute: private String theImage;)
public String getTheImage(){
if(this.theSchoolChoice.equals("University of Alabama")){
theImage = "/resources/gfx/UofALogo.png";
}
if(this.theSchoolChoice.equals("Harvard University")){
}
return theImage;
}
JSF Code:
<h:selectOneMenu value="#{person.theSchoolChoice}" style="width : 179px; height : 21px;">
<f:selectItems value="#{person.theOptions}"/>
</h:selectOneMenu>
<h:outputLabel value=" "/>
<h:commandButton action="submit" value="Get templates" style="FONT-SIZE: medium; FONT-FAMILY: 'Rockwell';width : 128px; height : 25px;">
<f:ajax event="change" render="image" />
</h:commandButton>
<br></br>
<br></br>
<h:graphicImage id="image" value="#{person.theImage}"/>