Changing variable with combobox selection - simple problem!
Hi there,
I have a search field when you click on search.
I want to make it so i can change which field in a datagrid
you search for depending on the choice in the Combbox. I'm not sure
how to set the object name correctly depending on the combobox
selection.
I tried it like this, to no avail
private var acOrder:ArrayCollection
private var currentOrder:Object;
///////////////this is incorrect. What should i use instead
of Object?//////
private var whichArray:Object
private function makeid():void
whichArray = "orderid"
private function makeemail():void
whichArray = "email"
private function filterByOrderid(item:Object):Boolean
if (item.(whichArray) == filterTxt.text)
////I want this result to either be if (item.orderid ==
filterTxt.text)
///or if (item.orderid == filterTxt.email)
return true;
else
return false;
private function doFilter():void
if (filterTxt.text.length == 0)
acOrder.filterFunction = null
else
acOrder.filterFunction = filterByOrderid;
acOrder.refresh()
i think answer is very simple. i just need to pass the name
of the item inside the object correctly
thanks very much for any help
Hi,
Try declaring whichArray as String and try this
item[whichArray] instead of item.(whichArray).
Hope this helps.
Similar Messages
-
2007A - Problem with Combobox.Selected with an empty value
Hi all,
I 've tried to launch my add-on created with SBO 2005 SP1
on 2007 client.
I've a problem when I try to do
myCombobox.Selected.Value
when the valid value is empty.
Selected is null and I've an error.
So I must test each Combobox by doing this :
if( myCombobox.Selected is null)
But I've hundreds of this case in my code.
Does an another solution exists?
Thanksyou have the same problem in every business one version.
you first have to check if the property is not null/nothing
the only other way is that you use try / catch
value = oform.Items.Item("cmb1").Specific.selected.value()
Catch ex As Exception
value = ""
End Try
but the effort is the same for you -
Problem with combobox.select method in 2007A
Hi,
When I'm trying to select the empty validvalue with a combo in SBO 2007 A, I've the error "Out of Range"
myCombo.Select( 0, BoSearchKey.psk_Index);
However I'm sure that the item 0 of my ValidValues is blank.
I tried to do the same thing by value or description and it's the same problem.
Can anyone help me ?
Thanks
(I'm using 2005 version of SAPboui/bobsCom.dll)Hi Julien,
i tried it as
oComboBox.ValidValues.Add("1", "Combo Value 1")
oComboBox.ValidValues.Add("", "") - as you wrote
oComboBox.ValidValues.Add("2", "Combo Value 2")
oComboBox.ValidValues.Add("3", "Combo Value 3")
oComboBox.Select("", SAPbouiCOM.BoSearchKey.psk_ByValue)
oComboBox.Select(1, SAPbouiCOM.BoSearchKey.psk_Index)
and both select method work. Are you sure that you have added this blank value?
Try to debug it as
Dim q As Integer
Dim s As String
For q = 0 To oComboBox.ValidValues.Count - 1
s = oComboBox.ValidValues.Item(q).Value
Next
maybe it helps you.
Petr -
Arrow keys with direct select tool problem
Hi list,
I hope somebody can help me. I just switched from MX to CS3.
Now selecting an anchor with the direct select tool and
moving it with
the arrow keys moves it 30 Steps at once (Using normal select
tool works
as usual). Strangely enough I have to undo 30 Times for one
time hitting
the arrow key.
Does anyone know this problem or have a hint where to switch
this?
thanks in advance
oeYour frustration is understandable. Anchor point selection is unforgiving in InDesign, especially when compared to Illustrator with Smart Guides, although I wouldn't call it "broken."
I suspect most InDesign users don't do enough "path editing" on their InDesign pages for there to be an outcry over this.
Pablo28282 wrote:
It shouldn't be able to select and move an image. That is not the point of the tool.
That's always been a function of the Direct Select tool. Simply, if you're aiming for an anchor point and select the frame's content instead, you've missed the point. <rimshot>
There's nothing broken, and no advice to offer, other than zoom in further, slow down, and keep an eye on the pointer cues which change when the pointer is over an anchor point. I suppose it's also possible you could make adjustments to your mouse/input device settings that might help you move and click more precisely. -
Authorization Variables with Optional Selection Variables
Has anyone used authorization variables in addition to optional selection variables?
I'm getting funny results and trying to figure out why.
Here's the scenario:
InfoObject zcompany has 5 values A - E
UserX is authorized to see all 5 values in his user profile.
In the query zcompany has two variables assigned to it. 1 is an optional multiple selection variable, and 2) is an authorization variable
Here's the funny result:
User X runs the query and selects company A from the optional selection criteria, he clicks execute and but the results returned are companies A - E. ?????
Is there a processing order here? Are the authorizations being processed last and overwriting the selection criteria? My users are annoyed with me because they feel like they have to pick everything twice.
Any help anyone could provide would be much appreciated.
thanks
SmittyHey Bhanu,
thanks for the reply.
I kinda tried that in the past and found out that it really annoyed my user community.
I guess im looking for the best of both worlds here, because I like the fact that the authorization variable limits the optional selection values for the users that are only allowed to see one or two things, but for the super users this creates the issue described above because they're allowed to see everything. But sometimes, the power users only want to see one or two values... and thus the problem above.
I noticed in the query information the value for zcompany was "Complex Selection" is that the system's way of saying that it's confused? -
Help with ComboBox Selection Update
Hello,
I am trying to make this application display all its labels in a different language depending on which locale the user picks from the ComboBox. The variables are being read from the ResourceBundles correctly (see command-line debugging statements) but I cannot get the pane to 'refresh' when the item is selected. I've tried everything I can think of! Please help! :)
(This assignment was to internationalize a program we wrote for a previous assignment, so this program wasn't originally written to do this. I am trying to add this functionality to my existing project, so it's not ideal).
Thank you for any advice, help or hints you can give!
Program(PrjGUI)
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.*;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.TimeZone;
public class PrjGUI extends JFrame
//**** Instance Variables for both classes
private JRadioButton optGram, optOz;
private JTextField txtWeightEnter, txtResult, txtDateTime;
private JButton cmdConvert;
private JComboBox comboSelectLocale;
//arrays--one for combo box list, and the other for values to use when a particular list item is selected
private String[] localeList = {"English, USA", "Fran\u00E7ais, France", "Espag\u00F1ol, M\u00E9xico"};
private Locale[] localeCode = {(new Locale("en", "US")), (new Locale("fr", "FR")), (new Locale("es", "MX"))};
private JLabel lblChoose, lblWeightEnter;
protected String titleTxt, enterTxt, btnTxt, gramTxt, ozTxt, resultDisplayTxt, localeTimeZone, dateFormat;
protected ResourceBundle res;
protected Locale currentLocale;
//declare Handler Object
private CmdConvertWeight convertWeight;
//**************main method******************
public static void main(String[] args)
PrjGUI convertWeight1 = new PrjGUI();
}//end of main******************************
//constructor
public PrjGUI()
//create panel for components
Container pane = getContentPane();
//set the layout
pane.setLayout(new GridLayout(0, 1, 5, 5));
//set the color
pane.setBackground(Color.GREEN);
//make a font to use in components
Font font1 = new Font("SansSerif", Font.BOLD, 16);
/**New calendar object to display the date and time*/
GregorianCalendar calendar = new GregorianCalendar();
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, Locale.US);
/**currentLocale = localeCode[comboSelectLocale.getSelectedIndex()];
DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, currentLocale); //uses key for ResourceBundle*/
TimeZone timeZone = TimeZone.getTimeZone("CST");
//TimeZone timeZone = TimeZone.getTimeZone(localeTimeZone); //uses key for resourceBundle
formatter.setTimeZone(timeZone);
//***create UI objects***
/**NEW OBJECTS FOR prjInternational:
* a drop-down combobox, a label, and a txt field
txtDateTime = new JTextField(formatter.format(calendar.getTime()));
//txtDateTime = formatter.format(calendar.getTime());
lblChoose = new JLabel("Please choose your language.");
lblChoose.setFont(font1);
lblChoose.setBackground(new Color(0, 212, 255)); //aqua blue
comboSelectLocale = new JComboBox(localeList);
comboSelectLocale.setFont(font1);
comboSelectLocale.setBackground(new Color(0, 212, 255)); //aqua blue
//comboSelectLocale.setSelectedIndex(0);
//add a listener to the combo box to get the selected item
/**default values for variables so I can debug--at the moment
* I can't get the resouceBundle to work--it can't locate the
* file. So I will hard code these in for now.
/*titleTxt="Food Weight Converter";
enterTxt="Please enter the Weight you wish to convert.";
btnTxt="Convert this weight!";
gramTxt="grams";
ozTxt="oz";
resultDisplayTxt="Result will display here.";*/
comboSelectLocale.addItemListener(new ItemListener()
public void itemStateChanged(ItemEvent e)
res = setCurrentLocale(comboSelectLocale.getSelectedIndex());
System.out.println(res.getString("enterTxt"));
updateItems(res);
//set variables from Resource Bundle
/* titleTxt = res.getString("titleTxt");
System.out.println(res.getString("enterTxt")); //debug
enterTxt = res.getString("enterTxt");
btnTxt = res.getString("enterTxt");
gramTxt = res.getString("gramTxt");
ozTxt = res.getString("ozTxt");
resultDisplayTxt = res.getString("resultDisplayTxt");*/
//2 radio buttons
//optGram = new JRadioButton("grams", true);
optGram = new JRadioButton(gramTxt, true);
//optOz = new JRadioButton("oz.");
optOz = new JRadioButton(ozTxt);
optGram.setBackground(Color.GREEN);
optGram.setFont(font1);
optOz.setBackground(Color.GREEN);
optOz.setFont(font1);
//button group so only one can be chosen
ButtonGroup weightUnit = new ButtonGroup();
weightUnit.add(optGram);
weightUnit.add(optOz);
//label and text field for weight
//JLabel lblWeightEnter = new JLabel("Please enter the weight you wish to convert:");
JLabel lblWeightEnter = new JLabel(enterTxt);
lblWeightEnter.setFont(font1);
txtWeightEnter = new JTextField("20.05", 6);
txtWeightEnter.setBackground(new Color(205, 255, 0)); //lime green
txtWeightEnter.setFont(font1);
//button to make conversion
//cmdConvert = new JButton("Convert this weight!");
cmdConvert = new JButton(btnTxt);
cmdConvert.setFont(font1);
//textfield to display result
//txtResult = new JTextField("Result will display here");
txtResult = new JTextField(resultDisplayTxt);
txtResult.setBackground(new Color(205, 255, 0)); //lime green
txtResult.setFont(font1);
//register the handler
convertWeight = new CmdConvertWeight();
cmdConvert.addActionListener(convertWeight);
//add content to pane
pane.add(txtDateTime);
pane.add(lblChoose);
pane.add(comboSelectLocale);
pane.add(lblWeightEnter);
pane.add(txtWeightEnter);
pane.add(optGram);
pane.add(optOz);
pane.add(cmdConvert);
pane.add(txtResult);
//create window for object
setTitle(titleTxt);
setSize(400, 300);
setVisible(true);
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}//end of constructor
/** ACTION LISTENER CLASS TO RESPOND TO USER'S INPUT (EVENTS) **/
private class CmdConvertWeight implements ActionListener
public void actionPerformed(ActionEvent e)
//System.out.println("we made it to the Action Listener"); //debug
//get info from fields
double weight = Double.parseDouble(txtWeightEnter.getText());
double weightConvert = 0;
String weightConvertString;
if (optGram.isSelected())//if user's weight is in grams, converting to oz
weightConvert = weight/28.35;
weightConvertString = Double.toString(weightConvert);
txtResult.setText(txtWeightEnter.getText() + " grams is equal to " + weightConvertString + " oz.");
}//end if gram select
else if (optOz.isSelected())//if user's weight is in oz, converting to grams
weightConvert = weight*28.35;
weightConvertString = Double.toString(weightConvert);
txtResult.setText(txtWeightEnter.getText() + " oz. is equal to " + weightConvertString + " grams.");
}//end if oz select
}//end actionPerformed
}//end CmdConvertWeight
/**setCurrentLocale method from combo box listener*/
public ResourceBundle setCurrentLocale(int index)
Locale currentLocale = localeCode[index];
System.out.println(currentLocale); //debug
System.out.println("MyResource_" + currentLocale); //debug
ResourceBundle res = ResourceBundle.getBundle("MyResource_" + currentLocale);
return res;
}//end setCurrentLocale
public void updateItems(ResourceBundle res)
//convertWeight1.setTitle(res.getString(titleTxt));
System.out.println(res.getString(btnTxt));//debug
lblWeightEnter.setText(res.getString(enterTxt));
optGram.setText(res.getString(gramTxt));
optOz.setText(res.getString(ozTxt));
cmdConvert.setText(res.getString(btnTxt));
txtResult.setText(res.getString(resultDisplayTxt));
}//end updateItems
}//end of class PrjGUIResourceBundles(each in a different file)
public class MyResource_fr_FR extends java.util.ListResourceBundle
static final Object[][] contents =
{"titleTxt", "Convertisseur de poids de nourriture"},
{"enterTxt", "Veuillez \u00E9crire le poids que vous souhaitez convertir."},
{"btnTxt", "Convertissez ce poids!"},
{"gramTxt", "grammes"},
{"ozTxt", "onces"},
{"resultDisplayTxt", "Le r\u00E9sultat montrera ici."},
{"localeTimeZone", "CET"},
{"dateFormat", "Locale.FR"}
public Object[][] getContents()
return contents;
public class MyResource_es_MX extends java.util.ListResourceBundle
static final Object[][] contents =
{"titleTxt", "Convertidor del peso del alimento"},
{"enterTxt", "Incorpore por favor el peso que usted desea convertir."},
{"btnTxt", "\u00F1convierta este peso!"},
{"gramTxt", "gramos"},
{"ozTxt", "onzas"},
{"resultDisplayTxt", "El resultado exhibir\u00E1 aqu\u00ED."},
{"localeTimeZone", "CST"},
{"dateFormat", "Locale.MX"}
public Object[][] getContents()
return contents;
public class MyResource_en_US extends java.util.ListResourceBundle
static final Object[][] contents =
{"titleTxt", "Food Weight Converter"},
{"enterTxt", "Please enter the weight you wish to convert."},
{"btnTxt", "Convert this weight!"},
{"gramTxt", "grams"},
{"ozTxt", "oz"},
{"resultDisplayTxt", "Result will display here."},
{"localeTimeZone", "CST"},
{"dateFormat", "Locale.US"}
public Object[][] getContents()
return contents;
}Edited by: JessePhoenix on Nov 2, 2008 8:30 PMcatman2u wrote:
does anyone from Lenovo actually read this forum?
From the Communiy Rules in the Welcome section....
Objectives of Lenovo Discussion Forums
These communities have been created to provide a high quality atmosphere in which users of Lenovo products and services may share experiences and expertise. While members from Lenovo may participate at intervals to engage in the discussions and offer advice and suggestions, this forum is not designed as a dedicated and staffed support channel. This is an informal and public forum, and Lenovo does not guarantee the accuracy of information and advice posted here -- see important Warranty information below.
No amount of ranting is going to get you anything more than you will achieve with a clear exposition of your issue... so you might want to try doing that instead of ranting and assuming that everyone already knows what you know etc etc.
Cheers,
Bill
I don't work for Lenovo -
Oracle Function with a select into problem
Here is one that I cannot figure out. I'm trying to select the median of a set of events in a purchase qty. I have the selects working in SQL. It returns the correct answer for several sets of test data. However, when I put this into a function to be able to call during more complex queries it doesn't work. I've tested the function several different ways and it's looking like the select median into v_median2... is not working. Please help!
Here is the code... When this is run what ever is in v_plant is returned. IE: If you pass 1122 into with getmedian('4567','12345678-0001') this returns 4567 at the output. I've bypassed the v_plant and v_material in the select part below and it still output 4567.
If you run the select (with test data put in place of v_plant and v_material in a sqlplus window without the INTO v_median2) it would return a 12.
If you run this function as is it would return 4567.
Here is the output from the dbms_output tests.
4567
12345678-0001
4567
12345678-0001
4567
WHY?
CREATE OR REPLACE FUNCTION getmedian(v_plant IN VARCHAR2, v_material IN VARCHAR2)
RETURN NUMBER
AS
v_median2 NUMBER;
BEGIN
DBMS_OUTPUT.PUT_LINE(v_plant);
DBMS_OUTPUT.PUT_LINE(v_material);
SELECT MEDIAN INTO v_median2
FROM (SELECT ROWNUM as rownums,MEDIAN
FROM (SELECT abs(quantity_in_unit_entry) AS MEDIAN
FROM tbl_transactions
WHERE plant = v_plant
AND material = v_material
AND movement_type IN ('961','261','201')
ORDER BY quantity_in_unit_entry DESC))
WHERE ROWNUMs = ( select round(COUNT(1)/2,0) AS TOTAL2
from tbl_transactions t
WHERE plant = v_plant
AND material = v_material
AND t.movement_type IN ('961','261','201'));
DBMS_OUTPUT.PUT_LINE(v_plant);
DBMS_OUTPUT.PUT_LINE(v_material);
DBMS_OUTPUT.PUT_LINE(v_median2);
RETURN v_median2;
END;It looks like another one of those cases where the pl/sql engine doesn't yet handle everything that the sql engine does. The usual solution is to execute the part that only works in sql dynamically. Try this:
CREATE OR REPLACE FUNCTION getmedian
(v_plant IN VARCHAR2,
v_material IN VARCHAR2)
RETURN NUMBER
AS
v_rownums NUMBER := 0;
v_sql VARCHAR2 (4000) := NULL;
v_median2 NUMBER := 0;
BEGIN
SELECT ROUND (COUNT (1) / 2, 0)
INTO v_rownums
FROM tbl_transactions
WHERE plant = v_plant
AND material = v_material
AND movement_type IN
('961', '261', '201');
v_sql :=
'SELECT median
FROM (SELECT ROWNUM AS rownums,
median
FROM (SELECT ABS (quantity_in_unit_entry)
AS median
FROM tbl_transactions
WHERE plant = :v_plant
AND material = :v_material
AND movement_type IN
(''961'', ''261'', ''201'')
ORDER BY quantity_in_unit_entry DESC))
WHERE rownums = :v_rownums';
EXECUTE IMMEDIATE v_sql INTO v_median2
USING v_plant, v_material, v_rownums;
RETURN v_median2;
END getmedian; -
Adding a new class with Creator (really simple problem i think..)
I added a new class to my project with creator...
class name is "CambiaNote" and there's a method called Cambia
tabellaselezionabile is my project(package)
I tried to run everything but It gave me an error:
Exception Details: org.apache.jasper.JasperException
Error getting property 'cambia' from bean of type tabellaselezionabile.Page1I don't know, but the word cambia don't exists at all in my code... or it is not case sensitive..?
please help, thankstypo: correct Paint() to paint()
-
How can we Restict the Char single value Variables with , , =
Hi Experts,
How can we Restict the Char value Variables with <, >, <= (without selecting Inverval or only passing single value)
For Example
We have a standard Query 0FIAR_C03_Q1005, in this
New Selection
"1 - 15 Days, Posting Date<=Key Date, Clearing Date>Key Date"
This is restricted with the
Clearing(0CLEAR_DATE)
<Clearing key date(0P_KEYD3) It is a single value SAP Exit Varible
PostingDate(0PSTNG_DATE)
<= Posting keydate(0P_KEYD3) It is a single value SAP Exit Varible
When seeing these 0P_KEYD3, 0P_KEYD3 variables in the New selection screen they looks like >0P_KEYD3, <=0PSTNG_DATE
if you define any custom variables these are looks like =ZV_DATE.
to enable < , >, <= symbols for variables what we need to do.
In other way
Say we created one variable ZV_DATE single value, processing type as customer exit.
for this we populated current day,
Now Requirement is we need to display the all the records which are <= current date,
instead of passing low and high values, i want to restrict the calday <=ZV_DATE
New selection
0calday
<=ZV_DATE
How can we achive this, this is how the business content report having the restrictions
Please sugget me.
Thanks
Chandra
Edited by: Chandra Gandla on Jun 18, 2010 11:01 AM
Edited by: Chandra Gandla on Jun 18, 2010 11:01 AMOk,
In the InfoObject 0calday in the query designer under the filter area, under characteristic restrictions right-click over that InfoObject (0calday).
In the next window (select Values for [0CALDAY] Calendar Day in the dropdown box for "Show" choose Value Ranges. Under the word "Between" dropdown box select "Less than or equal to"
Below that word click on the button of the dropdown box Select from list.
In the new window select instead of History Variables and double-click on your variable ZV_DATE.
Click on the right blue arrow to move it to the right.
And there you go.
Tip: It exists a SAP standard variable named 0DAT which is exactly the current date (don't need to use ZV_DATE variable).
Diogo. -
I am in a great problem with a very simple problem. I am new to J2EE. I had installed j2sdk1.4.0_03 / tomcat 4.1 in windows 2000. my problem is that the servlets are not being compiled. The error is " package javax.servlet is not found". error are also there in all the classes of this packege like in HttpServletResponse, HttpServletRequest etc.
The classpath are correct. One of my friend is working with the same version and with the same classpath but in Windows XP..
can anyone tell me why this is happening. and how to overcome this. PLEASE...............Add the jar that contains the javax.servlet package to your javac classpath using the -classpath option. Not sure why your CLASSPATH isn't working maybe youi have some invalid characters or directories with spaces that aren't quoted etc... I believe the servlet APIs are in servlet-api.jar, or at least they are in 5.0. Also please searxh the forums in the future this is a pretty typical question and has been answered numerous times.
-
Problem with userdefined combobox selection
Hi guys,
Have an "AutoSearchComboBox" as follows for searching the combolist fast.Have some problems with the selection in the AutoSearchComboBox.
*public class AutoSearchComboBox extends JComboBox {*
private static final long serialVersionUID = 1L;
*public AutoSearchComboBox(){*
setEditable(true);
setModel(new AutoSearchComboBoxModel());
setEditor(new MyComboBoxEditor());
public class AutoSearchComboBoxModel extends AbstractListModel
*implements MutableComboBoxModel{*
private static final long serialVersionUID = 1L;
private Vector items,filteredItems;
private Filter filter;
private Object selectedItem;
*public AutoSearchComboBoxModel(){*
this.items = new Vector();
this.filteredItems = new Vector();
this.filter = null;
updateFilteredItems();
*public void addElement(Object obj) {*
items.add(obj);
updateFilteredItems();
public void insertElementAt(Object obj, int index) {}
*public void removeElement(Object obj) {*
items.remove(obj);
updateFilteredItems();
*public void removeElementAt(int index) {*
items.remove(index);
updateFilteredItems();
*public Object getSelectedItem() {*
return selectedItem;
*public void setSelectedItem(Object anItem) {*
if ((selectedItem==null) && (anItem==null))
return;
if ((selectedItem != null) && (selectedItem.equals(anItem)))
return;
if(anItem!= null && anItem.equals(selectedItem))
return;
selectedItem = anItem;
fireContentsChanged(this, -1,-1);
*public Object getElementAt(int index) {*
return filteredItems.get(index);
*public int getSize() {*
return filteredItems.size();
*public void setFilter(Filter filter){*
this.filter = filter;
updateFilteredItems();
*public void updateFilteredItems(){*
fireIntervalRemoved(this,0,filteredItems.size());
filteredItems.clear();
if(filter==null)
filteredItems.addAll(items);
else
*for(Iterator iter = items.iterator(); iter.hasNext();){*
Object item = iter.next();
if (filter.accept(item))
filteredItems.add(item);
fireIntervalAdded(this,0, filteredItems.size());
*public static interface Filter{*
public boolean accept(Object obj);
*class FilterItems implements Filter{*
private String prefix;
*public FilterItems(String prefix){*
this.prefix = prefix;
*public boolean accept(Object obj){*
return doesStartsWithThePrefix(obj.toString(),prefix);
*private boolean doesStartsWithThePrefix(String str1,String str2){*
return str1.toUpperCase().startsWith(str2.toUpperCase());
*public class MyComboBoxEditor implements ComboBoxEditor,DocumentListener{*
private JTextField text;
private volatile boolean filtering = false;
private volatile boolean setting = false;
*public MyComboBoxEditor(){*
text = new JTextField(15);
text.getDocument().addDocumentListener(this);
*public void addActionListener(ActionListener l) {*
*// TODO Auto-generated method stub*
*public void removeActionListener(ActionListener l) {*
*// TODO Auto-generated method stub*
*public Component getEditorComponent() {*
return text;
*public void setItem(Object anObject) {*
if(filtering)
return;
setting = true;
String newText = (anObject==null)? "":anObject.toString();
text.setText(newText);
setting = false;
*public Object getItem() {*
return text.getText();
*public void selectAll() {*
text.selectAll();
*public void changedUpdate(DocumentEvent e) {*
*// TODO Auto-generated method stub*
*public void insertUpdate(DocumentEvent e) {*
handleChange();
*public void removeUpdate(DocumentEvent e) {*
handleChange();
*public void handleChange(){*
if(setting)
return;
filtering = true;
Filter filter = null;
if(text.getText().length()>0)
filter = new FilterItems(text.getText());
*((AutoSearchComboBoxModel)getModel()).setFilter(filter);*
setPopupVisible(false);
if (getModel().getSize()>0)
setPopupVisible(true);
filtering = false;
Iam creating the combo boxes as follows from another source file.
private AutoSearchComboBox indexTagCombo,indexValueCombo
//The following function is called for loading the comboBoxes.
private void loadInitialIndexTagValues()
indexTagCombo.removeAllItems();
//Getting values to be fiiled in the comboBox.
Set tags = this.model.getAvailableIndexTags();
// Iterating over the elements in the set
Iterator tagIter = tags.iterator();
while (tagIter.hasNext()) {
indexTagCombo.addItem(tagIter.next());
//Loading index values.
String currTag = (String)indexTagCombo.getSelectedItem(); //Selection problem 1
The statement above returns me null & the follwing code doesnt fill the other comboBox.
Set values = model.getAllValues(currTag);
indexValueCombo.removeAllItems();
Iterator valIter = values.iterator();
while (valIter.hasNext()) {
indexValueCombo.addItem(valIter.next());
Have added an "itemListener" to the indexTagCombo as follows:
indexTagCombo.addItemListener(new ItemListener(){
public void itemStateChanged(ItemEvent e)
indexTagSelection(e);
private void indexTagSelection(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED)
//The "getStateChange" is never ItemEvent.SELECTED,so that it never gets in to this loop.//Another problem
//code goes Here
There is some problem with the defined "AutoSearchComboBox" with selection.When I change the privately defined "AutoSearchComboBox" to JComboBox and make it editable,all the selection problems are gone.
In short all the "getSelectedItem" from the "AutoSearchComboBox" and the "itemstate" events defined are not going to the "ItemEvent.SELECTED"
What should I fix in the "AutoSearchComboBox" so that the selections work.
Any help is greatly appreciated.
Thanks
PHi Smita,
When you create the Transaction code either thru Se80 or thru Se93... please see that you are giving the screen number asked there as 1000, which is the default screen number for the selection screen.
Also, please see if the checkboxes for the GUI Support are ticked. I think it iwll solve you problem.
Regards,
Jayant -
Hello
Simple problem - don,t know how to solve it.
With Premiere CC when I try to do a selection (click... drag... release the click) very often it stop way before the end of the move I'm swinging the Magic Mouse. I taught that the mouse clicking was defective and went to get a new Magic Mouse after lots of frustration. Today, I have an edit to do it it does the SAME thing !!
I was like ????#$%?&*(???
Opened all the lights and taught I've trow the new mouse to the garbage and was using the defective mouse again... no !! - ??
Actually, the bran new mouse is doing the same thing. What I understand after investigating on the motion and watching carefully my fingers !! - is that when I click I have to keep my finger at the EXACT same place on the mouse... drag and release and it's fine. If I click by pushing on the mouse and my finder is moving of a 1/32th of a millimeter, it will release and my selection will be to redo. You can understand my frustration ! - 75$ later... same problem, but I know that if I click with about 5 pounds of pressure and trying to pass my finger through the plastic of the mouse, it you stay steady and make it !
The problem is that scrolling is enable while clicking and it bugs.
How to disable it ??
Simple question - can't find the answer !Helllooo !?
sorry but the Magic Mouse is just useless with the new Adobe Premiere CC and since I'm not the only one but can't find answer this is really disappointing. This mouse is just fantastic and now I have to swap from a USB mouse to the Magic Mouse every times I do some editing. My USB mouse if hurting my hand somehow and I want to got back to the Magic Mouse asap. Please - for sure there is a simple solution !
Thanks !! -
ComboBox Problem to change the size of selected text in JTextPane.
hi 2 all!
I have a problem in combo box actions, when i change the item in the combo its set is not set at that time but that action is performed when next action is taken, i have used combobox.setAction(new StyledEditorKit.FontSizeAction(" click", 12);) command to set the size of the selected text
Plz suggest the solution also if possible,plz provide some code for this
Action action1 = new StyledEditorKit.FontSizeAction(
"double click", 12);
Action action2 = new StyledEditorKit.FontSizeAction(
"double click", 14);
Action action3 = new StyledEditorKit.FontSizeAction(
"double click", 18);
s2 = (String) cb7.getSelectedItem();
if (s2.equals("Small")) {
cb7.setAction(action1);
e1.setSource(cb7);
} else
if (s2.equals("Medium")) {
cb7.setAction(action2);
e1.setSource(cb7);
} else if (s2.equals("Large")) {
cb7.setAction(action3);
// e1.setSource(cb7);
when i chooze any combobox item then according to that item i set the Action on ComboBox but that action is not working properly on the selected text in the JTextPane..means selected text in JText Pane is not changes its Size according to the comboBox selected ITEM.
PLZ plzzzzzzzzzz help me:((.i will be thankfull to u.
thanx in advance..this code is not working properly according to the action i set on comboBox.Thats correct, the setAction() method is used to invoke an existing Action on the combo box, not create a new Action.
What you need to do is have a single action that uses the information from the item that was selected to build a dynamic Action to change the font. Something like:
public void actionPerformed(ActionEvent e)
JComboBox comboBox = (JComboBox)e.getSource();
int fontSize = Integer.parseInt( comboBox.getSelectedItem().toString() );
Action fontAction = new StyledEditorKit.FontSizeAction("size", fontSize);
fontAction.actionPerformed(null);
} -
Hi all,
I've got a JTree that represents a sort of data that I'm going to change dynamically in my application. I'd like to reset the selection of the user to the leaf she has selected before the change to the tree structure.
First of all my tree uses DefaultMutableTreeNode to build each node, and each DefaultMutableTreeNode contains a SingleKeyValue object, that is a key-value object (two strings) and that has an hashcode defined as follows:
public class SingleKeyValue extends BaseKeyValue{
* The key of the database object.
protected String key = null;
* The description of this object.
protected String value = null;
public int hashCode() {
return this.key.hashCode();
I hope the hashcode can help me finding the right object even when its value changes (but the key is the same). The construction of the tree is the following:
DefaultMutableTreeNode root = new DefaultMutableTreeNode("The root");
// iterate and build each node
SingleKeyValue object = new SingleKeyValue("key","value");
DefaultMutableTreeNode node = new DefaultMutableTreeNode(object);
root.add(node);
DefaultTreeModel model = new DefaultTreeModel(root);
JTree tree = new JTree(model);
so the tree is associated to a DefaultTreeModel. Then, when I need to change something in the tree I rebuild the tree and all leafs (with the SingleKeyValues) and rebuild the model:
TreeModel treeModel = this.myTree.getModel();
TreeSelectionModel selectionModel = this.myTree.getSelectionModel();
DefaultTreeModel defaultTreeModel = null;
DefaultTreeSelectionModel defaultTreeSelectionModel = null;
TreePath selectedPath = null;
TreeNode root = null;
Logger.info("SimpleTreePanel.refreshDatabaseView: treemodel "+treeModel + " selectionModel " + selectionModel);
if( treeModel != null && treeModel instanceof DefaultTreeModel ) {
defaultTreeModel = (DefaultTreeModel) treeModel;
root = this.getRoot();
// get the selection
if( selectionModel != null && selectionModel instanceof DefaultTreeSelectionModel ){
defaultTreeSelectionModel = (DefaultTreeSelectionModel) selectionModel;
selectedPath = defaultTreeSelectionModel.getSelectionPath();
Logger.warn("Selection path of the tree: "+selectedPath);
// rebuild the tree
defaultTreeModel.setRoot(root);
// set the selected element
defaultTreeSelectionModel.setSelectionPath(selectedPath);The problem is that after the above code the tree is all closed, no leaf are selected. I guess the problem is with the SingleKeyValueObject because I've tried the default model and it works with, for example, simple strings. Any idea about?
Thanks,
LucaHere's a complete test program that creates a few SingleKeyValue objetcs (objects with a key and a description) and that then places them into a JTree using the DefaultMutableTreeNode. After that, the selection of user is took and one node is changed, but while the selection is working, the reload/refresh of the tree is not.
Any idea about how to work on it?
public class SingleKeyValue extends BaseKeyValue{
* The key of the database object.
protected String key = null;
* The description of this object.
protected String value = null;
// constants related to the type of the table this object refers to
public static final String COMPETENCE = "competenza";
public static final String FAMILY = "famiglia_competenza";
public static final String ROLE = "ruolo";
public static final String PROVINCE = "provincia";
public static final String KNOWLEDGE = "titolo_studio";
public final static String OBJECTIVE = "obiettivo";
public final static String PERSON = "persona";
public SingleKeyValue( String key, String value, String table){
super();
this.key = key;
this.value = value;
this.SQLTable = table;
* @return the key
public final String getKey() {
return key;
* @param key the key to set
public final void setKey(String key) {
this.key = key;
* @return the value
public final String getValue() {
return value;
* @param value the value to set
public final void setValue(String value) {
this.value = value;
* Shows this element.
public String toString(){
String ret;
if( this.showKey ){
ret = this.label + this.key +" { "+ this.value +" }";
else
ret = this.label + this.value;
// trim the string
if( ret.length() > this.maxLength )
return ret.substring(0 , this.maxLength);
else
return ret;
* The hash code of this object is the hash code of the key.
* @return the hash code of the key of the object
public int hashCode() {
return this.key.hashCode();
* Returns true if the object passed is a single key value equals (i.e., with the same key) of this one.
public boolean equals(Object o){
if( o== null || (! (o instanceof SingleKeyValue) ) ) return false;
else
return (this.hashCode() == o.hashCode());
public static void main(String argv[]) throws Exception{
SingleKeyValue skv1 = new SingleKeyValue("Key1","Description1", SingleKeyValue.COMPETENCE);
SingleKeyValue skv2 = new SingleKeyValue("Key1a","Description1a", SingleKeyValue.COMPETENCE);
SingleKeyValue skv3 = new SingleKeyValue("Key1b","Description1b", SingleKeyValue.COMPETENCE);
SingleKeyValue skv4 = new SingleKeyValue("Key2","Description2", SingleKeyValue.COMPETENCE);
SingleKeyValue skv5 = new SingleKeyValue("Key2a","Description2a", SingleKeyValue.COMPETENCE);
SingleKeyValue skv6 = new SingleKeyValue("Key2b","Description2b", SingleKeyValue.COMPETENCE);
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("root");
DefaultMutableTreeNode node1 = new DefaultMutableTreeNode(skv1);
DefaultMutableTreeNode node2 = new DefaultMutableTreeNode(skv2);
DefaultMutableTreeNode node3 = new DefaultMutableTreeNode(skv3);
DefaultMutableTreeNode node4 = new DefaultMutableTreeNode(skv4);
DefaultMutableTreeNode node5 = new DefaultMutableTreeNode(skv5);
DefaultMutableTreeNode node6 = new DefaultMutableTreeNode(skv6);
rootNode.add(node1);
node1.add(node2);
node1.add(node3);
rootNode.add(node4);
node4.add(node5);
node4.add(node6);
JTree tree = new JTree(rootNode);
JFrame f = new JFrame("Tree try");
f.add( new JScrollPane(tree) );
f.setSize(300,300);
f.setVisible(true);
System.out.println("Please select a node within 10 seconds");
Thread.sleep(10000);
// now get the user selection
TreeModel treeModel = tree.getModel();
TreeSelectionModel selectionModel = tree.getSelectionModel();
DefaultTreeModel defaultTreeModel = null;
DefaultTreeSelectionModel defaultTreeSelectionModel = null;
TreePath selectedPath = null;
TreeNode root = null;
if( treeModel != null && treeModel instanceof DefaultTreeModel ) {
defaultTreeModel = (DefaultTreeModel) treeModel;
// get the selection
if( selectionModel != null && selectionModel instanceof DefaultTreeSelectionModel ){
defaultTreeSelectionModel = (DefaultTreeSelectionModel) selectionModel;
selectedPath = defaultTreeSelectionModel.getSelectionPath();
// rebuild the tree
node1.setUserObject(new SingleKeyValue("key20","key changed",SingleKeyValue.FAMILY));
defaultTreeModel.reload();
// set the selected element
defaultTreeSelectionModel.setSelectionPath(selectedPath);
} -
HTMLLoader problem with comboBox
hi guys
I'm trying to loader pdf file using XML to retrieve the URL and I have CombBox to list all the files ,and I need to load another file every time I change the silder for the CombBox
the problem is the pdf file load only first time and dosent change if I select another one from the list, I dont know what the the probelm I tried manything like removeChild and I tried to use container but no change, only first time the file loaded
this is the code
cb_list.addEventListener(
SliderEvent.CHANGE,changehandler);
function changehandler(e:Event):void {
var sort1:String=cb_list.value;
var id:String = myXML.tip.(title == sort1)[email protected]();
//trace(id)
var slectedtip = myXML.tip.(title == sort1).fulltip.text();
tit_label.text=myXML.tip.(@ID == id).title .text();
date_label.text=myXML.tip.(@ID == id).date.text();
full_tip.text=myXML.tip.(@ID == id).fulltip.text();
var flashfileURL = myXML.tip.(@ID == id).picURL.text();
swfURL.text=flashfileURL;
var url:String = new String();
url= myXML.tip.(@ID == id).picURL.text().toXMLString();
var requestpdf:URLRequest=new URLRequest(url);
var container:Sprite = new Sprite();
var pdf = new HTMLLoader();
pdf.height=stage.stageHeight-150;
pdf.width=stage.stageWidth-270;
pdf.y=100;
pdf.x=260;
pdf.load(requestpdf);
pdf.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(event:Event):void {
addChild(pdf);[problem with combobox comes infront of popup window|http://forum.java.sun.com/thread.jspa?threadID=5291468]
Maybe you are looking for
-
Error Handling in OS 10gR3: How To's, Approaches, best practices
I am trying to do error rhandling within OSB 10gR3 and looking for some guidance as to best practices and how to carry out the error handling based on my use-case as - Consumers ---> GenericProxyExt(WSDL based) ---> GenericProxyInt(Any SOAP) ---> Pro
-
HT1695 WiFi internet page error on every page... Forbidden
Please can someone help with a WiFi connection issue with an iPad 2 Each page I try to pull up gives a Forbidden error & it shows connected to my Comcast Gateway (Dory Device). Thanks!
-
Hi all, I wanted to implement one new thing as an enhancement to my existing xi scenarios. I want to create a webservice or html page through which I can access the features of SXMB_MONI with some enhancements say I want one more column as in SXMB_MO
-
How do I create password presets in Acrobat X?
I did it in 9 but with the drastic changes made in X, I am still having a hard time finding everything. In 9, I created a preset that would automatically put a password and watermark onto my PDF. How do I do this in X?
-
OraOLEDB.Oracle on x64 Win 2003 connect to Oracle 9.2 from SQL 2005 x64
I know this is an Oracle board but some of you may also support SQL Server like I do and I am hoping someone has had the pleasure of using OraOLEDB.Oracle on 64 bit. I have a 64 bit SQL Server 2005 SP2 on a Windows 2003 x64. The developer said that h