This topic is READ ONLY
import-bot (20212) [Avatar] Offline
#1
[Originally posted by johnlatham]

Another problem? I'm afraid so....
Using GenerateHTMLForm to create a form from a DataWindow is giving some odd
results. If the column object displayed is left with an Edit Style of 'edit'
then it is being displayed in the browser as a plain text in a table. If
however a dropdownDatawindow is used as the edit style this is displayed
correctly (as a drop down list). The problem is that I want there to be edit
boxes displayed not plain text!
import-bot (20212) [Avatar] Offline
#2
Re: Problem with GenerateHTMLForm
[Originally posted by johnlatham]

AAAARRRgh! You're right. So simple yet it lost me a day or more in development
time. Well I know to check now.
import-bot (20212) [Avatar] Offline
#3
Re: Problem with GenerateHTMLForm
[Originally posted by yannick]

Post the HTML form generated by your script (the string returned by the
function) . It will make it easier for us to see what is wrong because
GenerateHTMLForm() usually works ok.


> Another problem? I'm afraid so....
> Using GenerateHTMLForm to create a form from a DataWindow is giving some odd
> results. If the column object displayed is left with an Edit Style of 'edit'
> then it is being displayed in the browser as a plain text in a table. If
> however a dropdownDatawindow is used as the edit style this is displayed
> correctly (as a drop down list). The problem is that I want there to be edit
> boxes displayed not plain text!
import-bot (20212) [Avatar] Offline
#4
Re: Problem with GenerateHTMLForm
[Originally posted by johnlatham]

I've continued to look at this and it seems that the problems occur when the
DataWindow selects from more than one table.
If I create a new DataWindow with SQLSelect and a Free Form style that
retrieves information from one table then GenerateHTMLForm works fine and
produces the correct Single Line Edit boxes. If I change the SQL data source
to include another table and pick one or two columns to include in the
DataWindow then GenerateHTMLForm will only return the new columns as text ie,
With one table ......
<FORM ACTION="df_process_user_form" METHOD=POST>
<table>
<tr>
<td CLASS=dw2>Userid:
<td CLASS=dw3><INPUT TYPE=TEXT NAME="userid_1" MAXLENGTH=30 VALUE="MARIANA">
<tr>
<td CLASS=dw2>User Name:
<td CLASS=dw3><INPUT TYPE=TEXT NAME="user_name_1" MAXLENGTH=60 VALUE="MARIANA">
<tr>

With two tables.....
<FORM ACTION="df_process_user_form" METHOD=POST>
<table>
<tr>
<td CLASS=dw2>Userid:
<td CLASS=dw3><INPUT TYPE=TEXT NAME="userid_1" MAXLENGTH=30 VALUE="MARIANA">
<tr>
<td CLASS=dw3>marine office
<td CLASS=dw3>HEALTH AND HYGIENE UNIT

As you can see from these sections of the HTML, PowerBuilder has not generated
the <input type=text....> for the second field and doesn't for all of these
additional fields.
AND, If I scrap that DataWindow and recreate it by selecting two tables from
the start then I get no Single Line Edit form components ie,
<FORM ACTION="df_process_user_form" METHOD=POST>
<table>
<tr>
<td CLASS=dw2>Userid:
<td CLASS=dw3>MARIANA
<tr>
<td CLASS=dw2>Name:
<td CLASS=dw3>HEALTH AND HYGIENE UNIT
<tr>
import-bot (20212) [Avatar] Offline
#5
Re: Problem with GenerateHTMLForm
[Originally posted by yannick]

This may sound simple, but have you checked the tab order for those fields
(that are not working). When tab is set to 0 on a column, GenerateHTMLForm()
generates a text field instead of an input.
Example tab order set to 0
<table>
<tr>
<td CLASS=dw2>User Profile for:
<td CLASS=dw3>lockheady
<tr>

Same but with tab order set to 10, so it displays an edit box instead of
static text.
<table>
<tr>
<td CLASS=dw2>User Profile for:
<td CLASS=dw3><INPUT TYPE=TEXT NAME="user_id_1" MAXLENGTH=18 VALUE="lockheady">
<tr>

Hope this solves the problem.
Yannick

> I've continued to look at this and it seems that the problems occur when the
> DataWindow selects from more than one table.
> If I create a new DataWindow with SQLSelect and a Free Form style that
> retrieves information from one table then GenerateHTMLForm works fine and
> produces the correct Single Line Edit boxes. If I change the SQL data source
> to include another table and pick one or two columns to include in the
> DataWindow then GenerateHTMLForm will only return the new columns as text
ie,
> With one table ......
> <FORM ACTION="df_process_user_form" METHOD=POST>
> <table>
> <tr>
> <td CLASS=dw2>Userid:
> <td CLASS=dw3><INPUT TYPE=TEXT NAME="userid_1" MAXLENGTH=30 VALUE="MARIANA">
> <tr>
> <td CLASS=dw2>User Name:
> <td CLASS=dw3><INPUT TYPE=TEXT NAME="user_name_1" MAXLENGTH=60<br /> VALUE="MARIANA">
> <tr>
>
> With two tables.....
> <FORM ACTION="df_process_user_form" METHOD=POST>
> <table>
> <tr>
> <td CLASS=dw2>Userid:
> <td CLASS=dw3><INPUT TYPE=TEXT NAME="userid_1" MAXLENGTH=30 VALUE="MARIANA">
> <tr>
> <td CLASS=dw3>marine office
> <td CLASS=dw3>HEALTH AND HYGIENE UNIT
>
> As you can see from these sections of the HTML, PowerBuilder has not generated
> the <input type=text....> for the second field and doesn't for all of these
> additional fields.
> AND, If I scrap that DataWindow and recreate it by selecting two tables from
> the start then I get no Single Line Edit form components ie,
> <FORM ACTION="df_process_user_form" METHOD=POST>
> <table>
> <tr>
> <td CLASS=dw2>Userid:
> <td CLASS=dw3>MARIANA
> <tr>
> <td CLASS=dw2>Name:
> <td CLASS=dw3>HEALTH AND HYGIENE UNIT
> <tr>
import-bot (20212) [Avatar] Offline
#6
Re: Problem with GenerateHTMLForm
[Originally posted by johnlatham]

On the same lines, I've just come back to this and I still can't get it to
work how I would expect. If I have a column with edit style that is a drop
down DataWindow, only the value that relates to the record is displayed in the
HTML returned by the function. I've checked the tab order and the datawindow
preview displays the full drop down list with the relevent line selected. The
HTML produced for that column is a select list, but it only has one entry.
import-bot (20212) [Avatar] Offline
#7
Re: Problem with GenerateHTMLForm
[Originally posted by johnlatham]

If anyone has any hints for this problem I could really do with them!
I'm connecting to Oracle 7.3 and making a datawindow. The main table selected
from contains codes that reference another table for their descriptions and
other details.
I've got a free form datawindow that displays the fields from the main window.
For the column object that gives the 'code' I have changed it's edit property
to be a drop down datawindow which looks at the table with the details.
The free form datawindow accepts a user id as a retieval argument. In the
datawindow preview the form is displayed correctly with a drop down list being
shown in place of the code column with the code description relevant to this
user selected.
When I user GenerateHTMLForm to return this datawindow to my browser it
displays a SELECT list for the code field but the only item in the list is the
one related to that user. I've checked that my tab values are correct.
What can I do to get a complete list? Is there something I'm doing wrong in my
datastore.Retrieve(userid) statement?
Please help.