PDA

View Full Version : Gird works on IE but not in Firefox



jeetmarwah
27 May 2010, 9:47 AM
Hi,

I have been having trouble with the Grid(com.extjs.gxt.ui.client.widget.grid.Grid.java) component when I test it in IE.

My Goal:
On click of 'Submit' button on a pop-up, I want to select a Grid component on the control Panel. So what I am trying to do is that when user wants to add a new page, the 'Edit' section that has 'Save' on the control panel , opens up.

Here is the code that works in IE but not in FireFox (FF):




private Grid<WikiCtrData> controlPanelGrid = null;

....
....
//rpc call
wikiService.addNewPage(curr, new RSAsyncCallback<Map<String, String>>()
{

@Override
public void onSuccess(Map<String, String> result)
{
//collapse all the groups on the control panel
((GroupingView) controlPanelGrid.getView()).collapseAllGroups();

//get the handle that you want it to be selected, in this case, its Edit/Save
WikiCtrData x = controlPanelGrid.getStore().findModel("name", WikiGUIConstants.SAVE);
GridSelectionModel<WikiCtrData> selectModelView = controlPanelGrid.getSelectionModel();
// selectModelView.select(x, false);
selectModelView.select(13, false);//attempt to use the id but still does not work in FF

//attempt to fire an event but still no success in FF
GridEvent<WikiCtrData> g = new GridEvent<WikiCtrData>(controlPanelGrid);
selectModelView.fireEvent(Events.CellClick, g);
// controlPanelGrid.setSelectionModel(selectModelView);

}
});

....



Please let me know if there is any other info that you will need to help me resolve this issue.

Thanks,
Jeet.

jeetmarwah
27 May 2010, 2:16 PM
Just thought I should mention the version. I am using Ext GWT 2.1.1 SDK with GWT 1.7. The Firefox version is 3.5.9. I hope they are compatible.

Thanks,
Jeet

sven
27 May 2010, 2:25 PM
You should try to post a fully working testcase that implements EntyPoint and so is runable for others.

jeetmarwah
27 May 2010, 2:48 PM
That will be difficult as this code is deep inside the app. I will try to create a simple app with the same code and reply.

Thanks,
Jeet

jeetmarwah
28 May 2010, 9:48 AM
NOTE: I HAVE TO RENAME JAVA FILES TO TXT AS IT WAS NOT UPLOADING. PLEASE RENAME IT BACK TO JAVA TO MAKE IT WORK.

Here is the complete working code that works in IE but not in FF. I have also added a screen shot so that one can visualize it better. Here is the code snippet that is the root cause (TestCaseControlPanel.java)


private void onButtonPress(Button button)
{
if (button.getText().equalsIgnoreCase(Dialog.OK))
{
/**
* THIS WORKS IN IE BUT NOT IN FF ????
*/
((GroupingView) controlPanelGrid.getView()).collapseAllGroups();

//get the handle that you want it to be selected, in this case, its Edit/Save
WikiCtrData x = controlPanelGrid.getStore().findModel("name", SAVE);
GridSelectionModel<WikiCtrData> selectModelView = controlPanelGrid.getSelectionModel();
selectModelView.select(x, false);
// selectModelView.select(13, false);
controlPanelGrid.setSelectionModel(selectModelView);

// GridEvent<WikiCtrData> g = new GridEvent<WikiCtrData>(controlPanelGrid);
// g.setRowIndex(13);
// selectModelView.fireEvent(Events.CellClick, g);
// controlPanelGrid.setSelectionModel(selectModelView);
}
else if(button.getText().equalsIgnoreCase(Dialog.CANCEL))
{
//do nothing
}
}

20697

jeetmarwah
3 Jun 2010, 10:47 AM
Does any one has any findings for this bug?

sven
3 Jun 2010, 11:12 AM
I found the problem. It will be fixed in GXT 2.2

Also your code is not good (you should not go into production with it).

jeetmarwah
3 Jun 2010, 12:34 PM
Can you please explain me why the code is not good and not be deployed to Production?

Thanks,
Jeet

jeetmarwah
3 Jun 2010, 12:35 PM
Is there an alternative way I can achieve the same result?

sven
9 Jun 2010, 3:28 AM
This is fixed in SVN as of revision 2096 for GXT 2.2

sven
9 Jun 2010, 3:28 AM
Is there an alternative way I can achieve the same result?

Set some brakepoints in your code. You will see that there is a lot of duplicate functionality. You should also think about reorginazign that code

jeetmarwah
9 Jun 2010, 7:59 AM
oh ok...right now my aim was to make it working as per the requirments....I still have to organize and clean the code...I was under the impression that the way I am accessing GXT API and using them is not correct....if there is any better way to code using the GXT API, please direct me to it...any reference that can help me improve and get better with GXT will be appreciated...

Thanks,
Jeet