Help with Dynamic Dropdown List
Hi everyone,
I'm completely new to this, so I hope you will excuse my lack of knowledge.
I need to add a dropdown menu on a page. The dropdown will display a list of all the state names in the U.S. When the person selects a particular state, the access numbers for that state should appear next to it.
I'm using Dreamweaver CS4. I was given a Excel spreadsheet with all of the information on it.
It would be easiest for me if I can use ASP to handle this, since I already have it setup on my machine as a local server to test it.
But, I can't seem to wrap my head around how to go about this.
Any help would be much appreciated.
Thanks!
Meb
Can you tell me if the following statements are correct?
- I need to make 2 xml documents. One for a list of states and one for cities and their phone numbers.
- I need to add a form to a page in DW.
- I need to add 2 Spry Regions to the form, one for the states dropdown list and one for the cities and phone numbers.
- I need to create two Spry Data Sets using the XML data sets I created earlier and insert them in their corresponding regions.
- And I need to analyze the code from iPHP's example and somehow link all the stuff together.
Am I even close to correct?
Thanks again,
Meb
1.) What does the source code from the example look like? Are there 2 xml documents?
2.) Is there a form on the example? Do you want a form on your page?
3.) How many Spry Regions are in the example?
4.) What does the source code from the example suggest?
5.) yes! View source code as previously advised. All of your other questions will be answered once you've done this! See a pattern forming here? You ask a bunch of questions, the answer is to view the source code. You say you've done that and will continue to do so, yet you still ask questions that can be answered by viewing the source code. The result is a lot of redundant discussion.
Similar Messages
-
Murray Please - Re: dynamic dropdown list DWMX
Hello Murray,
The dynamic dropdown list works fine now!
I have now a little other problem, the ORDER BY for my
dropdown list.
I selected "ASC" but he shows me from Z -->>A and a
want from A-->>Z
Can you explain this? My code ...
Thanks in advanced,
www.SamDesing.be
<%
Dim groepenrecordset
Dim groepenrecordset_numRows
Set groepenrecordset = Server.CreateObject("ADODB.Recordset")
groepenrecordset.ActiveConnection = MM_con_dbwaterloo_STRING
groepenrecordset.Source = "SELECT * FROM tbl_hoofdgroep ORDER
BY
hoofdgroep_fr ASC"
groepenrecordset.CursorType = 0
groepenrecordset.CursorLocation = 2
groepenrecordset.LockType = 1
groepenrecordset.Open()
groepenrecordset_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
//-->
</script>
</head>
<body>
<form action="resultdropdown.asp" method="post"
name="dropdown"
id="dropdown">
<p>Select category</p>
<select name="hoofdgroep" id="hoofdgroep"
onChange="MM_jumpMenu('parent',this,1)">
<%
While (NOT groepenrecordset.EOF)
%>
<option
value="resultdropdown.asp?ID_hoofdgroep=<%=(groepenrecordset.Fields.Item("ID_hoofdgroep") .Value)%>"
<%If (Not
isNull((groepenrecordset.Fields.Item("ID_hoofdgroep").Value)))
Then If
(CStr(groepenrecordset.Fields.Item("ID_hoofdgroep").Value) =
CStr((groepenrecordset.Fields.Item("ID_hoofdgroep").Value)))
Then
Response.Write("SELECTED") : Response.Write("")%>
><%=(groepenrecordset.Fields.Item("hoofdgroep_fr").Value)%></option>
<%
groepenrecordset.MoveNext()
Wend
If (groepenrecordset.CursorType > 0) Then
groepenrecordset.MoveFirst
Else
groepenrecordset.Requery
End If
%>
</select>
</p>
</form>
</body>
</html>
<%
groepenrecordset.Close()
Set groepenrecordset = Nothing
%>
"Murray *ACE*" <[email protected]> a
�crit dans le message de
news: [email protected]...
You're welcome.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Sam" <[email protected]> wrote in message
news:[email protected]...
> Thank you Murray
>
> "Murray *ACE*" <[email protected]> a
�crit dans le message
> de news: [email protected]...
>> You could use either, but with a jump menu, all you
would have to do is
>> to make sure that the category is carried to the
results page as a URL
>> parameter.
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do
so!)
>> ==================
>>
http://www.dreamweavermx-templates.com
- Template Triage!
>>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
>> ==================
>>
>>
>> "Sam" <[email protected]> wrote in message
>> news:[email protected]...
>>> Hello friends,
>>>
>>> I know that this is possible, but I can't find
the solution!
>>>
>>> I use ASP VB
>>>
>>> I have a dynamic dropdown list from a table
"categories" (access), when
>>> I select a category I want to display the
results from that category on
>>> the result page.
>>>
>>> Do I have to use a dropdown or jump menu?
>>>
>>> Somebody can help me or give me a good step by
step tutorial
>>>
>>> Thanks in advance,
>>>
>>> www.SamDesign.beSorry, Sam, I have no idea.....
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Sam" <[email protected]> wrote in message
news:[email protected]...
>I found it, but the last category is always selected. Is
it possible to
>have always the first selected with the A and not the Z?
> Thanks,
>
> "Murray *ACE*" <[email protected]> a
�crit dans le message
> de news: [email protected]...
>> Try DESC....
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do
so!)
>> ==================
>>
http://www.dreamweavermx-templates.com
- Template Triage!
>>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
>> ==================
>>
>>
>> "Sam" <[email protected]> wrote in message
>> news:[email protected]...
>>> Hello Murray,
>>> The dynamic dropdown list works fine now!
>>> I have now a little other problem, the ORDER BY
for my dropdown list.
>>> I selected "ASC" but he shows me from Z
-->>A and a want from A-->>Z
>>> Can you explain this? My code ...
>>> Thanks in advanced,
>>> www.SamDesing.be
>>> <%
>>> Dim groepenrecordset
>>> Dim groepenrecordset_numRows
>>>
>>> Set groepenrecordset =
Server.CreateObject("ADODB.Recordset")
>>> groepenrecordset.ActiveConnection =
MM_con_dbwaterloo_STRING
>>> groepenrecordset.Source = "SELECT * FROM
tbl_hoofdgroep ORDER BY
>>> hoofdgroep_fr ASC"
>>> groepenrecordset.CursorType = 0
>>> groepenrecordset.CursorLocation = 2
>>> groepenrecordset.LockType = 1
>>> groepenrecordset.Open()
>>>
>>> groepenrecordset_numRows = 0
>>> %>
>>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
>>> "
http://www.w3.org/TR/html4/loose.dtd">
>>> <html>
>>> <head>
>>> <meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
>>> <title>Untitled Document</title>
>>> <script language="JavaScript"
type="text/JavaScript">
>>> <!--
>>> function MM_jumpMenu(targ,selObj,restore){
//v3.0
>>>
>>>
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
>>> if (restore) selObj.selectedIndex=0;
>>> }
>>> //-->
>>> </script>
>>> </head>
>>>
>>> <body>
>>> <form action="resultdropdown.asp"
method="post" name="dropdown"
>>> id="dropdown">
>>> <p>Select category</p>
>>> <select name="hoofdgroep" id="hoofdgroep"
>>> onChange="MM_jumpMenu('parent',this,1)">
>>> <%
>>> While (NOT groepenrecordset.EOF)
>>> %>
>>> <option
>>>
value="resultdropdown.asp?ID_hoofdgroep=<%=(groepenrecordset.Fields.Item("ID_hoofdgroep") .Value)%>"
>>> <%If (Not
isNull((groepenrecordset.Fields.Item("ID_hoofdgroep").Value)))
>>> Then If
(CStr(groepenrecordset.Fields.Item("ID_hoofdgroep").Value) =
>>>
CStr((groepenrecordset.Fields.Item("ID_hoofdgroep").Value))) Then
>>> Response.Write("SELECTED") :
Response.Write("")%>
>>>
><%=(groepenrecordset.Fields.Item("hoofdgroep_fr").Value)%></option>
>>> <%
>>> groepenrecordset.MoveNext()
>>> Wend
>>> If (groepenrecordset.CursorType > 0) Then
>>> groepenrecordset.MoveFirst
>>> Else
>>> groepenrecordset.Requery
>>> End If
>>> %>
>>> </select>
>>> </p>
>>> </form>
>>> </body>
>>> </html>
>>> <%
>>> groepenrecordset.Close()
>>> Set groepenrecordset = Nothing
>>> %>
>>>
>>> "Murray *ACE*"
<[email protected]> a �crit dans le
message
>>> de news: [email protected]...
>>> You're welcome.
>>> --
>>> Murray --- ICQ 71997575
>>> Adobe Community Expert
>>> (If you *MUST* email me, don't LAUGH when you do
so!)
>>> ==================
>>>
http://www.dreamweavermx-templates.com
- Template Triage!
>>>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>>>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>>>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
>>> ==================
>>>
>>>
>>> "Sam" <[email protected]> wrote in message
>>> news:[email protected]...
>>>> Thank you Murray
>>>>
>>>> "Murray *ACE*"
<[email protected]> a �crit dans le
>>>> message
>>>> de news:
[email protected]...
>>>>> You could use either, but with a jump
menu, all you would have to do
>>>>> is
>>>>> to make sure that the category is
carried to the results page as a URL
>>>>> parameter.
>>>>>
>>>>> --
>>>>> Murray --- ICQ 71997575
>>>>> Adobe Community Expert
>>>>> (If you *MUST* email me, don't LAUGH
when you do so!)
>>>>> ==================
>>>>>
http://www.dreamweavermx-templates.com
- Template Triage!
>>>>>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>>>>>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>>>>>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
>>>>> ==================
>>>>>
>>>>>
>>>>> "Sam" <[email protected]> wrote in
message
>>>>>
news:[email protected]...
>>>>>> Hello friends,
>>>>>>
>>>>>> I know that this is possible, but I
can't find the solution!
>>>>>>
>>>>>> I use ASP VB
>>>>>>
>>>>>> I have a dynamic dropdown list from
a table "categories" (access),
>>>>>> when
>>>>>> I select a category I want to
display the results from that category
>>>>>> on
>>>>>> the result page.
>>>>>>
>>>>>> Do I have to use a dropdown or jump
menu?
>>>>>>
>>>>>> Somebody can help me or give me a
good step by step tutorial
>>>>>>
>>>>>> Thanks in advance,
>>>>>>
>>>>>> www.SamDesign.be
>>>
>>>
>>>
>>
>>
>
> -
Print form with dynamic dropdown
Dear all,
I have a form (xdp) with dynamic dropdown inside. (i.e. The value list is empty in design time)
And I have a problem that the print out (via the sendToPrinter service) will have the data value (e.g. EN) instead of the display value (e.g. English) for all the dynamic dropdown.
Would like to know if there are any solution beside mapping all the values from data value to display value before print?
Thanks in advance
Regards
BillI'm also seeking the better solution instead of
a) creating 2 field - one for capture data, one for printing (and it doesn't work using LC ES server component)
b) creating 2 templates - one for capture data, one for printing (maintenance overhead)
Ideally & logically, this should be achieve by using one field since it has already come with the presence & relevant attribute.
Anyway, the main problem, why dropdown data is printed instead of display value?
The user doesn't even know what's the technical data behind the dropdown screen value he/she selected.
From user point of view, nobody wants to see the technical data printed instead of the display value... -
Is it possible to make a search help with dynamic selection table?
Hi Experts,
Is it possible to create search helps with dynamic seletion tables means
i dont know the selection table names at the time of creation of search help.
These tables will be determined at runtime.
if yes, Please give an idea how to create and pass the table names at runtime.
Thanks
Yogesh GuptaHi Yogesh,
Create and fill your itab and show it with FM F4IF_INT_TABLE_VALUE_REQUEST
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'field to return from itab'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'field on your screen to be filled'
stepl = sy-stepl
window_title = 'some text'
value_org = 'S'
TABLES
value_tab = itab
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
Darley -
Flex Table Add Row Issue with Dynamic Entry Lists in Visual Composer
All,
Your help would be kindly appreciated in resolving an 'Add Row'-issue within a Flex Table that uses Dynamic Entry Lists in Visual Composer. The issue here is as follows :
When I use a [Local Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=O5hrG2aMxWZ84Mu1211193041]to populate a row field, the initial row and all next rows are emptied upon 'insert row', they loose their selected values and also the entry list values ('pull-down menus') are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
The initial row does [show the entry list values |http://www.postyourimage.com/view_image.php?img_id=2HybmEHAuQYs9cg1211192766]from the Local Dynamic Entry List based on the dynamically assigned input value; upon 'insert row' the entry lists are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
When using a [Global Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=m5p2KYuBb442dTq1211193501]to populate the row fields the Flex-table behaves normally as expected. Unfortunately with a Global Entry List it is not possible to dynamically assign a input value. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=U96V0zENCCyO3gA1211193157].
Please also see the [issue summary image|http://www.postyourimage.com/view_image.php?img_id=06xti08tIEfely1211195178] I made to visualize the issue. What I basically would like to know is whether this is a 'known issue' or not, or that it is an issue that can be fixed or whether there is an alternative workaround available ... I'm using Visual Composer 7.0 and the Portal is at SP 13.
Many thanks,
FreekHi,
you should be able to assign a dynamic value with global entry lists as well. If you say @myParam as dynamic value. VC will indicate in red letters, that the field @myParam is unknown. However, it will work, as long as @myParam is known in the form or table where you use the entry list.
I have never heard of the problem that entry lists are emptied after "insert"-event.
Kindes Regards,
Benni -
Flex Table Add Row Issue with Dynamic Entry Lists
All,
Your help would be kindly appreciated in resolving an 'Add Row'-issue within a Flex Table that uses Dynamic Entry Lists in Visual Composer. The issue here is as follows :
When I use a [Local Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=O5hrG2aMxWZ84Mu1211193041]to populate a row field, the initial row and all next rows are emptied upon 'insert row', they loose their selected values and also the entry list values ('pull-down menus') are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
The initial row does [show the entry list values |http://www.postyourimage.com/view_image.php?img_id=2HybmEHAuQYs9cg1211192766]from the Local Dynamic Entry List based on the dynamically assigned input value; upon 'insert row' the entry lists are lost. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=FPLr2cABcgiHRou1211192889].
When using a [Global Dynamic Entry List |http://www.postyourimage.com/view_image.php?img_id=m5p2KYuBb442dTq1211193501]to populate the row fields the Flex-table behaves normally as expected. Unfortunately with a Global Entry List it is not possible to dynamically assign a input value. Please also see [screenshot|http://www.postyourimage.com/view_image.php?img_id=U96V0zENCCyO3gA1211193157].
Please also see the [issue summary image|http://www.postyourimage.com/view_image.php?img_id=06xti08tIEfely1211195178] I made to visualize the issue. What I basically would like to know is whether this is a 'known issue' or not, or that it is an issue that can be fixed or whether there is an alternative workaround available ... I'm using Visual Composer 7.0 and the Portal is at SP 13.
Many thanks,
FreekHi,
you should be able to assign a dynamic value with global entry lists as well. If you say @myParam as dynamic value. VC will indicate in red letters, that the field @myParam is unknown. However, it will work, as long as @myParam is known in the form or table where you use the entry list.
I have never heard of the problem that entry lists are emptied after "insert"-event.
Kindes Regards,
Benni -
Search issue with dynamic dropdown array - PHP
I'm currently trying to set up a search with a couple of
dynamic dropdowns, basically to search for cars - so the parent
list is car make, and the child is car model.
I've gotten as far as a page with the dynamic array working,
but not the search :
dynamic array
working
(Ignore the cars and vans radio buttons)
For testing there's an Audi A3 and and Audi A6, but this
search doesn't work.
The select code looks like :
<select name="Model">
<option value="" <?php if (!(strcmp("",
$row_rsModels['Model']))) {echo "selected=\"selected\"";}
?>>Select a Model</option>
</select>
And the array code looks like :
<?php
if ($row_rsModels) {
echo "<SC" . "RIPT>\n";
echo "var WAJA = new Array();\n";
$oldmainid = 0;
$newmainid = $row_rsModels["Make"];
if ($oldmainid == $newmainid) {
$oldmainid = "";
$n = 0;
while ($row_rsModels) {
if ($oldmainid != $newmainid) {
echo "WAJA[".$n."] = new Array();\n";
echo "WAJA[".$n."][0] = '".WA_DD_Replace($newmainid)."';\n";
$m = 1;
echo "WAJA[".$n."][".$m."] = new Array();\n";
echo "WAJA[".$n."][".$m."][0] =
"."'".WA_DD_Replace($row_rsModels["ModelID"])."'".";\n";
echo "WAJA[".$n."][".$m."][1] =
"."'".WA_DD_Replace($row_rsModels["Model"])."'".";\n";
$m++;
if ($oldmainid == 0) {
$oldmainid = $newmainid;
$oldmainid = $newmainid;
$row_rsModels = mysql_fetch_assoc($rsModels);
if ($row_rsModels) {
$newmainid = $row_rsModels["Make"];
if ($oldmainid != $newmainid) {
$n++;
echo "var rsModels_WAJA = WAJA;\n";
echo "WAJA = null;\n";
echo "</SC" . "RIPT>\n";
function WA_DD_Replace($startStr) {
$startStr = str_replace("'", "|WA|", $startStr);
$startStr = str_replace("\\", "\\\\", $startStr);
$startStr = preg_replace("/[\r\n]{1,}/", " ", $startStr);
return $startStr;
?>
..to try and find the root of the problem, I've gotten as far
as a similar page, without the dynamic
array, with the child dropdown populated dynaically from the
recordset :
search working
This seems to work exactly as advertised - all the car models
are listed from the recordset, and if
you search for Audi and A3, then it gets returned correctly.
The select code here looks like :
<select name="Model" id="Model">
<option value="">Select a Model</option>
<?php
do {
?>
<option value="<?php echo
$row_rsModels['Model']?>"><?php echo
$row_rsModels['Model']?
></option>
<?php
} while ($row_rsModels = mysql_fetch_assoc($rsModels));
$rows = mysql_num_rows($rsModels);
if($rows > 0) {
mysql_data_seek($rsModels, 0);
$row_rsModels = mysql_fetch_assoc($rsModels);
?>
</select>
..so I guess the search is set up OK, but the issue is with
how to pass the model from the select code generated by the dynamic
array correctly....
Its presumably because the option value is empty :
<option value="" <?php if (!(strcmp("",
$row_rsModels['Model']))) {echo "selected=\"selected\"";}
?>>Select a Model</option>
So I've been trying various possibilities with no joy, such
as :
<?php if (!(strcmp("", $row_rsModels['Model']))) {echo
"selected=\"selected\"";} ?>
but without success.
Even then, I'd have though if the value was empty, "", then
it would return all results, rather than no results....?
hope that makes some sense, and someone can shed some
light...
Cheers.Thomas Jung wrote:>
> >
Chris Paine wrote:
> > That's a shame!
> >
> > Does this mean that using a drop down by index in an ALV is limited to having the same dropdown in every row of the table (it would certainly seem that this is the case).
> >
> > Cheers,
> >
> > Chris
>
> I would assume so as I can't think of a way around the subnode limitation. The system will actually allow you to have a subnode and everything works fine until you sort the ALV - then you get a short dump.
>
> I suppose you would have to fall back to using a regular table in this case.
But how come the class documentation says its possible.
Functionality
Using class CL_SALV_WD_UIE_DROPDOWN_BY_IDX, you make all the settings for the UI element index-based dropdown list box, from which the user can select from a range of values.
*You use the index-based dropdown list box if the dropdown list boxes in each cell of the column are to contain different entries.*
You use the key-based dropdown list box if the dropdown list boxes in each cell of the column are to contain the same entries.
To specify the entries in the dropdown list boxes, the context of your application requires an attribute for which the data type satisfies the following requirements:
The attribute is a table
The structure of this table contains at least one KEY column and a VALUE column.
Note
We recommend that you use the type WDY_KEY_VALUE_TABLE here. -
Multiple criteria search with 4 dropdown lists
I want to perform a multiple criteria search on a MySQL
database. Users should be able to use from 4 dropdown lists in a
form only one criterium, all 4 of them or 2 or 3.
Each used dropdown list gives a numeric variable: Fvar1 ...
Fvar4. The variables from the dropdown lists used should be matched
with numeric fields in the database: DBvar1...DBvar4
The numeric variables from the dropdown lists that are not
used, should be ignored.
Example: a user selects a value in dropdown list 2 and 3 and
does not use dropdown lists 1 and 4. Fvar1 and Fvar 4 should then
be ignored for the search, that has to be performed with Fvar2 and
Fvar3, who have to be matched with DBvar2 and DBvar3.
Anyone who can help me out with the WHERE statement in my SQL
query?
Your help will be greatly appreciated.
ErikErik61 wrote:
> I want to perform a multiple criteria search on a MySQL
database. Users should
> be able to use from 4 dropdown lists in a form only one
criterium, all 4 of
> them or 2 or 3.
Start by using the Advanced Recordset dialog box to create a
query that
looks for all four variables. Then switch to Code view and
start carving
up the code created by Dreamweaver.
The query will look something like this:
$query_getProducts = sprintf("SELECT product_name, price
FROM products
WHERE prod_type = %s AND colour = %s AND size = %s AND range
= %s
ORDER BY price ASC",
GetSQLValueString($var1_getProducts, "text"),
GetSQLValueString($var2_getProducts, "text"),
GetSQLValueString($var3_getProducts, "text"),
GetSQLValueString($var4_getProducts, "text"));
Change it like this:
$query_getProducts = "SELECT product_name, price
FROM products
WHERE ";
$where = false;
if (!empty($_GET['prod_type')) {
$query_getProducts .= sprintf("prod_type = %s ",
GetSQLValueString($var1_getProducts, "text"));
$where = true;
if (!empty($_GET['colour'])) {
if ($where) {
$query_getProducts .= 'AND ';
$query_getProducts .= sprintf('colour = %s ',
GetSQLValueString($var2_getProducts, "text"));
$where = true;
if (!empty($_GET['size'])) {
if ($where) {
$query_getProducts .= 'AND ';
$query_getProducts .= sprintf('size = %s ',
GetSQLValueString($var3_getProducts, "text"));
$where = true;
if (!empty($_GET['range'])) {
if ($where) {
$query_getProducts .= 'AND ';
$query_getProducts .= sprintf('range = %s',
GetSQLValueString($var4_getProducts, "text"));
That builds the query in stages using $where to decide
whether to add
"AND" in front of the second, third, and fourth variables.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of
ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
Editable Inline Table with a Dropdown List in Each Row
Dear All,
I am using: JDev 10.1.3.3 + JSF + BC
I need to build a dropdown List in each row for a child table of an inline style. I used the SelectOneChoice and followed Steve Muench example (http://radio.weblogs.com/0118231/stories/2005/06/24/jdeveloperAdfScreencasts.html). I'm unable to get the result. It display the correct value but lose the dropdown style, rather it shows the result as an outputText style.
Can someone please help...
I've tried different way like the table binding by droping the column from the dataControl as a selectOneChoice and did the binding... didn't work.
This is what I have in the source page
<af:column headerText="Cust Id" sortable="false"
sortProperty="CustId"
id="column34">
<af:selectOneChoice value="#{detailRow.CustId}">
<af:forEach var="li"
items="#{bindings.customerLookupVO1.rangeSet}">
<af:selectItem value="#{li.CustId}"
label="#{li.CustText}"/>
</af:forEach>
</af:selectOneChoice>
</af:column>
In this is what I have in the page Def file
<table IterBinding="customerLookupVO1Iterator" id="customerLookupVO1">
<AttrNames>
<Item Value="CustId"/>
<Item Value="CustText"/>
</AttrNames>
</table>Hi,
looks ok except for: "#{detailRow.CustId}"
did you change the var property of the table? normally it would be "#{row.CustId}"
the fact that your select one choice is not displaying would suggest that there is a problem with the 'value' property of the component.
there is another problem you should be made aware of with ADF editiable tables. If you put anything other than input text components in the table you will have chronic locking problems with the page. Only one person can use that page or else you will get errors all over the page until the user holding the lock commits or signs off.
regards,
Brenden -
Need help with Dynamic Excel File Name please.
I am try to output an excel file with dynamic date.
Here what I done.
I am using SQL 2012.
Create Execute SQL Task Connect Type: Excel
Create Data Flow Task set to DelayValidation: True
Create OLE DB Sourc
Create Data Converstion
Excel Destination
Excel Connection, Expression, select ExcelFilePath
@[User::sXLFilePath] + @[User::sFileName] + RIGHT("0" + (DT_WSTR, 2) DATEPART("DD", GETDATE()), 2)+ RIGHT("0" + (DT_WSTR, 2) DATEPART("MM", GETDATE()), 2) + RIGHT((DT_WSTR,
4) DATEPART("YYYY", GETDATE()), 2) +".csv"
C:\ExcelOutPut\SOX_CAM_SQL_Report_010215.xls
What I try to accomplish is output the file with each day append to it, date must be DDMMYY.
I google it and found many samples, tested it, and none of them is work for me.
Any suggestions or some examples to share is greatly appreciate.
I am new to SSIS. I found one poster have similar issue and inside the posted below, there was one suggestion to create variable and connection string but how do I bind that variable to Excel Connection manger.
Please help.
Thank you so much in advance.
Ex: SOX_CAM_SQL_Report _020215.csv
SOX_CAM_SQL_Report _030215.csv
--Similar issue:
https://social.msdn.microsoft.com/Forums/en-US/bda433aa-c8f8-47c9-9e56-efd20b8354ac/creating-a-dynamic-excel-file?forum=sqlintegrationservices
Suggestion in the above posted but where can bind this to Excel Connection Manger.
Please help provide step by step. Thanks.
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\" + "ExcelTarget" + (DT_WSTR,4)DATEPART("yyyy",GETDATE()) +
".xls" + ";Extended Properties=\"EXCEL 8.0;HDR=YES\";"
And yes, as you were intimating, the delay validation on the dataflow should be set.Hi NguyenBL,
According to your description, you created ssis package to export data from database to excel, when the package runs, you want to create new excel and name the file with time stamp. If that is the case, we can achieve the goal by following steps:
Create a script task used to create excel files.
Create a data flow task to export data from database to excel.
Add OLE DB source to data flow task.
Add Excel Destination to data flow task.
Create connection manager for OLE DB and Excel.
Click Excel Connection Manager, in Properties window, click (…) button next to Expressions, then set ExcelFilePath with expression like below:
"C:\\ETL Lab\\CreateNewExcel\\ExportData_"+REPLACE((DT_STR, 20, 1252)(DT_DBTIMESTAMP)@[System::StartTime], ":", "")+".xls"
For detail information, please refer to the document:
https://sqljourney.wordpress.com/2013/01/12/ssis-create-new-excel-file-dynamically-to-export-data/
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
Wendy Fu
TechNet Community Support -
Implementing a dynamic dropdown list
Hi All,
I am implementing an Adaptive RFC model that uses two custom RFC's. First RFC returns a table that has list of countries and the second RFC returns a table that lists the states of a particular country.
Now using these two RFC's how do I implement a dynamic dropdown...i mean the first dropdown should show the list of countries and the second dropdown should show the list of states depending on the country selected.
Thanks,
TomHi Tom,
Please try this,
IWDNodeInfo multiplenode = multipleinfo.addChild("MultiNode" , null, true, false, true, true, false, true, null, null, null);
multiplenode.addAttribute("roles", "ddic:com.sap.dictionary.string");
Assign values for Dropdown
IWDNode node1 = wdContext.nodeNodeA().getChildNode("MultiNode", IWDNode.NO_SELECTION);
IWDNodeElement elem1;
for(int s=0;s<5;s++){
elem1 = node1.createElement();
elem1.setAttributeValue("roles","Value"+s);
node1.addElement(elem1);
Inside Domodifyview create IWDDropDownByIndex UI Element and Bind it.
IWDDropDownByIndex dropDownList = (IWDDropDownByIndex)view.createElement(IWDDropDownByIndex.class, "drop");
IWDAttributeInfo info = wdContext.getNodeInfo().getChild("NodeA").getChild("MultiNode").getAttribute("roles");
dropDownList.bindTexts(info);
dropDownList.setWidth("100");
Regards,
Ramganesan K. -
Hello all, I need some help with a left navigation menu I
have created, you can see the code below:
the problem I have is when I am putting a link to the UL it
doesn't work ( probably because I have a background image in my
CSS) i was wondering if I can do it with another way..
css code
.treemenu {
margin : 0px 20px;
padding : 10px;
list-style : none;
width : 200px;
.treemenu ul {
list-style : none;
margin : 0px 5px;
padding : 0px 5px;
.treemenu li {
display : inline;
.treemenu a {
display : block;
padding-left : 0px;
text-decoration : none;
.treemenu .treeopen {
background-image : url('../img/open.gif');
background-repeat : no-repeat;
background-position : left;
.treemenu .treeclosed {
background-image : url('../img/closed.gif');
background-repeat : no-repeat;
background-position : left;
ULHello all, I need some help with a left navigation menu I
have created, you can see the code below:
the problem I have is when I am putting a link to the UL it
doesn't work ( probably because I have a background image in my
CSS) i was wondering if I can do it with another way..
css code
.treemenu {
margin : 0px 20px;
padding : 10px;
list-style : none;
width : 200px;
.treemenu ul {
list-style : none;
margin : 0px 5px;
padding : 0px 5px;
.treemenu li {
display : inline;
.treemenu a {
display : block;
padding-left : 0px;
text-decoration : none;
.treemenu .treeopen {
background-image : url('../img/open.gif');
background-repeat : no-repeat;
background-position : left;
.treemenu .treeclosed {
background-image : url('../img/closed.gif');
background-repeat : no-repeat;
background-position : left;
UL -
IMPORT from database with dynamic parameter list
Hi Gurus,
Iu2019m having problems during import from a cluster table.
I wanu2019t to do an import with a dynamic parameter list, but I cannot get it to work.
Sample code ********
DATA: BEGIN OF st_key,
report LIKE rsvar-report,
variant LIKE rsvar-variant,
END OF st_key.
DATA dirtab1 LIKE cdir OCCURS 10 WITH HEADER LINE.
DATA dirtab2 LIKE cdir OCCURS 10 WITH HEADER LINE.
st_key-report = 'ZPRG'.
st_key-variant = 'VAR1'.
IMPORT DIRECTORY INTO dirtab1 FROM DATABASE vari(vb) ID st_key.
IMPORT DIRECTORY INTO dirtab2 FROM DATABASE vari(va) ID st_key.
DATA: tmp_var(100) TYPE c.
This works - P_BWTAR is a parameter from the selection screen registred in VARI
I'm getting the content of the field in tmp_var
IMPORT p_bwtar TO tmp_var FROM DATABASE vari(va) ID st_key.
This does not work - the parameter P_BWTAR is in the dirtab2-name
I'm not getting the content
LOOP AT dirtab2.
IMPORT dirtab2-name FROM DATABASE vari(va) ID st_key.
ENDIF.
ENDLOOP.
I have tried the syntax IMPORT (dirtab2-name) ........
but this fails the syntax check.
Please - if you have any suggestions :o)
Best Regards,
VibekeDear Vibeke,
Could you please explain us how you solved the problem because you have the same issue ?
thanks a lot
KR
véronique -
Help with dynamic page layouts
Hello JSP Gurus,
I'm attempting to dynamically generate the page layout for my site based on the organization a user belongs to. Basically, I'd have certain resources like navigation links, graphics, etc, that are modular. Then I'd like to construct the layout using these "moduls" in a dynamic fashion. Does anyone have any suggestions on techniques or technologies that would be useful? I'm not really looking at the portal/portlet model. Is this something that Cocoon could do by storing the layout for each customer as an XML file or something? Any ideas, suggestions, experiences would be helpful.
Thanks!How does Tiles differ from the JetSpeed apache
project? They both appear to be portal-like
frameworks, or am I incorrect about that? Which is
preferred?Frankly, I can't give you an in-depth answer to that. Maybe someone else can help with more details.
What I can tell you is that JetSpeed seems to be more of a real portal architecture. Emphasis is placed on the framework portion, interfacing with exisiting applications. Visual layout takes second seat to this.
Tiles on the other hand puts more emphasis on visual layout and reuse.
Just looking at JetSpeed's visual interfacing a little bit makes me really dislike it. You build tables and such inside of a servlet, so there's a tight coupling (or at least, much tighter than with Struts/Tiles) between the presentation and logic. (I'm basing this on a JavaWorld article at
http://www.javaworld.com/javaworld/jw-07-2001/jw-0727-jetspeed.html )
Based on your initial question, it would seem to me that tiles is much closer to what you're looking for (and likely easier to just pick up and use).
Anyway, take all this with a grain of salt; I'm not exactly an expert on JetSpeed. =) -
Help with dynamic playlist for mpd
Hi guys,
I use mpd with sonata for playing my music, and after trying exaile there is one thing id really like for mpd, and that is the dynamic playlist function.
When you're playing a song in exaile with dynamic playlist enabled, it queries audioscrobbler and automatically adds similar artists/songs to your playlist (if you have them on your pc).
I dont want to use exaile as it just feels too big and slow and bloated (not KISS ), i know a little bit of python so i thought i'll try and make my own little script/program as Sonata has audioscrobbler support, but i dont think there is anyway to query similar artists.
I think im going to try and make this as a daemon type program that will run in the background adding songs to the playlist.
Ive found the code from the exaile source (audioscrobbler.py) which queries lastfm e.g.
>>> lips = AudioScrobblerQuery(artist='The Flaming Lips')
>>> for artist in lips.similar():
... print artist.name, artist.mbid
This will print a list of similar artists to the flaming lips.
I've not done much with python so i thought this would be a good way to try and improve.
Does anyone have any suggestions as to what the best way to go about searching and comparing the results to my mpd database, would the best way just to be to search the mpd.db?
And if anyone else has any ideas/comments id like to hear them.
Edit:
I just found this too, so i may only need to change some things to integrate it with mpd rather than amarok
http://www.kde-apps.org/content/show.php?content=31920
Thanks
Last edited by Kane (2008-06-05 13:24:33)well i just modified the patch into a little script, it does what i need
its here if anyone wants it
import audioscrobbler
import mpd
import random
import time
lastsong = {}
def timer_control():
get_similar()
time.sleep(10)
timer_control()
def get_similar():
audioscrobbler
client = mpd.MPDClient()
client.connect("localhost", 6600)
mpdstatus = client.status()
prevsonginfo = client.currentsong()
global lastsong
if mpdstatus['state'] == "stop": return
if prevsonginfo == lastsong: return
lastsong = prevsonginfo
similarartists = ""
song = prevsonginfo
#if not song: break #No song, do nothing
prevartist = song['artist']
# Is the info already cached?
similar_cache = {}
if similar_cache.has_key(prevartist):
similarartists = similar_cache[prevartist]
else:
#Not cached so fetch from Audioscrobbler
try:
similarartists = [artist.name for artist in audioscrobbler.AudioScrobblerQuery(artist=prevartist).similar()]
# Cache search results and save some time next search
similar_cache[prevartist] = similarartists
except audioscrobbler.AudioScrobblerError:
similar_cache[prevartist] = None # Empty cache
return # Do nothing!
if not similarartists: return # Empty list
# Split list in half and sort upper half
# this means good matches will have priority
# but makes sure artist A does not always result in artist B
half_idx = len(similarartists)/2
upperhalf = similarartists[:half_idx]
lowerhalf = similarartists[half_idx:]
random.shuffle(upperhalf)
artistlist = upperhalf
artistlist.extend(lowerhalf)
# Try each artist in order
for artist in artistlist:
try:
print "Trying:",artist
songs = client.search("artist", artist)
if not songs: continue
selected_song = random.sample(songs, 1)[0]
client.add(selected_song['file'])
print "Added", selected_song['title'],"by",selected_song['artist']
# Delete old song from playlist?
break
except mpd.MPDError, e:
print "MPDError", e.message
continue
except ValueError, e:
print "ValueError:",e.message
continue
timer_control()
Last edited by Kane (2008-06-06 16:22:49)
Maybe you are looking for
-
Error when trying to sign in on mobile phone
Dear Admin, I want to browse the ORACLE ADF FORUMS in my mobile phone (nokia x2-01 with UC and Opera mini Browser), the forum page opens correctly but when i try to signin it gives me error. ORACLE ACCESS MANAGER ERROR: System error. Please re-try yo
-
How can I re-activate my creative cloud with a firewire disc in target mode?
I am a hurrricane evacuee. I have lost my home to flooding. It will be months before I get my original internet connection back, if ever. I am staying at a friends and they have wifi, but I am not allowed to reboot their router or their modem. I have
-
Data Type, Message Type and Mapping for FTP
Thanks in advance for your replies. As our first production XI scenario, we need to move several (at least 46) files from our SAP instance to a couple of different servers to support our legacy systems. Once all locations are on SAP this requirement
-
HT201303 how to take out my credit card
i want to know i can take out my credit card number out of my account. Thank you.
-
ALV grid oo delete rows and update to table
Hi all How can I delete one row and update to the db table? thanks