• Grid locks up fails when computing search ie9&ie11

    By Pat Sawyer 9 years ago

    I am attempting to compute the search parameter to build a custom filtering option. I am using fields with viewScope variables. When I try to load the page I have the browser lock up on me and the search fails.

    • By F. Kranenburg 9 years ago

      I can't see why the grid would lock up the browser. Are there errors in the console, or try inspecting your network, is there a error 500 returned somewhere? Could you maybe post some code to demonstrate the problem?

      • By Pat Sawyer 9 years ago

        If I run everything in chrome it works fine. Just in crummy ole IE…

        Here is the code.

        Basically I have a number of fields whose values are viewScope variables that I use to create a search string. I then feed the search string to the search parameter in the grid. This is a method that Knut Herrmann has mentioned http://stackoverflow.com/questions/25424109/xpages-search-between-2-dates

        I try to replicate the same code in a computed field to verify the string is correct.

        This filtering method works really well in Chrome,


        <xp:view xmlns:xp=“http://www.ibm.com/xsp/core”

        xmlns:grid="http://www.openntf.org/xsp/viewgrid">
        
        
        Employee Name
        <xp:inputText id="inputText3" value="#{viewScope.Name}" ></xp:inputText>
        
        Supervisor
        <xp:inputText id="inputText4" value="#{viewScope.SupervisorName}"></xp:inputText>
        
        Location
        <xp:inputText id="inputText5" value="#{viewScope.location}"></xp:inputText>
        



        Shift<br></br>
        <xp:inputText id="inputText6" value="#{viewScope.shift}"></xp:inputText>
        



        Overtime<br></br>
        <xp:inputText id="inputText7" value="#{viewScope.overtime}"></xp:inputText>
        



        Body Type<br></br>
        <xp:inputText id="inputText8"
            value="#{viewScope.bodytype}">
        </xp:inputText>
        



        Status<br></br>
        <xp:inputText id="inputText9"
            value="#{viewScope.status}">
        </xp:inputText>
        



        Starting Range<br></br>
        <xp:inputText id="inputText1"
            value="#{viewScope.StartDate}">
            <xp:dateTimeHelper id="dateTimeHelper1"></xp:dateTimeHelper>
            <xp:this.converter>
                <xp:convertDateTime type="date" dateStyle="short"></xp:convertDateTime>
            </xp:this.converter>
        </xp:inputText>
        <br></br>
        Ending Range<br></br>
        <xp:inputText id="inputText2" value="#{viewScope.EndDate}">
            <xp:dateTimeHelper id="dateTimeHelper2"></xp:dateTimeHelper>
            <xp:this.converter>
                <xp:convertDateTime type="date" dateStyle="short"></xp:convertDateTime>
            </xp:this.converter>
        </xp:inputText>
        <xp:button value="Refresh Search" id="button1" styleClass="btn btn-success">
                        <i class="icon-refresh"></i>
            <xp:eventHandler event="onclick" submit="true"
                refreshMode="partial" refreshId="panel1">
            </xp:eventHandler></xp:button>
        
        =' + formatter.format(viewScope.StartDate); } if (viewScope.EndDate) { search += ' AND [accidentdate]<=' + formatter.format(viewScope.EndDate); } return search.substring(0);}]]> =' + formatter.format(viewScope.StartDate); } if (viewScope.EndDate) { search += ' AND [accidentdate]<=' + formatter.format(viewScope.EndDate); } return search.substring(0);}]]>

  • By Pat Sawyer 9 years ago

    Well looks like the code is parsed poorly, let me know if you can make sense of it. If not I will post it elsewhere.

  • By F. Kranenburg 9 years ago

    I think the full resulting search string can be found in the page source. It will be added to the property named 'search' where the ViewGrid is build.

    Please try to wrap your Strings with "mysearchstring" and don't use a single quote. Check out the custom control named 'ViewGrid'. The search parameter is wrapped with a single quote like this :

    search:'#{javascript:return compositeData.search ? compositeData.search : ““}',

    Now because of this you should escape any single qoute and use backslash + double quote to wrap search strings. I hope you follow me what I'm trying to say, but this problem is because Chrome can parse this search string and IE fails, probably because of an error in the generated output.

    Please let me know what you find!

    • By Pat Sawyer 9 years ago

      I am not sure if I follow exactly. Under further investigation I am finding that I cannot even get a one word search string to work properly in IE.

      in the search parameter I put in
      mysearchstring
      Where I know that string exists in the doc. In Chrome it works fine. But in IE it fails.

      I attempted to escape the ' as you suggest by computing the search string and using " to try and get the search working but could not get it to work in Chrome either.

      Could you do me a favor, could you post a search string that you know works in IE. Simple is good. You can use the directory if we need common ground.

      • By F. Kranenburg 9 years ago

        I have the search option currently fully working in IE10 and higher and our search include some notes fields in our application. But nothing really fancy like date searches. We use a seperate Java class to compute the complete search string correctly. So, it should be possible but I'm a bit lost in how I can help you.

        Are you able to create a sample db (maybe the included demo db) where I can reproduce the problem? Please send it to ferry.kranenburg -at- changetocomm.nl, and I'll try to fix it.

        • By Pat Sawyer 9 years ago

          Thank you. I will see what I can do on the demo database and send it back to you.