Dependant choice lists
Hi,
I would like to be able to present the user with two dropdown lists, with the data from the second one dependant on the first. I understand with 10g this is somewhat simpler due to the introduction of primaryClientAction. I thought of using the query type facility within JHeadstart to read a value from the session Data to populate the second list. My question ? Is this possible without having to submit the form (assuming that the value is only going to get set on the sessionData once the form has been submitted). Is there a way that I could store the value on the sessiondata using a javascript function on my first choice list ??
Thanks,
Brent Harlow
Hi Peter,
Thanks for the reply ! Seemed somewhat daunting at first but not bad once I tried it out. Not 100% successful yet though. I thought that I would first try it out populating a table on a separate page to make sure I had the basics right. First problem is that "'<%=sessionData.getAttribute("controller")%>" does not seem to be getting resolved - the alert(xmlHTTP.responseText) returns "404 Error : Resource /Choicedemo/<%9cessionData.getAttribute("controller")xtarget......"do I need to include something else in my javascript or struts-config ? Secondly, when I replace the code above and hard-code in the web url, the action returns success but the forward table page is not displayed ?? Here is my code
struts-config
<action path="ModuleRouter" type="oracle.jheadstart.controller.struts.action.DynamicActionRouter">
<set-property property="forwardParameterName" value="targetGroup"/>
<set-property property="attributeNameParameter" value="targetCondition"/>
<set-property property="attributeValueParameter" value="targetConditionValue"/>
<set-property property="defaultForward" value="Studies"/>
<set-property property="defaultPreviousForward" value="false"/>
<forward name="Studies" path="StudiesRouter"/>
<forward name="Kits" path="KitsRouter"/>
</action>
<action path="StudiesRouter" type="oracle.jheadstart.controller.struts.action.ActionRouter">
<set-property property="defaultForward" value="initial"/>
<forward name="initial" path="GetStudiesSet"/>
<forward name="browse" path="BrowseStudiesSet"/>
<forward name="insert" path="GetDefaultStudies"/>
<forward name="save" path="SaveStudies"/>
<forward name="delete" path="DeleteStudies"/>
<forward name="firstPoplistChanged" path="getSecondPoplist"/>
<forward name="groupPage" path="/WEB-INF/page/StudiesPage.uix"/>
</action>
<action path="getSecondPoplist" type="oracle.jheadstart.controller.struts.action.GetDataObjectSet">
<set-property property="dataObjectInterface" value="hmdclinical.choicedemo.model.invkitdetail"/>
<set-property property="dataObjectSetName" value="KitsSet"/>
<set-property property="isUpdatable" value="true"/>
<set-property property="rangeSize" value="30"/>
<set-property property="queryType" value="SecondPoplistQuery"/>
<set-property property="attributeNames" value="firstPoplistValue"/>
<set-property property="useAttributeNameAsKey" value="false"/>
<forward name="success" path="/WEB-INF/page/KitsTablePage.uix"/>
<forward name="userError" path="/WEB-INF/page/KitsTablePage.uix"/>
<forward name="dataObjectNotFound" path="/WEB-INF/page/KitsTablePage.uix"/>
</action>my javascript that is being called from the onChange handler
function firstPoplistChanged(item)
if (item.selectedIndex >0)
// This is a url that will invoke a specific forward on
// a specific actionRouter in your Struts config file.
// var url = '<%=sessionData.getAttribute("controller")%>?targetGroup=Studies&targetCondition=firstPoplistChanged&targetConditionValue=true';
var url = 'http://192.168.0.39:8989/Choicedemo/StartChoicedemo.do?targetGroup=Studies&targetCondition=firstPoplistChanged&targetConditionValue=true';
// Add a parameter to the URL that holds the selected
// value in the first poplist
url += '&firstPoplistValue='+item.options[item.selectedIndex].value;
alert(url)
// Invoke this URL
var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
xmlHTTP.open("GET",url, false);
xmlHTTP.send();
// Decomment this alert to see what you actually got back
// from the server.
alert(xmlHTTP.responseText);
// Find the second poplist (you'll need to set its id),
// and overwrite its content
// document.getElementById("secondPoplist").outerHTML = xmlHTTP.responseText;
else
// If the first poplist is not selected, clear the
// second one.
// document.getElementById("secondPoplist").innerHTML = "";
alert("Item selected index <= 0")
}and finally the oc4j debug showing me that the getSecondPoplist action was successful
22:42:17 DEBUG (DynamicActionRouter) -Forward returned: Studies
22:42:17 DEBUG (JhsRequestProcessor) -Execute StudiesRouter
22:42:17 DEBUG (ActionRouter) -Forward returned: firstPoplistChanged
22:42:17 DEBUG (JhsRequestProcessor) -Execute getSecondPoplist
22:42:17 DEBUG (GetDataObjectSet) -Forward returned: successHow come /WEB-INF/page/KitsTablePage.uix is not being shown then ?
Also..I appreciate you are giving me lots of info here but the last paragraph in your email "Finally, you need to write the simple secondPoplist.jsp that renders the second poplist with the new contents" has got me stumped - Sorry, I dont know where to begin ! How are the normal poplists rendered ? I was trying to find an example.......Im guessing that the JSP just provides the html that creates the poplist - dont understand how to hook it up to the dataObjectSetName. Also, the second list is going to be rather large so I wanted to use a LOV instead of a poplist ? Any pointers ? Do I just need to call the same lovFrame.jsp and pass in the new dataObjectName from the getSecondPoplist action ??
Thanks a million Peter,
Cheers
Brent
Similar Messages
-
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. -
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 -
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 -
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 -
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 -
Hi Gurus,
Can anyone please suggest How to create dependant message choice list in OAF.
Basically I am having two message choice list MC1 and MC2 where MC2 values depends on the MC1 value.
Thanks
PiyushHi Piyush,
I assume you have two different view object/instances created for the MC1 and MC2 attached as PickListViewObject with return value and display value. Now you can achieve your requirement like:
1) Set partial action on MC1.
2) In PorcessFormRequest handled event of MC1 and set where clause on MC2's PickListViewObject with value selected by MC1 --> Execute view object.
Note:: On page load you may need to write where clause for MC2's PickListViewObject with the value which returns no rows.!
Regards,
Swati -
ADF Dependent select one choice list
hi all
i have two lists in my page, and the second one takes value from the first, but it is not working, the second list is empty always whatever i select in the first one.
i have searched many threads and it is not working. i also did the steps in the page http://www.oracle.com/technology/obe/obe11jdev/11/adfbc_new_features/adfbc.html#t2
this what i have did in details:
first list : LevelComboVO
select distinct group_level from mrcps_group_link
second list: GroupComboVO
select large_group_seq, group_level, symbol
from mrcps_group_link
where group_level = :selectedLevel
then i made a bind variable for the second list GroupComboVO named selectedLevel
for the first list LevelComboVO i made the following:
press plus on the ListOfValues:GroupLevel and for the list data source i have made new one for GroupComboVO and choosen the list attribute groupLevel and for ui hent i chosed groupLevel
then i have tested the AM but no data returned for GroupComboVO
please helpfirst i have done the 2 view objects and the corresponding two select one choice list
for the first list i have made a managed bean for valueChangedListener -- > #{GrouplLevelBean.passLevel}
and i have put code as you told me :
package mrcps.view;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.jbo.ViewObject;
public class GrouplLevelBean {
public GrouplLevelBean() {
public void passLevel(ValueChangeEvent valueChangeEvent) {
// Add event code here...
DCIteratorBinding testListIter1 = getItrtBindings("GroupComboVOObj1Iterator");
ViewObject vo1 = testListIter1.getViewObject();
vo1.setNamedWhereClauseParam("selectedLevel", valueChangeEvent);
vo1.executeQuery();
getItrtBindings( is giving me a red underline indication that method not found
Edited by: user604057 on Apr 3, 2009 3:27 PM -
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. -
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 -
Calling pages based on choice list value
Hi,
I'm using jdev11.1.2.1.0
I have created page with one single choice list and 3 buttons.
in choice list, all the selected items are static only. I have created 3 selected items under the choice list.
and I created 9 jsff fragments.
now these 9 jsff's are called as regions in page when i select choice list value and button.
how can I achieve this?
Thank You..Hi Puthanampatti
thanks for Ur reply,
I have tried like this...
I have taken 9 buttons and i created valuechangelistener event and by depending up on the selecteditem in the choice list, rendered only three buttons and under those buttons i created setpropertylistener.
its working fine.
but I have created choice list by drag and drop the choice from the component palette and there I created list items( just labels only with no values)
by default its showing blank item in the list.
but as per my requirement, first item should be displayed first.
I don know much about unselectedlabel property for the choicelist.
how can I use this in displaying the first selectitem in the list? -
How to get selected values from Select Many Choice List
Hello All -
I am using Select Many Choice List and wish to get the selected values in the bean. I have created method binding for valueChangeListener for the choice list, but not sure how to get the selected values.
I am facing problem in getting values from valueChangeEvent.getNewValue(). For Select One Choice List this returns int, but some list type object for Select Many Choice List.
When I try to print the value it comes something like:
ArrayList newVal = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
System.out.println(newVal);
[Ljava.lang.Integer;@870ad8
Could anyone please suggest how to type cast and use the return of valueChangeEvent.getNewValue() to get the selected values.
Regards -
RohitHi Timo -
Thanks for the suggestion. I could get the values as below:
public void multiOpUnitValChange(ValueChangeEvent valueChangeEvent) {
// Add event code here...
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding opUnitIter = (DCIteratorBinding)bindings.get("OperatingUnit2VOIterator");
Integer[] values = (Integer[])valueChangeEvent.getNewValue();
for (int i=0; i<values.length; i++){
Row row = opUnitIter.getRowAtRangeIndex(i);
System.out.println(row.getAttribute("OpUnitId"));
Thanks -
Rohit -
How to implement two dependent dropdown lists in an input table row?
Hi all,
I am new in Jdev 11g. I try to develop an input table with two dependent dropdown list. I can create independent dropdown list in such table. When I try to implement dependent one following some examples do it in a form using bind variable in the view object I get an empty listbox. How can I do this? Is it possible. I cannot find any documents about this.
Thanks in advanceHi,
it hasn't changed between 10.1.3 and 11. The basic outline of how you do it is
- use a managed bean to query the data
- populate the list with f:selectItems that point to the managed bean ArrayList<SelectItem> for the master and the detail
- obtain the master ID in the managed bean by parsing the #{row} variable when the table renders
- then bulild the detail list
- have the detail list referencing the ArrayList<SelectItem> you expose for the details
Note that without proper caching, the action is quite expensive
Frank -
Can't get a blank entry in Choice List of Values (LOV)
Using Jdev 11.1.1.3 but will be upgrading to 11.1.1.5 in few weeks.
Need to display a Choice List that is bound a view object with static data. The List should show a blank item since users don’t need to select any.
I am able to display the LOV in the page but can’t seem to get a blank item as a first item.
Here is what I did:
1. Created the VO with static data. Initially didn’t include it in the Application Module based on the developer guide sec 5.3 but later added to get it in the data control list.
(Note the application doesn’t need to use any database and simply is using Web Service but for test I am using a DB)
2. To configured the VO, tried to add a View Accessor to the VO, but couldn’t select a data source until I added the VO to the App Module !
3. In attributes tab added an LOV and specified the data source. In UI Hints ensure the “Include “No Selection” Item” was selected.
(Initially didn’t shuttle the attribute to the right in the UI hints.)
4. In the List UI hints ensured that “Include “No Selection” Item” was selected.
5. Dragged the VO Data control to the page and selected ADF Select One Choice.
6. On running the List DID NOT include a blank item !? How to get one?
In pageDef got:
<list IterBinding="GenderListVO1Iterator" ListOperMode="navigation"
ListIter="GenderListVO1Iterator" id="GenderListVO1"
DTSupportsMRU="true">
<AttrNames>
<Item Value="Gender"/>
</AttrNames>
</list>
I even added the tag NullValueFlag="start" to the PageDef but no blank entry.
In Page got:
<af:selectOneChoice value="#{bindings.GenderListVO1.inputValue}"
label="#{bindings.GenderListVO1.label}"
required="#{bindings.GenderListVO1.hints.mandatory}"
shortDesc="#{bindings.GenderListVO1.hints.tooltip}"
id="soc3">
<f:selectItems value="#{bindings.GenderListVO1.items}" id="si7"/>
</af:selectOneChoice>
If I don't use the VO and code all items in the JSPX page with a blank item that get a blank entry (didn't test with the Web Service yet since not ready).
What is the issue with VO?
( I am also considering a number of SelectManyChecks on the same page but might be difficult)
Thanks for the reply.
Edited by: user8769031 on Jun 10, 2011 11:12 AMThanks for the hint, but in my case the attribute is not required. I never see a blank entry. The only way I was able to get a blank is to add a blank item to the static list in the VO. The VO XML file has:
<LOVUIHints
ListType="105"
MRUCount="0"
ListRangeSize="-1"
NullValueFlag="start"
NullValueId="LOVUIHints_NullValueId">
The Include "No selection" item is not working as expected. -
Is there a way to import a choice list in multiple (or single) selection fields?
Is there a way to import a previously created choice list in multiple (or single) selection fields in forms central?
Hello Dr. Ryan,
Unfortunately there is no way to move this data into FormsCentral.
As far as your question about using PDFs with FormsCentral, 'soon' is actually 'now'! You have two options:
1) Author a new form with FormsCentral. From the distribute tab, save a submission-enabled PDF form. You can send this form out to your recipients and their responses will be collected on FormsCentral.
2) Import an exsiting PDF form into FormsCentral from the dashboard, and then submission-enable it. Distribute the submission-enabled version and responses will be collected on FormsCentral.
Thanks!
Shannon
Maybe you are looking for
-
What is the quickest way to render video full screen?
In my application I am capturing video from a frame grabber at 640x512 resolution. I need to render output to a full screen window with adjustable scaling, and I need this to run at 60Hz. At the moment I am rendering the video using IMAQ WindDraw, un
-
With local OC4J Standalone I got no problems but with the Oracle 10 OAS I got this kind of error: 500 Internal Server Error java.lang.NoSuchMethodError: oracle.adf.share.perf.StateTracker.isActive()Z at oracle.adf.view.faces.webapp.AdfFacesFilte
-
Some trackpad functions suddenly stop working
Hello! I have no idea what causes this, but when I'm working on my MacBook, sometimes a couple of functions of the trackpad suddenly stop working. The functions that stop working are always the same: all of the "More Gestures" found in the "Trackpad"
-
Encapsulated Postscript (.eps) "Open With" Conflict
Our department just updated several Mac's to Snow Leopard and CS4. Most are working well, however we have experienced an "Open With" conflict. Background: We use .eps file format for both our Illustrator vector art logos and our Photoshop CMYK photog
-
Does OBIEE supports TimesTen as the data source
We use TimesTen for our in-memory db requirements, and our tables are cached i TimesTen. We are looking to see for OBIEE dashboards, can we use TimesTen as the datasource and is it supported and certified. If yes, could you please provide us the deta