Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout options freezes most functions #4

Closed
chrisfperes opened this issue Nov 15, 2018 · 16 comments
Closed

Layout options freezes most functions #4

chrisfperes opened this issue Nov 15, 2018 · 16 comments
Labels
bug Something isn't working

Comments

@chrisfperes
Copy link

When some of the options in lateral layout options menu are toggle, both lateral menus stop working, this only fixes when I clean the browser caches. I tested it on Chrome.

@rmpestano rmpestano added the bug Something isn't working label Nov 15, 2018
@rmpestano
Copy link
Contributor

rmpestano commented Nov 15, 2018

Yes, also ajax call are not triggered anymore, no javascript errors thou.

I need to investigate further as it doesn't happen on other starters (tomcat/javaee/javaee-security).

Thanks for reporting.

rmpestano added a commit that referenced this issue Nov 15, 2018
@rmpestano
Copy link
Contributor

Hi @chrisfperes, can you try the fix below?

84f10c5#diff-6937490b8ef42332c03bbfbc492073a8R60

@rmpestano
Copy link
Contributor

rmpestano commented Nov 15, 2018

Forget it, it only fixes the control sidebar opening issue but the ajax calls and left hamburger menu still not working.

@rmpestano
Copy link
Contributor

rmpestano commented Nov 15, 2018

Alright, now I think I got it working. Had to update OmniFaces (and weld) to v3.0, take a look at this branch: https://github.com/adminfaces/admin-starter-springboot/blob/omnifaces3/pom.xml and compare with your pom.xml to configure omnifaces 3.

If you want to test locally just clone omnifaces3 branch:

git clone -b omnifaces3 https://github.com/adminfaces/admin-starter-springboot

if you already have cloned the starter just do a git checkout -f omnifaces3

I hope it helps.

@chrisfperes
Copy link
Author

It's working fine now, thanks for helping!

@persapiens
Copy link
Contributor

hi @chrisfperes and @rmpestano

Which application server do you use to run omnifaces3 branch successfully? I tried with java -jar target/admin-starter.war but login failed.

I look forward your answer.

@rmpestano
Copy link
Contributor

Hi @persapiens, I'm just using mvn spring-boot:run and it is just working.

If it still doesn't work for you, try attached zip:

admin-starter-springboot-omni3.zip

@rmpestano
Copy link
Contributor

From the logs it is using embedded tomcat:

2018-11-23 16:10:08.909  INFO 14789 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2018-11-23 16:10:08.935  INFO 14789 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2018-11-23 16:10:08.936  INFO 14789 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/8.5.34

@rmpestano
Copy link
Contributor

rmpestano commented Nov 26, 2018

Hi guys,

Thanks to @persapiens PR this issue is almost fixed.

We're still facing the very same issue when a skin is changed via the controlsidebar.

As before it doesn't happen on omnifaces3 branch, JavaEE admin-starter or admin-starter-tomcat.

@persapiens, can you have a look? the skin changing was moved to admin-base, (for details see adminfaces/admin-template#140).

PS: I'm watting to release vRC20 so this fix gets included.

@persapiens
Copy link
Contributor

hi @rmpestano ,
omnifaces3 branch is not perfect. It works ok with skin change but it skips login if you run it with mvn spring-boot:run. More, omnifaces3 branch login does not work if you run it with java -jar target/admin-starter.war.

master branch breaks skin change indeed. I've played a bit with broken implementation

<p:commandLink id="btn-skin-purple" styleClass="skin-link clearfix #{skinMB.skin eq 'skin-purple' ? '':'full-opacity-hover'}"
  oncomplete="replaceSkinWith('skin-purple');updateSkinPurple()"
  process="@none" update="@none" global="false" partialSubmit="true">
  <div>
    <span style="display:block; width: 20%; float: left; height: 7px;" class="bg-purple-active"></span>
    <span class="bg-purple" style="display:block; width: 80%; float: left; height: 7px;"></span>
  </div>
  <div>
    <span style="display:block; width: 20%; float: left; height: 20px; background: #222d32"></span>
    <span style="display:block; width: 80%; float: left; height: 20px; background: #f4f5f7"></span>
  </div>
</p:commandLink>
<p:remoteCommand name="updateSkinPurple" action="#{skinMB.changeSkin('skin-purple')}" process="@this" update="@none" global="false"/>

It is strange that if I remove oncomplete="replaceSkinWith('skin-purple');updateSkinPurple()", controlsidebar breaks!

@rmpestano
Copy link
Contributor

rmpestano commented Nov 27, 2018

Hi @persapiens,

...It works ok with skin change but it skips login...

Yes, it is probably not recognizing AdminSession specialization on LoginMB because the AdminFilter is active but is considering user is always logged in which is the default behaviour. LoginMB is responsible for telling AdminFaces that user is not logged in.

More, omnifaces3 branch login does not work if you run it with java -jar target/admin-starter.war.

For some reason when using java -jar SpringBoot uses omnifaces1 and that's probably why it's not working with java -jar:

2018-11-27 09:45:48.121  INFO 4148 --- [ost-startStop-1] o.omnifaces.VersionLoggerEventListener   : Using OmniFaces version 1.14.1

It is strange that if I remove oncomplete="replaceSkinWith('skin-purple');updateSkinPurple()", controlsidebar breaks!

The controlsidebar is a bit complex component because it uses LocalStorage for persisting user preferences (see here, the get('layout.skin'); loads from browser storage - loadSkin is called on documentReady) but at the same time AdminFaces binds the current skin in skinMB so we can reset defaults by loading skin from admin-config.properties.

@persapiens
Copy link
Contributor

When I run omnifaces branch using java -jar admin-starter.war, I see OmniFaces 3.2

2018-11-27 15:50:17.566  INFO 21653 --- [ost-startStop-1] org.omnifaces.ApplicationInitializer     : Using OmniFaces version 3.2

@rmpestano
Copy link
Contributor

When I run omnifaces branch using java -jar admin-starter.war, I see OmniFaces 3.2

You're right, I was running against an old war file on target. Same thing for me here, the login is not working with java -jar on the other hand using mvn spring-boot:run the login page is skipped and looks like LoginMB is not being used on this case.

rmpestano added a commit to adminfaces/admin-template that referenced this issue Nov 27, 2018
@rmpestano
Copy link
Contributor

Guys, I think I got it working with OmniFaces1, can you try on the master branch of this repo?

rmpestano added a commit to adminfaces/admin-template that referenced this issue Nov 27, 2018
@persapiens
Copy link
Contributor

Guys, I think I got it working with OmniFaces1, can you try on the master branch of this repo?

It works. Great work.

@rmpestano
Copy link
Contributor

RC20 was released, I'll close the issue. Thank you very much guys for your help here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants