At first glance, the problem appears to be that you are declaring a <property> element for userRoles in your page spec (which is telling Tapestry to implement a getter and setter) while implementing the getter yourself.

I think you have to go one way or the other: either declare the userRoles property in your page spec or implement getUserRoles and setUserRoles yourself. If I'm correct, there is no setUserRoles being created at runtime even though you have a userRoles property in the page spec.

I didn't look over your renderers in detail so it's possible the problem is there. You should use the default renderers for testing.

-Ryan

Matt Raible wrote:
I've pasted my UserForm.java class below, as well as userForm.page and
the code for the "hiddenUserRoles" component.  There is no Exception,
the hidden fields I'm trying to render simply don't show up.

UserForm.java
----------------------

    public List getUserRoles() {
        List selectedRoles = new ArrayList(getUser().getRoles().size());

        for (Iterator it = getUser().getRoles().iterator();
                 (it != null) && it.hasNext();) {
            Role role = (Role) it.next();
            selectedRoles.add(role.getName());
        }
        return selectedRoles;
    }
}

userForm.page:
--------------------------------
<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
    "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>

<page-specification class="org.appfuse.webapp.action.UserForm">
        
    <property name="userRoles"/>
<component id="userRoles" type="contrib:MultiplePropertySelection">
       <binding name="model" value="availableRoles"/>
       <binding name="selectedList" value="userRoles"/>
       <binding name="renderer" value="beans.multipleCheckboxRenderer"/>
    </component>

    <component id="hiddenUserRoles" type="contrib:MultiplePropertySelection">
       <binding name="model" value="availableRoles"/>
       <binding name="selectedList" value="userRoles"/>
       <binding name="renderer" value="beans.hiddenCheckboxRenderer"/>
    </component>
</page-specification>



Thanks,

Matt
On 3/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Indeed odd.
Can you post some code + the exception you're getting?

From  Matt Raible <[EMAIL PROTECTED]>:

On 3/5/06, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
That sounds odd. What happens if you try making it "ognl:getUserRoles()"
instead?
I tried this based on your recommendation.  Unfortunately, it does not work.

Matt

On 3/5/06, Matt Raible < [EMAIL PROTECTED]> wrote:
Yes, I am using the 4.0 DTD with the following:

    <component id="userRoles"
type="contrib:MultiplePropertySelection">
       <binding name="model" value="availableRoles"/>
       <binding name="selectedList" value="userRoles"/>
       <binding name="renderer" value="beans.multipleCheckboxRenderer"/>
    </component>

Matt

On 3/5/06, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
Aren't you using the 4.0 dtd?
It should be
<binding name="selectedList" value="userRoles"/>


From Matt Raible < [EMAIL PROTECTED]>:

In Tapestry 3, I had methods in my pages like the following:

    public List getUserRoles() {
        List selectedRoles = new
ArrayList(getUser().getRoles().size());
        for (Iterator it =
getUser().getRoles().iterator();
                 (it != null) && it.hasNext();) {
            Role role = (Role) it.next();
            selectedRoles.add(role.getName());
        }

        return selectedRoles;
    }

I then called them in my .page specification using:

    <component id="userRoles"
type="contrib:MultiplePropertySelection">
       <binding name="model" expression="availableRoles"/>
       <binding name="selectedList" expression="userRoles"/>
       <binding name="renderer"
expression="beans.multipleCheckboxRenderer"/>
    </component>

Hower, it doesn't seem that this is possible with Tapestry 4 - even
if
I use expression="ognl:userRoles".  I have to add an abstract
getUserRoles() method and put the above logic in my
pageBeginRender()
method.

Is this "as designed" or am I doing something wrong?

Thanks,

Matt


---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]

--



---------------------------------------------------------------------
To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to