Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
7 replies
Subscribers
10 subscribers
Views
7077 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
I have a read only text field with value pre-populated. How can I get the displa
shaoyongw
over 9 years ago
I have a read only text field with value pre-populated. How can I get the display value? The saveInto expression is never executed.
a!textField(
label: "label",
value:"testValue",
readonly: true(),
saveInto: ri!tv
)
OriginalPostID-165545
OriginalPostID-165545
Discussion posts and replies are publicly visible
0
nageswararaoa
over 9 years ago
You should interact with the component to execute saveInto expression
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nageswararaoa
over 9 years ago
You can save the value by using a!save() at another sail component and that should be have user interaction
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chetany
A Score Level 1
over 9 years ago
As correctly said by @nageswararaoa, the value will not be saved if the user does not interact with the SAIL component. There is another solution. Specify the default value in local variable in load. Then save that variable in rule input in the buttonLayout. So that when the user submits the form by clicking on "Submit" button, the value will get saved into the rule input automatically. In this case, the user need not interact with the text field. Your code will be like this:
load(
local!tv: "testValue",
a!formLayout(
firstColumnContents: {
a!textField(
label: "label",
value: local!tv,
readOnly: true(),
saveInto: local!tv
)
},
buttons: {
a!buttonLayout(
primaryButtons: a!buttonWidgetSubmit(
label: "Submit",
saveInto: a!save(ri!tv, local!tv)
)
)
}
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
Why not just set the value in a local and use that? It seems like a fixed value; if you want to just display a value, place it either in an ri or a local and then set it as the display value in the field. There's no need to use the saveInto on a read only text field.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 9 years ago
There is a sail recipe in the documentation. There the default value for fields is set in the data input on the user input task.
forum.appian.com/.../SAIL_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 9 years ago
Maybe we need more detail here, but the only thing I can assume is that OP is attempting to push an arbitrary on-form literal value ("testValue") up into a Rule Input - I suppose to be passed back into process? Not sure.
If this is the case then I think @chetany nailed it, with the suggestion to store the literal value in a local variable, display the local variable in the read-only text field, then push it to the Rule Input on button click. I'd note here that it may be a better practice to declare the literal value in the ACP definition on the user input task; but there may be special use cases that don't allow this for whatever reason.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Srinivasan Radhakrishnan
Certified Associate Developer
over 9 years ago
A user can only update a variable by interacting with a component that has the variable in the component's saveInto parameter.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel