I think what you want is a @TextField component inside a @Form with a submit button. So your .html file would look something like this:

<form jwcid="[EMAIL PROTECTED]" listener="listener:checkUniqueUser">
 <input type="text" jwcid="@TextField" value="ognl:username" size="30"/>
 <br/>
 <input type="submit" value="Login"/>
</form>

your .java page would look something like:

public abstract String getUserName();

public void checkUniqueUser(IRequestCycle cycle,String username) {
                String name = getUserName();
                System.out.println("Username="+username);
           return;
         }
         return;
   }

The problem with your code is that the time at which the @DirectLink parameters are obtained, which is when the server renders the page to display it. At this point the parmeter username is null.

For further info see the @TextField component documentation.

Hope this helps,

Paul


Ananya Goswami <[EMAIL PROTECTED]> wrote:

Hi All!
        Kindly help me if anybody can..
        I have a .html file where I have a username text field. I have a
link near that to check the uniqueness of the username.
        I have done something like this but am facing a problem in passing
the parameter "username" in the DirectLink.

        .html

<td><input type="text" jwcid="username" size="30"/></td>
<td><a href="#" jwcid="@DirectLink" listener="listener:checkUniqueUser"
parameters="ognl:username"><font color="white" size="4" ><u>Check uniqueness
</u></font></a></td>

         In .java I have a listener method ChequeUniqueUser. I am trying to
print the username to see if I am getting it or not... but am not getting
it!!

public void checkUniqueUser(IRequestCycle cycle,String username) {
                String name = username;
                System.out.println("Username="+username);
           return;
         }
         return;
   }









Thanks & Regards
-----------------------------
Ananya Goswami
Software Developer

-----------------------------
mail: [EMAIL PROTECTED]
mob: 09886886320
ph: 080-57561000
extn:3720



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

Reply via email to