0
            <h:dataTable value="#{products.getAllProducts()}"
                         var="product">
                ....

                <h:column rendered="...">
                    <f:facet name="header">Quantity</f:facet>
                    <h:inputText id="basket-qty" value="#{basket.qty}" rendered="#{product.stock.qty > 0}" >
                        <f:convertNumber integerOnly="true" />
                        <f:validateLongRange minimum="1" maximum="#{product.stock.qty}" />
                    </h:inputText>
                    <h:message id="textmessage" for="basket-qty" />
                </h:column>

                <h:column rendered="...">
                    <h:commandButton action="#{basket.addProduct(product)}"
                                     value ="Add to Basket">
                    </h:commandButton>
                </h:column>

            </h:dataTable>

Basically the problem is that maximum="#{product.stock.qty}" is evaluating to zero, therefore my range is 0-0?

product.stock.qty evaluates correctly elsewhere in the table.

ovg
  • 1,486
  • 1
  • 18
  • 30
  • See [Using validator with a variable attribute in ui:repeat](http://stackoverflow.com/questions/15682196/using-validator-with-a-variable-attribute-in-uirepeat) – Jasper de Vries Apr 22 '17 at 18:03
  • @JasperdeVries nice, but is there any way without omni faces? I'm not allowed to use 3rd party stuff (at least I understand where the problem is now though) – ovg Apr 22 '17 at 18:49
  • Well, OmniFaces is open source... – Jasper de Vries Apr 23 '17 at 21:09
  • I would love to but it's a college project with no external frameworks or libraries allowed .. – ovg Apr 23 '17 at 21:11

0 Answers0