This issue duplicates another issue.
  1. #1
    Sencha User
    Join Date
    Mar 2008
    Location
    Berlin
    Posts
    25
    Vote Rating
    0
    madmaxmatze is on a distinguished road

      0  

    Question AccordionLayoutContainer

    AccordionLayoutContainer


    I'm not sure if the AccordionLayout is still under development - errors included, or if I'm using it totally wrong:

    --------------------------------

    When I create an AccordionLayout like in
    gxt-3.0.0-dp5\examples-src\com\sencha\gxt\explorer\client\layout\AccordionLayoutExample.java
    and add it to the west panel of a BorderLayoutContainer, I see the Accordion but I get the following error:

    Code:
    00:16:20,256 [ERROR] Uncaught exception escaped
    java.lang.NullPointerException: null 	
    at com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.onInsert(BorderLayoutContainer.java:693) 
    at com.sencha.gxt.widget.core.client.container.Container.insert(Container.java:380)
    at com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.setWestWidget(BorderLayoutContainer.java:370)
    ----------------------------------

    When I later add any other ContentPanel to the Accordion with: [..] con.add(cp5);

    Code:
    Caused by: java.lang.AssertionError: Method must be called before the widget is rendered
    at com.sencha.gxt.widget.core.client.Component.assertPreRender(Component.java:1175)
    at com.sencha.gxt.widget.core.client.ContentPanel.setCollapsible(ContentPanel.java:348)
    at com.sencha.gxt.widget.core.client.container.AccordionLayoutContainer.onInsert(AccordionLayoutContainer.java:206)
    at com.sencha.gxt.widget.core.client.container.Container.insert(Container.java:380)
    at com.sencha.gxt.widget.core.client.container.InsertResizeContainer.insert(InsertResizeContainer.java:22)
    at com.sencha.gxt.widget.core.client.container.Container.add(Container.java:86)
    -----------------------------

    Furthermore I couldn't figure out how to get the ChildWidgetIndex of the current expanded child.

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    I think your BorderLayoutContainer problem is related to this one which is already fixed: http://www.sencha.com/forum/showthre...dget(Widget-w)

  3. #3
    Sencha User
    Join Date
    Mar 2008
    Location
    Berlin
    Posts
    25
    Vote Rating
    0
    madmaxmatze is on a distinguished road

      0  

    Default


    Adding layout data to my uibinder definition as in http://www.sencha.com/learn/ext-gwt-...with-uibinder/

    Did not fix the problem. But hopefully the next release will. What's about the other 2 questions?

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Did not fix the problem. But hopefully the next release will.
    In that case can you please provide a fully working testcase implementing EntryPoint that shows your problem?

  5. #5
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Furthermore I couldn't figure out how to get the ChildWidgetIndex of the current expanded child.
    There is a getter to get the currently active widget. That one you can pass to the getWidgetIndex method

  6. #6
    Sencha User
    Join Date
    Mar 2008
    Location
    Berlin
    Posts
    25
    Vote Rating
    0
    madmaxmatze is on a distinguished road

      0  

    Default


    When I create a simple example, the problem is fixed with adding BorderLayoutData as suggested in the other bug report:

    Code:
    BorderLayoutContainer container = new BorderLayoutContainer();
    
    AccordionLayoutContainer con = new AccordionLayoutContainer();
    con.setFill(true);
     
    ContentPanel cp = new ContentPanel();
    cp.setAnimCollapse(false);
    cp.setHeadingText("Online Users");
    con.add(cp);
    con.setWidget(cp);
       
    BorderLayoutData northLayoutData = new BorderLayoutData(100);
    container.setNorthWidget(con, northLayoutData);
        
    RootLayoutPanel.get().clear();
    RootLayoutPanel.get().add(container);

    So it seems that adding BorderLayoutData is not fixing this issue when working with uibinder. My code:
    Code:
    <ui:with type="com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData" field="westLayoutData" />
    
    <gxtContainer:BorderLayoutContainer>
    [..]
    	<gxtContainer:west layoutData="{westLayoutData}">
    	</gxtContainer:west>
    [..]
    </gxtContainer:BorderLayoutContainer>
    and
    Code:
    @UiField(provided = true)
    BorderLayoutData westLayoutData = new BorderLayoutData(100);
    ----------------------

    Regarding the other issue, can you tell me how the getter is called. I see nothing like .getActiveWidget()


    BTW: Thank for the very fast and nice support!

  7. #7
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,966
    Vote Rating
    130
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Regarding the other issue, can you tell me how the getter is called. I see nothing like .getActiveWidget()

    Its called getWidget

  8. #8
    Sencha User
    Join Date
    Mar 2008
    Location
    Berlin
    Posts
    25
    Vote Rating
    0
    madmaxmatze is on a distinguished road

      0  

    Default


    Thanks for the getWidget() hint - works!

    The other issue is now gone as well. I didn't realized that even with uibinder the BorderLayoutData has to be passed with the container.setNorthWidget() call and not just in the XML.

    The last remaining issue, from my initial questions was: java.lang.AssertionError: Method must be called before the widget is rendered
    The error happens when I add new Content Panels to the accordion after the according was already created. This is my code:

    Code:
    ContentPanel cp1 = new ContentPanel(appearance);
    cp1.setAnimCollapse(false);
    cp1.setHeadingText("Test");
    accordionContainer.add(cp1);
    accordionContainer.setWidget(cp1);

  9. #9
    Sencha User
    Join Date
    Mar 2008
    Location
    Berlin
    Posts
    25
    Vote Rating
    0
    madmaxmatze is on a distinguished road

      0  

    Default


    To test the last issue, please use the following code: (Error occures with click on button)

    Code:
    public class Designer implements EntryPoint {
    	public void onModuleLoad() {
    		BorderLayoutContainer container = new BorderLayoutContainer();
    		container.setWidth(500);
    		container.setHeight(500);
    		
    		final AccordionLayoutContainer con = new AccordionLayoutContainer();
    		con.setFill(true);
    		 
    		ContentPanel cp = new ContentPanel();
    		cp.setHeadingText("Test 1");
    		con.add(cp);
    		con.setWidget(cp);
    		
    		Button b = new Button("Press here to add a new item to the accordion");
    		b.addClickHandler(new ClickHandler () {
    			@Override
    			public void onClick(ClickEvent event) {
    				ContentPanel cp1 = new ContentPanel();
    				cp1.setHeadingText("Test " + (con.getWidgetCount() + 1));
    				con.add(cp1);
    				con.setWidget(cp1);
    			}
    		});
    		
    		BorderLayoutData northLayoutData = new BorderLayoutData(100);
    		container.setWestWidget(con, northLayoutData);
    		container.setCenterWidget(b, northLayoutData);
    		
    		RootLayoutPanel.get().clear();
    		RootLayoutPanel.get().add(container);
    	}
    }

  10. #10
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    Pro1712 is on a distinguished road

      0  

    Default


    Same problem in 3.0.1!
    Is there a fix or workaround?

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