Dynamic choice list dependent on current record in edit form (10.1.3.4)
Using JDeveloper 10.1.3.4.0. BC4J+ADF Faces
I have a page with an edit form that shows one record at a time for a view object ("VO one") and also has buttons to navigate to other records in the view object (first, prev, next, last).
I use a selectOneChoice component to edit one of the attributes on the edit form. The choices for the selectOneChoice are driven by another view object ("VO two").
The query for "VO two" so that it has a bind variable which is populated with one of the attributes of the current record of "VO one". Therefore, as the user navigates through records the choice list on the page shows different choices.
What is the best way set up the selectOneChoice and to update the bind variable for "VO two" and re-execute its query when the form is navigated to different records in 10.1.3.4.0?
(Yeah, I know its easy in 11g but I can't update the project yet...)
Thank you for reading my question.
Hello -
I found a solution and am documenting it here in case someone else finds this while trying to solve a similar problem.
1. I added the bind variable to my list choices view object and added a method in the app module that would set the bind variable and execute the query of the view object. The method was then added to the app module's public interface.
2. In the page definition for the edit form page, I created a method binding for the method in the app module and set as parameter values data from attribute bindings already in the page definition.
3. I created a backing bean to act as a page phase listener as detailed here:
http://download.oracle.com/docs/html/B25947_01/bcdcpal005.htm#sm0271
4. In the "onPagePreRender" method I get a hold of the method binding and execute it.
Similar Messages
-
Dynamic select list dependency
Hello,
I want to have two select lists populated dynamically by a query, where contents of one list depend on the choice made in the other list.
For example I have tables CATEGORY (ID, NAME) and SUBCATEGORY (ID, NAME, CAT_ID). I created one List of Values that Category select list is based on: "select name d, id r from category order by 1". This alone works fine.
Now for Subcategory select list I created another List of Values: "select name d, id r from subcategory where cat_id = :CAT_ID order by 1". The where clause is just my guess and it doesn't work (select list is empty). How do I pass the value selected in my first select list as a parameter for the second one?
Nikolaican you take a look to my response to the second question at...
Pop List and Developer Toolbar
...and let us know if you have any questions?
thanks,
raj -
Hi All
I want to restrict Choice List values depending on data coming from previous page.
I am using following code :
OAMessageChoiceBean contactList = (OAMessageChoiceBean)webBean.findChildRecursive("<Chioce List Name>");
contactList.setPickListCacheEnabled(false);
After this i am building VO Query depending on ceratin values.
Still choice list is taking initial query only.
I will appreciate if someone can help me on this.
Thanks
SamirMukul
Even after using clearCache i am getting initial query only.
The details are give below:
View Object Details
VO Name: ContactNameVO
Query: select distinct LTRIM(RTRIM(rc.first_name || ' ' || rc.last_name)) meaning
from ra_customer_trx_all rctl, ra_contacts rc
where rctl.bill_to_contact_id = rc.contact_id
AND ROWNUM = 1
XML Page Details
Choice List Item Details
ID : ContactName
Item Style: messageChoice
PickLList View Instance: ContactNameVO1
Picklist Display Attribute: Meaning
Picklist Value Attribute: Meaning
Controller Code
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
OAApplicationModule am = pageContext.getApplicationModule(webBean);
OAMessageChoiceBean contactList = (OAMessageChoiceBean)webBean.findChildRecursive
("ContactName");
contactList.setPickListCacheEnabled(false);
String trxId = (String)pageContext.getParameter("trxId1");
String whereclause3 = " ";
whereclause3 += " AND rctl.customer_trx_id IN ("+trxId+") ";
System.out.println("whereClause3****************"+whereclause3);
Serializable [] param1 ={whereclause3};
am.invokeMethod("DynQueryForContName",param1);
AM Code
public void DynQueryForContName(String q)
ContactNameVOImpl vo = getContactNameVO1();
vo.clearCache();
if(vo == null)
MessageToken [] errToken ={new MessageToken("OBJECT_NAME","ContactNameVO1")};
throw new OAException("AK","FWK_TBX_OBJECT_NOT_FOUND",errToken);
else
vo.initQuery(q);
VO Impl Code
public void initQuery(String s)
if((s != null) && (!("".equals(s.trim()))))
String query = getQuery();
StringBuffer sb = new StringBuffer(query);
if(final_query == null)
sb.append(s);
final_query = sb.toString();
setWhereClauseParams(null);
setQuery(final_query);
System.out.println(final_query);
final_query = null;
executeQuery();
setQuery(query);
Let me know if something is wrong in the code.
Thanks -
Newbie: how to create a dynamic select list of the current date + 5 years
Hi - I'm a JSP newbie (coming from a PHP background), and am trying to create a select list that contains the current year, plus 5 years. So, the list when generated (today), would display:
2007
2008
2009
2010
2011
2012
Obviously, the code would need to generate inside the option tags, as well as in the value property of the option tag.function addit(){
var val = 2012; //you can take this from js date object and strip it off
for (var i=2007; i <= val;++i){
addOption(document.getElementById("mycombo"), i, i);
function addOption(selectbox,text,value)
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}without hardcoding:
function addit(){
var dd = new Date();
var yearnow = dd.getFullYear();
for (var i=yearnow; i <= yearnow + 5 ;++i){
addOption(document.getElementById("mycombo"), i, i);
function addOption(selectbox,text,value)
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
in your jsp:
<body onload="addit();">
<form>
<select name="mycombo">
<option> Select year</option>
</select>
</form>
</body>
Message was edited by:
skp71
Message was edited by:
skp71 -
Business Data List View ONLY Displays records - Cannot Edit them
Using SharePoint 2010, I created an External Content Type. Data is coming from SQL Server. I created a new Read operation on my External Content type. I added a few filters in this Read View.
I have created a web part page in which I placed a Business Data List Web Part. In Web Part properties I chose the VIEW in question. I can now filter my External List data and the Business Data List Web Part displays them. But I cannot edit these
records!!!
From the web Part properties window, I can ONLY choose Views that are created from READ operations. How do I allow users to edit data and save data in the original source (SQL Server).
MayankBelow are the reference links on how to CRUD operations on external data using BCS
CRUD operations using BCS using SharePoint designer
http://zimmergren.net/technical/sp-2010-getting-started-with-business-connectivity-services-bcs-in-sharepoint-2010
CRUD operations using BCS using Visual studio
http://www.c-sharpcorner.com/uploadfile/anavijai/creating-external-content-type-with-crud-operations-using-business-data-connectivity-model-in-sharep/
My Blog- http://www.sharepoint-journey.com|
If a post answers your question, please click Mark As Answer on that post and Vote as Helpful -
Getting current record from Partner Form
Hi all,
Once on the Partner form, i need to get the current card code and the selected adress numero on this form.
Has anyone an idea on how to retrieve these informations.
Help appreciated
Thx
Mongi HAMMAMI- access the form
- access the corresponding items in the form within the Items collection
- read the values into it
You can see the mapping of the items into the DB directly by B1 application
by setting the debug info on. -
Dependent Choice List Not working in ECapture as Expected
Hi Martin_A,
In ECapture i am trying to create a dependent Chocie list which will show City name based on Country name.
But in ECapture that configuration is not working since during the creation of Depedent list from Parent
Source,configuration is taking only one value of Parent source for eg. Country- US
Hence child choice list is showing cities related to only US.
Which should not be the case since in actual scenarios depended list means filter on the basis of selected parent value.
Please let me know if i configured it wrongly.
Please send me the steps if you did it perfectly last time
@Martin_ALooking at the documentation 3.7 of Managing Oracle Webcenter Capture, that's how it is, you have to have a separate child list of cities for every country in the country list, only 196 parent items and 196 lists to configure then
In a choice list dependency, a parent field is linked to two or more child choice lists,
one of which is displayed after the user makes a selection in the parent field.
Important Points About Choice List Dependencies
■ You can create choice list dependencies between Capture user defined choice lists,
database choice lists, or between choice list types.
■ Create all choice lists you plan to link before creating a choice list dependency. At
a minimum, you need a parent choice list, and two or more child choice lists.
■ Each item in a child list can be related to multiple parent items. For example,
Supplies could be a child item to Household and Automotive subproducts.
■ You can create multi-level dependencies (for example, great grandparent,
grandparent, parent, and child choice lists).
■ Only one choice list dependency may be assigned to a client profile. Multiple
parent/child dependencies must be defined within a single choice list dependency.
Martin -
Dynamic Select List Allowed Values
Howdy Folks,
I am trying to allow end users to select their username. The usernames are generated from a rule library, and displayed in a select form element. I am doing this by having the allowedValues call the rule that generates the possible names directly. The rule returns a list of valid names. The problem I am currently having, is that if the page reloads or refreshes, then the allowedValues calls the rule again. Some of the username choices involve random numbers, so it is possible (and very likely), that separate calls to the rule will generate different potential values. So what is now happening, is that when a user selects the value, the page reloads, and the end user sees an error that looks like this:
( ) - Warning: Selected value for field 'Select a Valid User Name' does not match any of the allowed values.
The reason I am reloading the page, is that I am also trying to show the user what their email address will look like with the new value. So I have a different form element that is loading is value dynamically, and referencing the select form element. This mostly works, but the warning above is unacceptable.
Is there a way I can load the dynamically created list only once, the first time the form is viewed, and not load it again every time the page refreshes?
Another thing I tried to do (but didn't have luck with, so I sorta gave up on it) was to use the onChange of the select to change the value of email display field. This way the page never reloads and I don't have to deal with that issue. I'm thinking the onChange might actually work, but I would need to execute javascript or something, and not just use an express <set/> command to set the value of the field name that displays the email text.
Does anyone have advice on how to make the values only load once? Or how to change the value on the onChange event?
Thanks!
JimMike,
Thanks for the feedback. I actually did try that eventually. I created a variable in the form, and initialized that variable to the list of possible values. Then I referenced the variable in the 'allowedValues' of the select form item. At that point in time I still had the select box set as an action, so it would reload the page, hoping to reload the value in the email display field. This still did not work. Each time the action fired off, the variable was re-initializing itself. I eventually tried to put in a check, so it would not re-initialize itself if it had already been initialized. That caused a syslog error.
I ended up solving the problem using javascript. I changed the field that reported the potential email address to an html element. Then for the html attribute I made a div with an ID. I then set a line of javascript into the onChange attribute of the select form element. This worked when ever the select form value changed. I then added the same line of javascript to the onLoad attribute of the jsp pages body element. This worked for loading the page.
This solved the problem of the page reloading and the select getting new values. That still happens if you actually reload the page, but all the form elements work without the reload now.
Thanks!
Jim -
Dynamic select list crashes with php
HI All,
I can't seem to get a dynamic select list to work in
dreamweaver. It completly crashes everytime I try adding it to my
page. I found someone else in the forum who had the same problem
but no one ever responded. I've tried several things including
putting just the record set and dynamic select on it's own page
with no other code on it. It still crashes DW. I also tried coding
it myself by making a listmenu and modifying it so that the option
value equals a PHP echo of a value. It crashed there too. Does
anyone have a piece of code with a working dynamic select list that
uses a record set that I could look at? That way I can see where
I'm going wrong. All I'm trying to do is get a simple drop down
select list of employee names so someone can choose their name to
get commission. It's a one table, 2 fields (first & last name)
record set.
Using DW CS3, php & MySQL.,windows XP Pro
Any help would be really appreciated!AthroughZ wrote:
> I can't seem to get a dynamic select list to work in
dreamweaver. It
> completly crashes everytime I try adding it to my page.
It looks as though you have a corrupt cache file. Follow
troubleshooting
step 4 in the following technote:
http://www.adobe.com/go/tn_19105
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/ -
Task flow return-Current Record pointing issue.
Hi friends
Newbie in ADF (basically from .net back ground)...........I am in the process of developing my first module.
I have a task flow where a master detail records are displayed ..When I click "Edit" it is calling a edit task flow where the editing of master/detail tables are performed .When I click "New" a blank record is created and it is calling same edit task flow.
my problem is when the child task flow exits and returns to the parent it is not pointing to the current record I edited...This is true if return either by commit or cancel.
My data control is shared , parent task flow does not have any transaction and child always starts a new transaction.
What is the ideal solution to point to the current record when I return?.
Thanks .
AshrafBelow is updated bean code
ViewObject VO;
FacesContext fctx = FacesContext.getCurrentInstance();
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iter = bindings.findIteratorBinding("Delmast1Iterator");
VO = iter.getViewObject();
Key currKey = iter.getCurrentRow().getKey();
Row[] rows = VO.findByKey(currKey, 1);
if (rows.length == 1) {
System.out.println("row found");
VO.setCurrentRow(rows[0]);
iter.executeQuery();
iter.setCurrentRowWithKey(currKey.toStringFormat(true));
iter.setCurrentRowWithKeyValue(iter.getCurrentRow().getAttribute("SaleId").toString());
If my child task flow does not have a commit or rollback the above code works fine...But I am beginning a transaction in my child flow(edit flow) so it is a must to have commit/rollback.
Is there any other options experts ?..Please guide me.
Thax. -
How to make dependent choice lists grow dynamically?
Is it possible to have dependent choice list which grow as the new content is added for choice list item?
E.g If we have countries, states, cities as dependent choice lists. If contributor adds a new country the value should appear in the drop down next time. That value of country can be in turn be used to add states for it. The id of state in trun should be used to add cities. Is this possible?
Regards,
PratapHello All,
by the way, it is very simple to let opltion lists grow dynamically, and moreover to have a predefined structure before.
First you create a table and fill the view for this table with you start values, as it has been described before in this thread.
Then you make the option list for the field Edit and Select.
And then, as you know, your predefined values are stored in your custom schTable (whatever the name is), but all the values entered by the user are stored in DOCMETA table!
All you need to do is to create a trigger with SQL Developer, so that on update and insert in table DOCMETA for your custom metadata field it is checked whether this value is already in your predefined option list stored in your schTable.
And if the value is not there, make the trigger add a new record to custom table with this value and related values as well.
Simple.
This is true for any option list with predefined value and updated by the end-user.
If it is dependent option list, then you need to add both values for parent and child fields in your custom table.
There is another problem for which I can not find a solution --> if the field depends on two fields...
Regards,
Guli -
Dependent choice list with Idoc Script
Hi,
I'm developing a customized component and I have made my own template.
This is made in *.hcst* extension.
I use 3 variables dependent (they are choice lists),
If I put these variables in a checkin profile everything is O.K.,
but the problem I have using these fields in my template,
if I select the first variable it shows a javascript error:"setOption is not defined", maybe that is problem because
I must include the script that contains the function but I don't know where it is located.
I do exactly what Bex's book says (as follows):
<$include std_doc_page_definitions$>
<$include std_html_head_declarations>
<$fieldName="xCountry", fieldCaption="<b>Country:</b>",
fieldIsOptionList=1, isInfoOnly=#active.isHcsp$>
<$include std_display_field>
<$fieldName="xState", fieldCaption="<b>State:</b>",
fieldIsOptionList=1, isInfoOnly=#active.isHcsp$>
<$include std_display_field-->
<$fieldName="xCity", fieldCaption="<b>City:</b>",
fieldIsOptionList=1, isInfoOnly=#active.isHcsp$>
<$include std_display_field>
<$include std_page_end$>
the result is the first field with its list options properly filled in, but the second and third choice list do not have values, even if I select any in the first list
I think the problem could be in some include
(I do not know if there includes missing, or I forgot something)
Please help me
Best regards,
JuaneleThe setOption function is defined in this dynamic html include:
query_form_std_script
There's also a different version defined in this include:
expired_form_std_script -
Dynamic query based Simple Choice List not working as expected.
I've a value in a View Object attribute which is not present in the LOV associated to it. How to show this in the UI if the attribute's component is a Simple Choice List ?
Jdev Version is : 11.1.1.6.0
The attribute for which the LOV exists has a value which was once active on an earlier date, i.e, the LOV used to show the value in it's dropdown on an earlier date.
Example:
The ViewObject query for the LOV is:
SELECT JOB_ID, END_DATE FROM JOBS WHERE END_DATE > SYSDATE
Results
JOB_ID -- END_DATE
45 -- -- -- 23-OCT-2012
56 -- -- -- 21-OCT-2012
76 -- -- -- 15-NOV-2012
78 -- -- -- 15-DEC-2012
Now,
The main viewObject EmployeesVO has an attribute JOB_ID with an LOV to the JOBS VO above.
On 20th Oct, 2012, when I create an employee record, the LOV shows all 4 records in JOBS dropdown and I selected job Id as 56.
On 25th Oct, when I try to edit the Employee Record, I see a blank item in the JOBS choice list (the LOV being a simple choice list).
The LOV will display the jobs which are active as on 25th Oct.
How do I know, what is the current job of the employee?
This issue will not happen if we use input list of values combo LOV -
Populate Actual values in Dependent Choice List
Hi,
I have a scenario wherein 3 metadata fields are dependent on each other.
Department -- > EmpNames --> EmpID
On implementing the dependent choice list, if i select the department, empnames of that department gets displayed.
But by default it loads up with No Selection option followed by empnames.
My client has a requirement wherein on selecting the empname, empid should get auto poulated. In our case it is,
by default No Selection option is present and empid comes after that.
Please let us me how to remove that No Selection type and make the value to get populate.
Regards,
BhaskarHi Bhaskar,
This can be achieved in ODC. Which GUI you are talking about?
Regards,
Vikrant Korde. -
Implementing dependent choice list with internal columns as varchar
Hi,
While implementing dependent choice list I created two tables & their views with internal column as varchar(for example: countryName for country table & stateName for states table) instead of int. I couldn't get the DCL working: selecting a value from the dropdown of parent field won't show up only the dependent values of the child field; it will display the dropdown with all values (it will show all values of the States irrespective of the countryname selection). However when I select the internal column as int & visible column as varchar the DCL works fine.
Our requirement is to use the internal columns as varchar instead of int. Please suggest/help.
Thanks,
MadhurHi Shashwat,
I have done that. The problem is: dependent choice list doesn't seem work is you choose primarykey/foreign key as varchar. It works if I choose the primarykey/foreign key as int. And this key will be the internal column in the views. My requirement is to have them as varchar so that while checking-in content using RIDC API I don't have to provide the int value.
Thanks & Regards,
Madhur
Maybe you are looking for
-
Importing to iTunes folder doesn't seem to work.
I don't know if this is a vista/itunes bug, but here I go: I have a music library of about 60 gigs or so. When I try and import the songs WITHOUT moving the songs to iTunes directory, it works like a charm. However, if I check the box to move the imp
-
When copying playlist from itunes to nano3rd message comes saying 9 of songs can't be copied to ipod cos of file type. These 9 are all from same album, all ACC and all copied fine when I copied the album itselm some weeks ago. Rest of playlist was A
-
How to pick up a Particular value in a table
Hi all, I have the output of a query to display in a table.Now i want to pickup some values from the output table and use them to display in a graph. I wanted to pick the values as below: i have 6 rows in the table and 10 columns in the table. How ca
-
Iwl3945 module loading problem (with workaround)
I've been experiencing problems with my intel wireless card (iwl3945) not loading at boot time. The problem arose after a fresh install from a Chakra (kdemod) live CD after I got a new harddrive for my notebook. It worked fine from the live CD and im
-
Hello, The user needs to save the Documents, other than text type(for eg. .doc, .pdf, .xls etc) thru Queries in Bex/Web for the Info-objects etc. in the Query, in the same way as he is able to do thru RSA1->Docuemnts. For the moment the user can crea