Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    0
    iamar is on a distinguished road

      0  

    Default PagingToolBar is not displayed at startup.

    PagingToolBar is not displayed at startup.


    Hi,

    I am fairly new to gxt grid and pagingtoolbar and my problem is that when I first time display the grid the paging tool bar is NOT displayed. But when I click on sort or any other filter options the pagingtoolbar is displayed properly.
    In addition in debug mode I see that the correct values such as offset and total records are returned from the server to the client side properly.

    Any help will be appreciated.

    Thanks Ilan,

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    It sounds like this could be a layout issue with your code, but without seeing how you are building this it is hard to tell.

    Can you try the example at http://sencha.com/examples/#ExamplePlace:paginggrid and see if it can be modified to demonstrate the issue?

    Otherwise, can you share a class that implements EntryPoint and demonstrates how you are setting up the UI to have this issue?

  3. #3
    Sencha Premium Member
    Join Date
    Jul 2012
    Posts
    4
    Vote Rating
    0
    iamar is on a distinguished road

      0  

    Default


    Thanks a lot for the response. My code is quiet different from the example you sent, please have a look at my code and tell if you see something:
    public class AlertLogView extends Composite implements AlertLogInterface {
    private static AlertLogViewUiBinder uiBinder = GWT.create(AlertLogViewUiBinder.class);
    interface AlertLogViewUiBinder extends UiBinder<Widget, AlertLogView> {
    }
    // UI Fields
    @UiField
    FiltersPanel filterPanel;
    @UiField
    ColumnModel<ClientAlert> cm;
    @UiField
    ListStore<ClientAlert> store;
    @UiField
    Grid<ClientAlert> grid;
    @UiField
    GridView<ClientAlert> view;
    @UiFactory
    ColumnModel<ClientAlert> createColumnModel() {
    return cm;
    }
    @UiFactory
    ListStore<ClientAlert> createListStore() {
    return store;
    }
    @UiField
    PagingToolBar toolBar;
    // Constructor
    public AlertLogView() {
    }
    /**
    * Method used the construct the view.
    * Since the view needs to receive the data store before being created - this
    * method is invoked by the presenter after creating the data store
    * @param loader
    * @param store
    */
    private void initView(PagingLoader<PagingLoadConfig, PagingLoadResult<ClientAlert>> loader, ListStore<ClientAlert> store) {
    // Set column model
    initColumnModel();
    // Set the data store
    this.store = store;
    initWidget(uiBinder.createAndBindUi(this));
    // Set the loader
    grid.setLoader(loader);
    toolBar.bind(loader);
    initFilters();

    }
    // Init the filter panel with all required filters
    private void initFilters() {
    filterPanel.setFiltersStyle(FiltersStyle.WIDGETS);
    List<FilterWidget> filters = new ArrayList<FilterWidget>();
    FilterWidget kpiTypeFilter = new FilterWidget(AlertLogColumnType.KPY_TYPE.getFilterName(), FilterWidgetTypes.FILTER_KPI_TYPE, true);
    filters.add(kpiTypeFilter);
    FilterWidget locationFilter = new FilterWidget(AlertLogColumnType.LOCATION.getFilterName(), FilterWidgetTypes.FILTER_LOCATION, true);
    filters.add(locationFilter);
    FilterWidget severityFilter = new FilterWidget(AlertLogColumnType.SEVERITY.getFilterName(), FilterWidgetTypes.FILTER_ALERT_SEVERITY, true);
    filters.add(severityFilter);
    FilterWidget trafficFilter = new FilterWidget(AlertLogColumnType.TRAFFIC_TYPE.getFilterName(), FilterWidgetTypes.FILTER_TRAFFIC_TYPE, true);
    filters.add(trafficFilter);
    FilterWidget datesFilter = new FilterWidget(AlertLogColumnType.ALERT_DATE.getFilterName(), FilterWidgetTypes.FILTER_FROM_TO, true);
    filters.add(datesFilter);

    filterPanel.setFiltersPanel(filters);
    }
    // Init the grid's column model
    private void initColumnModel() {

    AlertModelProperties props = GWT.create(AlertModelProperties.class);

    // Build column model
    ColumnConfig<ClientAlert, AlertSeverityType> severityCC = new ColumnConfig<ClientAlert, AlertSeverityType>(props.severity(), 30, "");
    severityCC.setCell(new SeverityCell());

    ColumnConfig<ClientAlert, Date> dateCC = new ColumnConfig<ClientAlert, Date>(props.alertTime(), 120, I18n.getMessages().alDate());
    dateCC.setCell(new LogDateCell());

    ColumnConfig<ClientAlert, String> countryCC = new ColumnConfig<ClientAlert, String>(props.countryCode(), 150, I18n.getMessages().alCountry());
    countryCC.setCell(new CountryCell());

    ColumnConfig<ClientAlert, String> operatorCC = new ColumnConfig<ClientAlert, String>(props.operatorId(), 180, I18n.getMessages().alOperator());
    operatorCC.setCell(new OperatorCell());

    ColumnConfig<ClientAlert, TrafficType> trafficTypeCC = new ColumnConfig<ClientAlert, TrafficType>(props.trafficType(), 100, I18n.getMessages().alTrafficType());

    trafficTypeCC.setCell(new TrafficTypeCell());

    ColumnConfig<ClientAlert, ClientKPIType> kpiCC = new ColumnConfig<ClientAlert, ClientKPIType>(props.kpiType(), 180, I18n.getMessages().alKPI());
    kpiCC.setCell(new KPICell());

    ColumnConfig<ClientAlert, ClientAlert> recentCC = new ColumnConfig<ClientAlert, ClientAlert>(new IdentityValueProvider<ClientAlert>(), 90, I18n.getMessages().alRecent());
    recentCC.setSortable(false);
    recentCC.setCell(new LogRecentCell());

    ColumnConfig<ClientAlert, ClientAlert> thresholdCC = new ColumnConfig<ClientAlert, ClientAlert>(new IdentityValueProvider<ClientAlert>(), 250, I18n.getMessages().alThreshold());
    thresholdCC.setSortable(false);
    thresholdCC.setCell(new LogThresholdCell());

    // TODO - add module column
    List<ColumnConfig<ClientAlert, ?>> l = new ArrayList<ColumnConfig<ClientAlert, ?>>();
    l.add(severityCC);
    l.add(dateCC);
    l.add(countryCC);
    l.add(operatorCC);
    l.add(trafficTypeCC);
    l.add(kpiCC);
    l.add(recentCC);
    l.add(thresholdCC);
    cm = new ColumnModel<ClientAlert>(l);
    }

    // External Interface
    public Map<String, Map<FilterKeyTypes, List<String>>> getFilterValues() {
    return filterPanel.getFiltersValues();
    }

    // Initiates the view
    public void buildView(PagingLoader<PagingLoadConfig, PagingLoadResult<ClientAlert>> loader, ListStore<ClientAlert> store) {
    initView(loader, store);
    }

    public void setFilterHandler(ValueChangeHandler<Map<FilterKeyTypes, List<String>>> handler) {
    filterPanel.addFilterWidgetChangeValueHandler(handler);
    }

    public Map<String, Map<FilterKeyTypes, List<String>>> getFilters() {
    return filterPanel.getFiltersValues();
    }
    }

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2011
    Posts
    80
    Vote Rating
    0
    iadded is on a distinguished road

      0  

    Default More Details on the problem

    More Details on the problem


    Thanks for your fast reply on this matter.
    My name is Inbal and i'm working with Ilan on this project.
    I will try to better explain the problem we are facing (creating a small app is not simple).

    Our code is divided to View and Presenter.
    View uses UI binder to create the layout - code is based on the example you mentioned in your reply. The only major change is we are using FlowPanel instead of GXT containers for the layout.

    Here is a pseudo code of the flow :

    Presenter :
    - Create data store
    - Create rpcproxy
    - Create loader
    - Call View.buildWidget(loader, store)

    View.buildWidget
    - init column model
    - set local store variable
    - initWidget(uiBinder.createAndBindUi(this))
    - grid.setLoader(loader);- toolBar.bind(loader);

    Presenter :
    - loader.load();

    This code results in the grid being loaded with data - but the paging toolbar is not displayed. After applying any sort or filter to the grid - toolbar appears and works properly.

    I looked again at the example and added the timer to the presenter as follows :

    Timer t = new Timer() {
    @Override
    public void run() {
    loader.load();

    }
    };
    t.schedule(20000);

    Now it works sometimes and sometimes it doesn't. and as you can see - i had to set the timer to 20 seconds for t to work.


    The main problem is i'm not sure i understand the flow - and what should be called when ...
    Our application takes long time to load - and the page presenting the grid is not presented immediately - so i need to understand how things are working and how i should schedule everything.

    If those details is not enough - let me know and i will try to reproduce the problem in a small application i can share with you.


    Any help on this issue will be appreciated.
    Thanks
    Inbal

Thread Participants: 2