HTMLEditor not displaying selection

Hiya! In an HTMLEditor that I'm working with, I allow the user to input text, select some/all of the text, and then change some formatting of the text (such as text size). The goal is to have the same piece of text selected after the format has been modified. So, the idea, along with my code, is pretty simple...
(parent is the name of my HTMLEditorKit)
String s = parent.getSelectedText();
int caretStart = parent.getSelectionStart();
int caretEnd = parent.getSelectionEnd();
SimpleAttributeSet attribs = new SimpleAttributeSet();
attribs.addAttribute("size", "+2");
insertCode(HTML.Tag.FONT, attribs);
parent.select(caretStart, caretEnd);
parent.requestFocus();The problem is that after the text is changed, the parent.select(int, int) statement is not apparent. It works but just isn't a visible selection. What would I need to change to make it visible?
-kwbrads

Okay, I feel stupid for having just realized this, but for some reason my HTMLEditor isn't receiving the focus. Even though I specifically call the requestFocus() function... this must be because the way I am changing the formatting is by using a JPopupMenu inside a JTabbedPane, so maybe the JPopupMenu still retains the focus even though it is no longer visible.
So... grr. Is there a way to make sure that when the popup menu goes non-visible it transfers the focus back to the correct pane? Is this too general of a question? I would've thought the requestFocus() that I called would have done it, but I guess not...
-kwbrads

