ErrorFree
ErrorFree

Reputation: 83

How to append string from oracle adf text field to button (link) and open in new tab?

I want to append string from an input text field to a button that opens an html link before opening the concatenated link in a new tab. For example, if my button opens the link "www.facebook.com/" (when input text field is empty), then when I enter "facebook" in the input text field and click the button link, it should open "www.facebook.com/facebook".

Upvotes: 1

Views: 619

Answers (2)

Florin Marcus
Florin Marcus

Reputation: 1657

You can try something like this:

<af:button textAndAccessKey="D&amp;estination Button"
           destination="http://www.oracle.com/#{'facebook'}"
           id="b4"/>

Upvotes: 1

Joe
Joe

Reputation: 3347

i think you need to capture the text of the text field in a backing bean: bean has getAStringValue() and setAStringValue() methods that access a private String field. then get the textfield value: #{bean.aStringValue}

The bean would do the concatenation and need to set the destination property for the button and refresh it. You will need to bind the button to the backing bean (go to Advanced Bindings property and assign it to the bean) so you can set its Destination property. You will want to have the input field set to AutoSubmit so that the form is processed but not redrawn. And have the inputtext field refresh the button via the button's partialTrigger property.

Upvotes: 1

Related Questions