-
Notifications
You must be signed in to change notification settings - Fork 190
Accordion: (data-)parent not working for accordion-groups #459
Comments
Hi Rob, sorry for being late. You forgot to set parent's id as 'a1'. Keep in mind to always consult twitter bootstrap docs too. Em terça-feira, 19 de novembro de 2013, ro0b escreveu:
D. Reinert |
Thanks for your answer, but the id is generated by gwt.
Edit: |
Hi ! |
Hi Julien, |
I'll get this issue and try to figure out the problem. As soon I get some answer, I'll share it here. D. Reinert On Wed, Dec 4, 2013 at 2:19 PM, ro0b [email protected] wrote:
|
Thanks |
It would be helpful! D. Reinert On Wed, Dec 4, 2013 at 2:35 PM, Julien Orain [email protected]:
|
I already found the problem. Now I'm figuring the solution. |
Really ?! What is it ? |
It is related to the Collapse Markup. |
Fixed! |
The commit 850 aims to fix this issue. Please give some feedback when possible. |
Thanks ! |
Ok, I build the jar and try my previous code ! It seems to work very well. However, the following test case seems to break the accordion.
Case 1 :
Case 2 :
|
Any news on this point ?! |
Not yet Julien. As soon as I get some time, I'll check it. If you feel like, you can try something too. We haply accept contributions. |
As a quick fix for your logic, you could check if AccordionGroup is visible before hiding. |
@JulienNexonia I just tried this reported use case and it happens that the Accordion works as expected. Could you state your context wider? |
Hi @reinert ! Here is the source code I used :
When I do not click on the collapse button, the behavior is what I expect :
However, after refreshing the page, when I click on the collapse button first, I will be unable to open both accordions. Is it clearer ? By the way, I also tested for the visibility of accordion, but it does not change anything. Thanks in advance ! |
Are you refreshing clicking on the browser's refresh button or on another way? |
Is your base class (JORDialog) a popup? |
Actually the panel is opened in a popup. So I don't really need to refresh the page via the browser. I just have to close the popup and re-open it. (accordion are recreated this way). |
Oh! I see! When dynamically creating Accordions, you need to call configure manually. And that's not a GWT-Bootstrap issue, that's normal when using Bootstrap with Ajax. See "Via Javascript" subsection of Collapse. So I suggest you call Collapse.configure(accordionGroupId, accordionId, false) for each AccordionGroup after opening the popup. In fact, it would be better if some reconfigure() methods exist in Accordion. I can create one. But before, tell me if this solution worked for you. |
Oh Thanks ! I tried it briefly with no success with the following code :
Maybe I am missing something... |
Two points:
|
I've tried many ways but I couldn't reproduce this misbehavior. It's working perfectly even inside modal. I'll even include an example in the showcase of it. I guess you're always creating a new instance of this JORDialog when requesting it to show, right? If so, the configure logic must be inside the show trigger event handling. // When user clicks the button to show dialog, or some other event causes it...
dialog.show();
Scheduler.get().scheduleDeferred(new Command() {
@Override
public void execute() {
dialog.configureAccordion();
}
}); You should create the configureAccordion method for your dialog with the logic of reconfiguring the accordionGroups: Collapse.configure(acc1.getId(), accordion.getId(), false);
Collapse.configure(acc2.getId(), accordion.getId(), false); |
Hi @reinert ! I tried to move the accordion directly in the entry point to avoid modal confusions without any success. Base :
JORPanel :
This example works well until I click on the collapse button and try to play again with the accordion. At least one of the group won't show up anymore. What version of GWT-Bootstrap are you using ? (For your information, I get the latest Snapshot here : http://oss.sonatype.org/content/repositories/snapshots/com/github/gwtbootstrap/gwt-bootstrap/2.3.2.0-SNAPSHOT/gwt-bootstrap-2.3.2.0-20140111.211743-56.jar) By the way, I was unable to see your changes on the showcase (I checked : http://gwtbootstrap.github.io/#component:modal) I know I can fix this by recreating the accordion each time I show/hide a group as a workaround, but it is not very efficient... Thanks again for your time ! Julien |
Hi,
I'd like to use an accordion that allows just one opened accordiongroup at a time.
From the docs I see that this should be done with the parent-property.
If I set this to the id of the enclosing accordion the generated markup seems to be ok ( (even with an prepended '#') but no exclusive-toggling effect.
I tested with a slightly modified xml taken form the Accordion.class javadoc:
Someone got this working? Did I miss sth?
Thanks in advance
Rob
The text was updated successfully, but these errors were encountered: