Setting initial selection in ChoiceBox
I know it is a simple request but I cannot fathom out from the API or the tutorial how to initialise the selected item in a ChoiceBox.
Take the example in the ChoiceBox tutorial where there is a selection of 5 languages. The tutorial suggests that the top item "English" shows when the program starts. When I try it, no item is shown. If I wanted the initial selection to be "Espanol", the second item in the list, how would I achieve this?
Since this is an important property of list selection, I am surprised that the tutorial doesn't tell me how to do it. JavaFx1.3 was much easier to understand.
Thanks
abg
I'm sorry Dayryl but there is nothing in the ChioceBox API or the tutorial that indicates how I would set thw selection index in the choice box's selectionModel. I have tried lots of things but can't make sense of what is required. Could you not just give me the line of code that would set the index of ChoiceBox cb to isem 2?
I am not a rank beginner in Java and JavaFX. I wrote my application originally in Java but switched to FX to clean it up, make it more user friendly and more maintainable. Now I have started to rewrire it in JavaFX2 and am finding it incomprehensible.
I find that the API descriptions and the tutorials and examples are written as reference documents for people who really understand what it is all about but is unfathomable for less experienced people.
abg
Similar Messages
-
RE: Setting initial DropList selection
Gary writes...
>
Does anyone know how to set the initially displayed selection
of a DropList to something other than the first element of the
array. <DropList>.IndexValue is supposed to be settable
according to the documentation, but it doesn't seem to be so.Gary, try setting the <DropList>.IndexValue in your Display method AFTER
the "self.Open()" call. I reported this bug sometime ago, and I believe
it will be fixed in an up coming build of R3.
Steve McIntyre
MCI Systemhouse
Applied Technology Research
------------------------------------Hi Gary !
If setting <DropList>.IndexValue doesn't work, I suppose you set it
before invoking the Self.Open() method of your UserWindow.
Try to set the IndexValue attribute of your DropList after invoking the
Self.Open() method. I think it will work.
Hope this helps !
- Manuel -
Manuel DEVEAUX
Forté Developer
Mutuelle Préviade
Nancy, FRANCE
E-Mail : [email protected]
De : GARY DALE +44 (0)1473-222466[SMTP:[email protected]]
Date : mardi 13 mai 1997 15:40
A : [email protected]
Objet : Setting initial DropList selection
Does anyone know how to set the initially displayed selection of a DropList
to
something other than the first element of the array.
<DropList>.IndexValue is supposed to be settable according to the
documentation, but it doesn't seem to be so.
Gary Dale
Willis Corroon -
Setting initial UIPickerView selection without click on iPhone
Is there a way to set the initial selection of a UIPickerView without generating the selection click? For example, I have a UIPickerView with 3 rows, and I want the 2nd row to be selected when the app starts. Right now, I'm calling this during initialization:
picker selectRow:1 inComponent:0 animated:NO
but it generates the same sound that plays when a user selects a row. The only way I've found so far to silently set the default selection relies on the undocumented method setSoundsEnabled.Hi Chris, and welcome to the Dev Forum!
I've never read about any other solution besides setSoundsEnabled except for persuading the user to turn key clicks off in the Settings panel. But you reminded me of an idea I meant to try (atm all I have is a 1st gen touch and no ear phone plug).
Try this if you haven't already: Create a UIPickerView in code, set only the dataSource, then select the rows you want. Then set the delegate and add the picker to a content view. If it still clicks prior to becomming visible, see if setting its hidden, alpha, or userInteractionEnabled properties has any effect. It doesn't make a lot of sense for an invisible picker to click, so I'm hoping some combination of circumstances will convince it that a click is inappropriate.
If there's nothing in that idea, I'm afraid I can't help.
\- Ray -
Setting initial DropList selection
Does anyone know how to set the initially displayed selection of a DropList to
something other than the first element of the array.
<DropList>.IndexValue is supposed to be settable according to the
documentation, but it doesn't seem to be so.
Gary Dale
Willis CorroonHi Gary !
If setting <DropList>.IndexValue doesn't work, I suppose you set it
before invoking the Self.Open() method of your UserWindow.
Try to set the IndexValue attribute of your DropList after invoking the
Self.Open() method. I think it will work.
Hope this helps !
- Manuel -
Manuel DEVEAUX
Forté Developer
Mutuelle Préviade
Nancy, FRANCE
E-Mail : [email protected]
De : GARY DALE +44 (0)1473-222466[SMTP:[email protected]]
Date : mardi 13 mai 1997 15:40
A : [email protected]
Objet : Setting initial DropList selection
Does anyone know how to set the initially displayed selection of a DropList
to
something other than the first element of the array.
<DropList>.IndexValue is supposed to be settable according to the
documentation, but it doesn't seem to be so.
Gary Dale
Willis Corroon -
How to make initial selection in Combobox with dataProvider
My ComboBox uses dataProvider. I want the combobox is
initially shown with an selected item displayed, which is normally
not the first item. How to set the initial selection? ThxUnless you combo box dataProvider items are primitive values,
like string or number, you cannot set currentItem.
Instead, you must loop over the dataProvider and compare the
value in the appropriate property to the value you want to match.
When you find a match, use the loop index to set the
ComboBox.selectedIndex.
Doing this one-off is simple. If you need it often, consider
extending ComboBox. The difficulty with this is that the
dataProvider can be anything and it is difficult to generically
handle all the possibilities. I suspect that this is why ComboBox
does not handle it natively.
I have an example here.
http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectID=767
Tracy -
SelectOneChoice set default selected item
Hi
I have an edit form, that is loaded from a query. In this form there are some values that are setted using a selectOneChoice
The thing is that i need to set the selectOneChoice initial selected item acording to the values of the entity retrieved by the query
How can i do this ???
ThanksHi,
Thanks for your reply.
But I have already called a action on Add button.
Still I tried the way you suggested,
RichSelectOneChoice selectOneChoiceBinding = new RichSelectOneChoice();
selectOneChoiceBinding.setValue(Integer.toString(1));
AdfFacesContext.getCurrentInstance().addPartialTarget(selectOneChoiceBinding.getParent());but this doesn't work.
I have binded(private RichSelectOneChoice customerIDNo;) that SelectOneChoice in bean.
So, I tried it like this also,
customerIDNo.setValue(Integer.toString(1));
AdfFacesContext.getCurrentInstance().addPartialTarget(customerIDNo.getParent());still it doesn't work.
please help.
Thanks,
Madhav. -
Set Field Selection for Completion Confirmation
I want to change the indicator of one field from "ready to input" to "required"..But i couldnt understand exactly the hierarchy under "Set Field Selection for Completion Confirmation" tab in SPRO. there are 3 parts under that tab;
1-PM: Confirmation - initial screen
2-PM: Confirmation - list and detail
3-PM: Confirmation - parameter
and i also couldnt find the name of my field which is about "codes for causes"..
Thanks...Russ,
I don't think it could be accomplished through configuration or through Transaction variants.
I think the simplest way to accomplish this would be by using one of the below user exits according to your needs.
CONFPM02: Customer-specific entry checks 1
CONFPM03: Customer-specific check by operation selection
CONFPM04: Customer-specific entry checks 2
The other option would be to use the Implicit enhancement functionality(If you are in EC C6.0 or above) to modify the table control field attributes dynamically.
Regards
Narasimhan -
Unable to set the selected value for a ADF LOV
Hi,
I am developing an application using jdeveloper 10.1.3 and Struts.
I have created a ADF LOV on my JSP Page as given below:
<html:select property="lob" onchange="javascript:selectLOB(this.form)">
<html:optionsCollection label="prompt" value="index" property="lob.displayData"/>
</html:select>
When i submit the form, i am able to get the value of the selected Value in the List.
JUCtrlListBinding listBinding = (JUCtrlListBinding) formBean.get("Lob");
Row r = (Row) listBinding.getSelectedValue();
String SoLob = (String) r.getAttribute("LobLob");
But i am unable to set the selected value back in the list when i return to the form again.
I tried the following:
int x = listBinding.getSelectedIndex();
listBinding.setSelectedIndex(x);
It would be really helpful if some one could let me know what needs to be done.
Thanks,
SubashiniGyan,
I tried with the code you suggest , its trying to set the value of a field, but my requirement is to change the property for
"Rendered" on the field so that based on search parameters we can hide result table column.
After searching online, I modified the controller code as follows
1.Created a new transient attribute (Testrender) with type "Boolean" and always updateable.
2.changed the "Rendered" property value on the field I want to hide as ${oa.PoSearchVO1.Testrender}.
3. Modified the controller code as follows :
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAViewObject testvo = (OAViewObject)am.findViewObject("PoSearchVO1");
OADBTransaction txn = am.getOADBTransaction();
if (testvo != null)
OARow row = (OARow)testvo.first();
if (a.equalsIgnoreCase("Approved"))
row.setAttribute("Testrender", Boolean.FALSE);
else
row.setAttribute("Testrender", Boolean.TRUE);
} But now when i run the page and populate the search field and click "Go" its hiding the field but throwing the following error and the search results are also bad.
Its using only the value of one search parameter but not the second one .
The search cannot be executed because the table has pending changes that would be lost. I think the vo is getting dirty when I update the transient attribute value. So I used txn.rollback ,then search is working fine but its not hiding the field.
So can you please let me know how to proceed from here ? -
How to programmatically set initial password when a user is created in OID
We are using the odihragent synchronization process to automatically create users in OID when an employee record is created. We would like to set the initial password for the newly created user to their last name + the last 4 digits of their SSN.
The odihragent process is successfully creating the user in OID and populates the last name and the last 4 digits of the SSN in OID. According to an open SR I have with Oracle, we cannot use the odihragent process to set the initial password because any time the employee record is updated, the synchronization process will reset the password to last name + SSN. They have recommended that we use a pl/sql plug-in to set the password using the WHEN_ADD plug-in procedure.
I am new to using OID and plug-ins and the examples provided in the Developer's Guide are limited.
I would like to know if anyone else is using plug-ins or another process to set initial passwords when a user is created? If you are using plug-ins would you be willing to share a code sample?I am surprised that I have not received any responses... Surely there are others who are experienced with programmatically setting passwords when new users are programmatically created. Does anyone have any pointers on how to best accomplish this?
-
How i can set the selected item of a dropDown component from java code
Hi
Thank you for reading my post
How i can set the slected item of a DropDown component from backing beans java code ?
it is binded with a database , so one field determine its display and one other field determine its value , I want to set the selected item of this combobox
In back code i have both value and display values to use them .
can some one give me some help ?
Thanks ,See code sample 3 at http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
See also, the selection components row in the table under http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/helloweb.html
It says
One way to preselect items is to call setSelectedValue(Object[]) or setSelectedValue(Object) from the prerender() method. You pass in the return values of the items that you want preselected. Be sure to verify that getSelected() returns null before setting the default options, or you will overwrite the user's selections on a post-back. -
how do I find and/or change the pre-set voltage selection switch in an HP TouchSmart IQ500 series (specifically an IQ524)
This question was solved.
View Solution.Doesn't it use an external AC Adapter? If so, all you should need to use in another country is an adpater plug to match the wall socket.
... an HP employee expressing his own opinion.
Please post rather than send me a Message. It's good for the community and I might not be able to get back quickly. - Thank you. -
"Missing parameter values." Error when setting record selection formula
Setup - VS 2008, CR 2008 (v12.0), Win XP & C#.Net
I have a form which loops through all parameters (non-linked to sub reports, so only off the main report) and allows users to enter the values for each parameter. When hitting the preview button, I loop through all of the saved values, set the parameter field values and then add any additional filters into the recordselection formula as below. The problem i'm having is that the ReportDocument.HasRecords returns true if the ReportDocument.RecordSelectionFormula doesn't filter out every result.
For example, I have a list of customers and if I set the selection formula to filter out a specific customer, ReportDocument.HasRecors returns true, if I set the selection formula to filter something that doesn't exist i.e. customer "xk39df", the moment this line of code runs "ReportDocument.RecordSelectionFormula = rsFormula;" - ReportDocument.HasRecors returns the following exception as opposed to "False".
Message: Missing parameter values.
Source: CrystalDecisions.ReportAppServer.DataSetConversion
StackTrace: at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.hasRecords()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.get_HasRecords()
ErrorID: MissingParameterFieldCurrentValue
The strange thing is, it works fine if the recordselectionformula selects a record which exists in the results - all parameters have a current value except for the linked parameters.
This one has got me stumped!
foreach (ParameterFieldDefinition parameterField in ReportDocument.DataDefinition.ParameterFields)
var query = ReportObjects.Values.Cast<Filters>().Where(objects => objects.ParameterName == parameterField.Name.ToUpper().Trim());
foreach (var item in query)
parameterField.CurrentValues.Clear();
parameterField.CurrentValues.Add(item.ParameterValue);
parameterField.ApplyMinMaxValues(item.MinLength, item.MaxLengh);
parameterField.ApplyCurrentValues(parameterField.CurrentValues);
var records = ReportObjects.Values.Cast<Filters>().Where(recordSelection => recordSelection.RecordSelectionFormula.Trim().Length != 0);
foreach (var item in records)
rsFormula += item.RecordSelectionFormula;
if (rsFormula.EndsWith(" AND "))
rsFormula = rsFormula.RTrim(5);
ReportDocument.RecordSelectionFormula = rsFormula;Hi,
The report has it's own ADO Datasource set in crystal reports, so I just pass the log on information to the report object before doing anything else.
this.DataSourceConnections[0].SetConnection("ServerName", "Database", "sa", "Password");
I then do a refresh before applying the parameter values (I do this because the user can preview the report more than one time by using a preview button on the parameter form without re-loading the report object)
this.Refresh();
Then I set all parameter values followed by setting the recordselection formula. -
How to set the Selected row and Column in JTable
Hi,
i have a problem like the JTable having one Method getSelectedRow() and getSelectedColumn to know the Selected row and Column but if i want to explicitly set the Selected Row and Column,then there is no such type of Methods.If anybody has any solution then i will be thankful to him/her.
Praveen K SaxenaIs that what you're looking for? :myTable.getSelectionModel().setSelectionInterval(row, row);
myTable.getColumnModel().getSelectionModel().setSelectionInterval(column, column); -
Interactive form that auto selects input fields based on initial selection
i want to create a form that based on initial selections, automatically highlights "required" input fields.
i.e. if i create an item on the form called "promotion", when this item is "checked", all the fields that are required will automatically light up, and the person completing the form cannot exit, save, and submit the form until all related fields are filled in.
is this possible using adobe products? i have cs5 (with dreamweaver, indesign, etc.)
can anyone point me toward any documentation that will show me how to do this?This forum is for Adobe FormsCentral (formscentral.adobe.com) which is a service that allows you to create, collect and analyze data using an online web form. You should ask general HTML form related questions in the Dreamweaver forums:http://forums.adobe.com/community/dreamweaver/dreamweaver_general
I'll move your post to that forum so you don't need to retype it. They can help you out...
Randy -
How to set default selection in html:radio
hai
how to set default selection in <html:radio>.No it won't help.
You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
Bottom line: you can't put a default value into the input type="file" control.
And a good thing too ;-)
Maybe you are looking for
-
Why do apps on the Ipad crash periodically?
My Ipad 1 will frequently close apps while I'm using them. There does not seem to be any pattern to it. This happens about 1-2 times per hour and has happened will both apple made apps as well as third party apps. I have tried power cycling the IP
-
GOA distribution to several contracts in r/3 not working
Hi, I have a problem with GOA distribution to backend. I would like to obtain the situation when I have 2 items in GOA, in Distribution I have also two inputs (both for the same purchasing organization, but locations are different) and the GOA is dis
-
How to set dynamic relevance in biee admin tool?
Source: essbase cube purpose: realize dynamic relevance prompt in answer, For example: I have measure(price,sales quantity), dimension(city, product name), 'city' and 'product name' set as prompt, when I choose one city, the product prompt should onl
-
The trouble started when I transferred applications from my old computer. When I click "bookmarks", all my bookmarks are there. When I try to "Organize Bookmarks", it acts like I have no bookmarks. When I try to "Bookmark this page", it does not show
-
How can i copy the text in cr11 screen dynamically.
Hi, In cr8 with VB, i can able to copy the text dynamically by using rigth click on cr8 screen and click copy. And able to paste the text in notepad. In same way,Rightckick option is not available in cr11 screen with vb.net.For that i created "Contex