You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by mateen <ma...@gmail.com> on 2012/12/20 17:13:33 UTC

Submitting a value from a Form

I have a form that contains a invisible textfield. I set the value of the
textfield, and when i submited the form the value of the textfield should be
submited with it. Here is my code. The ${transactionQuote.XXX} contains the
value of the object. If you scroll down, you can see a form and in that form
i set the value to the textfield using
t:value="${transactionQuote.pickupQuoteID}". Now when i submit the form i
want the value in the textfield to be submitted with it. But the value seems
to be written but not read ? What am i doing wrong ? 



        

            	${message:date-sent}
            	${transactionQuote.dateOfTransaction}
        
        

            	${message:recipient}
            	${transactionQuote.recipientName}
        
        

            	${message:amount}
            	${transactionQuote.transactionAmount}
        
        

            	${message:unique-id}
            	${transactionQuote.transactionId}
        
        

            	${message:sender}
            	${transactionQuote.senderName}
        
        

            	${message:location}
            	${transactionQuote.senderCountry}
        
    


    <t:form t:id="processQuoteForm" t:zone="searchTransactionZone">
      <div style="visibility: hidden; display:inline;">
      <input t:type="textField" t:id="dispenseCashForQuoteID"
t:value="${transactionQuote.pickupQuoteID}"
                t:validate="required,minlength=5" class="txtFld"
style="display:block;" />    
     </div>
        
      <p class="transaction-chk"><input name="confirm" type="checkbox"
value="" /> Confirm recipient's identity by reviewing ID </p>
        <p class="transaction-Fld" style="margin:0 auto; width: 360px;">
        <label>Phone Number </label>
        <input t:type="textField" t:id="dispenseCashForTelephoneNumber"
                t:validate="required,minlength=5" class="txtFld"
style="display:block;" />    
                
        <label>Confirm Code </label>
         <input t:type="textField" t:id="dispenseCashForTransactionID"
class="txtFld" style="display:block;"/>
        </p>
        <input type="submit" value="Dispense Cash" class="search-btn" />
    </t:form>
    



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-value-from-a-Form-tp5718882.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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


Re: Submitting a value from a Form

Posted by nquirynen <na...@pensionarchitects.be>.
The problem here is exactly what the error says: transactionQuote is null at
the moment he's trying to set pickupQuoteID.

The submit event is a new request so non persisted fields are gone... I'm
not sure what you are trying to achieve here, but I think you need to use
the context parameter of the Form component or the pages activation context
to load transactionQuote again before it tries to set one of its properties.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-value-from-a-Form-tp5718882p5718911.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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


Re: Submitting a value from a Form

Posted by mateen <ma...@gmail.com>.
I get this error when submiiting the form

Failure writing parameter 'value' of component
remittance/Teller:dispensecashforquoteid: Property 'transactionQuote'
(within property expression 'transactionQuote.pickupQuoteID', of
com.coinfling.web.pages.remittance.Teller@2dfc48fc) is null.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-value-from-a-Form-tp5718882p5718890.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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


Re: Submitting a value from a Form

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 20 Dec 2012 14:36:15 -0200, Lance Java <la...@googlemail.com>  
wrote:

> Never use ${...} in attributes.

More precisely, never use ${} in attributes that are component parameters.  
For example, a <a t:type="PageLink" class="${pageLinkCssClass}"  
context="transactionQuote.pickupQuoteID">..</a> is perfectly fine, because  
'class' is not a parameter. On the other hand, for 'context', which is a  
parameter, using ${} is 100% of the times wrong or useless.

> Use  t:value="transactionQuote.pickupQuoteID" instead and tapestry will
> create two way property binding which it can then get() and set().

Yep! :)

-- 
Thiago H. de Paula Figueiredo

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


Re: Submitting a value from a Form

Posted by mateen <ma...@gmail.com>.
<t:form t:id="processQuoteForm">
        <input t:type="textField" t:id="dispenseCashForQuoteID"
t:value="transactionQuote.pickupQuoteID" />
        <p class="transaction-chk"><input name="confirm" type="checkbox"
value="" /> Confirm recipient's identity by reviewing ID </p>
        <p class="transaction-Fld" style="margin:0 auto; width: 360px;">
         <label>Confirm Code </label>
         <input t:type="textField" t:id="dispenseCashForTransactionID"
class="txtFld" style="display:block;"/>
        </p>
        <input type="submit" value="Dispense Cash" class="search-btn" />
    </t:form>

I have done this, the value is in the textfield, when i press the submit
form it say, 
Failure writing parameter 'value' of component
remittance/Teller:dispensecashforquoteid: Expression
'transactionQuote.pickupQuoteID.id' for class
com.coinfling.web.pages.remittance.Teller is read-only.

What should i do ? 

Kind Regards



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-value-from-a-Form-tp5718882p5718888.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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


Re: Submitting a value from a Form

Posted by Lance Java <la...@googlemail.com>.
By the way... the tapestry-dev list is for developers of tapestry. Messages
such as this should be posted on the tapestry-users list.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-value-from-a-Form-tp5718882p5718887.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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


Re: Submitting a value from a Form

Posted by Lance Java <la...@googlemail.com>.
Never use ${...} in attributes.

Use  t:value="transactionQuote.pickupQuoteID" instead and tapestry will
create two way property binding which it can then get() and set().



--
View this message in context: http://tapestry.1045711.n5.nabble.com/Submitting-a-value-from-a-Form-tp5718882p5718886.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.

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