Page 1 of 1

Issue with exposing data element in Admin UI

Posted: Thu Feb 07, 2013 7:07 pm
by sai
I am a bit puzzled on how can I go about doing this...

I want to expose a data element in Admin UI. I see @AdminPresentationOverride that I can use to have the data show on my Admin UI. The problem is for example in below code on the class OfferCodeImpl in Broadleaf jar has hte override to not exclude the field that I want to see in UI so that I can set the max number of users who can use the promo/offer code.

I want to limit the number of users who can use a specific promo/offer code.

Code: Select all

@AdminPresentationOverrides(
    {
        @AdminPresentationOverride(name="offer.appliesToOrderRules", value=@AdminPresentation(excluded = true)),
        @AdminPresentationOverride(name="offer.appliesToFulfillmentGroupRules", value=@AdminPresentation(excluded = true)),
        @AdminPresentationOverride(name="offer.appliesToCustomerRules", value=@AdminPresentation(excluded = true)),
    [u]  [b]  @AdminPresentationOverride(name="offer.maxUses", value=@AdminPresentation(excluded = true)),[/b][/u]
        @AdminPresentationOverride(name="offer.uses", value=@AdminPresentation(excluded = true)),
        @AdminPresentationOverride(name="offer.targetItemCriteria", value=@AdminPresentation(excluded = true))
    }
)
@AdminPresentationClass(populateToOneFields = PopulateToOneFieldsEnum.TRUE, friendlyName = "baseOfferCode")
public class OfferCodeImpl implements OfferCode {

Code: Select all

    @Column(name = "MAX_USES")
    @AdminPresentation(friendlyName="Code Max Uses", order=2, group="Description", prominent=true)
    protected int maxUses;


Please advise on how can i achieve showing the max uses in Admin UI.

Re: Issue with exposing data element in Admin UI

Posted: Fri Feb 08, 2013 10:32 am
by phillipuniverse
These fields that are excluded are displayed by a different avenue which is why they are excluded via the annotations (if you're really curious, OfferCustomPersistenceHandler.fetch() is where this occurs). However, you should still see these in the admin. I just pulled it up and both "Max Uses Per Customer" and "Max Uses Per Order" are there. You might have to click on a specific promotion for those fields to show up, it doesn't look like they show until you do that.

Re: Issue with exposing data element in Admin UI

Posted: Fri Feb 08, 2013 12:47 pm
by sai
Thank you for the quick response.

I tried different combinations...can you please give the exact selections you made that made these options show.

Re: Issue with exposing data element in Admin UI

Posted: Fri Feb 08, 2013 2:25 pm
by phillipuniverse
What do you mean by "tried different combinations"? In the admin if you select an offer via the Offer section these fields should be shown or if you create a new offer it should also show up. What does your admin panel look like when adding/editing an offer?

In older builds this might actually show up after hitting the "Advanced" button on the top right. See if they are displayed then.

Re: Issue with exposing data element in Admin UI

Posted: Fri Feb 08, 2013 4:18 pm
by sai
Thank you very much. I did not notice the Advanced button before. Now I see it and I see the data exposed.