Class SellerController

    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • conversation

        @Inject
        private Conversation conversation
        Can be used to manage the conversation
      • catalog

        @Inject
        private ProductCatalog catalog
        A reference to back-end business logic that can manage products. This will be injected by CDI with the aid of a @Tx Qualifier
      • user

        @Inject
        private CurrentUser user
        Current user will be injected by CDI into this property using a @Produces by one of our components.
      • products

        private List<Product> products
        This is initially populated using a call to the back-end for persisted items for sale and then updated as products are added for sale during the conversation.
      • product

        private Product product
        This is the product the page is currently working with. No argument actions methods will be called and it is assumed they should be acting on the last item referenced by setProduct().
      • form

        private UIForm form
        Form used when adding a new product. We will hide this form when the user is not actively adding a new product.
                 
             
      • tableForm

        private UIForm tableForm
        Form used when displaying the list of products
                 
      • addCommand

        private UICommand addCommand
        Command button used when user chooses to add a new product. We track this so we can hide it while the user is entering the product data.
                
    • Constructor Detail

      • SellerController

        public SellerController()
    • Method Detail

      • getSeller

        public Member getSeller()
      • setProducts

        public void setProducts​(List<Product> products)
      • getProduct

        public Product getProduct()
        Associated getter/setter is called for inputText.value elements. The initial value of the form field will be the value provided in getProduct.
                
             
      • setProduct

        public void setProduct​(Product product)
      • getAddCommand

        public UICommand getAddCommand()
        The provider will supply a UICommand object for a form within the binding sellerController.addCommand.
            
                
            
            
        The provider will access that property through setAddCommand() and getAddCommand(). This controller gets a chance to modify the UICommand properties but the object itself is provided by the JSF provider.
      • setAddCommand

        public void setAddCommand​(UICommand addCommand)
      • addNew

        public String addNew()
        This action method will instantiate a new "Product" bean, disable the form containing this action, enable the form that will work on the new Product bean. The action method is referred to by name in an action. The Return value is used to navigate to a new page. action="#{sellerController.addNew}" 1) optionally call business logic 2) return a value that will be used to choose the next page
      • getForm

        public UIForm getForm()
      • setForm

        public void setForm​(UIForm form)
      • add

        public String add()
        This action method is used to add the populated "Product" bean to the conversation. Action Method to start working with a new product. The exact name of this method is referenced in the action element and the return value is used to navigate to another page. The exact name of this command is used in commandButton.action 1) optionally call business logic 2) return a value that will be used to choose the next page
      • getTableForm

        public UIForm getTableForm()
      • setTableForm

        public void setTableForm​(UIForm tableForm)
      • delete

        public String delete()