How to set current row in table after use tab key on inputText
Hello all,
My first post .., I'm newbie in ADF and I will try to explain my problem.
For the moment we use ADF 11g (11.1.1.4), in a jsff page I have a table with an inputText column.
On the valueChangeListener of the inputText, I invoke a method in a viewScope bean which call an EJB method, make some services in the EJB on the line modified. After that I refresh the VO and the table (because others values on the line have been modified) and reset the focus on the same inputText modified by the user with javaScript because focus was lost after refresh.
So far, everything works fine.
When I use the arrow keys to change the selected row in the table, it's work fine (focus is still in the next or previous inputText), but if user try to use tab key to change the current line, the inputText on the next line have the focus but the current row of the table is not changed (I think it's normal).
My question : how can I change the current row after tab key pressed in this case ?
I don't know if it's really clear, not easy to explain, don't hesitate to ask more details.
Thanks in advance.
Frank Nimphius wrote:
Hi,
My question : how can I change the current row after tab key pressed in this case ?
Use a client event to listen for the keyboard entry and intercept the tab. The use af:serverListener to call the server to set the rowKey on the table and issue a PPR for the table to re-paint
See sample 11 on http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html#CodeCornerSamples
to learn about how to use the client listener and server listener
FrankHi,
Thanks a lot for your advices, I used the client and server listener
I used this code on the method call in order to change the selection after key tab pressed, I don't know if it can be easier, but it works.
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("START changeSelectedRow");
RowKeySet oldRowKeySet = myTable.getSelectedRowKeys(); // get oldRowKeySet
if (oldRowKeySet == null) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("oldRowKeySet is null");
return;
RowKeySetImpl newRowKeySet = new RowKeySetImpl(); // The new RowKeySet use to change the selectedRow
DCIteratorBinding bindingIterator = ADFUtils.findIterator(MY_ITERATOR);
bindingIterator.setRangeSize(-1);
// set the new index of the current row.
int index = bindingIterator.getCurrentRowIndexInRange();
if (index < bindingIterator.getAllRowsInRange().length - 1) {
index++;
bindingIterator.setCurrentRowIndexInRange(index);
// get the current row after changed the index
Row currentRow = bindingIterator.getCurrentRow();
if (currentRow != null) {
ArrayList nextLst = new ArrayList(1);
nextLst.add(currentRow.getKey());
newRowKeySet.add(nextLst);
// set the new selectedRow
myTable.setSelectedRowKeys(newRowKeySet);
SelectionEvent selectionEvent = new SelectionEvent(oldRowKeySet, newRowKeySet, myTable);
selectionEvent.queue();
AdfFacesContext.getCurrentInstance().addPartialTarget(myTable);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("END changeSelectedRow");
Best Regards
Benjamin
Similar Messages
-
Access table cells using tab key with iterators
Hi,
I use a tableview with iterator and allow users to mouseclick certain column cells. I capture these user interactions using server event "onCellClick". But I cannot access these cells using tab key instead of mouse click. But tab key is a must for visibly challenged users. Is there any way to access table cells using tab keys (with iterators)?
I use icons in those cells to replace check box and change the icons to differentiate checked/unchecked status.Hi Craig,
Thanks for your effort.
But I was able to solve my problem. I don't think I gave all the information to simulate my problem in your environment. I used images in certain table cells and was not able to access those cells using tab key or access key. Tag <b><img></b> doesn't have the attributes <b>tabindex</b> and <b>access key</b>.
I solved the problem by surrounding the <b><img></b> by anchor tag <<b>A>,</b> which has both attributes. I did these changes within the iterator method <b>RENDER_CELL_START</b> using CL_BSP_BEE_TABLE.
In the event handling, I had to do separate processing for mouse click event and key press event for those cells.
For visibly challenged users:
They can access those cells by tab key or access key and the key press event is used to capture when they hit enter key.
So this problem is irrelevant to service packages (SP38,..). -
How to set current row in calendar
Hi All,
I am implementing ADF calendar using ADF faces. When i click on any activity the current row selected is not being displayed. Instead it always points to the last row of the VO.
How to i explicitly set the current row to the selected row.(this can be declaratively achieved in tables selectedRow property)
Thanks
Sandeep.GUse the following code to default the calender date to today's.
public void initializeSearchFormData()
String methodName = "initializeSearchFormData()";
_logger.entering(CLAZZ_NAME, methodName);
MapDataSearchFormVOImpl searchDataVO = getMapDataSearchForm();
// only create if we don't have any rows yet
if (searchDataVO.getEstimatedRowCount() == 0)
_logger.logp(Level.FINEST, CLAZZ_NAME, methodName,
"Creating new row for MapDataSearchFormVOImpl.");
MapDataSearchFormVORowImpl newRow =
(MapDataSearchFormVORowImpl) searchDataVO.createRow();
newRow.setSELECT_DATE(DateTimeUtil.singleton().getCurrentJboDate());
searchDataVO.clearCache();
searchDataVO.insertRow(newRow);
searchDataVO.setCurrentRow(newRow);
* Container's getter for MapDataSearchForm.
* @return MapDataSearchForm
public MapDataSearchFormVOImpl getMapDataSearchForm()
return (MapDataSearchFormVOImpl) findViewObject("YOUR VO NAME");
_logger.exiting(CLAZZ_NAME, methodName);
}Regards,
Kiran Konjeti -
How to identify current row in table from selectOneChoice compact mode
Hi,
I have an af:table in which one of the columns is selectOneChoice in compact mode. Upon selecting item in this selectOneChoice, valueChangeListener is triggered and do some work based on that row. However, my issue is that it's hard to identify the current row since the selectOneChoice is in compact mode. If the selectOneChoice is not in compact mode, when user selects item in selectOnechoice, selectionListener of af:table is triggered to identify the current row. But if selectOneChoice is in compact mode, user is able to select from selectOneChoice and valueChangeListener is triggered before selectionListener of af:table is triggered. Hence, not able to identify current row.
As a not so ideal workaround, I tried to put the row identifier (in my case, it's DetailSeq) in shortDesc, and get it from there. But users is complaining seeing this not user friendly in shortDesc/hintText. I tried to put DetailSeq as the id of the selectOneChoice, but it didn't work (Cannot get Id of selectOneChoice in table)
<af:table>
<af:column headerText="Action" id="c5" width="30">
<af:selectOneChoice id="a${row.DetailSeq}" autoSubmit="true" valueChangeListener="#{viewScope.backing_requestOverview.onSelectAction}" label="Action" mode="compact" shortDesc="#{row.DetailSeq}">
<f:selectItems value="#{backing_requestOverview.requestActionsMap[row.StatusUid]}" id="si333"/>
</af:selectOneChoice>
</af:column>
</af:table>
In the valueChangeListener:
public void onSelectAction(ValueChangeEvent valueChangeEvent) {
RichSelectOneChoice actionChoice = (RichSelectOneChoice)valueChangeEvent.getComponent();
LOGGER.info("Short Desc: " + actionChoice.getShortDesc());
LOGGER.info("Component Id: " + actionChoice.getId());
Any advice?
Thanks
-MinaHi,
what about using an f:attribute tag to add the "DetailSeq" to the component. Should work similar to the shortDesc but is invisible. You can then get this attribute value by its name among the component attributes
Frank -
How to get current row data in table control
Hi , expert ,
I am professional in oracle , but now I am a new guy in SAP ABAP .
I have a question in UI
How to get current row data and click pushbutton in table control to open next screen ?
I want to get the current data and open next screen to carry out detail detail .
Thansk for all your suggestion .GET CURSOR LINE SY-CUROW .
READ TABLE internal_table index SY-CUROW. -
LOV switcher and set current Row
Hi
I have a LOV switcher attached to one of the columns in the view object.
It works fine while switching the LOV's in mostly all conditions.
But its failing for one case.
We are using checkboxex to select a row , and do a operation in the row.
To do this, the button on which the operation is performed ...
1)we have checked which row has the transient value of check box as checked
2) Set the current row of the iterator to the row that comes from the selected check box index..
3) Called the operation.
But as the code go to step two and the current row is set to the required row, all the LOV 's in all the rows start showing the Default LOV which is selected in the LOV switcher, if i do a f5 fr the page, the original values are restored.
Also if the VO fecth size is 25 , it gives wrong value for 25 rows, if i scroll through the table again it automatically shows the correct value.
This has been taking a lot of out time to debug the issue.
I guess its somethng to do with LOV switcher , set current row and the table getting refreshed incorrectly on set current rowHi Timo ,
Thanks fr the reply..
Jdev 11.1.1.4
Code for checkbox selection
DCBindingContainer dcbindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding iterator =
dcbindings.findIteratorBinding(iteratorName);
Row[] rowSet = iterator.getAllRowsInRange();
Integer selectCount = 0;
for (Row row : rowSet) {
Object selAtt = row.getAttribute(selectAttribName);
if (selAtt != null && (Boolean)selAtt == true) {
System.out.println("Row selected");
selectCount++;
if (selectCount > 1) {
System.out.println("More than one row selected!");
throw new ValidationException("More than one row selected");
else{
iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
} else {System.out.println("Row not selected");}
I actually sorted the issue out
had to write
iterator.refresh(Row.REFRESH_CONTAINEES); after iterator.setCurrentRowWithKey(row.getKey().toStringFormat(true));
But not sure if thts correct ... -
Sql report, How to access current rows 6 columns data
I have one page having page items & SQL report having 8 columns.
First column of report is a link for editing.
on clicking first column, that record gets displayed on page items, which are opn same page.
Now my problem is i have used link column of report and set 3 page items value on click of link column.\
But i need to set values for 2 more page items.
I tried to create computation & process but not working. i am confused about which process point to select & whether onclick page gets submitted or not.
I tried to write jscript but not succeeded. I dont know how to get current row id in jscript & different column values of current rowid.
any help.Hi,
Thanks for reply.
in 5 items, first three are numeric and last two are timestamp fromtime, totime.
as I mentioned earlier if i interchange 4 & 5 items i.e. now ITEM4 is totime & ITEM5 is fromtime
and their values. I get value for totime & not for fromtime. all records contain values for all 5 columns. no null.
So basically their is no problem in value or data, The only problem is whatever sequence is maintained first 4 items get value & 5th item remains blenk.
Either I type all 5 ITEM NAMES in one Item name-value pair of link or use all three pairs, 5th ITEM remain blank. -
How to set border lines in table and also in template in the smartforms ?
How to set border lines in table and also in template in the smartforms ?
As I have to create table with following detals
total row = 3
row1 = 3 column
row2 = 6 column
row3 = 9 column
for 2nd and 3rd row data to be fetched using coding.
so can anybody explain me what should i use
Table or Template ?
and I want the border like excel format.
Can anybody suggest me ?
Thanks
nareshif the data is multiple i.e. line items choose table.
if the data is single i.e. fixed choose template.
Create table
> Draw u r no lines
> choose option select pattern
> select display framed patterns
Choose u r required one.
out lined, or full lined. u can choose option.
same procedure to be followed for template also.
with regards,
Kiran.G -
How to set current year,month as default value in combo box
hi, im newbie of xcelsius user
i realize that hv a issue that display combo box base on year & month
let said
<b><u>step 1</u></b>
I create excel data like this
<b><u>year___ </u> </b> | <u><b>month_ </b></u> | <u><b>Product</b></u> | <u><b>revenue</b></u>
02-04-09 | 02-04-09 | a | $4,154
03-04-09 | 03-04-09 | b | $6,813
04-05-09 | 04-05-09 | a | $9,875
05-06-09 | 05-06-09 | b | $6,813
06-04-10 | 06-04-10 | a | $6,813
07-04-10 | 07-04-10 | b | $9,875
08-06-10 | 08-06-10 | a | $9,875
22-06-10 | 22-06-10 | b | $6,813
<u><b>Step2</b></u>
Then i go format cell to format/custom date to year & month
Eg1: Year u2013> 02-04-09 convert to u2018YYYYu2019 (2009)
Eg2: Month u2013> 02-04-09 convert to u2018mmmmu2019 (April)
So output like this
<u><b>year</b></u> | <u><b>month</b></u> | <u><b>Product</b></u> | <u><b>revenue </b></u>
2009 | April | a | $4,154
2009 | April | b | $6,813
2009 | May | a | $9,875
2009 | June | b | $6,813
2010 | April | a | $6,813
2010 | April | b | $9,875
2010 | June | a | $9,875
2010 | June | b | $6,813
But the problem is when i insert to combo box,use u201Cfilter Row u201D, i excpectation will display only 2009,2010
But Actual display the Year in combo box is duplicated :'(
so any solution ? and then only how to set current year & month as default value :'(
thanks,
regards
s1
Edited by: Leong Pui Kee on Feb 25, 2011 5:25 AM
Edited by: Leong Pui Kee on Feb 25, 2011 5:36 AMhi,
your created data
step 1
I create excel data like this
year___ | month_ | Product | revenue
02-04-09 | 02-04-09 | a | $4,154
03-04-09 | 03-04-09 | b | $6,813
04-05-09 | 04-05-09 | a | $9,875
05-06-09 | 05-06-09 | b | $6,813
06-04-10 | 06-04-10 | a | $6,813
07-04-10 | 07-04-10 | b | $9,875
08-06-10 | 08-06-10 | a | $9,875
22-06-10 | 22-06-10 | b | $6,813
In this, year and month both are same data, make the diffent data like year 2009, 2010 And month Jan, Feb, March, ...Etc
and also one more check you formulas on month and year, select correct source data, destination data for compoonent..
OR
from above, to create a date column and convert date-->year, date--> month and Explore it.
All the best,
Praveen -
How to get Current row of ViewObject in the DoDML methode
Hi all
I have two ViewObject EmplyesView and DeptView
How to get Current row of ViewObject DeptView in the DoDML methode of EmplyesViewOK, we can play this game on and on...
I'll ask for a use case (http://en.wikipedia.org/wiki/Use_case) and you don't give any info we don't already know. After an other 10 posts we probably know what you real problem is and can give you the advice which you could have gotten in the fist place.
So please take some time and describe the problem as if you would ask your mother for help. Tell us how the data model is build and how the VO are related. Is there any input from an user involved? Which information from the other view do you need? How do you get to the doDML method? Is there a button in the ui involved?
Timo -
How to get all rows in table to red using alternate rows properties option
How to get all rows in table to red using alternate rows properties option
Hi Khrisna,
You can get all rows red by selecting the color red in the "Color" and "frequency" to 1 under the "Alternate Row/Column colors".
I tried doing it and the colors freaked me out (all red) :-D
Kindly tell me if im missing something.
Regards,
John Vincent -
How to add empty rows in table in smart form
how to add empty rows in table in smart form?
plz help me regarding this
send me ur queries to [email protected]You will need to add some extra rows to the internal table that your table is displaying. Use a program node to append additional rows with a key but no argument.
Alternaively a template may me more suitable for your requirement than a table.
Finally, please do not include you e-mail address in your question. Your question and the answers provided to it are for the benefit of everyone in the Community.
Regards,
Nick -
How to update duplicate row from table
Hi,
how to update duplicate row from table?
First to find duplicate row then update duplicate row with no to that duplicate row in oracle.
can you give me suggestion on it?
Thanks in advance.
your early response is appreciated...In order to find a duplicate row, see:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1224636375004
(or search this forum, your question has been asked before)
In order to update it, just create and use an Oracle sequence, have it start and increment at a value that doesn't exist in your table.
If that doesn't get you going, post some CREATE TABLE + INSERT INTO statements, and the results you want from them, in other words: a complete testcase. -
How to set special rows in jtable not selectable
Hello programmers,
anybody knows how to set special rows(p.E. row 0) in jtable not selectable.
in advance thanks for your answerstable = new JTable(...)
public void changeSelection(int row, int column, boolean toggle, boolean extend)
if (row == 0)
return;
else
super.changeSelection(row, column, toggle, extend);
}; -
After shirring Blu-ray does not want to read disk. If it's setting, how to setting correctly.
This happened after update.
Final Cut Pro X 10.1.1 & Mac Pro 10.9.2Just refuse to open.
Player show me first page (background) & refuse to open.
Thanks. Greg.
Maybe you are looking for
-
Transaction code for SAP query reports
Hi All, I am trying to create transaction code for sap query report but couldn't go further. 1) Created User group in SQ03 2) Created infoset in SQ03 and assigned that to the user group 3) Created query in SQ01 using the infoset. I executed the repor
-
I just bought this and was trying to load it for the first time and the circular icon just keeps flashing like it is trying to load and can't. Most elements come up but I am wondering why it is still flashing like it is trying to load. At times, the
-
How can I get iTunes to play more than one song before stopping?
When I click on a song listed in iTunes, iTunes plays it and then stops. How can I get it to continue and play the next song, and then the next.. Thanks
-
Menu Bar Buttons in PSE6 (Mac)
Immediately below the menu bar is a small collection of buttons (New, Browse, Save, Undo, Redo and Help). Visit the pulldown menus and as expected, common commands have a keyboard shortcut and some have an icon (eg Open, Print, Copy). The latter sugg
-
Hi We've been struggling with this issue for a while and were wondering if anyone has had similar exp's. reading this group and other weblogic ones I see that entity bean instance counts have been(sic) causing problems however we are having similar p