Trying to Bind Text Box

Trying to Bind Text Box

  

I have a webscreen (CheckInResident) where the user will type a number in a textbox (txtSearchResident). The webscreen has a button with a destination of another webscreen (UpdateResident)  that takes an input parameter. The destination of the button on CheckInResident is set to UpdateResident with in input parameter set to the value of the text box. When I click on the button to show a record for whatever value was typed in  the record is blank on the UpdateResident Screen. 

When I debug it, its seems like the variable is out of scope and not being bound to anything. Not sure what I am doing wrong. 

Solution

Outsystems Newbie wrote:

I have a webscreen (CheckInResident) where the user will type a number in a textbox (txtSearchResident). The webscreen has a button with a destination of another webscreen (UpdateResident)  that takes an input parameter. The destination of the button on CheckInResident is set to UpdateResident with in input parameter set to the value of the text box. When I click on the button to show a record for whatever value was typed in  the record is blank on the UpdateResident Screen. 

When I debug it, its seems like the variable is out of scope and not being bound to anything. Not sure what I am doing wrong. 

Hi, Instead of navigating to other screen, try calling an action on button click and then redirect it to desire screen with typed value as a input parameter, Also please make sure to refresh text box using ajax refresh before redirecting.

Sachin 


Solution

Hi Newbie,

A few observations:

  1. The main problem with your code is that links, and so also parameters to links, are rendered once, just after the preperation has run. Your link is just an "<a href="yourEspace/UpdateResident.aspx?resnumb=">" in the HTML that is prepared after the Preperation has run. To update the link to reflect the value of the Input widget, you can perform an Ajax Refresh in a Screen Action, but if you redirect to a Screen in a Screen Action, you can pass parameters and it works (since that's not a link in HTML).
  2. You set the input parameter "resnumb" to txtSearchResident.TypedValue. This isn't needed or encuraged: just use the bound variable ("varResidentId"). "TypedValue" can be used e.g. in case you have numeric input but validation failed because the user has typed letters or whatever, and you need to retrieve the literal text. With text input, the bound Variable and the TypedValue of the Input are always the same.
  3. You have named the variable bound to the Input widget "varResidentId". However, it doesn't make sense for a manually typed text value to be an Id. Reserve "Id" for actual Entity Identifiers.

Sachin Mahawar wrote:

Outsystems Newbie wrote:

I have a webscreen (CheckInResident) where the user will type a number in a textbox (txtSearchResident). The webscreen has a button with a destination of another webscreen (UpdateResident)  that takes an input parameter. The destination of the button on CheckInResident is set to UpdateResident with in input parameter set to the value of the text box. When I click on the button to show a record for whatever value was typed in  the record is blank on the UpdateResident Screen. 

When I debug it, its seems like the variable is out of scope and not being bound to anything. Not sure what I am doing wrong. 

Hi, Instead of navigating to other screen, try calling an action on button click and then redirect it to desire screen with typed value as a input parameter, Also please make sure to refresh text box using ajax refresh before redirecting.

Sachin 



Yes, thanks so much this worked!