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

Make <div> a first-class citizen of JSF #47

Closed
stephanrauh opened this issue Jan 10, 2015 · 9 comments
Closed

Make <div> a first-class citizen of JSF #47

stephanrauh opened this issue Jan 10, 2015 · 9 comments
Assignees
Milestone

Comments

@stephanrauh
Copy link
Collaborator

Divs play a crucial role in Bootstrap, but they aren't part of JSF's DOM tree. This mismatch often leads to difficulties. AngularFaces has the same problem, so I invented a way to make divs and spans first-class citizens of JSF. I'd like to donate the code to the BootsFaces project.

First-class divs would be an option that has to be activated in the web.xml, so it's the programmers' choice if they want to use the feature or not.

Demonstration of the problem:

<b:panelGrid colSpans="3,9">
  <h:outputText value="street"/>
  <b:inputText value="#{address.street}" />
  <h:outputText value="zipcode/city"/>
  <div>
     <b:inputText value="#{address.zip}" />
     <b:inputText value="#{address.city}" />
  </div>
</b:panelGrid>     

The idea is to display the two field zipcode and city in a single column, so that they align nicely with the wider fields, such as the street names. Unfortunately, JSF converts both the opening <div> and the closing </div> to text nodes. As a result, the form looks, well, confused.

It's possible to solve the problem in JSF using <h:panelGroup display="block"> instead of <div>. But that's verbose and ugly. Adding insult to injury, hardly anybody knows this trick.

@TheCoder4eu
Copy link
Owner

Did you try to use a <b:row> instead of a <div> ?

@TheCoder4eu
Copy link
Owner

A <b:container> instead of a <div> could be appropriate.

@stephanrauh stephanrauh modified the milestones: v0.7.0, v0.6.5 Feb 8, 2015
@stephanrauh stephanrauh self-assigned this Apr 1, 2015
@ahofmeister
Copy link
Contributor

Why do you think, that should work? As far as I understand, <b:inputText> spans the whole container. A component to 'group' other components such as <b:inputText> would be nice.

@stephanrauh
Copy link
Collaborator Author

Thanks for your upvote! I'll raise the priority of this ticket.

@jbmb
Copy link
Contributor

jbmb commented Jul 27, 2015

if you want the div to become part of the component tree, you could use the xmlns:jsf="http://xmlns.jcp.org/jsf" namespace (pass-through element):
<div jsf:id="someId">...</div>
Is that not sufficient?

@stephanrauh
Copy link
Collaborator Author

That didn't work when I tried (see http://www.beyondjava.net/blog/jsf-2-2-html5-cheat-sheet/). Does it work for you?

@TheCoder4eu TheCoder4eu modified the milestones: v0.9.0, v0.8.0 Nov 1, 2015
stephanrauh added a commit that referenced this issue Apr 23, 2016
migrated the decorators from AngularFaces to BootsFaces
@stephanrauh
Copy link
Collaborator Author

The feature has been implemented, but it has not been documented yet.

@stephanrauh
Copy link
Collaborator Author

While documenting the feature, I noticed it needs some polishing. Currently, it's marked as "experimental".

@stephanrauh
Copy link
Collaborator Author

Probably it's not perfect, but I've polished the feature enough to call in done and implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants