Hi list,

I want do embed some values feched from a quite complex db query, but my attempts to do it with <db:dataLabel> together with <db:queryData> were unsuccessfull. The problem is that I have to provide the fieldName attribute for the dataLabel tag, because it's used as a lookup key, although I'm not referencing the value to the certain field and I want to show some value only.

Currently, I realized the expected behaviour using JSTL taglib as following:

--code--
<db:setDataSource dataSource="ds" dbConnectionName="ds"/>
<db:dbform multipart="false" autoUpdate="false" followUp="/HC_DOCPATH_TO_DOCPATH_single.jsp" maxRows="1" tableName="HC_DOCPATH_TO_DOCPATH">
...
<db:textField id="id1" styleClass="clsInputStyle" size="22" fieldName="DOCPATH1_ID"/>
<br/>
<%
StringBuffer query = new StringBuffer();
String id;
query.append("SELECT d.ID, c.TITLE t1, d.TITLE t2 FROM HC_DOCUMENT d, HC_CATEGORY c, ");
query.append("HC_DOCUMENT_TO_CATEGORY d2c WHERE ");
query.append("d2c.DOCUMENT_ID = d.ID AND d2c.CATEGORY_ID = c.ID ");
query.append("AND d2c.ID = ");
%>
<%
try {
id = currentRow_HC_DOCPATH_TO_DOCPATH.get("DOCPATH1_ID").toString();
} catch (NullPointerException e) {
id = null;
}
%>
<% if (id != null) { %>
<sql:query var="qry" dataSource="${ds}"><%= query + id %></sql:query>
<c:forEach var="row" items="${qry.rows}" >
<c:out value='${row.t1}' /> / <c:out value='${row.t2}' />
</c:forEach>
<% } %>
--code--


I would like to know if similar result could be achieved with any of the dbform tags.

Thanks,
Dziugas



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
DbForms Mailing List


http://www.wap-force.net/dbforms

Reply via email to