Results 1 to 2 of 2

Thread: passing variables: please respond

  1. #1

    Default passing variables: please respond

    hello,
    I'm hoping to get a least one response this time. oauthlink and textfield. when the user click the oauthlink, i want the value of texfield to be added to the parameters of the oauthlink. I am currently using a set variable but it doesnt seem to work. here is a partial of my gsp view:

    HTML Code:
    <g:set var="myVar" value="${myField}"/>
    <g:oauthLink consumer='linkedin' returnTo="[controller:'profile', id:myVar ]" >            
    <img src="${createLinkTo(dir:'images', file:'log-in-linkedin-small.png')}" 
    style="border: 0; float: right"/>
    </g:oauthLink>
    
     Email:  <g:textField  name="myField" value="" /> 
    when this gets sent to the controller, the value is null. for testing purposes, I have replaced the value of the set variable with a string and it works fine. I just can get the value of the text box. please, let me know if you have any suggestions. remember, if everyone assumes that someone else will respond, no one will

    thanks
    jason

  2. #2
    Join Date
    Jun 2010
    Location
    London
    Posts
    304

    Default

    The value of 'myField' must come from the controller action in your example. Remember, GSP and tags are evaluated on the server, so user input must be provided by a previous request. If you want to modify that URL in the browser, you will have to use Javascript. Also remember that the data in a text field will only be passed to the server if you submit a surrounding form (unless you use Javascript).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •