Desired Cursor Position in JTextPane

Hello All,
I have a basic question regarding JTextPane. I have a funny thing going on when pasting text in a JTextPane. After I replace the text, the cursor stays put at the point where the replace started as opposed to the end of the line of the text pasted. So briefly I do this,
// jTextPane - JTextPane
// replaceText - String to replace
int position = jTextPane.getCaretPosition() + replaceText.getLength();
jTextPane.setCaretPosition(position);
jTextPane.moveCaretPosition(position);This throws a BadLocationException and I'm not sure why. Can somebody please shed some thoughts on this.
Thanks
Ragu

String str = "<html><body>Hello, welcome to the world of Swing</body></html>";
HTMLEditorKit kit = (HTMLEditorKit) tp.getEditorKitForContentType("text/html");
ByteArrayInputStream stream = new ByteArrayInputStream(str.getBytes());
Reader reader = new BufferedReader(new InputStreamReader(stream));
HTMLDocument doc = (HTMLDocument) tp.getDocument();
int pos = tp.getCaretPosition();
kit.read(reader, doc, tp.getCaretPosition());
reader.close();So the cursor in my case should be at the end of Swing. I cannot set it to the end of document since I can call the smart replace any where in between a sentence. Hopefully this should ring some bells for the experts out there. Thanks again for looking.

