FlexComboBox - return value from the dropdown after 5th Index
In QTP - Can i directly find value from FlexComboBox by Index, currently it can show only 5 values in dropdown, ifi do GetItemsCount it gives me total count in FlexComboBox but when i loop thorugh it it can successfully give me values only till idex 5 and then after that it says Object Required, (i am using flex 4.5)
m_ilio wrote:
I have a form (consult that return a value) with a jtextfield and a jtable. when the user types in the textfield, the textfield call a method to filter the tablemodel.
everything works fine, but after filtering the model, the references are lost and the return value does not match with the selected row.
I read that convertColumnIndexToView, convertRowIndexToView, vertColumnIndexToModel and convertRowIndexToModel, solve the problem, but I used all and nothing.
You're right in that you have to use convertRowIndexToModel(), but you are using it wrong. That method takes as input the index of a row in the view, i.e. the table, and returns the corresponding row in the underlying TableModel. No data is changed by the call, so this:
this.jTable1.convertRowIndexToModel(0);is meaningless by itself.
What you need to do is the following:
int selectedRow = this.jTable1.getSelectedRow(); // This is the selected row in the view
if (selectedRow >= 0) {
int modelRow = this.jTable1.convertRowIndexToModel(selectedRow); // This is the corresponding row in the model
String str_id =this.jTable1.getModel().getValueAt(modelRow, 0).toString();
}Hope this helps.
Similar Messages
-
Fetching more than one row from a table after selecting one value from the dropdown
Hi Experts,
How can we fetch more than one row from a table after selecting one value from the dropdown.
The scenario is that I have some entries in the dropdown like below
A B C
11256 VID 911256
11256 VID 811256
11256 SONY 11256
The 'B' values are there in the dropdown. I have removed the duplicate entries from the dropdown so now the dropdownlist has only two values.for eg- 'VID' and'SONY'. So now, after selecting 'VID' from the dropdown I should get all the 'C' values. After this the "C' values are to be passed to other methods to fetch some data from other tables.
Request your help on this.
Thanks,
Preeetam Narkhede.Hi Preetam!
I hope I understand your request proberly, since this is more about Java and less about WebDynpro, but if I'm wrong, just follow up on this.
Supposed you have some collection of your original table data stored in variable "origin". Populate a Hashtable using the values from column "B" (let's assume it's Strings) as keys and an ArrayList of whatever "C" is (let's assume String instances, too) as value (there's a lot of ways to iterate over whatever your datasource is, and since we do not know what your datasource is, maybe you'll have to follow another approach to get b and c vaues,but the principle should remain the same):
// Declare a private variable for your Data at the appropriate place in your code
private Hashtable temp = new Hashtable<String, ArrayList<String>>();
// Then, in the method you use to retrieve backend data and populate the dropdown,
// populate the Hashtable, too
Iterator<TableData> a = origin.iterator();
while (a.hasNext()) {
TableData current = a.next();
String b = current.getB();
String c = current.getC();
ArrayList<String> values = this.temp.get(b);
if (values == null) {
values = new ArrayList<String>();
values.add(c);
this.temp.put(b, values);
So after this, you'll have a Hashtable with the B values als keys and collections of C values of this particular B as value:
VID --> (911256, 811256)
SONY --> (11256)
Use
temp.keySet()
to populate your dropdown.
After the user selects an entry from the dropdown (let's say stored in variable selectedB), you will be able to retrieve the collection of c's from your Hashtable
// In the metod you handle the selection event with, get the c value collection
//and use it to select from your other table
ArrayList<String> selectedCs = this.temp.get(selectedB);
// now iterate over the selectedCs items and use each of these
//to continue retrieving whatever data you need...
for (String oneC : selectedCs) {
// Select Data from backend using oneC in the where-Clause or whatever...
Hope that helps
Michael -
How to get all the values from the dropdown menu
How to get all the values from the dropdown menu
I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
How do I get number of item is selection dropdown?
How do I extract a ?name? for each value, one by one?
How do I change a selection by referring to particular index of the item in a dropdown menu?
Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
Message was edited by: testtestThe findElement method allows various attributes to be used to search. Take the following two examples for the element below:
<Select Name=ProdType ID=testProd>
</Select>
I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
If I want to search by id I could do the following:
Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
You can use the FindElement to grab links, text boxes, etc.
The next example grabs from a link on a page
Home
Set x = RSWApp.om.FindElement("Home","A","innerText")
I hope this helps clear it up. -
How do I get (in c) a method return value from the java side?
I have a class in the Java side, that I pass as object to the c side.
in the Java class I have the following method:
public String getPgmId()
return pgmId;
where pgmId is a private string.
I nees to get the value of pgmId, hopefully by using the getPgmId method.
what I have until now is:
JNIEXPORT jint JNICALL Java_JavaAPI_StartProgram (JNIEnv *env, jobject obj, jobject obj2)
jmethodID methID;
jstring jstr;
const char *str;
/* Get a reference to obj2 class */
jclass cls = (*env)->GetObjectClass (env, obj2);
if (cls == NULL){
return;
methID = (*env)->GetMethodID (env, cls, "getPgmId", "()Ljava/lang/String;");
}//StartProgram
my question is how from this point, can I get the return value of the method getPgmId().
tnxjString CallStringMethod(env, obj2, methID);
-
Problem with the return value from a tablemodel after filtering
I have a form (consult that return a value) with a jtextfield and a jtable. when the user types in the textfield, the textfield call a method to filter the tablemodel.
everything works fine, but after filtering the model, the references are lost and the return value does not match with the selected row.
I read that convertColumnIndexToView, convertRowIndexToView, vertColumnIndexToModel and convertRowIndexToModel, solve the problem, but I used all and nothing.
**** This is the code to fill the jtable
DefaultTableModel modelo=(DefaultTableModel)this.jTable1.getModel();
while(rs.next()){
Object[] fila= new Object[2];
fila[0]=rs.getObject("id_categoria");
fila[1]=rs.getObject("nombre");
modelo.addRow(fila);
this.jTable1.getColumnModel().removeColumn(this.jTable1.getColumnModel().getColumn(0));
// I delete the first column because is a ID, I dont want that the user see it. the value is only for me**** this is the method to filter from the jtextfield
private void FiltrarJtable1() {
TableRowSorter sorter = new TableRowSorter(this.jTable1.getModel());
sorter.setRowFilter(RowFilter.regexFilter("^"+this.jTextField1.getText().toUpperCase(), 1));
this.jTable1.setRowSorter(sorter);
this.jTable1.convertRowIndexToModel(0);
}*** this is the method that return the ID (id_categoria) from the tablemodel
private void SeleccionarRegistro(){
if(this.jTable1.getSelectedRow()>-1){
String str_id =this.jTable1.getModel().getValueAt(this.jTable1.getSelectedRow(),0).toString();
int_idtoreturn=Integer.parseInt(str_id);
this.dispose();
}else{
JOptionPane.showMessageDialog(this,"there are no records selected","Warning!",1);
}Who I can solve this problem?m_ilio wrote:
I have a form (consult that return a value) with a jtextfield and a jtable. when the user types in the textfield, the textfield call a method to filter the tablemodel.
everything works fine, but after filtering the model, the references are lost and the return value does not match with the selected row.
I read that convertColumnIndexToView, convertRowIndexToView, vertColumnIndexToModel and convertRowIndexToModel, solve the problem, but I used all and nothing.
You're right in that you have to use convertRowIndexToModel(), but you are using it wrong. That method takes as input the index of a row in the view, i.e. the table, and returns the corresponding row in the underlying TableModel. No data is changed by the call, so this:
this.jTable1.convertRowIndexToModel(0);is meaningless by itself.
What you need to do is the following:
int selectedRow = this.jTable1.getSelectedRow(); // This is the selected row in the view
if (selectedRow >= 0) {
int modelRow = this.jTable1.convertRowIndexToModel(selectedRow); // This is the corresponding row in the model
String str_id =this.jTable1.getModel().getValueAt(modelRow, 0).toString();
}Hope this helps. -
Remote Object - not able to get the returned value from java method
Hi ,
I am developing one sample flex aplication that connects to the java code and displays the returned value from the
java method in flex client. Here I am able to invoke the java method but not able to collect the returned value.
lastResult is giving null . I am able to see the sysout messages in server console.
I am using flex 3.2 and blazeds server and java 1.5
Here is the code what I have written.
<?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" initialize="initApp()">
<mx:Script><![CDATA[
import mx.controls.Alert;
import mx.binding.utils.ChangeWatcher;
import mx.rpc.events.ResultEvent;
import mx.messaging.*;
import mx.messaging.channels.*
public function initApp():void {
var cs:ChannelSet = new ChannelSet();
var customChannel:Channel = new AMFChannel("my-amf", "http://localhost:8400/blazeds/messagebroker/amf"); cs.addChannel(customChannel);
remoteObj.channelSet = cs;
public function writeToConsole():void { remoteObj.writeToConsole(
"hello from Flash client");
var returnedVal:String = remoteObj.setName().lastResult; Alert.show(returnedVal);
//[Bindable]
// private var returnedVal:String;
]]>
</mx:Script>
<mx:RemoteObject id="remoteObj" destination="sro" />
<mx:Form width="437" height="281">
<mx:FormItem>
</mx:FormItem>
<mx:Button label="Write To Server Console" click="writeToConsole()"/>
</mx:Form>
</mx:WindowedApplication>
Java code
public
public SimpleRemoteObject(){
super(); }
class SimpleRemoteObject {
public void writeToConsole(String msg) { System.out.println("SimpleRemoteObject.write: " + msg); }
public String setName(){ System.
out.println("Name changed in Java");
return "Name changed in Java";
And I have configured destination in remote-config.xml
<destination id="sro">
<properties>
<source>SimpleRemoteObject</source>
<scope>application</scope>
</properties>
</destination>
Please help me .You are not able to get the returned value because if you see the Remote object help you will realise you have to use result="resultfn()" and fault = "faultfn()"
In this you define what you wish to do.
More importantly in the remote object you need to define which method you wish to call using the method class like this
<mx:RemoteObject id="remoteObj" destination="sro" result="r1" fault="f1" >
<Method name="javaMethodName" result="r2" fault="f2"/>
<mx:RemoteObject>
r2 is the function where you get the result back from java and can use it to send the alert. -
Capture Return Value from Contextual Events Subscriber Method
Hi
I was wondering if anyone knew whether you could capture the return value from a method exposed as a subscriber for a contextual event?
Requirement: We have 2 bounded task flows (parent-child) with the child task flow embedded as a region in a view activity in the parent task flow. Based on an action in the parent task flow we raise a contextual event which calls an application module method exposed as a data control within the child task flow. We need to be able to capture the return value from the method on the managed bean.
Example method within child task flow application module:
public String contextualEventSub(){
Return "Y";
So here we would like to capture String value when the event is raised by the event producer (parent task flow action).
Within the Event Map on the page definition of the parent task flow view activity it is possible to set parameters to pass to the subscriber but it’s not obvious where you can capture the return value.
Many thanks!
Technology:
ADF 11.1.1.7 – ADFbc with ADF task flows and page fragmentsCheck this URL it may help you
One size doesn't fit all: JDev 11g: Programmatic Contextual Events -
RE: (forte-users) Reading return value from Javaprogram
when using the RunCommand method you can specify the an error file:
task.part.os.RunCommand(command = l_tdCommandLine,
isSynchronous = TRUE,
inputFile = Nil,
outputFile = Nil,
errorFile = l_ErrorFile.GetLocalName(TRUE));
BEGIN
l_ErrorFile.Open(SP_AM_READ);
EXCEPTION
WHEN Ex: FileResourceException DO
l_ErrorFile = NIL;
task.ErrorMgr.Clear();
END;
IF l_ErrorFile <> NIL THEN
l_tdFileContents : TextData = New();
l_ErrorFile.ReadText(l_tdFileContents);
l_ErrorFile.Close();
END IF;
Have you java program output the return value to the standard IO. This way
you will have an error file that you can read from Forte.
ka
-----Original Message-----
From: Anthony D [mailto:saigonxyahoo.com]
Sent: Tuesday, September 12, 2000 7:49 AM
To: forte-userslists.xpedior.com
Subject: (forte-users) Reading return value from Java program
Hi,
Does anyone know whether Forte application can
read a return value from a Java program?
I'm using the RunCmd method to invoke the Java
program. I'd like to read the return value from the
Java program. How do I go about doing it?
Any suggestion will be appriciated.
Thanks
AD
http://mail.yahoo.com/
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.comwhen using the RunCommand method you can specify the an error file:
task.part.os.RunCommand(command = l_tdCommandLine,
isSynchronous = TRUE,
inputFile = Nil,
outputFile = Nil,
errorFile = l_ErrorFile.GetLocalName(TRUE));
BEGIN
l_ErrorFile.Open(SP_AM_READ);
EXCEPTION
WHEN Ex: FileResourceException DO
l_ErrorFile = NIL;
task.ErrorMgr.Clear();
END;
IF l_ErrorFile <> NIL THEN
l_tdFileContents : TextData = New();
l_ErrorFile.ReadText(l_tdFileContents);
l_ErrorFile.Close();
END IF;
Have you java program output the return value to the standard IO. This way
you will have an error file that you can read from Forte.
ka
-----Original Message-----
From: Anthony D [mailto:saigonxyahoo.com]
Sent: Tuesday, September 12, 2000 7:49 AM
To: forte-userslists.xpedior.com
Subject: (forte-users) Reading return value from Java program
Hi,
Does anyone know whether Forte application can
read a return value from a Java program?
I'm using the RunCmd method to invoke the Java
program. I'd like to read the return value from the
Java program. How do I go about doing it?
Any suggestion will be appriciated.
Thanks
AD
http://mail.yahoo.com/
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com -
How to get the return values from a web page
Hi all :
how to get the return values from a web page ? I mean how pass values betwen webflow and web page ?
thank you very much
Edited by: jingying Sony on Apr 15, 2010 6:15 AM
Edited by: jingying Sony on Apr 15, 2010 6:18 AMHi,
What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
Regards,
Karri -
how do I make a drop down list of text in numbers as it is made in the example spreadsheet for comparing cars for buying where you can choose a value from a dropdown list for each car?
Where is this example spreadsheet? Without seeing it I can only guess at what you are asking.
To make a drop-down list (a pop-up menu in Numbers-speak), format the cell as a pop-up then edit and add to the list of items.
If the example spreadsheet is pulling in a dollar value based on what car you chose in the pop-up, it is probably using LOOKUP or one of the other lookup functions, getting the information from another table (a lookup table). If, instead, these dollar values are what you are choosing in the pop-up, then you need to create a pop-up with these values in it.
The Help menu includes a link to a page where you can download the Numbers Users Manual. It also has a link to the Formulas and Functions guide. Both are useful to new users. -
After selecting the value from the list box, want to disable checkbox
hi guru,
After selecting the value from the list box, want to disable checkbox and custom control textbox(container) in module pool.
so please help me on this.
thanx,
manin PBO,
loop at screen.
if screen-name = your textbox's name.
screen-input = 0.
modify screen.
endif.
endloop. -
How to Sort by the length of the returned value from a query.
Hi,
I was wondering if it is possible to sort by the length of the returned value from a query?
For example if I want to get a list of people with the name 'Samuel', I would like to short by how short the length of the whole name is.
Sort by length of the name in SQL
Samuel Syda
Samuel Indranaka
Samuel Johnsons
Samuel Longhenderson
Thank you.Hi,
Sorting is done by an ORDER BY clause at the end of the main query.
In most cases, you can ORDER BY any expression, even f it is not in the SELECT clause. In this case, it sounds like you just need:
ORDER BY LENGTH (name_column)
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Post your query, using an ORDER BY clause like the one above, and point out where that query is producing the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
I just upgraded to OS X Yosemite and this new "feature" appeared. I often have several email addresses that contain the same set of characters. I just type the first few characters and then select the appropriate email address from the dropdown menu that appears. But if I hit return afterwards to enter another email address, the first address gets switched back automatically to the first one that appeared in the dropdown menu. The more characters I type, the more accurate it is, but it totally defeats the purpose of autofill if I have to type the entire email address! Anyone else having this problem? And can you guys please fix it? If you select something from the dropdown menu, it should stay selected.
Thanks!This forum is filled with this same complaint. There is a bug reported on it. If and when they fix it is another question.
Version 24.6 works if you want to go back to a working version. -
Logging a string as the 2nd return value from a VI
I have a VI that returns a Boolean pass/fail which maps into step.result.passfail. I return another hex value from the same VI that only needs to be logged on the datasheet, but has no pass/fail status. It comes back via a telnet connection as a string. If I convert it to a number I can use the null type adapter and call it a numeric limit test with a comparison type of none and it will get logged on the data sheet without any pass fail consequences. It would be simpler just to pass back the string and have it logged. In fact this is a general case, there may be many times I just want something returned from a VI to be logged on the data sheet without any checking. What testStand tool/object/gizmo could one use?
Thanks,
jvhTool/object/gizmo to use is an Action Step
Action Step
The Action step calls code modules that do not perform tests but,
instead, perform actions necessary for testing, such as initializing an
instrument. By default, Action steps do not pass or fail. The step type does not
modify the step status. Thus, the status for an Action step is Done or Error unless the
code module specifically sets another status for the step or the step calls a
subsequence that fails.
You can use the TestStand - Evaluate.vi code module template to create a VI that includes a ReportText indicator.
Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
If you don't hate time zones, you're not a real programmer.
"You are what you don't automate"
Inplaceness is synonymous with insidiousness -
How to pass value from the Z Report to the selection screen of the std rep
Dear Experts,
i have developed a report and the values are maintained only in internal table based on some condition. When I execute the report, for example MM60, there is a material number field for multiple selection.
the report should call the standard transaction and pass the values from the internal table to the multiple selection- material number of the standard transaction.
the standard transaction should never get executed automatically. Only the value should get passed from internal table to the standard t code. Please help.
regards,
ShankarHai
Go through the following Documents
SUBMIT rep.
Additions
1. ... LINE-SIZE col
2. ... LINE-COUNT lin
3. ... TO SAP-SPOOL
4. ... VIA SELECTION-SCREEN
5. ... AND RETURN
6. ... EXPORTING LIST TO MEMORY
7. ... USER user VIA JOB job NUMBER n
8. ... Various additions for parameter transfer to rep
9. ... USING SELECTION-SETS OF PROGRAM prog
Effect
Calls the report rep . Leaves the active program and starts the new report rep .
Addition 1
... LINE-SIZE col
Effect
Prints the report with the line width col .
Addition 2
... LINE-COUNT lin
Effect
Prints the report with lin lines (per page).
Addition 4
... VIA SELECTION-SCREEN
Effect
Displays the selection screen for the user. In this case, the selection screen is redisplayed after return from the report list display - the user's entries are retained.
Addition 5
... AND RETURN
Effect
Returns to the calling transaction or program after the called program has been executed. SUBMIT ... AND RETURN creates a new internal mode .
Addition 6
... EXPORTING LIST TO MEMORY
Effect
Does not display the output list of the called report, but saves it in SAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. You can read the saved list from SAP memory with the function module 'LIST_FROM_MEMORY' and then (for example) store it in the database with EXPORT . You can process this list further with the function modules 'WRITE_LIST' , 'DISPLAY_LIST' ... of the function group "SLST" .
Addition 7
... USER user VIA JOB job NUMBER n
Effect
Schedules the specified report in the job specified by the job name job and the job number n . The job runs under the user name user and you can omit the addition USER user . The assignment of the job number occurs via the function module JOB_OPEN (see also the documentation for the function modules JOB_CLOSE and JOB_SUBMIT . This addition can only be used with the addition ...AND RETURN .
Note
When scheduling a report with the SUBMIT ... VIA JOB job NUMBER n statement, you should always use the addition ...TO SAP-SPOOL to pass print and/or archive parameters. Otherwise, default values are used to generate the list and this disturbs operations in a production environment.
Addition 9
... USING SELECTION-SETS OF PROGRAM prog
Effect
Uses variants of the program prog when executing the program rep .
Note
Important
The programs prog and rep must have the same SELECT-OPTIONS and PARAMETER s. Otherwise, variants of the program prog may be destroyed.
Note
When using this addition, the specified variant vari of the program prog is taken in USING SELECTION-SET vari . On the other hand, all variant-related actions on the selection screen of rep (Get , Save as variant , Display , Delete ) refer to the variants of prog .
Example
SUBMIT REPORT01
VIA SELECTION-SCREEN
USING SELECTION-SET 'VARIANT1'
USING SELECTION-SETS OF PROGRAM 'REPORT00'
AND RETURN.
Effect
Executes the program REPORT01 with the variant VARIANT1 of the program REPORT00 .
Note
Runtime errors
LOAD_PROGRAM_NOT_FOUND : The specified program was not found.
SUBMIT_WRONG_TYPE : The specified program is not a report.
SUBMIT_IMPORT_ONLY_PARAMETER : Only one value passed to a report parameter.
SUBMIT_WRONG_SIGN : Invalid value passed to a selection with the addition SIGN .
SUBMIT_IN_ITAB_ILL_STRUCTURE : Table passed to a selection with WITH sel IN itab had an unexpected structure.
Try with this Example
Data: listobject like abaplist occurs 1 with header line.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1 .
IF sy-subrc <> 0.
message ID '61' TYPE 'E' NUMBER '731'
with 'LIST_FROM_MEMORY'.
ENDIF.
Thanks & regards
Sreenivasulu P
Maybe you are looking for
-
Can't import Radiohead In Rainbows
Has anyone else had a problem importing Radiohead's new album In Rainbows? I try to import it it just ignores me. I first imported it last week and though it showed up in my library it wouldn't play the tracks. So I deleted it and tried to import it
-
How to read the code of html page
Hi, I want to know how to read the code of html page through Java? And if anyone know the link of full implementation of Page Rank Algorithm in Java. Please let me know. I have to do the project on that topic. Regard Vivek
-
Adobe Air iOS publishing keeps giving unexpected errors
The device has encountered and unexpected error. Installation Error: PackageExtractionFailed I thought it would maybe be because of my certificates or profiles. So I made new development certificates and distribution certificates. I extracted them to
-
How can I batch import images 1 per page?
I need to import images into the same Fireworks file, 1 per page. I have about 60 to do, and I'm hoping there's a better way then just adding them one by one. How can I batch import so that a page is created for each image?
-
I am trying to connect a 3G phone to WiFi. When I try with one iPhone 3G, I enter in the password, it connects and then provides service and the connection works properly. I then try doing the same thing with another 3G phone and it appears to connec