zwwcn

Just another WordPress.com site

Datamodel and Factory method

We need to add @Out annotation to make it work


@Out(required=false)
private List<NationalAccount> masterNationalAccountList;

@Factory("masterNationalAccountList")
public void findMasterNationalAccounts(){
masterNationalAccountList =  em.createNamedQuery("NationalAccount.findAllNationalAccountByMaster")
.setParameter("master", AdvisorUtil.getMaster(getCurrentUser().getAdvisor()))
.getResultList();
}

<li>
<h:outputLabel for="goto"  value="National Account:" />
<h:selectOneMenu id="nationalAccount"  styleClass="input smaller"  value="#{prospectController.nationalAccount}" >
<s:selectItems value="#{masterNationalAccountList}"
var="_nationalAccount"
label="#{_nationalAccount.nationalAccountName}"/>
</h:selectOneMenu>
</li>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: