- Create a component named imageretrieval by right clicking on any project (here am taking a geometrixx-outdoors project as my project)
- Create a dialog as shown below node structure.
- the dialog finally results as shown below
- imageretrieval.jsp code snippet (have added both scriptlet and JSTL way of retrieving)
<%–
image retrieval component.
–%>
<%
%><%@include file=”/libs/foundation/global.jsp”%><%
%><%@page session=”false” %><%
%>
<b>::This is simple test to hide/show image from dialog box::</b><!– JSP Scriplet Style of retrieval –>
<%
boolean isChecked = properties.get(“showimage”, false);
String imgpath = properties.get(“imgpath”, “”);
//out.println(isChecked);
//out.println(imgpath);
//write the scriplet code if conditions for retrieval of dialog values and display image in page
%><!– JSTL code which displays the image based on the dialog selection –>
</br>
<c:if test=”${properties.showimage}”>
<c:if test=”${not empty properties.imgpath}”>
<img src=’${properties.imgpath}’ alt=”Smiley face” width=”100″ height=”100″>
</c:if>
</c:if> - Finally drag and drop the component into any geometrixx-outdoors page and edit the dialog to see the functionality result