Dynamic comboBox and listgrid operations

I have 3 problems to solve:

1. I have a listGrid with a list of products. I created functions to add and delete those items to/from a listgrid. In fieldEditors, I use two comboBoxes (lists of categories and products). I'd like to load content of products comboBox automatically after selecting an item from categories comboBox. So the first question is: how to populate product comboBox on change event?

2. The other thing is about the data structure. I can load list of available products and categories (along with their IDs) to some dataSource, but is this the best option? If yes, then how to deal with that data, how to use it in comboBoxes?

3. After completing the list, I'd like to send it by POST (but I would only need 3 things: product ID, price and quantity) to some PHP script. How to gather that data from listGrid? Please note that not all of it is displayed (i.e. product ID is not displayed)?

My existing code for the listGrid looks like this (hopefully it's valid):

  1.         <e:variable name="varData">
  2.                 <e:data xmlns="" type="text/xml">
  3.                         <quotation>
  4.                         <?php echo $this->partialLoop("management/edit_item.phtml",$this->quotationItems); ?>
  5.                         </quotation>
  6.                 </e:data>
  7.         </e:variable>
  8.        
  9.         <b:dataSource id="myDataSource" name="myData" dataType="application/xml" dataSelect="$varData" e:behavior="b:localData">
  10.                 <b:dataSchema>
  11.                         <b:dataRecordTemplate xmlns="">
  12.             <item>
  13.                                 <catname catid="" />
  14.                                 <productname productid="" />
  15.                                 <price />
  16.                                 <quantity>1</quantity>
  17.                         </item>
  18.                 </b:dataRecordTemplate>
  19.                 </b:dataSchema>
  20.                 <b:dataFormatter name="myPound" type="text/javascript">
  21.                         return '&pound;' + (parseFloat(value)).toFixed(2);
  22.                 </b:dataFormatter>
  23.                 <e:handler event="error" type="application/javascript">
  24.                         alert(event.message)
  25.                 </e:handler>
  26.         </b:dataSource>
  27.         <b:listGrid dataSource="myData" rowClasses="rowClass1, rowClass2" id="qListGrid" >
  28.                 <b:listGridCol select="@id" label="ID" display="false" />
  29.                 <b:listGridCol select="@catid" label="cID" display="false" />
  30.                 <b:listGridCol select="catname" label="Category" width="170px" >
  31.                 <b:fieldEditor>
  32.                         <b:comboBox>
  33.                                 <?php echo $this->partialLoop("option.phtml",$this->itemCats); ?>
  34.                         </b:comboBox>
  35.                 </b:fieldEditor>
  36.                 </b:listGridCol>
  37.                 <b:listGridCol select="@productid" label="pID" display="false" />
  38.                 <b:listGridCol select="productname" label="Product name" >
  39.                         <b:fieldEditor>
  40.                                 <b:comboBox>
  41.                                 <?php echo $this->partialLoop("option.phtml",$this->items); ?>
  42.                                 </b:comboBox>
  43.                         </b:fieldEditor>
  44.                 </b:listGridCol>
  45.                 <b:listGridCol select="price" label="Price" format="myPound" width="70px" >
  46.                         <b:fieldEditor>
  47.                                 <b:spinner decimals="2" min="0.00" max="10000.00" step="1.00" />
  48.                         </b:fieldEditor>
  49.                 </b:listGridCol>
  50.                 <b:listGridCol select="quantity" label="Quantity" width="60px" datatype="number" />
  51.         </b:listGrid>

Is there anyone who could

Is there anyone who could help me with this?

Hi Piotrek, Could you expand

Hi Piotrek,
Could you expand example to include the output of your PHP scripts, instead of a call to these?
Just three products would be fine, fake data is fine too.
If you do that, you can check yourself whether the code is running and you would not need the "hopefully" anymore :-)
Also it would be a basis for someone here to help you further.
Cheers, Ghica.

Further problems

Dear ghica,

I improved my code significantly and it works now (to some extent). I describe further problems here http://bdn.backbase.com/node/5224 . I will be very grateful if you could give me a hand there.

dynamic Dropdown menus

Hi,

I am trying to evaluate toolkits and specifically I am working on backbase and asp.net. I am working on dynamic dropdown menus with data populated from an xml source from MySQL database. I seem not to get any sample coding for dropdowns using backbase. My role as a research student is not to create the code but just to evaluate the codes based on some selected codemetrics. I will be very glad if anybody could assist me with a code to accomplish this. Thanks in advance.

dataMenu

In release 4.2.1 there is a beta version of dataMenu. Look in the Reference for a description. This widget uses a data source that can be remote. There are no examples for this widget yet.

Other widgets that have drop-down functionality (with examples) are: comboBox and suggestBox.
Cheers, Ghica.

dataTree and others

Talking about dataMenu, there is also a dataTree component in a Beta stage released in 4.2.1 (actually all the data* components appear to be very useful). Is it going to be released as non-beta in the nearest Backbase release? When could that be? (In a month, two?)

Also, after release, some nice tutorial on using data* components would be very useful for developers.