Hi,

I usually like to create custom columns in the SQL
Like 
Select product,count(product)as ProdCounts from SalesTable

Then I can save a lot of coding within the @CHOICELIST

Im looking for an example of this for ya

Ben Johansen - http://www.pcforge.com
Authorized Witango & MDaemon Reseller 
Available for Web App. Developement


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 31, 2005 12:20 PM
To: [email protected]
Subject: Re: Witango-Talk: Build a dropdown

Maybe if I simplified this a bit.

How can I assign a product name to an array then add a column that counts.

ie...

<@ASSIGN NAME="ArrayW" VALUE="<@ARRAY ROWS='<@NUMROWS>' COLS='2'>" 
SCOPE="USER">
<@ASSIGN NAME=ArrayW[*,1] "<@VAR resultSet[*,1]>">

to populate the array with product names

then populate column 2 so the array ends up like this...

first pruduct name              1
second product name     2
third product name              3
fourth product name             4
fifthe product name             5
etc.

Thanks, sorry about the brain fart... I think there must be an easy 
way to do this.





>
>
>etc.
>
>This is what I have so far....
>
>In the first search, I am assigning the array with these values. 
>This product numbers then product name. Don't need the product 
>numbers but a simple count here woudl do for <@VAR resultSet[*,1]>
>
><@ASSIGN NAME="ArrayW" VALUE="<@ARRAY ROWS='<@NUMROWS>' COLS='3'>" 
>SCOPE="USER">
><@ASSIGN NAME=ArrayW[*,1] "<@VAR resultSet[*,1]>">
><@ASSIGN NAME=ArrayW[*,2] "<@VAR resultSet[*,2]>">
><@ASSIGN NAME="totalrows" VALUE="<@NUMROWS>">
>
>Then I am doing a looping count called m_counter
>
>I think this is where I would need to update the current array is it 
>not? This is where I would like to change the <@VAR 
>NAME='ArrayW[*,1]'> to a simple count so I could use it for startrow 
>in the next search.
>
>
>
>In the choice list, I now have the options right, but need the 
>values to be the count. Is this making sense? Or is there a better 
>way to do this?
>
>
><@CHOICELIST NAME="pick" SIZE=1 TYPE=select VALUES="<@VAR 
>NAME='ArrayW[*,1]'>" OPTIONS="<@VAR NAME='ArrayW[*,2]'>" 
>SELECTED="selected">
>
>
>
>>(sorry, a typo)
>>
>>
>>For the simple drop down, it's going to look more like this
>>
>>
>>given: you have an array: @@myArray and a field = myName
>>
>>  <@choicelist name="myName" size=1 options=@@myArray[*,1] 
>>Values=@@myARray[*,2] >
>>
>>of course, myArray can be all of your products that is held in a 
>>persistent variable, or the product of a prior query. It can be 
>>filtered, sorted, and tortured to you preference. It's just got 2 
>>columns that you care about, and you're using one for the values 
>>and one for the display.
>>
>>
>>
>>On May 31, 2005, at 9:43 AM, [EMAIL PROTECTED] wrote:
>>
>>>Okay, it seems that choicelist is the way to go. I have never had 
>>>a need for this, so please bear with me as I muddle through this.
>>>
>>>I have built an array that has 2 values, one is the product 
>>>number, the other is the name of the product. I cannot see how to 
>>>display the product name as what the user sees and the product 
>>>number as the value when selected. Anyone know if this can be done?
>>>
>>>In other words
>>>
>>><option value="<product number>">Blue Widgets</option>
>>>
>>>Thanks
>>>
>>>
>>>
>>>>look at <@choicelist>
>>>>
>>>>On May 31, 2005, at 8:52 AM, [EMAIL PROTECTED] wrote:
>>>>
>>>>>Witango 2000
>>>>>
>>>>>Is it possible to build a dropdown to be used on another search.
>>>>>
>>>>>In other words, I have a page that displays 5 products per page. 
>>>>>That's easy enough. But I need to have a dropdown of all the 
>>>>>products on that same page. I have been trying to do this by 
>>>>>bulding an array, but cannot seem to get it to work right. The 
>>>>>problem is the array has to be built on a search before the main 
>>>>>search page.
>>>>>
>>>>>Logic would dictate that
>>>>>
>>>>>Array search -- > build an array for all products
>>>>>Main search --> Need to drop in a form dropdown here for all 
>>>>>products even though this search only displays 5 products at a 
>>>>>time.
>>>>>
>>>>>Is this making sense? All I get is a list of the products, but I 
>>>>>cannot seem to get them to display in a drop down. Seems that it 
>>>>>reverts to just text.
>>>>>____________________________________________________________________ __
__
>>>>>TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>>>>>
>>>>
>>>>_____________________________________________________________________
___
>>>>TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>>>>
>>>
>>>______________________________________________________________________ __
>>>TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>>>
>>
>>
>>________________________________________________________________________
>>TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf
>
>________________________________________________________________________
>TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf


________________________________________________________________________
TO UNSUBSCRIBE: Go to http://www.witango.com/developer/maillist.taf

Reply via email to