Reload items of select item which is related with connector

How can reload items of a select item which is related with a java connector?
The Form loads the structur from a XML and is binded with a grid. The grid is synchronized with a datastore.
My plan:

  1. Reload datastore
  2. Reload all items of each select item in the form
  3. Select first item in the grid
  4. Show selected data in the form

I found no way to reload the select item data.

Person Form.XML

<?xml version="1.0" encoding="UTF-8"?> <items> <items> <item type="settings" labelWidth="100" labelAlign="left" inputWidth="120" position="label-left"></item> <item type="fieldset" label="General" inputWidth="auto"> <item type="block" width="auto"> <item type="select" name="P_Title" label="Titel" inputWidth="122" connector="Person/TitleConnector"></item> <item type="input" name="P_FirstName" label="First name"></item> <item type="input" name="P_LastName" label="Last name"></item> </item> </item> </items>

Hi

Select connector used once just lo load options.
To load another set you need something like this:

dhtmlxAjax.get(“conector_url”, function®{
// assume response is xml
// xmlTopNodeName - str, top tagname
var root = r.xmlDoc.responseXML.getElementsByTagName(xmlTopNodeName)[0];
// get options from xml here
var t = myForm.getSelect();
t.options.length = 0;
t.options.add(new Option(name,value))
})

getSelect() works only with the Select Item id.

Is there no way to define two new form method:

var selectArray = myForm.getAllSelect(); //return a array with all select objects var t; for (t in selectArray) { t.reload(); //call the connector again and reload all items in the select }

No good idea?

or

myForm.reloadAllSelect();

Question:
Has the form a list with all items?
Has each item an identifier to know what type of item it is?
Has the select item a parameter with the connector url?

Hi

form does not have reloadAllSelect() and getAllSelect() functionality

you can use:
myForm.forEachItem(function(id){
if (myForm.getItemType(id) == “combo”) {
// do something
}
})

Ok. Thanks

And how can I find the connector url?

It used once on init stage and not stored inside form.