Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

refresh a value of a field in form based on other fields in the form - ADF

User_1KZ3NAug 9 2018 — edited Aug 17 2018

Hi Guys,

i want to refresh the value of the field based on the other fields in the form.

I have performed the following steps but didn't helped. kindly suggest.

1. updated the attribute in the VO with Expression

if (CustNum != null)

{

return 'Y';

}

else

{

return 'N';

}

}

2. set autosubmit for CustNum filed & partial trigger for other field.

i didn't see value is getting refreshed.

********************Edited******************************

use case:

I have a form, which will insert a data into the table on click of the submit button.

Table have some customer related records.

For Example:

Table fields/ form inputs

cust_id (user editable field)

Cust_Name (user editable field)

Cust_department (user editable field)

Is_Cust_Active (not user editable field)

if user enter value for cust_id & Cust_Name , then Is_cust_active field has to auto populate with Y else it has to auto poupulate with N

Message was edited by: 2812601

This post has been answered by Cvele_new_account on Aug 9 2018
Jump to Answer

Comments

Cvele_new_account

Please, describe in more details.

This is unclear to me what you trying to do

User_1KZ3N

Hi ,

I am trying to achieve something similar to what is explained here

https://www.youtube.com/watch?v=pPH9JwRBC7M

Thanks!

Cvele_new_account

No. no; describe your use case

User_1KZ3N

Ok. Sorry for that.

I have a form, which will insert a data into the table on click of the submit button.

its a table which have some customer related records.

For Example:

Table fields/ form inputs

cust_id (user editable field)

Cust_Name (user editable field)

Cust_department (user editable field)

Is_Cust_Active (not user editable field)

if user enter value for cust_id & Cust_Name , then Is_cust_active field has to auto populate with Y else it has to auto poupulate with N

Hope this helps.. kindly let me know if you need anything further. Thanks.

Okan Sutcuoglu

You can use an EL Expression on the value attribute of Is_cust_active like:

#{bindings.cust_id.inputValue.length() gt 0 && bindings.Cust_Name.inputValue.length() gt 0 ? 'Y' : 'N'}

And dont forget to make autosubmit true.

Cvele_new_account
Answer

Generate java class file for ViewRoeImpl.

Then, in the setters of cust_id & Cust_Name, write following code

public void setXXX(... value){

   setAttributeInternal(...);

   if (value != null && getCust_Name() != null) // ..or getCust_ID() != null, ajdust that for specific setter

      setIs_cust_active("Y");

    else

     setIs_cust_active("N");

}

Marked as Answer by User_1KZ3N · Sep 27 2020
Sam11116

what is the component u r using for the cust_active field.

dvohra21

Use Ajax to auto-refresh based on a field value.

References:

Ajax and Partial-Page Refresh in Oracle ADF Rich Client

Ajax and Partial-Page Refresh in Oracle ADF Rich Client, Part 2

Forcing refresh of an ADF Faces component with EVERY Partial Page Request

1 - 8
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 6 2018
Added on Aug 9 2018
8 comments
545 views