You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 35 Members of 4183 |
| Forum: Seam Users |
23. Apr 2008, 00:57 CET | Link |
Hi everyone
I love SEAM but im coming back to it from a long break and im hitting memory blocks and lapse of monkey-ism.
im trying to use the Factory anotation to populate my context variable but all i get is
@Out attribute requires non-null value: candidateHome.genderList
if i use the alternate approach ie annotating a method that has a return value everything works fine.
As allways all help is greatly appreciated
Many thanks Harps
@Name("candidateHome")
public class CandidateHome extends EntityHome<Candidate>
{
@RequestParameter
Long candidateId;
@Out(scope = ScopeType.SESSION)
public ArrayList genderList;
@Factory(value="genderList", scope=ScopeType.SESSION)
public void retrieveGendersList() {
ArrayList genderList = new ArrayList<String>();
genderList.add(new SelectItem("MALE"));
genderList.add(new SelectItem("FEMALE"));
}
@Override
public Object getId()
{
if (candidateId==null)
{
return super.getId();
}
else
{
return candidateId;
}
}
@Override @Begin
public void create() {
super.create();
}
}
Hi,
In the examples I've seen on the docs, @Factory on a void method is only used when annotating the member variable as a @DataModel, never with @Out.
For what you are doing, all of the examples use the pattern where the method returns the value. You've already said that approach works - so why not just use it?
Daniel.
i wanna be a contextual component
Datamodel is just an @Out wrapped for clickable rows.
dude .... does Outjection work on Pojo's?
lol... is this a homer moment
You're assigning to a local variable, not the instance variable:
Arrgggggg flipping hell!!!
Hey Shane! cheers man.... a real homer momment!
Sorry dude... hey Daniel cheer for your pointer as well.
I spent 2.5 hrs trying to work out what i was doing wrong...
Click HELP for text formatting instructions. Then edit this text and check the preview.
Sorted!
i forgot to add required is false to my Outjected component
Does Datamodel do this by default?