Searchbar Issues in Web Mode

John Sanda jsanda at redhat.com
Fri Feb 24 15:50:25 UTC 2012


After lots of debugging, it looks like we have this resolved. The value 
of the search expression comes from FlexSearchBar.getValue which in turn 
previously just delegated to autoCompletePatternField.getValue(). It 
isn't clear to me where the value was getting mangled, but it seems to 
be either when it was added to or fetched from the SmartGWT request. We 
verified with log statements in firebug that the search bar itself was 
returning the correct value. When accessing it from the SmartGWT request 
though, it looked like,

{0=p, 1=l, 2=u, 3=g, 4=i, 5=n, 6==, 7=J, 8=B, 9=o, 10=s, 11=s, 12=A,
13=S, compareTo__Ljava_lang_Object_2I$=function
java_lang_String_compareTo__Ljava_lang_Object_2I(other) {
     return
     java_lang_String_$compareTo__Ljava_lang_String_2Ljava_lang_String_2I(this,
     com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(other,
     Q$java_lang_String));
     }, equals__Ljava_lang_Object_2Z$=function
     java_lang_String_equals__Ljava_lang_Object_2Z(other) {
         return
java_lang_String_$equals__Ljava_lang_String_2Ljava_lang_Object_2Z(this,
other);
}, getClass__Ljava_lang_Class_2$=function
java_lang_String_getClass__Ljava_lang_Class_2() {
     return
     com_google_gwt_lang_ClassLiteralHolder_Ljava_1lang_1String_12_1classLit;
     }, hashCode__I$=function java_lang_String_hashCode__I() {
         return
java_lang_String_$hashCode__Ljava_lang_String_2I(this);
}, toString__Ljava_lang_String_2$=function
java_lang_String_toString__Ljava_lang_String_2() {
     return
     java_lang_String_$toString__Ljava_lang_String_2Ljava_lang_String_2(this);
     }, java_lang_Object_castableTypeMap$={1=1, 628=1,
     636=1, 641=1}}

autoCompletePatternField is an instance of SuggestTextBox_v3 which 
implements HasText and HasValue, both of which are GWT interfaces. After 
a little more debugging this morning, I got a little suspicious of the 
autoCompletePatternField.getValue() call. The getValue method is 
declared in HasValue with a generic return type. Changing the call to 
autoCompletePatternField.getText() resolves the problem. getText is 
declared in HasText with a concrete return type of String.

I am going to try and reproduce this behavior in simplified test case 
that I can post on the SmartGWT forums. I want to better understand what 
was happening because we are bound to run into this again if we try to 
use other native GWT components, like for graphing.

- John


