1
votes

I'm using the 0.7 version of bootsfaces to create a simple page, which has something like the following:

<h:form id="some_form">
  <ui:repeat id="some_elements" var="property" value="#{someBean.properties}">
    <b:commandButton value="ShowProp" ajax="true" actionListener="#{someBean.showProperty(property)}" update=":some_form:some_elements:graphic"/>
    <!-- This property is true -->
    <ui:fragment rendered="#{someOtherBean.showGraphic}">
      <h:graphicImage url="gen_image?id=#{property.id}" id="graphic"/>
    </ui:fragment>
  </ui:repeat>
</h:form>

Now, the idea is that on clicking the button, a property is updated and the image should be re-generated (in this case a jfreechart graph - but this is besides the point.) I tested this with primefaces commandButton and it works fine (the graph is redrawn..) However with bootsfaces commandButton, nothing happens once the ajax call completes (I can see the call on the server side, but the graph is not reloaded.) I think it's down to how it must reference the image in the repeated block, but now sure what is wrong - has anyone come across this?

(NOTE: reason I don't want to use primefaces is that it does not integrate well with bootstrap)

1
OT (not fully) Does not integrate well in what regard? Responsiveness? Otherwise it would be the controls and then there would gave been no reason at all to use PrimeFaces. And how doe the ajax response look like? And are you running in dev mode?Kukeltje
I'm using some of the more advanced functionality in primefaces (such as push), but the controls themselves don't fit into the bootstrap template I'm using (i.e. the laf), the bootsfaces controls fit into the laf, but clearly, some functionality is lacking...Nim
I really love your Note. I do have the same problems. You may want to use plain JSF with <f:ajax>. It does work.alexander

1 Answers

1
votes

I've opened a bug on the project's bugtracker (https://github.com/TheCoder4eu/BootsFaces-OSP/issues/135).

Actually, why did you expect the update=":some_form:some_elements:graphic" to work in the first place? This expression is an id that doesn't exist. The id is some_form:some_elements:0:graphic. In other words: it contains the row number. PrimeFaces (and Mojarra and MyFaces) recognizes that the command button is part of a UIRepeat group and guesses the correct row number. But that's just a guess. Obviously a reasonable guess, because most of the time you want to update something that's in the vicinity of the command button.

The next version of BootsFaces is going to guess the correct row number, too :).