PDA

View Full Version : ContenetPannel



mrhari
13 Dec 2010, 2:36 AM
Cntenetpannel's BeforeExpand event is not firing..
please check my code..

[contentPannel.addListener(Events.BeforeExpand,
new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
}
});
][/CODE]
any issue in the code
please help

sven
13 Dec 2010, 3:02 AM
When do you expect it to be called?

mrhari
13 Dec 2010, 3:07 AM
when content panel is going to exapnd. after collapsing it

sven
13 Dec 2010, 3:08 AM
Where, in which sceneria? Standalone or in a BorderLayout?

mrhari
13 Dec 2010, 3:09 AM
in a bordeLayout

sven
13 Dec 2010, 3:11 AM
A BorderLayout is not doing a collapse/expand on a ContentPanel. You need to listen to the Events.BeforeExpand event on the BorderLayout.

mrhari
13 Dec 2010, 3:14 AM
ya i am expecting a before expand event .

[contentPannel.addListener(Events.BeforeExpand,
new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
}
})][/CODE]

Events.BeforeCollapse event is working..

sven
13 Dec 2010, 3:15 AM
ya i am expecting a before expand event .

[contentPannel.addListener(Events.BeforeExpand,
new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
}
})][/CODE]

Events.BeforeCollapse event is working..

Please reread my response. A BorderLayout is not doing a real Collapse/Expand and therefor you cannot listen to the events on the ContentPanel.

mrhari
13 Dec 2010, 3:20 AM
so i must add listener to border layout right?

sven
13 Dec 2010, 3:22 AM
Yes. Also note than that a BorderLayout does not fire a ComponentEvent but a BorderLayoutEvent

mrhari
13 Dec 2010, 3:29 AM
Thank you very much. I will do like you said.

mrhari
13 Dec 2010, 3:32 AM
Thank you very much.

mrhari
13 Dec 2010, 3:49 AM
acually i am using BorderLayoutData for content pannel.please help

sven
13 Dec 2010, 4:01 AM
acually i am using BorderLayoutData for content pannel.please help

What is the problem with this? How is this related to the topic?

mrhari
13 Dec 2010, 4:07 AM
i am adding tabpannel and a border layout in content pannel data and set border layout data as collapsible.so i need that event .

sven
13 Dec 2010, 4:08 AM
i am adding tabpannel and a border layout in content pannel data and set border layout data as collapsible.so i need that event .

I cannot follow you.

mrhari
13 Dec 2010, 4:17 AM
i am adding content pannel and a border layout data in dialouge box. and set border layout data as collapsible.and what i need is the collapsible and expandable events.please look the code

[
ContentPannel pannel =new ContentPannel();
BorderLayoutData data = new BorderLayoutData(LayoutRegion.NORTH,
);
data.setCollapsible(true);
DialougeBox box=new DialougeBox();
box.add(pannel ,data)
][/CODE]

sven
13 Dec 2010, 4:19 AM
Isnt this what we just did already? The BorderLayout fires these events.

Events.Collapse, Events.Expand, Events.BeforeCOllapse and Events.BeforeExpand.

mrhari
13 Dec 2010, 4:22 AM
so did this work pannel .getLayout().addListene(rEvents.BeforeExpand,
new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
}});

sven
13 Dec 2010, 4:23 AM
so did this work pannel .getLayout().addListene(rEvents.BeforeExpand,
new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
}});

"pannel" does not have the BorderLayout. According to your last code "box" has it. Also please reread all my posts in this thread


Yes. Also note than that a BorderLayout does not fire a ComponentEvent but a BorderLayoutEvent

mrhari
13 Dec 2010, 4:26 AM
so is it work pannel.getLayout().addListener(Events.BeforeExpand,
new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
}});

mrhari
13 Dec 2010, 4:34 AM
thank you very much.as you said the layout data is associated with the box.and i am looking it with the panel..now i got it.thank you for your patience.