1. #1
    Ext GWT Premium Member
    Join Date
    Jun 2008
    Posts
    50
    Vote Rating
    0
    Manuel Elaraj is on a distinguished road

      0  

    Default ContentPanel Problem

    ContentPanel Problem


    It seems like i cannot get all the components that i add to the content panel to show. If i collapse and expand the panel manually it renders correctly. Am i doing something wrong or is this a bug??

    The attachment shows the panel before manually collapsing and expanding the panel. The second picture shows after.

    Here is the code for the content panel:

    Code:
    public class ClaimGrid
    {
    
    
    	public ContentPanel getGrid()
    	{
    
    		final NumberFormat currency = NumberFormat.getCurrencyFormat();
    		final NumberFormat number = NumberFormat.getFormat("0.00");
    
    		List<TableColumn> columns = new ArrayList<TableColumn>();
    
    		TableColumn col = new TableColumn("Company", 180);
    		col.setMinWidth(75);
    		col.setMaxWidth(300);
    		columns.add(col);
    
    		col = new TableColumn("Symbol", 75);
    		columns.add(col);
    
    		col = new TableColumn("Last", 75);
    		col.setMaxWidth(100);
    		col.setAlignment(Style.HorizontalAlignment.RIGHT);
    		col.setRenderer(new NumberCellRenderer(currency));
    		columns.add(col);
    
    		col = new TableColumn("Change", 75);
    		col.setAlignment(Style.HorizontalAlignment.RIGHT);
    		col.setRenderer(new CellRenderer()
    		{
    			public String render(String property, Object value)
    			{
    				double val = (Double) value;
    				String style = val < 0 ? "red" : "green";
    				return "<span style='color:" + style + "'>" + number.format(val) + "</span>";
    			}
    		});
    		columns.add(col);
    
    		col = new TableColumn("Last Updated", 100);
    		col.setAlignment(Style.HorizontalAlignment.RIGHT);
    		col.setRenderer(new DateTimeCellRenderer("MM/d/y"));
    		columns.add(col);
    
    		TableColumnModel cm = new TableColumnModel(columns);
    
    		Table tbl = new Table(cm);
    		tbl.setSelectionModel(new RowSelectionModel(Style.SelectionMode.MULTI));
    		tbl.setHorizontalScroll(true);
    
    
    		List<Stock> stocks = TestData.getStocks();
    		for (int i = 0; i < stocks.size(); i++)
    		{
    			Stock stock = stocks.get(i);
    			Object[] values = new Object[5];
    			values[0] = stock.getName();
    			values[1] = stock.getSymbol();
    			values[2] = stock.getLast();
    			values[3] = stock.getLast() - stock.getOpen();
    			values[4] = stock.getLastTrans();
    
    			TableItem item = new TableItem(values);
    			tbl.add(item);
    		}
    
    		ContentPanel panel = new ContentPanel();
    		panel.setCollapsible(true);
    		panel.setFrame(true);
    		panel.setAnimCollapse(false);
    		panel.setButtonAlign(Style.HorizontalAlignment.CENTER);
    		panel.setIconStyle("icon-table");
    		panel.setHeading("Claim Search");
    		panel.setLayout(new RowLayout());
    		panel.add(tbl);
    		panel.setSize(600, 500);
    
    		// built in support for top component
    
    		TextBoxToolItem txtSearch = new TextBoxToolItem();
    		TextToolItem btnSearch = new TextToolItem("Search Claims");
    		txtSearch.textField.setEmptyText("Enter Rx # To Search");
    		ToolBar toolBar = new ToolBar();
    		toolBar.add(txtSearch);
    		toolBar.add(btnSearch);
    		//panel.setTopComponent(toolBar);
    
    		// add buttons
    
    		SearchListner searchlistener = new SearchListner()
    		{
    			public void componentSelected(ComponentEvent ce)
    			{
    				Button btn = (Button) ce.component;
    
    				//Info.display("Click Event", "The '{0}' button was clicked.", btn.getText());
    
    				String iData = (String) this.searchTextField.textField.getValue();
    				Info.display("Action","Searching for Rx #" + iData);
    
    			}
    		};
    
    
    		searchlistener.searchTextField=txtSearch;
    
    		btnSearch.addSelectionListener(searchlistener);
    
    		Button btnSave = new Button("Save");
    
    		panel.addButton(btnSave);
    		panel.addButton(new Button("Cancel"));
    	//	txtSearch.textField.focus();
    		
    		return panel;
    	}
    
    
    	private class SearchListner extends SelectionListener
    	{
    		public TextBoxToolItem searchTextField;
    
    
    	}
    
    } //ClaimGrid

    I appreciate any help greatly...

    Manuel
    Attached Images

  2. #2
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,241
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    If you post your code in the format defined here I will take a look.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar