CodeMirror enhancement
- planetsizebrain
- Posts: 7
- Joined: 08 Mar 2012, 17:21
I really like the CodeMirror component, but I'm missing one piece of functionality. I'd like to have a dynamic code suggestion system that uses a backing bean method to request a list of suggestions based on the current editor position. That way I could use the new Java Compiler API to provide Java code completion. I had a quick look at the component code, but can not see a way how I can link the Javascript event for code completion, CTRL+Space, to a backing bean method. Any ideas?
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
Currently is not possible.
You could create an feature request but i don't know if i have much free time in near future.
It would be cool if you could try it yourself and provide an patch.
You could create an feature request but i don't know if i have much free time in near future.
It would be cool if you could try it yourself and provide an patch.
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
- planetsizebrain
- Posts: 7
- Joined: 08 Mar 2012, 17:21
I'm going to try to hack it together in the following days and have found a few articles/post that could help me, but as I haven't created custom AJAX JSF2.0 components yet and AJAX/Javascript isn't my strong suit, I don't know how far I'll get.Any pointers to information about how to connect a Javascript call to a backing bean call and have the result of the backing bean method passed back to the client are always welcome.
I'll keep you posted.
I'll keep you posted.
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
Check out PrimeFaces Autocomplete. It should send the data via JSON the client - this could be reused for the CodeMirror.
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
See PrimeFaces Ajax APIs in user's guide.
Adding sth like this to code mirror is not trivial btw, you need to send the data to codemirror component, then codemirror realizes it is a suggest request, calls sth like suggestListener, returns some markup, then you need to parse the response, get that markup, position an overlay and display it.
That's why we love PrimeFaces components, handles all this hard work for you
Adding sth like this to code mirror is not trivial btw, you need to send the data to codemirror component, then codemirror realizes it is a suggest request, calls sth like suggestListener, returns some markup, then you need to parse the response, get that markup, position an overlay and display it.
That's why we love PrimeFaces components, handles all this hard work for you
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
Yep, you're right Cagatay
I will add this in the future, but it would be cool if someone could do a part of this work
I will add this in the future, but it would be cool if someone could do a part of this work
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
I'm currently working on it. It will be shipped with 0.4 if no further problems will occur.
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
done!
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
I also implemented something similar for p:inputTextarea;
http://www.primefaces.org/showcase-labs ... xtarea.jsf
It completes while you type after 4 characters.
http://www.primefaces.org/showcase-labs ... xtarea.jsf
It completes while you type after 4 characters.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests