CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 PHP - Editable Grid - Dependent List Boxes

Print topic Send  topic

Author Message
Lee Irving
Posted: 04/03/2003, 3:38 AM

I am attempting to get the following working within CCS 2.0.5.6

On the page there is an editable grid, each row in the grid has a hidden
field {SlotCode} there is also a list box which searches another table for
the list values. These list values should be the ones associated against the
slotcode.

ie
table - slottoworkshop
Slot Workshop Code Workshop
1 2 Web Workshop
1 3 PHP Coding
1 4 Greek
2 5 Indian Cooking
2 6 French

If slotcode = 1 in the first row then the list box should contain:

WebWorkshop
PHPCoding
Greek

However the next row of the grid has slotcode = 2 and then the list box
should contain:
Indian Cooking
French

I cannot use URL parameters for the slot code may be different for each row.
The contents of the list box must reflect the value of the slotcode field.

I thought that I could pick up the value of SlotCode and use this as a query
parameter somehow. I have tried Form and Application parameter types
however I cant seem to get them to work. Can anyone point me in the right
direction or maybe to documentation explaining the use of Form and
Application parameters withing the SQL where clause.

Regards

Lee




DonB
Posted: 04/03/2003, 5:16 AM

This is not what I'd call a "good" use for the editable grid. Although you
could accomplish what you have asked for, the performance would probably be
unsatisfactory. You have two choices for your request: (1) make a "round
trip" to the database for each listbox, so that you can fill it based on the
slotcode or (2) download the entire lookup list into an array or other data
structure on the clientside - then write a bunch of code (again clientside)
to populate the dropdown lists.

I would consider a design similar to the datepicker - that is, a popup
window where you can pick from that list (contents filled with data based on
the slotcode). Still this requires clientside code and the inevitable
browser-dependency issues) but it minimizes the overhead associated with
getting the lookup values.

I think I'd go with a conventional non-editable grid paired up with a
"record" form in this situation.

DonB


"Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
news:b6h6fo$tdl$1@news.codecharge.com...
> I am attempting to get the following working within CCS 2.0.5.6
>
> On the page there is an editable grid, each row in the grid has a hidden
> field {SlotCode} there is also a list box which searches another table for
> the list values. These list values should be the ones associated against
the
> slotcode.
>
> ie
> table - slottoworkshop
> Slot Workshop Code Workshop
> 1 2 Web Workshop
> 1 3 PHP Coding
> 1 4 Greek
> 2 5 Indian Cooking
> 2 6 French
>
> If slotcode = 1 in the first row then the list box should contain:
>
> WebWorkshop
> PHPCoding
> Greek
>
> However the next row of the grid has slotcode = 2 and then the list box
> should contain:
> Indian Cooking
> French
>
> I cannot use URL parameters for the slot code may be different for each
row.
> The contents of the list box must reflect the value of the slotcode field.
>
> I thought that I could pick up the value of SlotCode and use this as a
query
> parameter somehow. I have tried Form and Application parameter types
> however I cant seem to get them to work. Can anyone point me in the right
> direction or maybe to documentation explaining the use of Form and
> Application parameters withing the SQL where clause.
>
> Regards
>
> Lee
>
>
>
>
>

Lee Irving
Posted: 04/03/2003, 5:30 AM

DonB,

Thanks for the response. I would like to try the round trip and see if the
performance is acceptable, however I cannot seem to make the drop down list
dependent on the SlotCode. Any idea if the list box will work this way?

The application I am workingon will only display a few records (its a
booking system) so hopefully it will be ok. If the performance sucks then I
will then need to look at an alternative.

I was hoping to do it all server side.

Regards

Lee
"DonB" <dbweb2@premiersi.com> wrote in message
news:b6hc82$a96$1@news.codecharge.com...
> This is not what I'd call a "good" use for the editable grid. Although
you
> could accomplish what you have asked for, the performance would probably
be
> unsatisfactory. You have two choices for your request: (1) make a "round
> trip" to the database for each listbox, so that you can fill it based on
the
> slotcode or (2) download the entire lookup list into an array or other
data
> structure on the clientside - then write a bunch of code (again
clientside)
> to populate the dropdown lists.
>
> I would consider a design similar to the datepicker - that is, a popup
> window where you can pick from that list (contents filled with data based
on
> the slotcode). Still this requires clientside code and the inevitable
> browser-dependency issues) but it minimizes the overhead associated with
> getting the lookup values.
>
> I think I'd go with a conventional non-editable grid paired up with a
> "record" form in this situation.
>
> DonB
>
>
> "Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
>news:b6h6fo$tdl$1@news.codecharge.com...
> > I am attempting to get the following working within CCS 2.0.5.6
> >
> > On the page there is an editable grid, each row in the grid has a hidden
> > field {SlotCode} there is also a list box which searches another table
for
> > the list values. These list values should be the ones associated against
> the
> > slotcode.
> >
> > ie
> > table - slottoworkshop
> > Slot Workshop Code Workshop
> > 1 2 Web Workshop
> > 1 3 PHP Coding
> > 1 4 Greek
> > 2 5 Indian Cooking
> > 2 6 French
> >
> > If slotcode = 1 in the first row then the list box should contain:
> >
> > WebWorkshop
> > PHPCoding
> > Greek
> >
> > However the next row of the grid has slotcode = 2 and then the list box
> > should contain:
> > Indian Cooking
> > French
> >
> > I cannot use URL parameters for the slot code may be different for each
> row.
> > The contents of the list box must reflect the value of the slotcode
field.
> >
> > I thought that I could pick up the value of SlotCode and use this as a
> query
> > parameter somehow. I have tried Form and Application parameter types
> > however I cant seem to get them to work. Can anyone point me in the
right
> > direction or maybe to documentation explaining the use of Form and
> > Application parameters withing the SQL where clause.
> >
> > Regards
> >
> > Lee
> >
> >
> >
> >
> >
>
>

Lee Irving
Posted: 04/03/2003, 6:56 AM

DonB

As time is now pressing I am trying to do a simple grid with a form. Again
however I need the lookup to work but I cant get it to do anyhting sensible.

I have the form with the same hidden fields the important ones being
SlotCode and ConCode. In the list box I want to have the contents dependent
on the contents of these fields. So I select Table View, create the various
table links then add a where parameter type form and set it to integer and
SlotCode. This should be simple but it also refuses to work.

Any ideas ?


"DonB" <dbweb2@premiersi.com> wrote in message
news:b6hc82$a96$1@news.codecharge.com...
> This is not what I'd call a "good" use for the editable grid. Although
you
> could accomplish what you have asked for, the performance would probably
be
> unsatisfactory. You have two choices for your request: (1) make a "round
> trip" to the database for each listbox, so that you can fill it based on
the
> slotcode or (2) download the entire lookup list into an array or other
data
> structure on the clientside - then write a bunch of code (again
clientside)
> to populate the dropdown lists.
>
> I would consider a design similar to the datepicker - that is, a popup
> window where you can pick from that list (contents filled with data based
on
> the slotcode). Still this requires clientside code and the inevitable
> browser-dependency issues) but it minimizes the overhead associated with
> getting the lookup values.
>
> I think I'd go with a conventional non-editable grid paired up with a
> "record" form in this situation.
>
> DonB
>
>
> "Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
>news:b6h6fo$tdl$1@news.codecharge.com...
> > I am attempting to get the following working within CCS 2.0.5.6
> >
> > On the page there is an editable grid, each row in the grid has a hidden
> > field {SlotCode} there is also a list box which searches another table
for
> > the list values. These list values should be the ones associated against
> the
> > slotcode.
> >
> > ie
> > table - slottoworkshop
> > Slot Workshop Code Workshop
> > 1 2 Web Workshop
> > 1 3 PHP Coding
> > 1 4 Greek
> > 2 5 Indian Cooking
> > 2 6 French
> >
> > If slotcode = 1 in the first row then the list box should contain:
> >
> > WebWorkshop
> > PHPCoding
> > Greek
> >
> > However the next row of the grid has slotcode = 2 and then the list box
> > should contain:
> > Indian Cooking
> > French
> >
> > I cannot use URL parameters for the slot code may be different for each
> row.
> > The contents of the list box must reflect the value of the slotcode
field.
> >
> > I thought that I could pick up the value of SlotCode and use this as a
> query
> > parameter somehow. I have tried Form and Application parameter types
> > however I cant seem to get them to work. Can anyone point me in the
right
> > direction or maybe to documentation explaining the use of Form and
> > Application parameters withing the SQL where clause.
> >
> > Regards
> >
> > Lee
> >
> >
> >
> >
> >
>
>

Lee Irving
Posted: 04/03/2003, 7:00 AM

DonB

I have done what I needed to do with URL parameters but thanks for your
help. Do you know of any decent documentation on the Form and Application
parameter types ?

Thanks again for assistance

Regards

Lee


"Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
news:b6hi2g$nkr$1@news.codecharge.com...
> DonB
>
> As time is now pressing I am trying to do a simple grid with a form. Again
> however I need the lookup to work but I cant get it to do anyhting
sensible.
>
> I have the form with the same hidden fields the important ones being
> SlotCode and ConCode. In the list box I want to have the contents
dependent
> on the contents of these fields. So I select Table View, create the
various
> table links then add a where parameter type form and set it to integer and
> SlotCode. This should be simple but it also refuses to work.
>
> Any ideas ?
>
>
> "DonB" <dbweb2@premiersi.com> wrote in message
>news:b6hc82$a96$1@news.codecharge.com...
> > This is not what I'd call a "good" use for the editable grid. Although
> you
> > could accomplish what you have asked for, the performance would probably
> be
> > unsatisfactory. You have two choices for your request: (1) make a
"round
> > trip" to the database for each listbox, so that you can fill it based on
> the
> > slotcode or (2) download the entire lookup list into an array or other
> data
> > structure on the clientside - then write a bunch of code (again
> clientside)
> > to populate the dropdown lists.
> >
> > I would consider a design similar to the datepicker - that is, a popup
> > window where you can pick from that list (contents filled with data
based
> on
> > the slotcode). Still this requires clientside code and the inevitable
> > browser-dependency issues) but it minimizes the overhead associated with
> > getting the lookup values.
> >
> > I think I'd go with a conventional non-editable grid paired up with a
> > "record" form in this situation.
> >
> > DonB
> >
> >
> > "Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
> >news:b6h6fo$tdl$1@news.codecharge.com...
> > > I am attempting to get the following working within CCS 2.0.5.6
> > >
> > > On the page there is an editable grid, each row in the grid has a
hidden
> > > field {SlotCode} there is also a list box which searches another table
> for
> > > the list values. These list values should be the ones associated
against
> > the
> > > slotcode.
> > >
> > > ie
> > > table - slottoworkshop
> > > Slot Workshop Code Workshop
> > > 1 2 Web Workshop
> > > 1 3 PHP Coding
> > > 1 4 Greek
> > > 2 5 Indian Cooking
> > > 2 6 French
> > >
> > > If slotcode = 1 in the first row then the list box should contain:
> > >
> > > WebWorkshop
> > > PHPCoding
> > > Greek
> > >
> > > However the next row of the grid has slotcode = 2 and then the list
box
> > > should contain:
> > > Indian Cooking
> > > French
> > >
> > > I cannot use URL parameters for the slot code may be different for
each
> > row.
> > > The contents of the list box must reflect the value of the slotcode
> field.
> > >
> > > I thought that I could pick up the value of SlotCode and use this as a
> > query
> > > parameter somehow. I have tried Form and Application parameter types
> > > however I cant seem to get them to work. Can anyone point me in the
> right
> > > direction or maybe to documentation explaining the use of Form and
> > > Application parameters withing the SQL where clause.
> > >
> > > Regards
> > >
> > > Lee
> > >
> > >
> > >
> > >
> > >
> >
> >
>
>

Daniel Gaudreault
Posted: 04/03/2003, 8:50 AM

If you don't need to support anything but IE and netscape 6+(?), you can
always use JavaScript Remote Scripting.

Just Google for "JSRS", he's got an example of like drowdowns, mind you
you'll have to hack the example a lot, but in the end it may well be worth
it.

Dan


"Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
news:b6hia6$o8a$1@news.codecharge.com...
> DonB
>
> I have done what I needed to do with URL parameters but thanks for your
> help. Do you know of any decent documentation on the Form and Application
> parameter types ?
>
> Thanks again for assistance
>
> Regards
>
> Lee
>
>
> "Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
>news:b6hi2g$nkr$1@news.codecharge.com...
> > DonB
> >
> > As time is now pressing I am trying to do a simple grid with a form.
Again
> > however I need the lookup to work but I cant get it to do anyhting
> sensible.
> >
> > I have the form with the same hidden fields the important ones being
> > SlotCode and ConCode. In the list box I want to have the contents
> dependent
> > on the contents of these fields. So I select Table View, create the
> various
> > table links then add a where parameter type form and set it to integer
and
> > SlotCode. This should be simple but it also refuses to work.
> >
> > Any ideas ?
> >
> >
> > "DonB" <dbweb2@premiersi.com> wrote in message
> >news:b6hc82$a96$1@news.codecharge.com...
> > > This is not what I'd call a "good" use for the editable grid.
Although
> > you
> > > could accomplish what you have asked for, the performance would
probably
> > be
> > > unsatisfactory. You have two choices for your request: (1) make a
> "round
> > > trip" to the database for each listbox, so that you can fill it based
on
> > the
> > > slotcode or (2) download the entire lookup list into an array or other
> > data
> > > structure on the clientside - then write a bunch of code (again
> > clientside)
> > > to populate the dropdown lists.
> > >
> > > I would consider a design similar to the datepicker - that is, a popup
> > > window where you can pick from that list (contents filled with data
> based
> > on
> > > the slotcode). Still this requires clientside code and the inevitable
> > > browser-dependency issues) but it minimizes the overhead associated
with
> > > getting the lookup values.
> > >
> > > I think I'd go with a conventional non-editable grid paired up with a
> > > "record" form in this situation.
> > >
> > > DonB
> > >
> > >
> > > "Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
> > >news:b6h6fo$tdl$1@news.codecharge.com...
> > > > I am attempting to get the following working within CCS 2.0.5.6
> > > >
> > > > On the page there is an editable grid, each row in the grid has a
> hidden
> > > > field {SlotCode} there is also a list box which searches another
table
> > for
> > > > the list values. These list values should be the ones associated
> against
> > > the
> > > > slotcode.
> > > >
> > > > ie
> > > > table - slottoworkshop
> > > > Slot Workshop Code Workshop
> > > > 1 2 Web Workshop
> > > > 1 3 PHP Coding
> > > > 1 4 Greek
> > > > 2 5 Indian Cooking
> > > > 2 6 French
> > > >
> > > > If slotcode = 1 in the first row then the list box should contain:
> > > >
> > > > WebWorkshop
> > > > PHPCoding
> > > > Greek
> > > >
> > > > However the next row of the grid has slotcode = 2 and then the list
> box
> > > > should contain:
> > > > Indian Cooking
> > > > French
> > > >
> > > > I cannot use URL parameters for the slot code may be different for
> each
> > > row.
> > > > The contents of the list box must reflect the value of the slotcode
> > field.
> > > >
> > > > I thought that I could pick up the value of SlotCode and use this as
a
> > > query
> > > > parameter somehow. I have tried Form and Application parameter
types
> > > > however I cant seem to get them to work. Can anyone point me in the
> > right
> > > > direction or maybe to documentation explaining the use of Form and
> > > > Application parameters withing the SQL where clause.
> > > >
> > > > Regards
> > > >
> > > > Lee
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

Lee Irving
Posted: 04/07/2003, 4:52 AM

Code behind listbox before show. May be of use to someone out there.

global $tblconctos;

if ($tblconctos->SlotCode->Value and $tblconctos->ConCode->Value){

$SQL = "SELECT Asign, WksName
FROM tblconworkshop INNER JOIN tblconwtos ON tblconworkshop.WksCode =
tblconwtos.WorkCode
WHERE SlotCode = ". $tblconctos->SlotCode->Value . " AND tblconwtos.ConCode
= " . $tblconctos->ConCode->Value;

$tblconctos->ListBox1->Values = CCGetListValues($tblconctos->ListBox1->ds,
$SQL, "", "", $tblconctos->ListBox1->BoundColumn,
$tblconctos->ListBox1->TextColumn, "", 1);
}



"Lee Irving" <lee.irving@transcendit.co.uk> wrote in message
news:b6h6fo$tdl$1@news.codecharge.com...
> I am attempting to get the following working within CCS 2.0.5.6
>
> On the page there is an editable grid, each row in the grid has a hidden
> field {SlotCode} there is also a list box which searches another table for
> the list values. These list values should be the ones associated against
the
> slotcode.
>
> ie
> table - slottoworkshop
> Slot Workshop Code Workshop
> 1 2 Web Workshop
> 1 3 PHP Coding
> 1 4 Greek
> 2 5 Indian Cooking
> 2 6 French
>
> If slotcode = 1 in the first row then the list box should contain:
>
> WebWorkshop
> PHPCoding
> Greek
>
> However the next row of the grid has slotcode = 2 and then the list box
> should contain:
> Indian Cooking
> French
>
> I cannot use URL parameters for the slot code may be different for each
row.
> The contents of the list box must reflect the value of the slotcode field.
>
> I thought that I could pick up the value of SlotCode and use this as a
query
> parameter somehow. I have tried Form and Application parameter types
> however I cant seem to get them to work. Can anyone point me in the right
> direction or maybe to documentation explaining the use of Form and
> Application parameters withing the SQL where clause.
>
> Regards
>
> Lee
>
>
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.