Similar Messages

  • Popup tooltip at cursor position

    Carl's example at http://apex.oracle.com/pls/otn/f?p=11933:121 works great but it uses the following snippet of code to position the popup div at the right edge of the triggering element.
                $x_Style('rollover','left',findPosX(pThis)+pThis.offsetWidth+5);
                $x_Style('rollover','top',findPosY(pThis)-($x('rollover').offsetHeight/2)+($x(pThis).offsetHeight/2));Depending on the size of the triggering element, this may not always be desirable.
    Is there a way to position the div right where the cursor is? Getting the cursor position in a cross-browser way seems to be a little tricky, any help appreciated.
    Thanks

    Thanks, will keep that in mind.
    To answer my own question, all I needed to do was pass in the "event" object to the click/mouseover handler so the event handler can use a script like this to get the mouse position and then use that to position the div.

  • ITunes 6.0.1.3 "forgets" last cursor position in the library

    Hi there,
    I've a minor issue with my iTunes library. When I'm comfortably browsing my library using the "Browse"-Button, switching to e.g. my CD in iTunes and after that returning to the library the last cursor position with selected title and/or album is lost. So anew I've always to navigate manually to the previous selected album which it's bit annoying especially when you've to manage a larger library.
    Any hints?
    Thanx!
    Steve
    5G 60GB (European version) Windows XP
      Windows XP  

    DEZ3124,
    I want to change the default location of the music libary, so I went through the edit | preferences | consolidate library processes...which seemed to work fine.
    This method will change the location of the iTunes Music folder but the the iTunes folder itself will be left behind in its original place: C:\Documents and Settings\user name\My Documents\My Music. This makes iTunes (and by extension will also make you) much happier and in this case you'll be well-advised to let it have its way.
    Note that all the actual music files you now have, as well as those you will add in the future(which take up the bulk of the space on your hard drive), will be in the new location. The iTunes folder will be left behind with the iTunes Library files which don't take up much space at all ... if that's a concern.

  • Pda cursor position property does not work

    Hi!
    I have a problem with cursor positionX propery on PDA.
    I use PDA Module 8.2 and Windows Mobile 5 OS on PocketPC.
    Actually problem is only when I try to get value of two cursors, it return the same value for both cursors (you can test it with attached VI), but when I set values it work fine.
    I have also worked with PDA Module 8.0.1 in past and I remember that get cursor position value worked, so I have no idea why it doesn't work in newer version.
    Thanks,
    andrej
    Attachments:
    cursor test.vi ‏21 KB

    Hello andrej,
    Unfortunately I also see the same behavior on a PDA using this "active cursor" property. It appears to me that this property is not being written successfully. I say this because it appears that the value displayed is always from the most recently repositioned cursor rather than either the 0 or 1 which is set by the property node.
    What I will do at this point is to file a corrective action request so that this behavior is corrected for a future release of the LabVIEW PDA module. I apologize for the inconvenience that this causes for your application. Please let me know if I can help at all as you modify your application to work around this behavior. Thanks,
    Mike D.
    National Instruments
    Applications Engineer

  • Invalid Cursor Position Error

    Help!
    I am using JRun3.1 and developing a web interface to a database. In this particular screen, I am using CachedRowSet (I downloaded this and added it to jrun classpath). I am getting "Invalid cursor position" error.
    I feel there is a problem with the usebean tag.
    This is my code:
    what is wrong with this?
    <%@ page language = "java" import="java.sql.*, java.util.*, javax.sql.*, sun.jdbc.rowset.*" %>
    <%
    String indSub = request.getParameter("indSub");
    String areaname = request.getParameter("selarea");
    %>
    <jsp:useBean id="crs" class="CachedRowSet" scope="session" >
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    crs.setUrl("jdbc:odbc:asphData");
    crs.setCommand("SELECT siccode, sicdesc from siccode where sictitle = '" + indSub + "'");
    crs.execute();
    %>
    </jsp:useBean>
    <%@ include file="header2.htm" %>
    <link rel="stylesheet" href="http://localhost:8100/empData/almis.css" type="text/css">
    <br>
    <br>
    <table align="center">
    <tr><td class="moduleDesign" align="center">Employers Database</td></tr>
    </table>
    <br><br>
    <font size="+2" face="verdana sans-serif">
    <form action="employerDetail.jsp" method="post">
    <p><center><font color="Blue">Employers in the �<%= indSub %>� Industry
    <br>
    SIC Code:�<%= crs.getString("siccode") %>
    <br>State: Utah<br>
    Region: �<%=areaname %><br>
    </font></center></p>
    <p>
    <b>Description:</b>�<%= crs.getString("sicdesc") %>
    </p>
    </form>
    <jsp:include page="footer2.htm" />
    </body>
    </html>
    srajaman2

    Never mind!
    I have to issue a next() command to get to the first line of the resultset!
    srajaman2

  • DataTable Exception: Invalid operation for the current cursor position

    I have a JSF application that lists rows from a view in a SQL Server database. I have set up a commandLinks in an extra columns.
    The data is displayed properly, but when I select one of the commandLinks I get the "Invalid operation for the current cursor position" exception.
    Here's the source
    Domain.jsp
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <html lang="en-US" xml:lang="en-US">
                <head>
                    <meta content="no-cache" http-equiv="Cache-Control"/>
                    <meta content="no-cache" http-equiv="Pragma"/>
                    <title>Page1 Title</title>
                    <link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
                </head>
                <body style="-rave-layout: grid">
                    <h:form binding="#{Domains.form1}" id="form1">
                        <h:dataTable binding="#{Domains.dataTable1}" headerClass="list-header" id="dataTable1" rowClasses="list-row-even,list-row-odd"
                            value="#{Domains.dataTable1Model}" var="currentRow">
                            <h:column binding="#{Domains.column9}" id="column9">
                                <h:selectBooleanCheckbox binding="#{Domains.checkbox2}" id="checkbox2"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Domains.outputText9}" id="outputText9" value="Select"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Domains.column10}" id="column10">
                                <f:facet name="header">
                                    <h:outputText binding="#{Domains.outputText4}" id="outputText4" value="Name"/>
                                </f:facet>
                                <h:commandLink action="#{Domains.groupList}" binding="#{Domains.linkAction1}" id="linkAction1">
                                    <h:graphicImage binding="#{Domains.image1}" id="image1" url="resources/images/domain16.gif" value="resources/images/domain16.gif"/>
                                    <h:outputText binding="#{Domains.linkAction1Text}" id="linkAction1Text" value="#{currentRow['name']}"/>
                                </h:commandLink>
                            </h:column>
                            <h:column binding="#{Domains.column3}" id="column3">
                                <h:outputText binding="#{Domains.outputText5}" id="outputText5" value="#{currentRow['description']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Domains.outputText6}" id="outputText6" value="Description"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Domains.column4}" id="column4">
                                <h:selectBooleanCheckbox binding="#{Domains.checkbox1}" id="checkbox1" value="#{Domains.domainviewRowSet.currentRow['enabled']}==1"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Domains.outputText8}" id="outputText8" value="Enabled"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Domains.column7}" id="column7">
                                <h:outputText binding="#{Domains.outputText13}" id="outputText13" value="#{currentRow['userCount']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Domains.outputText14}" id="outputText14" value="Users"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Domains.column8}" id="column8">
                                <h:outputText binding="#{Domains.outputText15}" id="outputText15" value="#{currentRow['groupCount']}"/>
                                <f:facet name="header">
                                    <h:outputText binding="#{Domains.outputText16}" id="outputText16" value="Groups"/>
                                </f:facet>
                            </h:column>
                            <h:column binding="#{Domains.column5}" id="column5">
                                <f:facet name="header">
                                    <h:outputText binding="#{Domains.outputText17}" id="outputText17" value="Actions"/>
                                </f:facet>
                                <h:commandLink action="#{Domains.editDomain}" binding="#{Domains.linkAction2}" id="linkAction2">
                                    <h:graphicImage binding="#{Domains.image2}" id="image2" title="Edit" value="resources/images/edit.gif"/>
                                </h:commandLink>
                                <h:commandLink binding="#{Domains.linkAction3}" id="linkAction3">
                                    <h:graphicImage binding="#{Domains.image3}" id="image3" title="View" url="resources/images/view.gif" value="resources/images/view.gif"/>
                                </h:commandLink>
                                <h:commandLink binding="#{Domains.linkAction4}" id="linkAction4">
                                    <h:graphicImage binding="#{Domains.image4}" id="image4" title="Delete" value="resources/images/delete.gif"/>
                                </h:commandLink>
                            </h:column>
                        </h:dataTable>
                    </h:form>
                </body>
            </html>
        </f:view>
    </jsp:root>
    Domains.java
    * Page1.java
    * Created on October 28, 2004, 12:45 PM
    * Copyright Gordon.Bell
    package usergroupmgt;
    import javax.faces.*;
    import com.sun.jsfcl.app.*;
    import javax.faces.component.html.*;
    import com.sun.jsfcl.data.*;
    import javax.faces.component.*;
    import com.sun.sql.rowset.*;
    import javax.faces.convert.*;
    public class Domains extends AbstractPageBean {
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
        private int __placeholder;
        private HtmlForm form1 = new HtmlForm();
        public HtmlForm getForm1() {
            return form1;
        public void setForm1(HtmlForm hf) {
            this.form1 = hf;
        private HtmlDataTable dataTable1 = new HtmlDataTable();
        public HtmlDataTable getDataTable1() {
            return dataTable1;
        public void setDataTable1(HtmlDataTable hdt) {
            this.dataTable1 = hdt;
        private JdbcRowSetXImpl domainviewRowSet = new JdbcRowSetXImpl();
        public JdbcRowSetXImpl getDomainviewRowSet() {
            return domainviewRowSet;
        public void setDomainviewRowSet(JdbcRowSetXImpl jrsxi) {
            this.domainviewRowSet = jrsxi;
        private HtmlOutputText outputText4 = new HtmlOutputText();
        public HtmlOutputText getOutputText4() {
            return outputText4;
        public void setOutputText4(HtmlOutputText hot) {
            this.outputText4 = hot;
        private UIColumn column3 = new UIColumn();
        public UIColumn getColumn3() {
            return column3;
        public void setColumn3(UIColumn uic) {
            this.column3 = uic;
        private HtmlOutputText outputText5 = new HtmlOutputText();
        public HtmlOutputText getOutputText5() {
            return outputText5;
        public void setOutputText5(HtmlOutputText hot) {
            this.outputText5 = hot;
        private HtmlOutputText outputText6 = new HtmlOutputText();
        public HtmlOutputText getOutputText6() {
            return outputText6;
        public void setOutputText6(HtmlOutputText hot) {
            this.outputText6 = hot;
        private UIColumn column4 = new UIColumn();
        public UIColumn getColumn4() {
            return column4;
        public void setColumn4(UIColumn uic) {
            this.column4 = uic;
        private HtmlOutputText outputText8 = new HtmlOutputText();
        public HtmlOutputText getOutputText8() {
            return outputText8;
        public void setOutputText8(HtmlOutputText hot) {
            this.outputText8 = hot;
        private UIColumn column7 = new UIColumn();
        public UIColumn getColumn7() {
            return column7;
        public void setColumn7(UIColumn uic) {
            this.column7 = uic;
        private HtmlOutputText outputText13 = new HtmlOutputText();
        public HtmlOutputText getOutputText13() {
            return outputText13;
        public void setOutputText13(HtmlOutputText hot) {
            this.outputText13 = hot;
        private HtmlOutputText outputText14 = new HtmlOutputText();
        public HtmlOutputText getOutputText14() {
            return outputText14;
        public void setOutputText14(HtmlOutputText hot) {
            this.outputText14 = hot;
        private UIColumn column8 = new UIColumn();
        public UIColumn getColumn8() {
            return column8;
        public void setColumn8(UIColumn uic) {
            this.column8 = uic;
        private HtmlOutputText outputText15 = new HtmlOutputText();
        public HtmlOutputText getOutputText15() {
            return outputText15;
        public void setOutputText15(HtmlOutputText hot) {
            this.outputText15 = hot;
        private HtmlOutputText outputText16 = new HtmlOutputText();
        public HtmlOutputText getOutputText16() {
            return outputText16;
        public void setOutputText16(HtmlOutputText hot) {
            this.outputText16 = hot;
        private HtmlSelectBooleanCheckbox checkbox1 = new HtmlSelectBooleanCheckbox();
        public HtmlSelectBooleanCheckbox getCheckbox1() {
            return checkbox1;
        public void setCheckbox1(HtmlSelectBooleanCheckbox hsbc) {
            this.checkbox1 = hsbc;
        private UIColumn column5 = new UIColumn();
        public UIColumn getColumn5() {
            return column5;
        public void setColumn5(UIColumn uic) {
            this.column5 = uic;
        private UIColumn column9 = new UIColumn();
        public UIColumn getColumn9() {
            return column9;
        public void setColumn9(UIColumn uic) {
            this.column9 = uic;
        private HtmlSelectBooleanCheckbox checkbox2 = new HtmlSelectBooleanCheckbox();
        public HtmlSelectBooleanCheckbox getCheckbox2() {
            return checkbox2;
        public void setCheckbox2(HtmlSelectBooleanCheckbox hsbc) {
            this.checkbox2 = hsbc;
        private HtmlOutputText outputText9 = new HtmlOutputText();
        public HtmlOutputText getOutputText9() {
            return outputText9;
        public void setOutputText9(HtmlOutputText hot) {
            this.outputText9 = hot;
        private UIColumn column10 = new UIColumn();
        public UIColumn getColumn10() {
            return column10;
        public void setColumn10(UIColumn uic) {
            this.column10 = uic;
        private RowSetDataModel dataTable1Model = new RowSetDataModel();
        public RowSetDataModel getDataTable1Model() {
            return dataTable1Model;
        public void setDataTable1Model(RowSetDataModel rsdm) {
            this.dataTable1Model = rsdm;
        private BooleanConverter booleanConverter1 = new BooleanConverter();
        public BooleanConverter getBooleanConverter1() {
            return booleanConverter1;
        public void setBooleanConverter1(BooleanConverter bc) {
            this.booleanConverter1 = bc;
        private HtmlCommandLink linkAction1 = new HtmlCommandLink();
        public HtmlCommandLink getLinkAction1() {
            return linkAction1;
        public void setLinkAction1(HtmlCommandLink hcl) {
            this.linkAction1 = hcl;
        private HtmlOutputText linkAction1Text = new HtmlOutputText();
        public HtmlOutputText getLinkAction1Text() {
            return linkAction1Text;
        public void setLinkAction1Text(HtmlOutputText hot) {
            this.linkAction1Text = hot;
        private HtmlGraphicImage image1 = new HtmlGraphicImage();
        public HtmlGraphicImage getImage1() {
            return image1;
        public void setImage1(HtmlGraphicImage hgi) {
            this.image1 = hgi;
        private HtmlCommandLink linkAction2 = new HtmlCommandLink();
        public HtmlCommandLink getLinkAction2() {
            return linkAction2;
        public void setLinkAction2(HtmlCommandLink hcl) {
            this.linkAction2 = hcl;
        private HtmlGraphicImage image2 = new HtmlGraphicImage();
        public HtmlGraphicImage getImage2() {
            return image2;
        public void setImage2(HtmlGraphicImage hgi) {
            this.image2 = hgi;
        private HtmlCommandLink linkAction3 = new HtmlCommandLink();
        public HtmlCommandLink getLinkAction3() {
            return linkAction3;
        public void setLinkAction3(HtmlCommandLink hcl) {
            this.linkAction3 = hcl;
        private HtmlGraphicImage image3 = new HtmlGraphicImage();
        public HtmlGraphicImage getImage3() {
            return image3;
        public void setImage3(HtmlGraphicImage hgi) {
            this.image3 = hgi;
        private HtmlCommandLink linkAction4 = new HtmlCommandLink();
        public HtmlCommandLink getLinkAction4() {
            return linkAction4;
        public void setLinkAction4(HtmlCommandLink hcl) {
            this.linkAction4 = hcl;
        private HtmlGraphicImage image4 = new HtmlGraphicImage();
        private HtmlOutputText outputText17 = new HtmlOutputText();
        public HtmlOutputText getOutputText17() {
            return outputText17;
        public void setOutputText17(HtmlOutputText hot) {
            this.outputText17 = hot;
        public HtmlGraphicImage getImage4() {
            return image4;
        public void setImage4(HtmlGraphicImage hgi) {
            this.image4 = hgi;
        // </editor-fold>
        public Domains() {
            // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
            try {
                domainviewRowSet.setDataSourceName("java:comp/env/jdbc/HBird");
                domainviewRowSet.setCommand("SELECT ALL dbo.DomainView.id, dbo.DomainView.name, dbo.DomainView.description, dbo.DomainView.enabled, dbo.DomainView.created, dbo.DomainView.modified, dbo.DomainView.userCount, dbo.DomainView.groupCount  FROM dbo.DomainView");
                dataTable1Model.setDataCacheKey("com.sun.datacache.Domains.domainviewRowSet");
                dataTable1Model.setRowSet(domainviewRowSet);
                dataTable1Model.setSchemaName("");
                dataTable1Model.setTableName("");
            } catch (Exception e) {
                log("Page1 Initialization Failure", e);
                throw e instanceof javax.faces.FacesException ? (FacesException) e : new FacesException(e);
            // </editor-fold>
            // Additional user provided initialization code
    //        try {
    //            domainviewRowSet.execute();
    //            domainviewRowSet.next();
    //        } catch (Exception ex) {
    //            throw new FacesException(ex);
        protected usergroupmgt.ApplicationBean1 getApplicationBean1() {
            return (usergroupmgt.ApplicationBean1)getBean("ApplicationBean1");
        protected usergroupmgt.SessionBean1 getSessionBean1() {
            return (usergroupmgt.SessionBean1)getBean("SessionBean1");
         * Bean cleanup.
        protected void afterRenderResponse() {
            domainviewRowSet.close();
        public String groupList() {
            // User event code here...
            return "groupList";
        public String editDomain() {
            // User event code here...
            return "editDomain";
    }and the exception stack:
    Stack trace:
    com.sun.jsfcl.data.ResultSetPropertyResolver$RowData.getData(Unknown Source)
    com.sun.jsfcl.data.ResultSetPropertyResolver.getValue(Unknown Source)
    com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
    com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
    com.sun.faces.el.MixedELValueBinding.getValue(MixedELValueBinding.java:80)
    javax.faces.component.UIOutput.getValue(UIOutput.java:147)
    javax.faces.component.UIInput.validate(UIInput.java:639)
    javax.faces.component.UIInput.executeValidate(UIInput.java:838)
    javax.faces.component.UIInput.processValidators(UIInput.java:412)
    javax.faces.component.UIData.iterate(UIData.java:969)
    javax.faces.component.UIData.processValidators(UIData.java:781)
    javax.faces.component.UIForm.processValidators(UIForm.java:170)
    javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:904)
    javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:342)
    com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:78)
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    java.lang.reflect.Method.invoke(Method.java:324)
    org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
    org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
    org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
    org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
    org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
    java.security.AccessController.doPrivileged(AccessController.java:-2)
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
    org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:254)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
    com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
    org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
    org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
    org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
    org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
    java.lang.Thread.run(Thread.java:534)Any help is appreciated.

    Hi,
    Looks like some inconsistency in the jsp source:
    in the 2nd link the url property is set. I don't think
    you need to set this.
    I couldn't tell what action you want to occur when you
    click. If you want some action to occur such as
    navigating to another page then you can use Page Navigation. Then you would need an action handler
    for the LinkAction component.
    <h:commandLink action="#{Domains.editDomain}" binding="#{Domains.linkAction2}" id="linkAction2">
    <h:graphicImage binding="#{Domains.image2}" id="image2" title="Edit" value="resources/images/edit.gif"/>
    </h:commandLink>
    <h:commandLink binding="#{Domains.linkAction3}" id="linkAction3">
    <h:graphicImage binding="#{Domains.image3}" id="image3" title="View" url="resources/images/view.gif" value="resources/images/view.gif"/>
    </h:commandLink>
    <h:commandLink binding="#{Domains.linkAction4}" id="linkAction4">
    <h:graphicImage binding="#{Domains.image4}" id="image4" title="Delete" value="resources/images/delete.gif"/>
    </h:commandLink>
    John
    JSC QA

  • How to get the current cursor position in word report?

    I am generating a word report. But I would like to keep the table in one page. However, I did not find the way to do it in labview. Somebody would give me some suggestions? I appreciate a lot.
    One way I think I can do is to find the current cursor position. Since I know the table size so I can figure out if the left space in the current page is enough to hold the table. But I do not know how to locate the curent cursor position in word document in labview programmatically. I appreciate any suggestions on this question.
    Thanks.

    Hi,
    when you insert data in a word document you have to refer to bookmarks rather than cursor position.
    If you are using the Report Generation Toolkit for Office it is explained in the manual chapter 3-1.
    See also the example: Generate Report From Template (Word).vi included in the toolkit.
    If you aren't using the toolkit, you still have to refer to bookmark as reference points to insert and/or fetch data.
    The principle is:
    - First create a document in which you insert bookmarks where you wish and save it as a template
    - In LV open your template document and insert in it your data referring to bookmarks as insertion points
    - At the end save your report with another name, so you still have the template
    I hope I have been clear enough, if not just as
    k!
    Good luck,
    Alberto

  • Accessing cursor positions on Tek TDS3052 oscilloscope

    Hello,
    I'm trying to program a LabVIEW application using a Tektronix TDS3052 digital oscilloscope that I access via GPIB.
    I have a got most of it running using the tkds30xx driver library that came with LabVIEW. However, I am missing one function: I need to query the user cursor positions set by the user on the scope. What I'm looking for is pretty much what the "TekTDS read cursors.vi" from the vi lib for the older Tek scopes does. I didn't find its equivalent in the TDS30xx lib, and unfortunately these routines cannot be intermixed.
    Does someone know whether that function exists at all and, if yes, how to access it (where is it and what its name?)?
    Thanks in advance for your help!
    Best regards
    K
    ristian Laß

    Hello,
    For horizontal cursors try:
    CURS:HBA?
    The instrument should give a response in this format:
    Horizontal Pos1;Pos2;Delta;Selected Cursor;Units
    For Vertical try these:
    CURS:VBA:HDELT?
    Returns horizontal difference
    CURS:VBA:HPOS? x = 1 or 2
    Returns value of vertical bar ticks
    CURS:VBA:UNITS?
    Return measurement units
    CURS:VBA:VDELTA?
    Returns value difference between the bars ticks
    If you are using the IVI driver, use the write to instrument and read from instrument VIs. If you are using the LabVIEW native one, VISA write and read should do the trick. Hope this helps.

  • Cursor position

    I ahve a program written and all but it looks like I distorted the cursor position. I want to set the cursor position to where it can be moved by clicking and i cant figure it out. I know i have the magnify on is that why if so is there a way to keep both.
    Attachments:
    windchime2.vi ‏53 KB

    Press Here.
    Tim
    Johnson Controls
    Holland Michigan

  • Java.sql.SQLException: Invalid cursor position on saving

    Dear all
    I'm having a problem with saving components on a JSF page. The page is plit in two parts:
    1. Save report details, which are being saved correctly. Here is the code
    public String btnSaveReport_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            System.out.println("Saving the report ... forsi");
            int seqNumber = SequenceNumber.getNextSequenceNo("TB_REPORTS");
            getSessionBean1().setReportFK(seqNumber);
            String reportId = "REP_" + ((String)tfReportName.getText()).replace(' ', '_').trim();
            System.out.println("ReportFK in btnSaveReport: " + getSessionBean1().getReportFK());
            //SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
            System.out.println("Start Date: " + calRepStartDate.getSelectedDate());
            //error(calRepStartDate.getValue().toString());
            //System.out.println("getvalue" + calRepStartDate.getValue());
            try {
                rk = tb_reportsDataProvider.appendRow();
                tb_reportsDataProvider.setCursorRow(rk);
                System.out.println("Setting Values ...");
                tb_reportsDataProvider.setValue("REP_PK", new Integer(seqNumber));
                tb_reportsDataProvider.setValue("REP_ID", reportId);
                tb_reportsDataProvider.setValue("REP_ACTIVE", "Y");
                tb_reportsDataProvider.setValue("REP_SESSION_FK", new Integer(getSessionBean1().getSessionId()));
                tb_reportsDataProvider.setValue("REP_NAME", (String)tfReportName.getText());
                tb_reportsDataProvider.setValue("REP_START_DATE", new java.sql.Date(calRepStartDate.getSelectedDate().getTime()));
                tb_reportsDataProvider.setValue("REP_END_DATE", new java.sql.Date(calRepEndDate.getSelectedDate().getTime()));
                System.out.println("Committing Changes ...");
                tb_reportsDataProvider.commitChanges();
                System.out.println("Refreshing Row ...");
                tb_reportsDataProvider.getCachedRowSet().refreshRow();
                getSessionBean1().getTb_reportsRowSet().refreshRow();           
    //            tb_reportsDataProvider.refresh();
    //            System.out.println("Refreshing Row ...");
    //            tb_reportsDataProvider.setCursorRow(tb_reportsDataProvider.findFirst("REP_PK",new Integer(seqNumber)));
                info("Report Data Saved Successfully!");
            } catch (SQLException sqle) {
                /* error("Cannot update report (SQLException): " +
                        reportId +
                        " : " + sqle.getMessage()); */
                log("Cannot update report (SQLException): " +
                        reportId +
                        " : " + sqle);
                info("Could not save report: " + sqle.getMessage());
                sqle.printStackTrace();
            //tfReportName.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //tfReportName.setValueBinding("text", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_NAME']}"));
            // calRepStartDate.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //calRepStartDate.setValueBinding("selectedDate", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_START_DATE']}"));
            //calRepEndDate.setValueBinding("sourceData", getApplication().
            //    createValueBinding("#{newReport.tb_reportsDataProvider}"));
            //calRepEndDate.setValueBinding("selectedDate", getApplication().createValueBinding            ("#{newReport.tb_reportsDataProvider.value['REP_END_DATE']}"));
            info("Report Name: " + tb_reportsDataProvider.getValue("REP_NAME"));
            tfReportName.validate(this.getFacesContext());
            calRepStartDate.validate(this.getFacesContext());
            calRepEndDate.validate(this.getFacesContext());
            tfReportName.setDisabled(true);
            calRepStartDate.setDisabled(true);
            calRepEndDate.setDisabled(true);
            btnNewQuery.setDisabled(false);
            btnSaveReport.setDisabled(true);
            return null;
        }The problem is that the reportFK is losing its value when I submit the page the second time! I am trying to get the value from the provider or from the rowset, but none work. Here is the code I am trying ...
    public String btnSaveQuery_action() {
            // TODO: Process the button click action. Return value is a navigation
            // case name where null will return to the same page.
            int seqNumber  = 0;
            // Save the query header details to the database  
            try {
                // Start with the query - needed for the link table
                seqNumber = SequenceNumber.getNextSequenceNo("TB_QUERY");
                String queryId = "QRY_" + ((String)tfQueryName.getText()).replace(' ', '_').trim();
                tb_queryDataProvider.setCursorRow(queryRowKey);
                tb_queryDataProvider.setValue("QRY_PK", new BigDecimal(seqNumber));
                tb_queryDataProvider.setValue("QRY_CODE", queryId);
                tb_queryDataProvider.setValue("QRY_NAME", (String)tfQueryName.getText());
                tb_queryDataProvider.setValue("QRY_ACTIVE", "Y");
                tb_queryDataProvider.setValue("QRY_SESS_FK", new BigDecimal(getSessionBean1().getSessionId()));
                System.out.println("Committing Changes ...");
                tb_queryDataProvider.commitChanges();
                System.out.println("Refreshing Row ...");
                tb_queryDataProvider.setCursorRow(tb_queryDataProvider.findFirst("QRY_PK",new Integer(seqNumber)));
                getSessionBean1().getTb_queryRowSet().refreshRow();
                info("Query Data Saved Successfully!");
            } catch (Exception ex) {
                error("Error while saving query: " + ex.getMessage());
                log("Error while saving query" + ex);
                ex.printStackTrace();
            // Now save the link
            try {
                // Start with the query - needed for the link table
                String sql = "INSERT INTO TB_LINK_REPORT_QUERY ( " +
                   "LRQ_PK, LRQ_REP_FK, LRQ_QRY_FK, " +
                   "LRQ_TYPE, LRQ_START_DATE, LRQ_END_DATE, " +
                   "LRQ_ACTIVE, LRQ_SESS_FK) " +
                   "VALUES (?,?,?,?,?,?,?,?)";
                System.out.println("Trying to do the link");
                int linkSeqNumber = SequenceNumber.getNextSequenceNo("TB_LINK_REPORT_QUERY");           
                PreparedStatement pstmt = DBConnection.getConnection().prepareStatement(sql);
                if (getSessionBean1().getReportFK() == -1 || getSessionBean1().getReportFK() == 0)
                    System.out.println("reportFK = -1 or 0!!! Trying from provider.");
                    System.out.println("Report PK is: " + getSessionBean1().getTb_reportsRowSet().getBigDecimal("REP_PK"));
                    getSessionBean1().setReportFK(((Integer)tb_reportsDataProvider.getValue("REP_PK")).intValue());
                System.out.println("Report Foreign Key: " + getSessionBean1().getReportFK());
                System.out.println("Query Foreign Key: " + seqNumber);
                pstmt.setInt(1, linkSeqNumber);
                pstmt.setInt(2, getSessionBean1().getReportFK());
                pstmt.setInt(3, seqNumber);
                pstmt.setString(4, (String)dropDownQueryType.getSelected());
                pstmt.setDate(5, new java.sql.Date(calendarQueryStartDate.getSelectedDate().getTime()));
                pstmt.setDate(6, new java.sql.Date(calendarQueryEnd.getSelectedDate().getTime()));
                pstmt.setString(7, "Y");
                pstmt.setInt(8, getSessionBean1().getSessionId());
                System.out.println("Committing Changes for Link ...");
                pstmt.executeUpdate();
                DBConnection.getConnection().commit();
                System.out.println("Refreshing Row in link ...");
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        1, new Integer(linkSeqNumber));
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        2, new Integer(getSessionBean1().getReportFK()));
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        3, calendarQueryStartDate.getSelectedDate());
                getSessionBean1().getTb_link_report_queryRowSet().setObject(
                        4, calendarQueryEnd.getSelectedDate());
                tb_link_report_queryDataProvider.refresh();
                info("Link Data Saved Successfully!");
            } catch (Exception ex) {
                error("Error while saving query: " + ex.getMessage());
                log("Error while saving link: " + ex);
                ex.printStackTrace();
            return null;
        }The part saving the query with the provider is working correctly. But the part with the link is not working at all (the part with the PreparedStatement). The fact is that the PreparedStatement cannot be executed because I am getting the error at the line
    System.out.println("Report PK is: " + getSessionBean1().getTb_reportsRowSet().getBigDecimal("REP_PK"));Can anyone help please?
    Thanks and Regards
    Joseph

    guys if any of you have an idea just post it. It would be of great help for me. I can't figure out my mistake and its been 2days already and still i am stuck with my problem.
    It displays the table but there is an error "java.sql.SQLException: Invalid cursor position" so i cannot put the counter to the session.

  • Invalid Cursor Position Error on Windows XP using CachedRowSet

    Hello, I don't know if this question lies here, but I thought it would be the well suited place so please pardon me if it isn't. I am trying to access multiple pages from my database on my XP machine but I am getting an "invalid cursor position" error when trying to access the next page. I don't know how this error is coming about because it works well on a Vista machine with no errors. I don't know if it is my drivers or something that brings about the problem. I am using mysql connecter 5.1.10, JRE 1.6.0_02 and windows XP SP2
    Below is a simple code that brings the error.
    package Admin; import javax.sql.rowset.CachedRowSet; import com.sun.rowset.CachedRowSetImpl; public class test { public void table() { try { CachedRowSet crs=new CachedRowSetImpl(); crs.setUrl("jdbc:mysql://host:3306/database");         crs.setUsername("User");         crs.setPassword("password"); crs.setCommand("select * from myTable"); int[] keys = {1}; crs.setKeyColumns(keys); crs.execute(); crs.last(); if(crs.getRow()>500){ //new overLimit(); } crs.setPageSize(3); crs.execute(); while (crs.next()) { System.out.print("page one----"); System.out.println(crs.getString(1)); } while(crs.nextPage()){ System.out.println("page two---"); while (crs.next()) { System.out.println("in page two"); System.out.println(crs.getString(1)); } } } catch (Exception e) { e.printStackTrace(); } } public static void main(String []args){ new test().table(); } }

    Yes I am running the same code on both machines. The output I get on the XP machine is shown below. I modified the code I posted earlier and replaced the "page two" text with "page (then page number)" and also omitted the "in page two" text for better readability---------PAGE 0---------
    DB09140110
    DU35463010
    EX29201810
    ---------PAGE 1---------
    EX38341510
    EX40471810
    KZ280299
    ----------PAGE 2---------
    LA130299
    LC130299
    MC081009
    ----------PAGE 3---------
    RZ300502
    VA130299
    VI020209
    ----------PAGE 4---------
    YX101008
    ZE220299
    ZF231105and vista....
    ----------PAGE 0---------
    EX38341510
    EX40471810
    KZ280299
    ----------PAGE 1---------
    LA130299
    LC130299
    MC081009
    ----------PAGE 2---------
    RZ300502
    VA130299
    VI020209
    ----------PAGE 3---------
    YX101008
    ZE220299
    ZF231105

  • How to get the index of the word at current cursor position in the word?

    Dear All
    I am implementing a spell checker of my native language in Word. Whenever I run spell checker it start from the first word. How can I make it to start from the current cursor position? How can I get the index of the word at the current cursor position?
    Thanks in advance.
    Dharam Veer Sharma

    hi Dharam Veer Sharma,
    Thanks for sharing the solultion with us.
    It is helpful for others who have the same issue. And if you have any Office developing issue, please feel free to open a new thread.
    Have a nice day.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Cursor position on screen data in module pool programming(urgent)

    Hi all,
    I developed a module pool  program which will save the data after  scanning the barcode data.
    In my program screen 100 is there which contains field  ‘2dbar’. scanned data is comming to 2dbar field.
    we r doing scan 4 times.once for vendor number,once for material no. like this.
    After 1st scan, vendor number will come to field ‘2dbar’.
    Then I developed logic to put comma after each scanned data come to this field ‘2dbar’.
    MODULE put_comma INPUT.
    CASE OK_CODE.
    when ''.
    move 2dbar to 2dbar1.
    clear 2dbar.
    concatenate 2dbar1 ',' into 2dbar2.
    *replace 2dbar with 2dbar2 into 2dbar.
    move 2dbar2 to 2dbar.
    *write 2dbar2 to 2dbar.
    condense 2dbar no-gaps.
    *move '' to 2dbar.
    *set cursor field 2dbar offset 5.
    *write
    ENDCASE.
    ENDMODULE.                 " put_comma  INPUT
    By above logic, comma  comes to the starting position of 2dbar after each scan. i.e cursor position is coming to the starting position of screen field ‘2dbar’.
    Now  I need to move the cursor position after the comma position on 2dbar after each scan.
    after 1st scan, 2dbar contains
    vmotorola
    then my logic puts a comma when u put enter on screen 100.
    now 2dbar contains
    vmotorola,
    i should get the cursor position after the comma.but i am getting cursor position before 'v'.so how to move this cursor position  beyond comma after each scan.
    I added set cursor  command but it is not working.plz
    What is the logic, I need to put in PAI  to move the cursor on selection screen.
    Already the logic I have mentioned.  with that logic, I can put comma.now I need to add cursor movement logic  to move the cursoron  on screen field ‘2dbar’.
    Plz reply me as it is urgent.
    Thanks in advance.
    Regards
    pabitra

    CASE OK_CODE.
    when ''.
    move 2dbar to 2dbar1.
    clear 2dbar.
    concatenate 2dbar1 ',' into 2dbar2.
    move 2dbar2 to 2dbar.
    condense 2dbar no-gaps.
    len = strlen ( 2dbar ).
    len = len - 1.
    set cursor field 2dbar offset len.
    ENDCASE.
    ENDMODULE. " put_comma INPUT

  • Inserting text into a field at the current cursor position

    Does anyone know how to insert text into a field at the current cursor position? I would like it to work similar to the Syntax Palette in Forms. I cannot figure out how to retrieve the current cursor position in order to manipulate the text.
    Any help would be great.
    Thanks.

    Hi,
    If the button and the textfield are on in the same subform then this code should work in the click event of the button
    (This is JavaScript code so make sure the code is set to JavaScript and Client on the drop downs in the script window)
    (assuming the name of the textfield is TextField1)
    TextField1.rawValue = "some value";
    If they are in different subforms then you have 2 options
    Please note in both these options it is easier if the subforms have names ( I am assuming this to keep samples simple)
    option 1 -
    use the parent object to move up the tree till you are at the same level as that of the subform that contains the textfield
    e.g. 
    (Click Event of the button)
    this.parent.subformname.TextField1.rawValue = "some value";
    option 2 -
    Use the resolve node to make your way down from the top level of the form
    xfa.resolveNode ("form1.subformname.TextField1").rawValue = "some value";
    Hope this helps
    Malcolm
    p.s. I am making assumptions as the image/file you attached did not appear for me.

  • How to assign values to textbox automatically when cursor position changed

    I want to get values based on the values entered in the one textbox when we change the cursor position the value to be automatically loaded in to other text box is it possible please help me .....

    You still haven't explained what a text box is.
    Repeating what you've already said in "BOLD" text doesn't make the question any clearer.
    What does the changing cursor position have to do with anything. I can use the arrow keys to move the cursor without changing the text.

Maybe you are looking for

  • How can I disable files from being shown in spotlight?

    Hi All, In my spotlight preferences I've enabled only Applications, Folders, and System Preferences. However, in almost all of my searches, many individual files are shown. These are usualy .java, .jar, or .html even. To exacerbate the problem, spotl

  • MS-6957 Ver 1A

    Hi, I cann't seem to be find drivers for MS 6957. Can somebody help me? I am running XP machine and installing the TV-OUT card. I can not even find any related information anywhere. Help is appriciated. -Anand

  • How do we call a function returning a collection from package

    Dear Member, i have a package spec whose code is as follows: create or replace package c_test as procedure main; TYPE JOURNAL_HEADER_TYPE IS TABLE OF NUMBER; l_header JOURNAL_HEADER_TYPE := JOURNAL_HEADER_TYPE(); TYPE JOURNAL_SOURCE_TYPE IS TABLE OF

  • Premiere Pro file size and timeline duration limits?

    Hello. Are there any file size limits for importing JPEG or MPEG files and exporting WMV? I am looking at some extremely long footage. Thanks! Message was edited by: Kevin Monahan

  • Multiple NIC (eth), VLAN, bridge & netctl profiles

    Hello,   I need to configure the following network setup on my Archlinux Gateway : eth0 : LAN, static IPv4 and v6 eth1 : WAN (internet) dhcp IPv4, static v6 eth0.100: no address. eth1.100: no address brfbx : bridge on eth1.100 & eth0.100, no address.