You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Kevin J. Menard, Jr." <ni...@negativetwenty.net> on 2004/12/06 00:25:10 UTC

Form-wrapping Component Question

Hi,

I've been trying to write a component that'll wrap a login form for me, but
have been running into issues.

The component spec looks like:

<component-specification
    class="net.negativetwenty.bookmarker.UserAuthPanel"
    allow-body="no"
    allow-informal-parameters="yes">
    


    <description>A user authentication panel.</description>

    <parameter name="verifypw" type="boolean" direction="in"/>
    <parameter name="username" type="java.lang.String" direction="in"
        required="yes"/>
    <parameter name="password" type="java.lang.String" direction="in"
        required="yes"/>
    <parameter name="listener" type="org.apache.tapestry.IActionListener"
        direction="in" required="yes"/>


    <property-specification name="verifyPassword" type="java.lang.String"/>


</component-specification>


And component template:

<form jwcid="@Form" listener="ognl:listener">
    <span class="label">Username:</span>
    <input type="text" jwcid="@TextField" value="ognl:username"/><br/>
    <span class="label">Password:</span>
    <input type="password" jwcid="@TextField" hidden="true"
                            value="ognl:password"/><br/>
    <input type="submit" jwcid="@Submit"/>
</form>


And I use it like so (simplified to a self-closing):

<form jwcid="@UserAuthPanel" username="ognl:username"
password="ognl:password" listener="ognl:listeners.login"/>

The problem is that I can't get the username and password to update
properly.  I read the Gotchas page on the wiki, and set the parameter
directions to be "in" like it says, but that didn't work.  If I change them
to "auto" however, it does.  Can anyone please provide some insight into
this please?

Thanks,
Kevin



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Form-wrapping Component Question

Posted by Kevin Menard <ni...@negativetwenty.net>.
Hi Erik,

Thanks for the quick response.

On 12/5/04 6:35 PM, "Erik Hatcher" <er...@ehatchersolutions.com> wrote:

> 
> "in" means it goes _in_ but doesn't come back out.

Yeah, that's what I thought, but I figured someone smarter than me had
written the Gotchas page.  I had actually tried using "form" first, but that
didn't work either.  Then again, that was before I read that the component
needs to implement IFormComponent (although, TIA makes no mention of this
*shrug*).
 
> I've always viewed the parameter directions as black magic, myself.
> Howard has said on numerous occasions that this is an area of active
> improvements for 3.1.

Well, yet another reason to look forward to 3.1 :-)
 
> Since "auto" works for you, stick with it :)

Will do.  Although there's something a bit unnerving about guess n' check
work :-P

Thanks,
Kevin



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Form-wrapping Component Question

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Dec 5, 2004, at 6:25 PM, Kevin J. Menard, Jr. wrote:
> The problem is that I can't get the username and password to update
> properly.  I read the Gotchas page on the wiki, and set the parameter
> directions to be "in" like it says, but that didn't work.  If I change 
> them
> to "auto" however, it does.  Can anyone please provide some insight 
> into
> this please?

"in" means it goes _in_ but doesn't come back out.

I've always viewed the parameter directions as black magic, myself.  
Howard has said on numerous occasions that this is an area of active 
improvements for 3.1.

Since "auto" works for you, stick with it :)

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org