[ADF, JDev12.1.3] (1) creating a "select a Choiche" from a query 2-fields and 2) to get the key of the selected element?
Hallo,
I have a VO based query, that query is like that...
Select field1 as keyField, Field2 as valueField
table
By dragging the VO istance in the page I want to create a Choiche a Select...
The list should show only the values of valueFields.
Moreover, in my bean I need to get the keyField to the selected line (not the valueField).
You kindly could you tell me which is the right approach to create the list choiche and what code I use to get the keyField to the selected item in the list?
Thank you very much
Federico
Google would be useful.
https://tompeez.WordPress.com/tag/afselectonechoice/
Tags: Java
Similar Questions
-
Hi all
If someone can help me with a powercli script to create a new account a local administrator on all ESX and ESXi hosts in the vcenter, create a role called admin and give all access except the root. This shoulb be past by a virtual centre.
Very much appreciated to help him.
Kind regards
MelLvin
I suspect that you posted your question to the wrong thread
This requires only a minor change to the script above actually.
Something like that
$groupName = "group"$accountName = "user"$accountPswd = "password"$accountDescription = "A user" $esxlist = Get-VMHostforeach($esx in $esxlist){ Connect-VIServer -Server $esx -User root -Password "password" Try { Get-VMHostAccount -Id $groupName -Group -ErrorAction Stop | Out-Null } Catch { New-VMHostAccount -Id $groupName -GroupAccount | Out-Null } $rootFolder = Get-Folder -Name ha-folder-root Try{ $account = Get-VMHostAccount -Id $accountName -ErrorAction Stop | Set-VMHostAccount -Password $accountPswd -Description $accountDescription -AssignGroups $groupName } Catch{ $account = New-VMHostAccount -Id $accountName -Password $accountPswd -Description $accountDescription -UserAccount -GrantShellAccess -AssignGroups $groupName } $rootFolder = Get-Folder -Name ha-folder-root New-VIPermission -Entity $rootFolder -Principal $account -Role admin Disconnect-VIServer -Confirm:$false}
-
Hallo,
I defined a VO with 3 fields (A, B and C) and I would like to create a SelectOneChoiche that shows only the field as options from this instance of VO.
In a managed bean, I need to retrieve the values for all areas (A, B and C) of the item selected by the user.
I started dragging the entire VO instance to UI to create a SelectOneChoiche (in which I have chosen to show only the to field).
Then, I created a for the SOC ValueChangeListener read the values A, B and C of the selected element, but the only thing I've done is to get the displayed value:
System.out.println((String) ((RichSelectOneChoice) FacesUtils.findComponent("MySoc")).getValue());
You kindly help me?
Thank you
Federico
Federico, sorry I didn't see your answer.
As you use 12.1.3 you can do this more easily than the code that I posted before. You can use
{} public void onCountrySelection (ValueChangeEvent valueChangeEvent)
FacesContext will involve = FacesContext.getCurrentInstance ();
Make sure that the selection change is processed and the current link lov line has the new selected line
valueChangeEvent.getComponent () .processUpdates (contxt);
BindingContext lBindingContext = BindingContext.getCurrent ();
BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry ();
List JUCtrlListBinding = lBindingContainer.get ("CountryId") (JUCtrlListBinding);
the newindex in not necessary, but ok let's get it (must be equal to the CountryId, the pharmacokinetics of the binding of the lov
String newindex = (String) valueChangeEvent.getNewValue ();
get the selected value in the list that is the selected line of the binding of the lov
Line lFromList = list.getSelectedValue () (line);
now, we can get the attributes of the line of lov
String s = (String) lFromList.getAttribute ("CountryId");
System.out.println ("CountryId:" + s);
String s2 = (String) lFromList.getAttribute ("CountryName");
System.out.println ("CountryName:" + s2);
BigDecimal s3 = lFromList.getAttribute("RegionId") (BigDecimal);
System.out.println ("RegionId:" + s3.toString ());
}
The form that I use is based on the location of the HR DB schema table. The CountryId is configured in the view object to display a lov based on the campagneVoir. This view contains thre CountryId, CountryName and RegionId attributes.
If you want to get to the attributes of an action listener you can use this code
{} public void onGetSelectedCountryLov (ActionEvent actionEvent)
BindingContext lBindingContext = BindingContext.getCurrent ();
BindingContainer lBindingContainer = lBindingContext.getCurrentBindingsEntry ();
List JUCtrlListBinding = lBindingContainer.get ("CountryId") (JUCtrlListBinding);
get the selected value in the list that is the selected line of the binding of the lov
Line lFromList = list.getSelectedValue () (line);
now, we can get the attributes of the line of lov
String s = (String) lFromList.getAttribute ("CountryId");
System.out.println ("CountryId:" + s);
String s2 = (String) lFromList.getAttribute ("CountryName");
System.out.println ("CountryName:" + s2);
BigDecimal s3 = lFromList.getAttribute("RegionId") (BigDecimal);
System.out.println ("RegionId:" + s3.toString ());
}
You must add the valueChangeListener and at least add the lines
FacesContext will involve = FacesContext.getCurrentInstance ();
Make sure that the selection change is processed and the current link lov line has the new selected line
valueChangeEvent.getComponent () .processUpdates (contxt);
to ensure that the selected line is available when you click the button.
And set autosubmit'= true for the field in the UI that displays the LOV.
Timo
-
Hallo,
in lots of examples that I have seen that sometimes the whole (through the Binding property) UI component is bound to a variable of bean and sometimes only the value property is bound to a variable of bean.
I understand that when it comes to the UIC connection on the Value property value is sufficient.
But I ask myself... which is the approach recommended in general?
And is there a situation in which the binding using the Binding property must avoid?
I have created a search custom form with the field (inputTexts, checkboxes,...) the values are handled in a bean. Which would be, in this case, the approach of linking advisable?
Thank you
Federico
But I ask myself... which is the approach recommended in general?
You should almost always use concrete goods (such as the ' value')
In some cases, you will need to update some components of the user interface programmatically (with AdfFacesContext.getCurrentInstance () .addPartialTarget (component)), and for this you need reference to any component.
But even in this case, you can use another approach to get the reference of the component instead of binding to the beans (but of course, "binding" attribute is the best way to get the reference of the component)
See also: that binds the JSF component? When it is best to use? -Stack overflow
And is there a situation in which the binding using the Binding property must avoid?
-If you do not need any component
-If you have scope of pageFlow/view/session bean
I have created a search custom form with the field (inputTexts, checkboxes,...) the values are handled in a bean. Which would be, in this case, the approach of linking advisable?
Probably the "value" property
Dario.
-
Hallo,
in my page, I have a table based on VO istance.
I open a workflow in the dialog box when the user clicks a button.
I spend a whole param through the SetPropertyListener in the button configured this way...
In the called workflow, I read the param in a bean managed through this code...
Long protocol = (Long) AdfFacesContext.getCurrentInstance().getPageFlowScope().get("protToOpen");
And everything works fine.
The is problematic if I change the From the SetPropertyListener property set with a bind var....
... I have also display in an inputText.
(runtime)
(designtime)
The framework throws this exception...
oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding cannot be cast in java.lang.Long
I don't understand why it only works when the From of the SetPropertyListener property is configured with a fixed value, but not when I use the link vars.
You could you kindly help me find the error?
Thank youFederico
If your value not be #{bindings.prot.inputValue} instead of #{bindings.prot}?
-
When the alpha element group influence all elements, but the text remains 100%
I try with the Group of elements and no group, but include elements in the 'State' of the widget library button. Nothing!Explain dough my problem and please excuse my English...
I need to have a transparent background with text (name and job) at the start. When I rollon with the cursor of the mouse on the button background should take a color with 60% alpha, required text full color stay, but if I group or insert State of the item on Rollo button mouse everything take alpha 60%I need to regroup or insert in elements went State button because if they are ungruoped to mouse Rollo on bottom its all is ok, but when the mouse passes over the background of text out you of you initial state.
Can someone help me please?
I think I know your problem - are you using the opacity of the 'effects' rather than opacity to "fill" - one of the effects will affect the entire element rather than just the rectangle.
Use this opacity
not this one
-
Hallo,
I see that default ADF makes all the 100px wide columns and there is the possibility to stretch a column to take full available width.
I would like to know if there is a function / approach in ADF which - occupies all the available space - auto-calcule the width of each column to 1) the width of DB fields and 2) space in the browser window.
I could also set the with columns of table in columns (characters) or (better?) in pixels and the framework should only for reproportion widths according to the available width.
Or track to follow is defining the width of the columns in the table (percentage) property?
Thank you
Federico
There is the possibility to stretch a column to take full available width.
AFAIK, you can stretch several columns (read the docs for this property)
I would like to know if there is a function / approach in ADF which - occupies all the available space - auto-calcule the width of each column to 1) the width of DB fields and 2) space in the browser window.
(1) as far as I know, no
(2) you can add class AFStretchWidth to the styleClass property to af:table (or surround your table with af:panelCollection and add this style class here)
Or track to follow is defining the width of the columns in the table (percentage) property?
Is probably not.
% has different interpretation in different browsers, so you should use the style class AFStretchWidth.
Dario
-
Hello
I use JDev 11.1 with ADF, I have the grid, I need to get the selected row in the grid when I press the button, how can I do this?
Thank youHello
You have a table in your page that is based on a viewObject iterator and you must get the selected line in your bean to support when you click on a button.
Did I get that right?If yes then you must add an actionListener on this button that executes a method in bean support.
the code for the button:
In this method, you add the code like this:
public void buttonActionListener(ActionEvent actionEvent) { BindingContext bindingctx=BindingContext.getCurrent(); DCBindingContainer bindings=(DCBindingContainer)bindingctx; DCIteratorBinding iter= bindings.findIteratorBinding("iteratorName"); Row currentRow=iter.getCurrentRow(); }
If this isn't what you need to give more details.
Gabriel
-
Hello, I'm new with the mobile app and this is my first time using WebWorks 2.0 (I jumped Webworks 1.0)
I'm in this step https://developer.blackberry.com/html5/documentation/beta/testing_and_signing_setup.html#kba13821044... and in the section create your developer certificate. And I'm following the step by step (not sure I myself do right)
and I entered this CL
blackberry-keytool -genkeypair -storepass
-dname "cn= " and it's seems it is true, but I don't see any error. Can you help me please?
and it's the image
Thank you
Jaka
Hello
It seems that you missed a step? At this point, I think that you should have your "bbidtoken" file in the directory before creating the author.p12, but it is empty.
---
- Go to https://developer.blackberry.com/codesigning and sign in using your BlackBerry ID credentials.
- Type and confirm the password to use for your BlackBerry ID token, and then click get the token.
-
Logon to an account on the Win8 Pro system. In the PC settings. Your account, try to create a PIN. You will be asked your password, and when I enter the password, the tracking error. "The remote procedure call failed."
In the application event log, we see:
The failing application name: CredentialUIBroker.exe, version: 6.2.9200.16384, time stamp: 0x5010a22d
The failed module name: nvwgf2umx.dll, version: 9.18.13.1070, time stamp: 0x50b976f6
Exception code: 0xc000041d
Offset: 0 x 0000000000135122
ID of the process failed: 0 x 1160
Start time of application vulnerabilities: 0x01cddfd4b4a988ef
The failing application path: C:\Windows\System32\CredentialUIBroker.exe
Path of the failing module: C:\Windows\System32\nvwgf2umx.dll
Report ID: fdf0d095-4bc7-11e2-be7a-e0cb4e8a55c5
Faulting full name of the package:
ID of the failed package-parent application:
I did a search of exhaust gases and am not finding that anything related.
Action taken:
ran sfc/scannow and no reported problems.
Need to stop the application to quit.
I found the problem for the updated NVidia driver. Once I disabled the display driver USB 3.0 that acts as a method to connect to a computer USB 3.0 (also tactile) monitor, the driver installed correctly and does not interfere with any of the Windows applications.
Also, try to remove all the accounts on your system that are not user accounts that some applications will add them without apparent reason. Applications still work correctly. It's just less sure there to access your system. -
Hallo,
Dario and Timo advised me (in this thread
) I make a request using the functions create/restoreSavpoint to this fragment in my application.The tables are read-only, and the user can insert and modify records by a form of popup.
Each table has its own pop-up that I created using a btf executed as diaolog (*).
Before I open the popup, I create the backup point.
BindingContext bctx = BindingContext.getCurrent(); DCDataControl dcDataControl = bctx.getDefaultDataControl(); String sph = (String) dcDataControl.createSavepoint(); AdfFacesContext.getCurrentInstance().getPageFlowScope().put("AdfmSavePoint", sph);
When the popup is closed, I restore the backup point if the Cancel button was clicked...
Object confirmOrCancel = returnEvent.getReturnValue(); if (((String) confirmOrCancel).equals("cancel")) { String sph = (String) AdfFacesContext.getCurrentInstance().getPageFlowScope().get("AdfmSavePoint"); BindingContext bctx = BindingContext.getCurrent(); DCDataControl dcDataControl = bctx.getDefaultDataControl(); dcDataControl.restoreSavepoint(sph); }
I have these doubts:
- the button "CANCEL ALL" (so far) AM restore operation is still meaningful (is always useful) when you use the check points? Or can I avoid using the restore of the AM operation, creating a backup point before you enter the fragment and restore it if the user clicks on "RESTORE ALL"?
- for all tables: before opening the popup insert/change the backup point is implemented pageFlowScope under the same key 'AdfmSavePoint '. Is it OK or would it be better to use a different key for each table (for example 'AdfmSavePointTable1', 'AdfmSavePointTable2',...)?
- If the pageFlowScope already contains a checkpoint under the "AdfmSavePoint" key... What does if I give the floor to new .put ("AdfmSavePoint", sph)? Can I be sure that the old value is overwritten?
- is this safe with nested savepoint? For example in my case I want to create a backup before the fragment in the image point is displayed (and restore if the user leaves the fragment by clicking "RESTORE ALL"), then within the fragment, as I said above, I would manage other points of record when inserting/editing tables.
- I noticed that clicking on the button "RESTORE ALL" when it relates to the AM-restore operation causes this strange thing: when before displaying the fragment I call SetCurrentRowWithKey on the master istance VO... If I click on "ROLLBACK ALL" posted master VO Records changes and 1 minutes of the main of the VO table is displayed. Why the master istance VO is not reimain in the folder I've previously selected by SetCurrentRowWithKey?
- With reference to the expression (*) above. The BTF 'dialogue' I created contains only the page jspx with shape and a return to activity. I also tried a) create (and restore) the backup point, b) to call createInsert inside the "dialog box" operation BTF (see images below), but the createInsert on retail VO istance called inside the 'dialogue' BTF seems not to reflect on the table as when I call createInsert by calling btf. I have to make some adjustments in the 'dialogue' of BTF?
Thank you
Federico
Federico,
(1) Yes, what should happen if a user add or edit vo1 and click ok in the dialog box but decided that ask to work must be restored?
(2) as long as you don't have that a dialog box is open, it should work.
(3) the flowrate range of page is a map. You can put the same key more than once. If the key already exists, the value is replaced.
(4) in fact, I don't know, but the sounds of complicated design. I guess you can record more points, but only in the order of creation. It's as if you try to rebuild the framework. BTF yo it even for you, when worn right. Please go to ADF Architecture Square and read and watch it task flow of related things.
(5) this behavior is as expected. A restore resets all the iterators so thagetto point at the top of he. http://www.Oracle.com/technetwork/Developer-Tools/ADF/learnmore/OCT2010-OTN-Harvest-183714.pdf 'keep the line after cancellation' shows how to handle this situation.
(6) I suppose have you refresh the table iterator, once you close the dialog box for the new data. But that's only a guess because it depends on how the btf share control of data and the your involved.
Timo
-
Hallo,
in my application, I would use SelectOneChoiche components a range of years including start/end of the year can be different based on other values/conditions of display.
I found this thread helpful Andrejus Baranovskis Blog: select a choice with select elements Tag which explains how to fill a PLOUGHSHARE of a managed bean.
Would it be possible (and how) to create a reusable component (something to drag them to the design-time user interface) configurable with expressions of start/end of year?
This would avoid as me to write the code to fill the SOC whenever I need one of them.
Thank you
Federico
You can see this example ADF practice: component example declarative ADF which shows how to create a component declarative which shows a decimal lov.
This Oracle magazine article Oracle ADF: Build Your Own is another example that will guide you throughout the process.
Timo
-
Hallo,
in a stubborn workflow, I have a fragment of Details as you can see here...
And it is the working group...
Then dynamic region is contained within the page that has a menu.
Each menu item has action = "#{viewScope.mainDynamicRegion.startBoundedTaskFlowX}". "
The bean maniDynamicRegion I have a lot of functions, each for each menu item, like this:
public String startBoundedTaskFlowX() {}
taskFlowId = "/WEB-INF/btf-X.xml#btf-X";
Returns a null value.
}
End of details
I would like to have 2 menu items for the btf above: one as 'research and details open' and onoter like 'create new details '.
When I click on "search...". "a search form should appear, the user selects a folder, then click on 'Open' and finally appears my fragment 'details' showing the desired folder.
Of course I have now that I'll have to add a new snippet to search for the folder desired to open
When I click "create...". "my fragment displays the master desired folder should appear. Af: form in the 1st tab must be ready to be filled.
You kindly could help me to complete the stubborn workflow? What components do I use?
How can I let know the stubborn workflow what mode should work (research & open or create)?
Is there something in particular, I have to take care of?
Thank you very much
Federico
Hi Federico
You can do this by using a BTF or two
So, using only a BTF you can do the following:
1. create an inputPram in your BTF who receives a value if the application is called from the search menu or create (set its value to S (Search) and C (Create))
2 use a router to check if BTF is called from the search menu, then he should go to the search page
3. and if it is called in Menu create then they should goto createPage drirectly and in the range of the router and createPage createInsert (for the first tab) operating as a method in taskFlow, so it will show a folder created in the first tab
See -task using flow router in Oracle ADF - YouTube activity
Thank you
-
Hallo,
I created an af:table like this https://community.oracle.com/servlet/JiveServlet/downloadImage/2-12620067-7140/cmnt1.png following the advice that the kind has been suggested to me by Ashish (for details, see [ADF, JDev 12.1.3] how to display multiple records on the same page... not in a table, but display a form for each record)
When the table is loaded for the first time, it appears correctly.
But often (not always) when I select a new line, the selected line up to become "white" and its content disappears http://digilander.libero.it/flattit82/OTN_FILES/rowDisappearing.png
This product especially if I change the value of 1 or 2 fields contained in the line.
If I select several lines - one after the other one - the part visible AF: table may become totally white.
Looks like a refresh problem.
The table is in a tab.
If I switch to the tab, then I it again once the table appears again correctly.
Another thing I noticed: for example 2 rows have disappeared, I select an end of line I have empty in a required field: when I select another line, the popup "this field is required" appears in the row selected previously and magically all the missing lines are coming back!
The problem seems to be less frequent if I set the selection table = none... but it is always present.
You could you kindly help me to solve this problem?
Thank you
Federico
Hi Federico
See I've made a few changes in your application, this problem is due to your provision
as there are a lot of line of the grid, groups, I simple used Panel of and provision of group only
Thank you
-
Hallo,
I create a stubborn workflow that begins with a create operation on the table where a new record should be added.
The recording fields must be filled in by the user, but before committing, I have to fill a field of the reocord with the address IP of the PC of the user.
Could you kindly advice me which are the possible recommended approaches to achieve this?
Thank you
Federico
Hello
See this post: Blog of Zeeshan Baig: how to get the IP address of the customer in ADF merge request
You can use a createWithParams operation and to fill in this field.
Reference: Andrejus Baranovskis Blog: CreateWithParams operation for Oracle ADF 11g BC
Kind regards
Ruben.
Maybe you are looking for
-
HP elitebook 6930p I need drivers opengl 1.2
I need opengl 1.2 or higher for video calls Cisco is possible
-
After inslling service pak 3 can maintain pacs 1and 2 deleted in XP pro
XP pro service pack 3 right now, wish to uninstall service pack 1 and 2
-
COM1 is used by an unknown application.
Windows XP Professional. I use several different programs that are run ever at the same time requiring the COM1 port. Now I'm in a situation that I can't use one of my apps because they all say that the COM1 port is used by another application. I uni
-
Time of the laptop is false and no access to MSN
It happened on the son's cell phone but I do not remember how to fix, but I remember that it is very easy. Has tried to do restart, no success and restoration.
-
crashes when you watch YouTube or videos as well as Minecraft.
PC guard crashing when I look at you tube or videos too when my son playing minecraft any one know what is wrong please?