[ADF, JDev12.1.3] How to get the column headers, request of VO and VO bind vars used by an af:table?
Hallo,
I want to create a method that takes as a parameter the id of an af:table (used to display the search results) and returns:
- the column headings of the af: table
- Visible property (true/false) of the columns af:table
- the actual query of the VO instance used to create the af: table
- the values of real bind variables passed to the query of the instance of VO
I would like to create a servlet which takes the parameters reruns the query and returns a report Excel/PDF file that contains exactly the same columns and same of the af records: table.
I'm a little confused on who use the code to achieve this... you kindly help me?
I did a similar qustion here
but then I guessed that it was preferable to create a new thread.Thank you
Federico
For this, you can use this type of code
Context LocaleContext = _adfTableBinding.getLocaleContext ();
for (attr AttributeDef: attributeDef) {}
Label As String = attr.getUIHelper () .getLabel (context);
_logger.info ("Attritbute name:" + attr.getName () + "column name:" + attr.getColumnName () + "Col4Query name:" + attr.getColumnNameForQuery () +)
"Name:"+ label);
}
which produces this output
Timo
Tags: Java
Similar Questions
-
How to get the column headers into an Excel report with variable width columns?
Hello:
I read this question before but I can´t open the link when I try to download the solution I get the following: status HTTP 404 the requested resource is not available.
Can someone help me with the solution? I want to just put a heading for each column (1 thermocouple, thermocouple 2, anemometer, etc.).
In advance, thank you for your help!
You may need to take some tutorials.
LabVIEW Introduction course - 3 hours
LabVIEW Introduction course - 6 hours -
The knife tool develops a black line on the objects that I colored using the live paint bucket. How to get the tool knife to stop this and instead of being invisible?
I understand that it is a live paint object you use.
Try this:
-
How to get the RGB value of a pixel in a psd document using scripting Photoshop
Hi, guys! Does anyone know how to get the RGB value of a pixel in a psd document using scripts in Photoshop? I myself have missed for a long time and could not resolve. I am very happy to hear your voice as soon as possible!
Here is an example...
var originalUnits = app.preferences.rulerUnits; app.preferences.rulerUnits = Units.PIXELS; var doc = activeDocument; var Colour1 = GetHexColour(eyeDropperRGB(1,doc.height-1)); var Colour2 = GetHexColour(eyeDropperRGB(20,doc.height-5)); var Colour3 = GetHexColour(eyeDropperRGB(40,doc.height-14)); alert("Colour 1 = " +Colour1 + "\rColour 2 = " +Colour2 + "\rColour 3 = " +Colour3); var decColour = eyeDropperRGB(40,doc.height-14); alert("Red = " +decColour[0] + "\rGreen = " +decColour[1] + "\rBlue = " +decColour[2]); app.preferences.rulerUnits = originalUnits; function GetHexColour(reqHex){ var out=''; for(No in colours = reqHex){ out = out.concat(zeroPad(d2h(reqHex[No]),2)); } return out; }; function eyeDropperRGB(x,y) { var x2 = x + 1; var y2 = y + 1; var out = new Array(3); activeDocument.selection.select([[x,y], [x2,y], [x2,y2], [x, y2]], SelectionType.REPLACE, 0, false); for(ch in list = ["Red", "Green", "Blue"]) { histogram = activeDocument.channels[list[ch]].histogram; for (i = 0; i <= 255; i++) { if (histogram[i]) { out[ch] = i; break; } } } return out; }; function d2h(d) {return d.toString(16);} function zeroPad(n, s) { n = n.toString(); while (n.length < s) n = '0' + n; return n; };
-
Hi all,
I'm sorry to ask this question because I found 2 different answers, tried without result. So before you go crazy, I prefer to ask!
Thus given mySelection = app.selection [0], how is possible to get the column's selection?
I tried app.selection [0] .parentTextFrames [0].characters.itemByRange (0, x)
with x being app.selection [0] .index.
but then I'm stuck as if I add ".textColumns", I get an error
I explored the second way using app.selection [0].textColumns.item (1).insertionPoints.item (1), but once I'm stuck again.
As a beginner I don't understand why there is no simple built-in function to call in order to obtain such a result of base
Any help would be appreciated
Thank you
Ed
Okay here goes,
For and only for the linked text frames.
// For and only for linked text frames. // Warning // The Good: This will PROBABLY work for you // The Bad :THIS IS A REALLY PRIMITIVE METHOD // The Ugly: It could fail in COUNTLESS cases // Here goes...... var mySelection, textFrame, parentPage, c; mySelection = app.selection[0]; textFrame = mySelection.parentTextFrames[0]; parentPage = textFrame.parentPage; c = 0; while(textFrame && textFrame.parentPage === parentPage){ textFrame = textFrame.previousTextFrame; c++; } alert('Column number: ' + c);
Now with regard to the issue of the image columns bound text compared to the blocks of text with multiple columns of text or span. Depends on what you're trying to achieve with your workflow.
The scripts are around written by me and others who convert multicolumn text executives to related texts related and vice versa.
If you want to know which is more appropriate you can use with your workflow, then I suggest the regular ID forum.
HTH
Trevor
-
Interactive reports using collections - how to control the column headers
Hello
I found a link on the forum somewhere that showed a step by step how to use collections with interactive reports, you can dynamically generate SQL code and also control the column headers. Does anyone know where is the manual?
Otherwise, I know how to generate dynamic SQL code, but what is the best way to control the column headers.
Sometimes, the report will have 17 columns and other times up to 30 columns.
Thank you, BillHi Bill,
You can use * & ITEMNAME.* notation for the column headers. This means that you can have elements of page/application that contains the topics you need which can, of course, be filled using PL/SQL and, thus, could be established in your code. It's a bit of pain to have to do this for each section, but I do not see a quicker method.
Andy
-
Hallo,
I have a master VO based on entities and a retail entity based VO to which JDev automatically created a link display (1 to 1 relationship).
In the request Module I programmatically access MasterVO and I would like to get the value of a field of DetailVO...
ViewObject vo = getMaster1(); RowSetIterator iterator = vo.createRowSetIterator(null); iterator.reset(); if (iterator.hasNext()) { MasterVORowImpl row = (MasterVORowImpl) iterator.next(); System.out.println(row.getField1); System.out.println(row.getField2); // ... System.out.println( <DetailVO.Field1> ); // How to...? // ... } iterator.closeRowSetIterator();
How can I achieve this?
Thank you
Federico
In MasterVORowImpl should be getter for the detail rows (if you selected "Include the accessors" option when you generated class MasterVORowImpl).
Dario
-
Hallo,
I want to hide the "magnifying glass" to a field LOV.
This is possible only by using a CSS approach like this Ashish Awasthi (Jdev/ADF) Blog: search to hide from af icon: inputListOfValues using CSS & StyleClass-Oracle ADF?
Since then, I need to calculate in a bean managed if the magnifying glass must be hidden or not... I would like to know if there is an appproach simple and clean alternative.
Thank you
Federico
Hi Federico,.
You can use the same approach, as mentioned in the blog. Just you need not set the StyleClass on the page.
In the method of bean managed when you calculate that there should be no magnifying glass, then get the reference to lov and set its styleclass (LOV.setStyleClass) and refresh the LOV.
This way you can conditionally hide and display magnifying glass.
Thank you
-
How to get the column provided out of the Oracle Data Miner?
Hi all!
I use Oracle Data Miner provided with Oracle SQL Developer to predict the loss of customers. If I plan on the table column lets say X (as a target column) of table say T, so how can I get the corresponding values under my model?
Here is the simplified model for the reference.
Thanks in advance!
Hello
Simply connect a node that accepts data to the node to apply it.
For example, if you want to create a view or table table using the prediction of outputs generated by the node to apply it, and then add a Create Table node and connect the node to apply it.
For more information, try the Oracle by example tutorials for ODMr.
You must use the node apply Publisher to revise prediction outputs models to generate as well as the additional columns to include, for example columns id.
There are a set of predictor columns added by default that may be acceptable.
THX, mark
-
How to get the value of prompt financial reports and use it as a header
Hi gurus of the Oracle,.
I have Hyperion Financial Reporting 11.1.1.3. I've created a report.
I have the Products dimension on rows. And I also fast for the products.
Let's say there are 3 products, product A, B and C, each has its own point of level 0 (for example, A1, A2, B1, C1)
Currently in my situation, user will be prompted to select a list of products, and then the report will only show the level 0 of the product selected by the user. For example, the user select product has, then the report (or grid) displays A1 and A2 on the ranks. The user select product B, B1 will be displayed.
My question is, I want to create a dynamic header report, so how can I get this prompt value and use it as a report header? For example: sale of product when the user choose the product, or sales of product B when the user choose produced B.
Thanks a lot for your answer.Hello
Here's the way to do this:
1 insert a line (can be in line 1) in the report that produced as 'ask the user.
2 always mark this as hidden line
3. the user other lines like Level0 of product online 1
4 use MEMBERALIAS in the header to use the product as dimension & row as row1It could be useful!
Published by: user8628169 on June 22, 2011 10:53
-
How to get the total line count COUNT (*) SELECT and put on a page?
Hello
I use JDeveloper 10.1.3.4. I need get the total number of rows in a table and display it on a page and the problem in doing so. At the sqlplus prompt the row count simply would be, for example:
I wonder if having this simple number must be so complicated and if there is more simple, better ways. Here's how I do it and the problem encountered.select count(*) from BILL;
1. the name of the page to display the number is summary.jspx. It has a grain of support that "summed" as the managed bean name in faces - config.xml, and the name of the bean class is "summary." The component output on the page is:
2. in summary the bean code is:<h:outputText value="#{summary.totalStudentsCount}" binding="#{summary.outputText5}" id="outputText5"/>
The idea of calling a stored function usnig as a "helper" method is 25.5.3 in the Developer's guide, which is closest to you in my need. It's for the functions with the one IN argument; but in my case, the function is not any argument IN. That's why, when you call the helper method CallStoredFunction(), I gave an empty as the last argument and amazing array that caused the problem:private Number totalStudentsCount; public static int NUMBER = Types.NUMERIC; public void setTotalStudentsCount(Number totalStudentsCount) { this.totalStudentsCount = totalStudentsCount; } public Number getTotalStudentsCount() { ZBLCModuleImpl zblcam = getZBLCModuleImpl(); LoggedInStudentImpl studentTable = (LoggedInStudentImpl)zblcam.getLoggedInStudent(); String sql = "select count(lsap_uid) from BILL"; studentTable.setQuery(sql); return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {}); } private ZBLCModuleImpl getZBLCModuleImpl() { FacesContext fc = FacesContext.getCurrentInstance(); ValueBinding vb = fc.getApplication().createValueBinding("#{data}"); BindingContext bc = (BindingContext)vb.getValue(fc); DCDataControl dc = bc.findDataControl("ZBLCModuleDataControl"); ApplicationModule am = (ApplicationModule)dc.getDataProvider(); return (ZBLCModuleImpl)am; } protected Object CallStoredFunction(int sqlReturnType, String stmt, Object[] bindVars) { CallableStatement st = null; ZBLCModuleImpl zblcam = getZBLCModuleImpl(); try { st = zblcam.getDBTransaction().createCallableStatement("begin ? := " + stmt + "; end", 0); st.registerOutParameter(1, sqlReturnType); if (bindVars != null) { for (int z = 0; z < bindVars.length; z++) { st.setObject(z + 2, bindVars[z]); } } st.executeUpdate(); return st.getObject(1); } catch (SQLException e) { throw new JboException(e); } finally { if (st != null) { try { st.close(); } catch (SQLException e) { throw new JboException(e); } } } }
3. the registered function has been tested and works fine at the sqlplus prompt:return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {});
4. when the summary.jspx page is run, the browser is full of error messages, the first long line is here (I have split several online for ease of reading):create or replace function get_total_students return NUMBER AS v_student_count NUMBER; BEGIN select count(ldap_uid) into v_student_count from bill; return v_student_count; END;
Thus,.javax.faces.el.EvaluationException: javax.faces.el.EvaluationException: Error getting property 'totalStudentsCount' from bean of type zblc.viewcontroller.backing.staff.Summary: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.sql.SQLException, msg=Missing IN or OUT parameter at index:: 2
(1) what is the problem? What is this parameter IN or OUT of {color: red} index: 2 {color} consult? It has to do with the empty array as the last argument in the call to the helper method?
(2) this approach is an overdose, and are there more simple and better ways?
Thank you very much for help!
NewmanHello
Is there a specific reason why you don't simply create read only object to display with some count (*) as OFCASES from MYTABLE and then just drag and drop the attribute ofcases in page?
Kind regards
Branislav
-
How to get the date of request for a date column
I have a requirement where I need to filter the data between two guests to date. I have only a single column of date and the date in the guests should be chosen by the calendar.
I saw may approaches to do this, and I have one where two columns of fictitious date must be declared in the repository and used to define the guests of the date.
but by using other methods I couldn't schedule option in the command prompt.
but y at - it another way to get the guests with calndar selection without set dummy columns in the repository
Thank youTry adding a column of similar date first and then edit the formula in the column
-
Hi, I tried to figure out how to extract data from my SQL Server databases and reading messages and to do some tests with examples, I can get data connection type in my SQL server, but so far nothing helps. Is it possible to get data from a SQL Server database without using the database connectivity Toolkit? and if so, how? are there whitepapers and/or examples of this? So far, I can't find something that works. Thank you.
Jesse - what is your reason for not using the database connectivity Toolkit? It is by far the best way to recover the data.
-
Hallo,
I have a VO that selects records from a table databace where FkId = < value >.
For example: this is the database table...
ID RowDetNumber OtherFields FkId
1 3 1 ...
2 3 2 ...
3 3 3 ...
4 3 4 ...
5 4 1 ... |
6 4 2 ... | -VO selects these records (where FkId = 4 for example)
7 4 3 ... |
8 5 1 ...
9 5 2 ...
When a new record is created the field RowDetNumber must be calculated with the logic of the max (RowDetNumber) + 1.
So for the example above, the calculated value should be 3 + 1 = 4.
I would like to know how I can calculate the value and assign to the RowDetNumber attribute.
I did some experiments using a Groovy expression as a default value for the field, but I got only errors.
I'm a bit confused on how I can do so a few details / examples / tips are welcome
In particular, a small example for every possible approach would be happy.
Thank you
Federico
Federico, the solution mentioned in the block will work as it only generates unique numbers without guarantee that the generated numbers are without flaw. However, if you want to use max + 1 this normally means you want to have a sequence without gap. It is very very complicated in nature. It doesn't matter what application you're trying, there is almost always room for error, ending with duplicate numbers.
The trigger also works as the DB supports triggers on MS SQL.
If you don't need a number of gap-less for the attribute, you can use the groovy solution and just get a number of a sequence is is guaranteed unique and greater value, like the last number that you asked of the sequence. In this way, you can have the sorted records
ID RowDetNumber OtherFields FkId
1 3 1 ...
2 3 7 ...
3 3 9 ...
4 3 10 ...
5 4 3 ... |
6 4 5 ... | -VO selects these records (where FkId = 4 for example)
7 4 12 ... |
8 5 4 ...
9 5 6 ...
Timo
-
Hallo,
I would like to not display the asterisk in front of the label of the fields...
... so I set for all areas of the ShowRequired property to false.
I do not understand why the asterisk continues to display...
I have to set another property somewhere?
Thank you
Federico
Check the documentation for the showRequired property (jdev or online: ADF RichClient API - ).
As a workaround, you can put af:inputText in af:panelLabelAndMessage component and set simple = "true" to hide the label.
Dario
Maybe you are looking for
-
By icons in my toolbar, I had links to several Web sites such as my e-mail address, bank accounts and several other Web sites...
-
Satellite L850 - after 1 year of use battery runs out quickly
Hi, through programs such as care or battery battery I see a Toshiba Satellite L850 * 48% battery wear * currently. I notice that a game, the battery runs out quickly, as the warm up by many things and often descalibra and behaves erratically. The la
-
How to restore the Satellite L300 PSLB8E to factory settings?
I have problems with repeated "crash" of my system.I get the dreaded blue page, which then restarts (usually) pretty quickly. I think trying the option 'Restore factory settings', but I've never done this before.If I do, which will leave it on my com
-
HP officejet 4630: HP officejet 4630 does not print
My printer is not printing. When I try to print now come but it dose not print. I tried to print from 2 computers and same problem. Also tried turing the printer works but the problem persists.
-
is the only way to update word on my Mac to buy an expensive 2016 update?
I have an older version of Word I have to spend a lot of money to update?