TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
246 stars 102 forks source link

Feature <b:dataGrid> #1040

Closed Yvtq8K3n closed 5 years ago

Yvtq8K3n commented 5 years ago

Would be amazing to be able to have a "decent" dataGrid capable of mixing components like .

stephanrauh commented 5 years ago

I'm afraid you see me at a loss. What is a dataGrid? Wikipedia has the term, but they describe a geography service. Obviously, that's not what you're referring to. :)

Yvtq8K3n commented 5 years ago

https://www.primefaces.org/showcase/ui/data/dataGrid.xhtml also:3 a would be quite amazing:3, Whenever i try to "integrate" bootfaces with primefaces, for some reason my tables stop displaying the "export options, csv..."

sometowngeek commented 5 years ago

@Yvtq8K3n What are you using <b:repeat> for?

I believe <b:datatable ...> automatically includes repeat if you give them a collection of objects.

FooBean.java

private List<Bar> bars = new ArrayList<Bars>();

// stuff
// ...

public List<Bars> getBars(){
    return this.bars;
}

public void setBars(List<Bar> bars){
    this.bars = bars;
}

index.xhtml

<b:dataTable var="foo" values="#{fooBean.bars}">
    <b:dataTableColumn value="#{foo.id}" label="ID" />
    <b:dataTableColumn value="#{foo.Name}" label="Some Name" />
</b:datatable>
Yvtq8K3n commented 5 years ago

Im using repeat to do something like this: image

I also had to make a custom filter;; and rip the paginate;;

stephanrauh commented 5 years ago

@Yvtq8K3n As for the rendering problem: Mojarra 2.3 introduced something I'd call a bug but they'd probably call a feature. Be that as it may, updating to BootsFaces 1.4.0 (released today!) might help.

stephanrauh commented 5 years ago

@Yvtq8K3n Regarding <b:repeat>: I thought about that myself, but before I start implement such a thing, I'd like to learn which extra value we can add to <ui:repeat>. Any suggestions? Ideas from the PrimeFaces world are welcome, but in this particular case, I'd like to provide some added value over<p:repeat>.

stephanrauh commented 5 years ago

@Yvtq8K3n Regarding your original request: Now I've understood what a BootsFaces data grid might be. Let us ponder about it. Of course, you could speed up the process by providing a pull request. It's hard to reject a suggestion that's backed up by a working implementation. :)

Yvtq8K3n commented 5 years ago

About , i think adding a paginator and a search including all the exporting options: csv... Would be something looking forward, plus it isn't done in neither primefaces nor butterfaces;3 About the pull request, i will give it a try, never created a jsf components before.

stephanrauh commented 5 years ago

@Yvtq8K3n If you want to implement a paginator, let's call it b:paginator or b:pagination.

I suspect that's similar, but not identical to the idea of ui:repeat. Mind you, it adds a new visual widget, while the original ui:repeat is an invisible component.

That said, and assuming you might like my suggestion, let me point your attention to https://github.com/michaelbromley/ngx-pagination#readme. I believe that's a great paginator component, especially for the simple use-cases. The advanced use-cases require some esoteric (for want of a better word) source code.

How about porting the API of <ngx-pagination> to the BootsFaces world? Plus adding your ideas to it?

tandraschko commented 5 years ago

just my 2 cents: p:repeat is just a fork of the mojarra ui:repeat, which fixes a bug with nesting iterators. IMO it was a bad decission to fork it but it was done for customers, which needed a fix.

the problem is that Mojarra UIRepeat is looking for nested iteration tags to correctly resolve stuff... but there is no marker available in the API, to mark our iteration components. Therefore we had to add checks for our components there. MyFaces UIRepeat works fine without those "is nested in another iteration tag" logic.

jepsar commented 5 years ago

A ui:repeat fork (especially to fix bugs) feel more like something you would expect in https://github.com/omnifaces/omnifaces

tandraschko commented 5 years ago

nope, it should be fixed/aligned/better implemented in the JSF impls... Everything else is always reinventing the wheel.

jepsar commented 5 years ago

yeah well.. until it has been fixed of course ;-)

stephanrauh commented 5 years ago

Let's close the ticket. After running out of team members it's unlikely we'll implement a data grid any time soon.