Hi all,
jdbform is very nice... but I've a complex feeling with it!
[i use 1.1.4pr1 of 2003-09-20]
I've produced a form where I use a tecnique like in
howtoChangeSelectBox.jsp example to change the contents of the form.
I've a session that loads a selectBox with particular values, then when I
change this selectBox the form is submitted to change another subform with
the correct data. [I'll put the source code at the end of this post.]

The subform displays the records of a table with a particular whereClause.

I've a table "student_grade" where every student's grade is taked from
another table named "tbl_grade".

My problem is on the select with tableData based on "tbl_grade".
The selectBox is rendered correctly with all the values of the "tableData
tbl_grade" displayed with the "decoded value", but this values aren't
matched with the record of "student_grade" contents.
So I've a long table where the contents of selectBox is the same for every
record and if i print out the coded valued (the value in the table) it is
different from "decoded value" taked from tableData.

My english is very poor, i hope you understand me.
I tried to disable caching with disableCache="true" in tableData TAG, but
i didn't have any result....

I must put this page in work in two days, I'm disperated.

Many thanx

---- PARTIAL SOURCE CODE OF THE PAGE ---
              <db:dbform
                        maxRows="*"
                        bypassNavigation="true"
                        
followUp="business_objects/navigation_test/howtoChangeSelectBox.jsp"
                        autoUpdate="false"
                        >
                         <!--- To force an reload event.
                                   This is necessary because we have no given table
                                   and needs and reload event to refetch the values of 
the
                                   select boxes!
                           -->
                           <input type="hidden" name="customEvent" value="re_0_0"/>

                           <!-- PRIMA SELECT BOX - SCELTA TEACHER - -->
                                <%
                                                String user= 
(String)session.getValue("loginName");
                                                out.println("Welcome, "+ user);
                                                /*
                                                                String 
class=(String)session.getValue("classCode");
                                                                String qry_class=new 
String("SELECT DISTINCT classcode, classcode
FROM teching_block ");
                                                                if (class==null)
                                                                {
                                                                        qry_class = 
qry_class + " WHERE         teacher = '"  + user + "'";
                                                                }
                                                                else
                                                                {

                                                                }
                                                */
                                        %>

                                <!-- SECONDA SELECT BOX - SCELTA CLASS - -->
                                        Class choice
                                        <db:select
                                                fieldName="classcode"
                                                onChange="this.form.submit();"
                                        >
                                                <db:queryData
                                                        name="ext_classcode"
                                                        query='<%=  "SELECT DISTINCT 
classcode, classcode " +
                                                                                "FROM 
teaching_block " +
                                                                                "WHERE 
teacher= '" + user +"'"
                                                                  %>'

                                                />
                                   </db:select>

                        <!---------------------------  SUB FORM
---------------------------------------------->
                        <db:dbform
                                maxRows="*"
                                
followUp="business_objects/navigation_test/howtoChangeSelectBox.jsp"
                                autoUpdate="true"
                                tableName="student_grade"
                                whereClause='<%= "WHERE classcode = '" +
                                                        
org.dbforms.util.ParseUtil.getParameter(request, "classcode", "-1")
                                                        +"'"%>'
                                >
                                <db:header>
                                        <table align="center">
                                                <tr>
                                                        <td>S.</td>
                                                        <td>S.Code</td>
                                                        <td>Class</td>
                                                        <td>Year</td>
                                                        <td>Term</td>
                                                        <td>Effort</td>
                                                        <td>Achiev.</td>
                                                        <td>Acad.year</td>

                                                </tr>
                                </db:header>
                                <db:body>
                                                <tr>
                                                        <td><db:associatedRadio 
name="r_Studentcode"/></td>
                                                        <td><db:label 
fieldName="studentcode"/></td>
                                                        <td><db:label 
fieldName="classcode"/></td>
                                                        <td><db:label 
fieldName="courseyear"/></td>
                                                        <td>
                                                                <db:select 
fieldName="term">
                                                                        <db:staticData 
name="termineFisso">
                                                                                
<db:staticDataItem key="OCT_1" value="October"/>
                                                                        
</db:staticData>
                                                                </db:select>

                                                        </td>
                                                        <td>
                                                                <db:select 
fieldName="effortgrade">
                                                                <db:queryData
                                                                        
name="ext__EF_grades"
                                                                        query='<%=  
"SELECT DISTINCT id_grade, textualnumber" +
                                                                                       
         " FROM tbl_grade " +
                                                                                       
         " WHERE gradetype = 'EF'"
                                                                                %>'
                                                                                
disableCache="true"
                                                                        />
                                                                </db:select>

                                                        </td>
                                                        <td>
                                                                <db:label 
fieldName="achievmentgrade"/>
                                                        </td>
                                                        <td>
                                                                <db:select 
fieldName="achievmentgrade">
                                                                        <db:tableData
                                                                                
name="ac_grade"
                                                                                
foreignTable="tbl_grade"
                                                                                
visibleFields="textualnumber"
                                                                                
storeField="id_grade"
                                                                                
disableCache="True"
                                                                                />
                                                                </db:select>

                                                        </td>
                                                        <td><db:label 
fieldName="academicyear"/></td>
                                                        <td><db:updateButton
followUp="/business_objects/navigation_test/howtoChangeSelectBox.jsp"
styleClass="clsButtonStyle" caption="Update"
src="/uwcad/pics/buttons/update.png"
associatedRadio="r_Studentcode" flavor="image"
caption="Save"/></td>
                                                </tr>
                                </db:body>
                                <db:footer>
                                <tr align="center">
                                        <db:updateButton
followUp="/business_objects/navigation_test/howtoChangeSelectBox.jsp"
styleClass="clsButtonStyle" flavor="image" caption="Save"/>
                                <td align="center">
                                </td>
                                </tr>
                                        </table>
                                </db:footer>
                        </db:dbform>

                </db:dbform>




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
DbForms Mailing List

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

Reply via email to