cancel
Showing results for 
Search instead for 
Did you mean: 

subclass of NewUserWizard

soeursourire
Champ in-the-making
Champ in-the-making
Hi!

I have some trouble with my subclass MyNewUserWizard that extends NewUserWizard. I wanted to use this class in my jsp pages so I replaced
#{NewUserWizard.firstName}
by
#{MyNewUserWizard.firstName}
in person-properties.jsp for example.
But then when I click on the button finish() I have some error saying that Person has null values. What should I do to avoid that while using my subclass instead of the super class?

Thanks in advance for help.
7 REPLIES 7

gavinc
Champ in-the-making
Champ in-the-making
Have you ensured you have caught all the places where NewUserWizard is used. You'll need to make sure the following places are changed:

- You have a managed bean defined for MyNewUserWizard in the faces config files (copy and paste the NewUserWizard entry and change the bean name)

- The action link on the page the wizard starts from has been changed i.e. on users.jsp….

action="createUser" actionListener="#{MyNewUserWizard.startWizard}"

and

action="editUser" actionListener="#{MyNewUserWizard.startWizardForEdit}"

- All the pages used by the wizard have changed NewUserWizard to MyNewUserWizard

When you say the Person object has null values, do you mean the person is null or that you have the person but it has no properties? Are you editing or creating with the wizard?

soeursourire
Champ in-the-making
Champ in-the-making
Thanks a lot for your help. Actually I think that my person had no properties. The problem has been resolved by adding some getters setters on services in NewUserWizard. I was using other variable PersonService, PermissionService etc.. and that is why it was not working.

I am now looking for adding properties of type int so in my CustomModel I added this property e.g.
<property name="customSmiley TongueostalCode">
    <type>d:int</type>
</property>
But then I do not know how to get it in the function populate() with the map as this map is using String and not int:
Map<String, Object> props = getPerson().getProperties();

I also look if it is possible to add a property of type "ListItem" but it seems that not. And how to add calendar properly.

Thanks again!

soeursourire
Champ in-the-making
Champ in-the-making
The function getProperties return a Map<String, Object> so does that mean that there is no way to return a Map<int,Object>? How do you manage the properties of type that are int then?

gavinc
Champ in-the-making
Champ in-the-making
The String is the property name i.e. "customSmiley TongueostalCode" and the Object is the value of the object.

So in the case of an int the Map would contain an instance of Integer for that property.

One thing to be aware of, i found a bug yesterday to do with saving number properties (http://www.alfresco.org/jira/browse/AWC-524), it is now fixed in the latest code.

soeursourire
Champ in-the-making
Champ in-the-making
oki thanks. Is it the same problem with other types date, boolean…?

gavinc
Champ in-the-making
Champ in-the-making
No, it was only numbers that were effected.

soeursourire
Champ in-the-making
Champ in-the-making
Another small question again… Smiley Happy
What is exactly the goal of the function populate()?
Because I realized that I added an attribute d:boolean "ready" that I called in finish() but not in populate() and while entering a value in my person-properties.jsp page I can get it back in my users.jsp page and it appears in the NodeBrowser of Administration Console so why using populate() then?

Thanks
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.