Similar Messages

  • Webi snapshot not displaying selected drillfilters of report

    I am using business objects enterprise xi 3.1 fixpack 1.5 (12.1.5.1096)  on the Java Platform.
    I have created a web intelligence report with drillfilters that  used as a dropdown selection at the top of the report.  one contains a list of countries for instance.
    I have the following in a cell within the header to display the selection of the filter:
    = If DrillFilters([Country Name])="" Then "All Countries" Else DrillFilters([Country Name])
    If no country is selected then the header displays "All Countries" or the name of the country that was selected.
    This works great except for when a user takes a "snapshot" of the report with a drillfilter selected using the camera icon at the top right corner of infoview;
    the drillfilter selection data does not display in the header of teh snapshot version of the report; it defaults to all....which is very confusing to a user try to create different sceanrios to analyze with the snapshot tool.
    Is there a way to correct this behaviour?
    Thanks in advance.
    -scott
    Edited by: Scott M on Apr 19, 2010 6:09 PM

    Scott,
    One behaviour that can occur next after clicking on the camera is to next navigate to the new tab and immediately hit the "start drill mode" icon.  Once the "start drill mode" icon is activated, the  cell within the header to display the selection of the filter will appear.
    Thanks,
    John

  • Windows Phone 8.1 xaml, c# ComboBox does not display selection when first item is selected from full page list.

    I have 3 comboboxes on a xaml page and most of the time when I select the first item on the full page list displayed when the number of items are > 5, the screen returns to the combobox and the box is blank. The combobox.SelectedItem is valued but it
    does not display.  This does not happen every time and I have seen this using the emulator and my windows 8.1 phone.  If I select any other item in the list they always display but when I go back and select the first item the box is blank. 
    Does anyone know what I could be doing that is causing this?

    Thanks for your help.  When I run the code below and the page is displayed, I select an item from the page list and it displays fine and then I select the first item from the page list and I do not see that selected item in the box. 
    If I remove the SelectedIndex=0 it all works fine except I do not have an item selected for the initial display.  Below should show problem and should work copy/paste in universal blank app.
    ScrollViewer x:Name="scrollViewer1">
            <StackPanel x:Name="stackPanel1" Background="Transparent">
                <ComboBox x:Name="comboBoxTestTypes" Margin="20,117.75,0,465.25" SelectedValuePath="ItemDescription" Width="310" Height="Auto" FontSize="17"
           ItemsSource="{Binding}" HorizontalAlignment="Left" VerticalAlignment="Center">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding ItemDescription}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
     </StackPanel>
        </ScrollViewer>
    public sealed partial class MainPage : Page
            public ObservableCollection<ItemDetail> itemDetail;
            public MainPage()
                this.InitializeComponent();
                this.NavigationCacheMode = NavigationCacheMode.Required;
                this.itemDetail = new ObservableCollection<ItemDetail>();
            protected override void OnNavigatedTo(NavigationEventArgs e)
                PageLoad();
            public class ItemDetail
                public string ItemDescription { get; set; }
                public string ItemName { get; set; }
            private async void PageLoad()
                await initializeTypes();
                var comboBoxTestTypesItemsSource = await GetTestTypes();
                comboBoxTestTypes.ItemsSource = comboBoxTestTypesItemsSource;
                comboBoxTestTypes.SelectedIndex = 0;
            private async Task initializeTypes()
                await addTestType("Item1");
                await addTestType("Item2");
                await addTestType("Item3");
                await addTestType("Item4");
                await addTestType("Item5");
                await addTestType("Item6");
            private async Task<ObservableCollection<ItemDetail>> GetTestTypes()
                //ObservableCollection<ItemDetail> list = new ObservableCollection<ItemDetail>();
                //Random rnd = new Random();
                //for (int i = 0; i < 50; i++)
                //    list.Add(new ItemDetail() { ItemDescription = "hello" + rnd.Next(0, 1001), ItemName = rnd.Next(0, 101).ToString() });
                await getSaveDataFileDataAsync("get");
                return itemDetail;
            private async Task addTestType(string description)
                int newIdAdd = 0;
                if (itemDetail != null && itemDetail.Count > 0)
                    newIdAdd = itemDetail.Max(mT => Convert.ToInt32(mT.ItemName)) + 1;
                var addTestType = new ItemDetail();
                addTestType.ItemName = newIdAdd.ToString();
                addTestType.ItemDescription = description;
                itemDetail.Add(addTestType);
                await getSaveDataFileDataAsync("save");
            private async Task getSaveDataFileDataAsync(string getSave)
                try
                    DataContractJsonSerializer jsonSerializer1 = null;
                    string dataFileName1 = "testFileName";
                    jsonSerializer1 = new DataContractJsonSerializer(typeof(ObservableCollection<ItemDetail>));
                    if (jsonSerializer1 != null && getSave == "get")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForReadAsync(dataFileName1))
                            itemDetail = (ObservableCollection<ItemDetail>)jsonSerializer1.ReadObject(stream1);
                    if (jsonSerializer1 != null && getSave == "save")
                        using (var stream1 = await ApplicationData.Current.LocalFolder.OpenStreamForWriteAsync(dataFileName1, CreationCollisionOption.ReplaceExisting))
                                jsonSerializer1.WriteObject(stream1, itemDetail);
                catch

  • INCLUDE BDCRECX1 not displaying selection text in selection screen.

    In my BDC program in using INCLUDE BDCRECX1, When i execute program in selection screen i am not getting selection texts.
    what is the problem?

    You are not getting selection texts because you have not maintained text symbols in your BDC program,

  • Combox Box not displaying selected item

    Below is the code I'm using to try to capture and display the
    selected item from a ComboBox:
    private function
    changeProjectTypeSelection(event:Event):void{
    projectTypeChange.text+=event.currentTarget.selectedItem.cboProjectType
    + " " +
    event.currentTarget.selectedIndex + "\n";
    Then the ComboBox:
    <mx:ComboBox fontSize="12" x="93" y="83" width="110"
    id="cboProjectType" dataProvider="{projectTypeArray}"
    labelField="projectTypeName" selectedIndex="0"
    click="changeProjectTypeSelection(event)"></mx:ComboBox>
    Then the TextInput:
    <mx:TextInput id="projectTypeChange" x="248.95" y="84"
    width="121"/>
    I know there's something wrong with the Actionscript code...
    just haven't figured it out. Any suggestions would be greatly
    appreciated!

    I've almost got it...
    private function
    changeProjectTypeSelection(event:Event):void{
    var i:int;
    for(i=0;i<projectTypeArray.length;i++){
    if(projectTypeArray.getItemAt(i).projectTypeName ==
    event.currentTarget.selectedItem.projectTypeName){
    projectTypeChange.text+=projectTypeArray.getItemAt(i).projectTypeName
    + "\n";
    Alert.show(projectTypeArray.getItemAt(i).projectTypeName +
    "FirstAlert");
    //Alert.show(event.currentTarget.selectedItem.projectTypeName +
    "SecondAlert");
    I just can't seem to be able to reset the value in the
    textInput field. I've tried setting it equal to spaces in several
    places, but it won't change after the first selection. Any ideas?
    Thanks for any suggestions!

  • Table Control not displaying selected data

    I have 2 screens, screen 100 is the selection screen where i select the data to be displayed and 300 is my table control.  When I select a single airline in screen 100, it displays all the airlines in my table control in screen 300, how can i fix?

    Table control if built via the screen painter wizard uses the contents of internal table declared in the main program and defined in the wizard to display. Check how you are filling this table, perhaps your filling it incorrectly.

  • Iphoto calendar does not display selected calendars

    I have created a calendar specifically for use in iPhoto's calendar project. It does not show. Others of my calendars do but not this one. I cannot identify a single factor that would cause this. Date clash is not an issue; calendar (in Calendar) is text only.
    I am hoping for some guidance.

    Have you rebooted and tried again since this began? 
    Also as a test launch iPhoto with the Option key held down and create a new, test library.  Import some photos and test to see if the same problem persists. Does it?
    OT

  • MENU item selection does not display drop down in ITS enabled transaction

    Hello,
    We are experiencing a strange behavior between two portal env.
    1. DEV.
    For example we have transaction MM01 display in the Portal via ITS (integrated). The end user can select the Menu Tab and the System Tab and the drop downs appear as expected.
    2. Prod
    Same  scenario as above. Only this time, end user is unable to select the button. The Menu and System Tab dont appear greyed out but selecting it does not display the drop down.
    Material, Edit GoTo Defaults are some of the links under the Menu tab for MM01.
    Very confusing. And this is the behavior in Prod for all transactions. Any ideas on why this is happening would be greatly appreciated.
    The architectural difference is that DEV has no Web Dispatcher versus Prod has the Web Dispatcher.
    We are on EP 7.0
    Many thanks.
    Regards,
    Sunil

    Thanks. Now, I realise this may cause dismay to some, but I have now solved the problem, and just wanted to share my experience with those even less savvy than myself. In Dreamweaver, the Spry css styles are arranged with little or no hint as to which style controls what. I found that there is a rule in the sub-menu styles that controls the little graphic arrows which indicate that there are dropdown subs under the tabs. I had removed these arrows to make way for my background images. However, the rules that control their positioning by percentage were still there, causing my images to display incorrectly. Of course, there was no way anyone could have spotted this and helped me as the fault was in the external spry css file, not the page code. So many thanks to vw2ureg for looking anyway. Regarding the page code, which you have flagged up, would you mind elaborating on what you see wrong here? I'm none the wiser. Many thanks again.

  • Multi-Select Box Not Displaying Values Passed From Grid?

    Coldfusion 8
    I inherited an application and am trying to maintain and improve it... hit a snag today.
    I have a multi-select box that is not displaying what I expect.  The values come from a ColdFusion grid which is based off a database query.
    Here is the code for the select - does not work - nothing is selected:
    <cfselect name="USER_IDS" multiple="true" queryposition="below" selected="USER_IDS" query="ActiveUsersPlus" disabled="#disabled#" value="G_USER_WORK_UNIT_SK" display="G_USER_ID" >
    </cfselect>
    Now if I change the multiselect to a single select like below - it takes the first item in the field list (from the grid) and selects it in the drop down.
    <cfselect name="USER_IDS" multiple="false" queryposition="below" selected="USER_IDS" query="ActiveUsersPlus" disabled="#disabled#" value="G_USER_WORK_UNIT_SK" display="G_USER_ID" >
    </cfselect>
    Or if I assign a variable like this and use the multi-select code it seems to work as well.
    testlist = "22,26";
    <cfselect name="USER_IDS" multiple="true" queryposition="below" selected="#testlist#" query="ActiveUsersPlus" disabled="#disabled#" value="G_USER_WORK_UNIT_SK" display="G_USER_ID" >
    </cfselect>
    I have displayed the value of "User_IDs" in the grid and in the data entry part of the screen to see values of:  22,26
    to make sure that wasn't my issue.
    Do grids and multiselects require something additional?  Any advice on how to resolve?

    Problem was related to some javascript for the select box.  There was a function for a single select box but not a multiple select box - this fixed it: 
    if(theForm.elements[i].type == "select-multiple"){
                        var selectBox = theForm.elements[i];
                        var sbname = selectBox.name;
                        cpvalue = String(eval('record.data.' + sbname));
                        var NotifyArray = cpvalue.split(',');
                        for (var j=0; j < selectBox.length; j++) {
                            selectBox[j].selected = false;
                        for (var j=0; j < selectBox.length; j++) {
                            sbvalue = selectBox[j].value;
                            for (var k=0; k < NotifyArray.length; k++){
                                if (sbvalue == NotifyArray[k]){
                                    selectBox[j].selected = true;

  • Selection screen is not displaying if I use logical database CCLDB_AENR

    Hi Experts,
    If I use the logical database CCLDB_AENR in my custom program, it is not displaying my custom program selection screen. It is only displaying the logical database selection screen.
    some one help me how we can handle this.
    Thanks,
    Naresh.

    Hi Experts,
    If I use the logical database CCLDB_AENR in my custom program, it is not displaying my custom program selection screen. It is only displaying the logical database selection screen.
    some one help me how we can handle this.
    Thanks,
    Naresh.

  • Dynamic Select List not displaying correct value

    Hi there!
    I have a page with a dynamic repeat region.
    As I press one record I get up all the details based on id on an edit page.
    The problem is that the info that is inserted via a Select List is not displaying correct on edit page.
    All the other values are correct, also the values in the repeat region on index page,
    but the value from the Select List on edit page is just displaying the initially selected item.
    Have tried using SELECT DISTINCT in the SQL statement, but no luck.
    Any other ideas?
    Cut and paste from form:
    <select name="Vegtype" class="ProvDet" id="Vegtype" title="<%=(rsAs.Fields.Item("VegType").Value)%>">
                        <option value="Ev" selected="selected">Ev</option>
                        <option value="Fv">Fv</option>
                        <option value="Rv">Rv</option>
                        <option value="Kv">Kv</option>
                      </select>
    Recordset
    <%
    Dim rsAs
    Dim rsAs_cmd
    Dim rsAs_numRows
    Set rsAs_cmd = Server.CreateObject ("ADODB.Command")
    rsAs_cmd.ActiveConnection = MM_LabCon_STRING
    rsAs_cmd.CommandText = "SELECT DISTINCT DatoM, DatoR, DatoU, Distr, FagFelt, Felt, IntNr, Km, KontrNr, Kontrollor, Masse, MasseBK, Punkt, Resept, TestID, UserID, VegHp, VegNavn, VegNr, VegType FROM tblTest WHERE TestID = ?"
    rsAs_cmd.Prepared = true
    rsAs_cmd.Parameters.Append rsAs_cmd.CreateParameter("param1", 5, 1, -1, rsAs__MMColParam) ' adDouble
    Set rsAs = rsAs_cmd.Execute
    rsAs_numRows = 0
    %>
    Regards,
    Christian
    DWCS5 | .Asp | MS Access

    Ok, here goes the top down approach...
    In the HTML header of my page, i have this reference to a js file containing the javascript - <script src="#WORKSPACE_IMAGES#108.js" type="text/javascript"></script>
    Then in an HTML Region I have the following code to create the divs that will be shown and hidden - <div id="divREGION" class="divs">Select region to get list of countries.</div>
    <div id="divCOUNTRY" class="divs">Select country to get list of cities.</div>
    <div id="divCITY" class="divs">Select city and then press "Get Employees". </div>
    Note that these divs contain static content. You may be able to create dynamic content for these divs by creating dynamic query regions and putting div tags around the region (i havent tried this, it may require template modification).
    The select boxes have this code in the "HTML form elements attributes" - onFocus="javascript:showHideDiv(this,true)" onBlur="javascript:showHideDiv(this,false)"
    This onFocus and onBlur call the showHideDiv() function, passing in the object reference of the select box and a true/false to show/hide the related div.
    The actual javascript function that is contained in the 108.js file is:
    function showHideDiv(objThis, inBool){
         var divid = "div" + objThis.id.substring(3);
         if (inBool) {
         ShowDiv(divid);
         else {
    HideDiv(divid);
    That function in turn calls either the ShowDiv() or HideDiv() functions, depending on the true or false, passing in the ID of the div to be changed...
    function ShowDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "inline"');
    function HideDiv(divid){
         eval('document.all'+ '["' + divid + '"]' + '.style' +'.display = "none"');
    Hope this helps.

  • Selections not displaying in Photoshop CC

    When using any selection tool in Photoshop CC it will not display the selection - it will only dosplay the sele ction when I go to the Edit option on the Toolbar.
    I'm using a HP Envy Laptop running Windows 8.1. 
    Any ideas as to what might be going on?

    Yes follow the instracktion.

  • Numbers will not display 3D charts on my new computer. I am running system 10.6.8. A 2D chart turns into a selected empty rectangle when I change it to a 3D chart. What do I do?

    Numbers will not display 3D charts on my new computer. I am running system 10.6.8. A 2D chart turns into a selected empty rectangle when I change it to a 3D chart. What do I do? I am running iWork 9.1.

    Hello
    Numbers 2.1 under 10.7.2 on my iMac described below.
    There is at least a thread describing what you get:
    https://discussions.apple.com/message/15526080
    It claims that it strike when the app is using the NVIDIA video card available in some macBook pro.
    Yvan KOENIG (VALLAURIS, France) samedi 7 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2

  • "View Selected Item" does not display

    I'm using RoboHelp7 out of the Technical Communication Suite.
    When I'm working on a topic and select the
    View Selected Item button, the topic does not display. When
    I first tried yesterday, nothing happened (IE didn't open and there
    was nothing in my tray). I contacted Oversea's support and was
    informed that there wasn't an incident for this occurance. I was
    instructed to uninstall and reinstall RoboHelp.
    I uninstalled and reinstalled the applications and the button
    still doesn't work; however, this time there is an hourglass for an
    instant before not producing any results.
    The button doesn't work with anything that I've created or
    with the example projects (Clownfish School). Any help would be
    greatly appreciated. I'd hate to have to regenerate the project
    just to look at a quick change.
    Thanks,
    Matt

    Sounds like I need to add a note to that Snippet. Thanks.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Firefox 33 HTML select elements do not display correctly

    HTML form <select> elements do not display options correctly in Firefox 33.
    For example:
    <select id="field_4" class="mainForm" name="field_4">
    <option value=""></option>
    <option value="submitted"></option>
    <option value="pending"></option>
    <option value="discarded"></option>
    <option value="all"></option>
    </select>
    should display a drop down with 5 elements (first one blank) but no elements at all are displayed.
    The bounding box does not seem to be computed correctly so no options display.
    I have observed this issue on multiple pages. These pages displayed correctly in older version of Firefox and they display correctly under IE. The problem occurs with no addons or additional themes installed. The problem does not occur in SafeMode so I suspect that it is theme related but the Default 33.0 theme is the only installed theme and it cannot be disabled outside of SafeMode. I tried installing and changing multiple themes without success. The problem persists after restarting Firefox and after rebooting the computer and even after uninstalling and re-installing Firefox.
    I can supply a screen shot if needed.

    You can try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    You need to close and restart Firefox after toggling this setting.
    *https://support.mozilla.org/kb/upgrade-graphics-drivers-use-hardware-acceleration
    If it works in Safe Mode and in normal mode with all extensions (Firefox/Tools > Add-ons > Extensions) disabled then try to find which extension is causing it by enabling one extension at a time until the problem reappears.
    Close and restart Firefox after each change via "Firefox > Exit" (Windows: Firefox/File > Exit; Mac: Firefox > Quit Firefox; Linux: Firefox/File > Quit)
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

Maybe you are looking for