ng-first
03-15-2007, 02:56 AM
:cool: Hi all,
I defined "myAttributeEditor" that extends WMAttEditorComboBox.
Than I work with it, to find out the values to set another Attribute that has "secondAttributeEditor".
To do so:
from 'myAttributeEditor' I find the Object(WMElement) who's attribute is being edited;
from this object I find its WMAttributeSet;
from WMAttributeSet, I find the WMAttribute of 'secondAttributeEditor'
from the WMAttribute of 'secondAttributeEditor'
I would like to find the reference its JComboBox, to set the new values !!!!!In this way (I copy below my java code):
...
if(myAttributeEditor.this.getDBObject() != null)
{
WMAttributeSet attributeSet ;
try
{
//1- find WMAttributeSet
attributeSet = myAttributeEditor.getDBObject().getWMClass().getAttributes();
for (int i = 0; i < attributeSet.size(); ++i)
{
//2- find WMAttribute
WMAttribute att = attributeSet.getAttribute(i);
if (att.getAttributeName().equalsIgnoreCase("secondAttributeEditor") == true )
{
//3- find AttributeEditor and its ComboBox
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().removeAllItems();
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().addItem("PIPPO !!!");
}
}
}
but why this instructions:
"...
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().removeAllItems();
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().addItem("PIPPO !!!");
... "
doesn't work ?!?!?!?
The secondCOmboBox don't change its value !!!!
(I have add an actionListener to the myAttributeEditor, and I have implemented the ActionPerformed method)
Please HELP ME !!! I'm going crazy :eek: !!!!
Nadia
I defined "myAttributeEditor" that extends WMAttEditorComboBox.
Than I work with it, to find out the values to set another Attribute that has "secondAttributeEditor".
To do so:
from 'myAttributeEditor' I find the Object(WMElement) who's attribute is being edited;
from this object I find its WMAttributeSet;
from WMAttributeSet, I find the WMAttribute of 'secondAttributeEditor'
from the WMAttribute of 'secondAttributeEditor'
I would like to find the reference its JComboBox, to set the new values !!!!!In this way (I copy below my java code):
...
if(myAttributeEditor.this.getDBObject() != null)
{
WMAttributeSet attributeSet ;
try
{
//1- find WMAttributeSet
attributeSet = myAttributeEditor.getDBObject().getWMClass().getAttributes();
for (int i = 0; i < attributeSet.size(); ++i)
{
//2- find WMAttribute
WMAttribute att = attributeSet.getAttribute(i);
if (att.getAttributeName().equalsIgnoreCase("secondAttributeEditor") == true )
{
//3- find AttributeEditor and its ComboBox
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().removeAllItems();
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().addItem("PIPPO !!!");
}
}
}
but why this instructions:
"...
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().removeAllItems();
((ComboBoxEditorRenderer) att.getAttEditor().getJComponent()).getComboBox().addItem("PIPPO !!!");
... "
doesn't work ?!?!?!?
The secondCOmboBox don't change its value !!!!
(I have add an actionListener to the myAttributeEditor, and I have implemented the ActionPerformed method)
Please HELP ME !!! I'm going crazy :eek: !!!!
Nadia