Page 1 of 1

Custom field admin

Posted: Mon Oct 06, 2014 11:32 am
by tiagovt
I create my custom Order entity extending OrderImpl and add my attribute using annotation @AdminPresentation but the field dont display in Order admin

Code: Select all

@Entity
@Table(name="blc_order")
@Inheritance(strategy = InheritanceType.JOINED)
public class OrderCustomImpl extends OrderImpl {

   /**
    *
    */
   private static final long serialVersionUID = 1L;
   
      @AdminPresentation group = Presentation.Group.Name.General, hint="Id da transação de pagamento",                friendlyName="Id Transação",readOnly=false, groupOrder = Presentation.Group.Order.General, fieldType=SupportedFieldType.STRING, tab="General",order=11
       )
   private String transactionId;

   public String getTransactionId() {
      return transactionId;
   }

   public void setTransactionId(String transactionId) {
      this.transactionId = transactionId;
   }

Re: Custom field admin

Posted: Mon Oct 06, 2014 3:11 pm
by phillipuniverse
1. Change the table to something other than BLC_ORDER (like CUSTOM_ORDER)
2. Ensure that this file is referenced in a <class></class> element in persistence-core.xml
3. Ensure that you did a full build of the 'core' and 'admin' Maven modules

Re: Custom field admin

Posted: Mon Oct 06, 2014 5:55 pm
by tiagovt
thans phillipuniverse

One question :

I cant put new field in same table "blc_order"

Re: Custom field admin

Posted: Tue Oct 07, 2014 8:22 am
by phillipuniverse
By default, Broadleaf uses multi-table inheritance. I think that your configuration that you have there with the same table name will blow up. You might instead want to use single-table inheritance. Check out http://www.broadleafcommerce.com/docs/c ... s-tutorial which details how to set that up (in the 'Single table inheritance section).