Dear All,
I have a very strange problem with dbforms2.5.
I'm upgrading my production system from the dbforms2.5snapshot of December 2004
to the final release.
I enclose to this mail my JSP page and 2 pieces of my dbforms config.
I have also created a similar example on bookstore (but in that case all the
things run well)...
I could send you also that files to extend the "tests" folder...
I have the main form that uses two searchCombos to search (1) a student and (2)
an academic year.
The subform is related to the first one through (studentcode,academicyear)
attribs.
The problem is that when I select a student from the searchCombo my database
(postgresql) logs this two queries:
(1) For the MAIN FORM:
SELECT studentcode, lastname, firstname, courseyear, academicyear
FROM enrolment_pinfo WHERE ( ( (studentcode = 'AD03MROS' AND
academicyear = 2003 ) ) )
[this is as expected the query to extract a specific student in a
specific academic year.
(2) The strange thing is that for the SUBFORM:
SELECT studentcode, academicyear, subjectlevel, subject, date_start,
date_end, updatedate, lastusermod
FROM study_plan WHERE ( ( ( academicyear = 2003 ) ) )
[in this case dbform loses the studentcode part in the whereString]
The very strange thing is that the December Version (of course 29 december 2004)
is ok and works well with the same page simply
using the "old" jar file.
Is this a bug? Is this a problem related to my form or related to the use of
search fields?
I created a "similar" example for bookstore but in that case I'm not able to
generate the same situation....
(Henner or other developers do you need it? I could zip it and send to you the
hsqldb file, jsp and dbforms-config.xml).
Has anyone an idea? Now I will restore my configuration with the December
version, but I would like to solve this issue...
Thank you.
Ivan
######################### MY JSP FILE
###########################################
<%
String GLOBAL_AcademicYear="2004";
%>
<db:style part="begin" template="menuTemplate"/>
<!-- ========================= INIZIO INTESTAZIONE DATI PERSONALE STUDENTE +
RICERCA ======================================= -->
<db:dbform
maxRows="1"
followUp="
/business_objects/subject_activity/subject_management/study_plan/study_plan_editor.jsp"
tableName="enrolment_pinfo"
captionResource="true"
>
<db:header>
<table>
<tr>
<td>Select student</td>
<td>Select year</td>
</tr>
<tr>
<td><db:searchCombo
fieldName="studentcode"
style="width:400px"
onChange="this.form.submit()"
customEntry="--,Not selected,true"
>
<db:queryData
name="query"
query='<%="select studentcode, studentcode||'-'||lastname || ' ' ||
firstname as name from enrolment_pinfo where academicyear=" +
GLOBAL_AcademicYear %>'
disableCache="true" />
</db:searchCombo>
</td>
<td><db:searchCombo
fieldName="academicyear"
>
<db:staticData name="lstyear">
<db:staticDataItem key="2004"
value="2004"/>
<db:staticDataItem key="2003"
value="2003"/>
</db:staticData>
</db:searchCombo>
</td>
</tr>
<tr>
<td colspan=2 align="center">
<db:label fieldName="lastname" /> <db:label
fieldName="firstname"/> (<db:label fieldName="studentcode"/>)
</td>
</tr>
</db:header>
<db:body>
<!-- ========================= subform FORM START
======================================= -->
<db:dbform
tableName="study_plan"
childField="studentcode,academicyear"
parentField="studentcode,academicyear"
captionResource="true"
maxRows="*"
>
<db:header>
<table bgcolor="#eeeeee">
<tr><td colspan=4>
<db:navNewButton
styleClass="button"
caption="New"
showAlwaysInFooter="false"/>
</td>
</tr>
</table>
<table bgcolor="#ffffff" >
<tr class="clsHeaderDataTableRow" >
<td width="60px">S</td>
<td
width="60px">Academic<br>Year</td>
<td width="60px">Subject</td>
<td width="60px">Level</td>
<td
width="60px">Start<br>Date</td>
<td
width="60px">End<br>Date</td>
</tr>
</db:header>
<db:body allowNew="true">
<tr class="clsEvenDataTableRow" >
<td align="center">
<db:updateButton
caption="Save" styleClass="button"/><br/>
<db:insertButton
showAlways="false" caption="Save" styleClass="button"/>
<db:deleteButton
caption="Delete"
styleClass="button" confirmMessage="alert.delete" />
</td>
<td align="center">
<db:label
fieldName="academicyear" nullFieldValue="" pattern="####"/>
<db:textField
hidden="true" fieldName="academicyear"/>
</td>
<td align="center">
<db:label
fieldName="studentcode" />
<db:label
fieldName="subject" />
</td>
<td align="center">
<db:label
fieldName="subjectlevel" />
</td>
</tr>
</db:body>
<db:footer/>
</db:dbform>
</db:body>
<db:footer/>
</db:dbform>
############################################################################
My tables in dbforms-config.xml
<!-- STUDY_PLAN -->
<table name="study_plan">
<field name="studentcode" fieldType="varchar" size="10"
isKey="true"/>
<field name="academicyear" fieldType="int" isKey="true"/>
<field name="subjectlevel" fieldType="varchar" size="1"
isKey="true"/>
<field name="subject" fieldType="varchar" size="5"
isKey="true"/>
<field name="date_start" fieldType="date" isKey="true"/>
<field name="date_end" fieldType="date"/>
<field name="updatedate" fieldType="varchar" size="15"/>
<field name="lastusermod" fieldType="varchar" size="15"/>
</table>
<!-- ENROLMENT_PINFO -->
<table name="enrolment_pinfo">
<field name="studentcode" fieldType="char" size="10"
isKey="true"/>
<field name="lastname" fieldType="varchar" size="50"
sortable="true"/>
<field name="firstname" fieldType="varchar" size="50"
sortable="true"/>
<field name="courseyear" fieldType="int" />
<field name="academicyear" fieldType="int" isKey="true"/>
</table>
-----------------------
Ivan Codarin
-----------------------
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
DbForms Mailing List
http://www.wap-force.net/dbforms