On 2/24/12 10:12 AM, mike thompson wrote:
> After having fixed the enter key not working and the star, arrow and 
> patternField, the next issue is that is appears that the Criteria is 
> injecting some weird javascript to the domain that cause the search to 
> come back erroneous.
>
>
> *Scenario:*
> */From Inventory -> Services type do a search for 'version' in the 
> search bar./*
> *
> *
> We will run the same scenario through both 'Dev mode' and then 'Web 
> mode (compiled)'
>
> *This is the Dev Mode Logging*
>
> Thu Feb 23 13:13:09 PST 2012 FINE: Table.TableFilter Pressed Enter key2
> Thu Feb 23 13:13:09 PST 2012 FINE: Table.TableFilter searchBarValue : 
> version, hiddenValue:
> Thu Feb 23 13:13:09 PST 2012 FINE: Table.TableFilter 
> fetchFilteredTableData
> Thu Feb 23 13:13:09 PST 2012 FINE: In Table.refresh()
> Thu Feb 23 13:13:09 PST 2012 FINE: 
> org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView.refresh() 
> using criteria [Criteria[{search=version, 
> resourceType.category=SERVICE}]]...
> Thu Feb 23 13:13:09 PST 2012 FINE: Table.refresh dataSource != null
> Thu Feb 23 13:13:09 PST 2012 FINE: Resetting paging on 
> org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource...
> Thu Feb 23 13:13:09 PST 2012 FINE: Array filter: 
> resourceType.category=[[Service]]
> Thu Feb 23 13:13:09 PST 2012 FINE: Filter: search=[version]
> Thu Feb 23 13:13:09 PST 2012 FINE: 
> org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource 
> using [PageControl[firstRow=0, size=50]] for fetch request.
> Thu Feb 23 13:13:09 PST 2012 FINE: RPC method invocation: 
> ResourceGWTService_Proxy.findResourcesByCriteria
> Thu Feb 23 13:13:09 PST 2012 FINE: RPCTracker register: 
> TrackingRequestCallback[id=28, 
> name=ResourceGWTService_Proxy.findResourcesByCriteria, age=0]
> Thu Feb 23 13:13:09 PST 2012 FINE: SessionRpcRequestBuilder is adding 
> sessionId(-1961737963) to 
> request(http://192.168.1.3:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceGWTService)
> POST 
> http://192.168.1.3:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceGWTService
> 200 OK
> 118ms
> (line 42)
> Thu Feb 23 13:13:09 PST 2012 FINE: Table.refresh markForRedraw()
> Thu Feb 23 13:13:09 PST 2012 FINE: ****** Pressed Enter in SearchBar
> Thu Feb 23 13:13:09 PST 2012 FINE: Table.TableFilter Pressed Enter key2
> Thu Feb 23 13:13:09 PST 2012 FINE: Table.TableFilter searchBarValue : 
> version, hiddenValue: version
> Thu Feb 23 13:13:09 PST 2012 FINE: OnValueChange in SearchBar: version
> Thu Feb 23 13:13:09 PST 2012 INFO: Loading [2] types with facets=[[]]...
> Thu Feb 23 13:13:09 PST 2012 FINE: RPC method invocation: 
> ResourceTypeGWTService_Proxy.findResourceTypesByCriteria
> Thu Feb 23 13:13:09 PST 2012 FINE: RPCTracker register: 
> TrackingRequestCallback[id=29, 
> name=ResourceTypeGWTService_Proxy.findResourceTypesByCriteria, age=0]
> Thu Feb 23 13:13:09 PST 2012 FINE: SessionRpcRequestBuilder is adding 
> sessionId(-1961737963) to 
> request(http://192.168.1.3:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceTypeGWTService)
> POST 
> http://192.168.1.3:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceTypeGWTService
> 200 OK38ms
>
> As you can see Dev Mode completes without error.
>
> Now, we run the same search in 'Web mode'.
>
>
> *This is the web mode logging*
>
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Table.TableFilter Pressed Enter 
> key2
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Table.TableFilter 
> searchBarValue : version, hiddenValue: ejb
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Table.TableFilter 
> fetchFilteredTableData
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: In Table.refresh()
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: 
> org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceSearchView.refresh() 
> using criteria [Criteria[*{search={0=v, 1=e, 2=r, 3=s, 4=i, 5=o, 6=n, 
> cT=function Bpd(a) { return Pod(this, VL(a, 1)); }, eQ=function Cpd(a) 
> { return Tod(this, a); }, gC=function Fpd() { return WW; }, 
> hC=function Gpd() { return Wod(this); }, tS=function Hpd() { return 
> qpd(this); }, cM={1=1, 628=1, 636=1, 641=1}}*, 
> resourceType.category=SERVICE}]]...
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Table.refresh dataSource != null
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Array filter: 
> resourceType.category=[[Service]]
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Filter: search=[{0=v, 1=e, 2=r, 
> 3=s, 4=i, 5=o, 6=n, cT=function Bpd(a) { return Pod(this, VL(a, 1)); 
> }, eQ=function Cpd(a) { return Tod(this, a); }, gC=function Fpd() { 
> return WW; }, hC=function Gpd() { return Wod(this); }, tS=function 
> Hpd() { return qpd(this); }, cM={1=1, 628=1, 636=1, 641=1}}]
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: 
> org.rhq.enterprise.gui.coregui.client.inventory.resource.ResourceDatasource 
> using [PageControl[firstRow=0, size=50]] for fetch request.
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: RPC method invocation: 
> ResourceGWTService_Proxy.findResourcesByCriteria
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: RPCTracker register: 
> TrackingRequestCallback[id=22, 
> name=ResourceGWTService_Proxy.findResourcesByCriteria, age=0]
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: SessionRpcRequestBuilder is 
> adding sessionId(-1961737963) to 
> request(http://192.168.1.3:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceGWTService)
> B5209B...he.html (line 1484)
> POST 
> http://192.168.1.3:7080/coregui/org.rhq.enterprise.gui.coregui.CoreGUI/ResourceGWTService
> 200 OK91ms
> B5209B...he.html (line 2854)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Table.refresh markForRedraw()
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: ****** Pressed Enter in SearchBar
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Table.TableFilter Pressed Enter 
> key2
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: Table.TableFilter 
> searchBarValue : version, hiddenValue: version
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: OnValueChange in SearchBar: version
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 SEVERE: At [Thu Feb 23 13:00:44 
> GMT-800 2012] MessageCenter received: Invalid search expression.
> B5209B...he.html (line 1484)
> Thu Feb 23 13:00:44 GMT-800 2012 FINE: In Table.refresh()
>
>
>
> You can see that the criteria built are incorrect with the weird 
> javascript stuff injected into it; and this only occurs in web mode.
>
> If anyone has experience  with this sort of thing please pipe up 
> otherwise John Sanda and I will continue to figure this out.
>
> Current hotspot is around building the criteria.
>
>
>
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/rhq-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://fedorahosted.org/pipermail/rhq-devel/attachments/20120224/249a9119/attachment-0001.html>


More information about the rhq-devel mailing list