Splitting rows in an iterator
Hi all,
I have an iterator binded to an arraylist having 8 items.
Is it possible to display the items in two rows i.e 4 items in first row and next 4 items in second row.
ex : value1 value2 value3 value4
value5 value6 value7 value8
In the above way??
please help.
Thanks,
Hari
Hi,
that would not be possible with panelFormLayout, because it depends on order of your data.... and panelFormLayout arranges in top down approach column wise..
Perhaps if af:panelFormLayout also allowed developers to define the stamping order then it would be more better......
see if this helps.. perhaps you need to struggle with alignment.
<af:iterator varStatus="vs" var="row">
<af:switcher facetName="#{vs.index % 4 == 0 ? 'lineBreak' : 'content'}">
<f:facet name="lineBreak">
<af:panelGroupLayout>
<br/>
<af:outputText value="#{row.value}" />
</af:panelGroupLayout>
</f:facet>
<f:facet name="content">
<af:panelGroupLayout>
<af:outputText value="#{row.value}" />
</af:panelGroupLayout>
</f:facet>
</af:switcher>
</af:iterator>
Similar Messages
-
Splitting rows at specific times (not intervals)
Greetings.
I have a data set with fields that hold start and end times for specific events. These events have unique ID's and cross multiple time intervals. I'm looking for a way to split a single row in the dataset into multiple rows with new start and end times for each relevant time interval.
The examples I've found online describe ways (using the MODEL method) to split rows based on time intervals of a fixed length (24 hours, for example) but I'm looking for a way to split the records at a specific time (at 6am and 6pm.)
So this record set:
<tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE
_ ID __________ Start_date __________ End Date _____
1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 19:32:27
1228327 __ 21-NOV-11 14:53:24 __ 22-NOV-11 03:46:06
1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
1183267 __ 25-SEP-11 16:09:13 __ 27-SEP-11 04:38:11</tt>
Would become:
<tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE MODEL...
_ ID __________ Start_date __________ End Date _____
1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 18:00:00
1228322 __ 21-NOV-11 18:00:00 __ 21-NOV-11 19:32:27
1228327 __ 21-NOV-11 14:53:24 __ 21-NOV-11 18:00:00
1228327 __ 21-NOV-11 18:00:00 __ 22-NOV-11 03:46:06
1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
1183267 __ 25-SEP-11 16:09:13 __ 25-SEP-11 18:00:00
1183267 __ 25-SEP-11 18:00:00 __ 26-SEP-11 06:00:00
1183267 __ 26-SEP-11 06:00:00 __ 26-SEP-11 18:00:00
1183267 __ 26-SEP-11 18:00:00 __ 27-SEP-11 04:38:11</tt>
Notice that record 1183267 starts in one interval, crosses two whole intervals and ends in a fourth. This splitting of one event into many is required to create a record set that will guarantee a record for each of the relevant intervals.
Thanks in advance for your consideration!SonyDADCuser wrote:
Greetings.
I have a data set with fields that hold start and end times for specific events. These events have unique ID's and cross multiple time intervals. I'm looking for a way to split a single row in the dataset into multiple rows with new start and end times for each relevant time interval.
The examples I've found online describe ways (using the MODEL method) to split rows based on time intervals of a fixed length (24 hours, for example) but I'm looking for a way to split the records at a specific time (at 6am and 6pm.)
So this record set:
<tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE
_ ID __________ Start_date __________ End Date _____
1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 19:32:27
1228327 __ 21-NOV-11 14:53:24 __ 22-NOV-11 03:46:06
1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
1183267 __ 25-SEP-11 16:09:13 __ 27-SEP-11 04:38:11</tt>
Would become:
<tt>SELECT ID, START_DATE, END_DATE FROM EVENTTABLE MODEL...
_ ID __________ Start_date __________ End Date _____
1228322 __ 21-NOV-11 17:51:29 __ 21-NOV-11 18:00:00
1228322 __ 21-NOV-11 18:00:00 __ 21-NOV-11 19:32:27
1228327 __ 21-NOV-11 14:53:24 __ 21-NOV-11 18:00:00
1228327 __ 21-NOV-11 18:00:00 __ 22-NOV-11 03:46:06
1228334 __ 21-NOV-11 03:32:53 __ 21-NOV-11 05:13:13
1183267 __ 25-SEP-11 16:09:13 __ 25-SEP-11 18:00:00
1183267 __ 25-SEP-11 18:00:00 __ 26-SEP-11 06:00:00
1183267 __ 26-SEP-11 06:00:00 __ 26-SEP-11 18:00:00
1183267 __ 26-SEP-11 18:00:00 __ 27-SEP-11 04:38:11</tt>
Notice that record 1183267 starts in one interval, crosses two whole intervals and ends in a fourth. This splitting of one event into many is required to create a record set that will guarantee a record for each of the relevant intervals.
Thanks in advance for your consideration!Neat problem.
This assumes you have a reasonably recent version of Oracle, and i only tested it for your "complex" case spanning multiple days because i didn't want to type out a bunch of sample data. Should work on all your data sets though (i always say this when i do incomplete testing :).
with
time_data as
select
1 as col1
, to_date('25-sep-2011 16:09:13', 'dd-mon-yyyy hh24:mi:ss') as start_date
, to_date('27-sep-2011 4:38:11', 'dd-mon-yyyy hh24:mi:ss') as end_date
from dual
select *
from
select
col1
, greatest
trunc(t.start_date, 'dd') - interval '6' hour + (interval '12' hour * m.column_value)
, t.start_date
) as start_date
, least
trunc(t.start_date, 'dd') + interval '6' hour + (interval '12' hour * m.column_value)
, t.end_date
) as end_date
from time_data t,
table(cast(multiset(select level from dual connect by level <= ceil(end_date - start_date) * 2) as sys.odcinumberlist)) m
where start_date < end_date; -
Parallely Insert Multiple Rows into an Iterator
Hi,
I'm facing a scenario where I have to enter data into multiple rows of an iterator in parallel, where each row is represented as an af:panelFormLayout on the UI, the number of rows being determined at runtime, by user input. I've got a java-based solution with af:forEach and an ArrayList and a HashMap, but I'm wondering, is there any way to do this only with create operation and EL reference(perhaps directly to the row attributes themselves)?
I'd be really grateful for any guidance. I've been stuck with this for the last week now.
Regards,
DebojitHi,
use an editable table if you can. If you can't then a possible solution is to
- create an editable table
- change af:table to af:iterator
- use panelFormLayout to align entry fields (remove columns)
Frank
Ps.: Note that it wont allow you to create multiple new rows (unless you disable required field validation). However, you can create new rows using the createInsert operation -
How to PPR a row in af:iterator
We have an af:iterator component that adds rows of components at run time. Each row includes a progress bar(af:progressIndicator), which we need to update periodically. So we do PPR for the panel (af:panelGroupLayout) that contains the af:iterator. That works. However, if it is possible to do PPR for specific row of iterator, then that will be more efficient. Is it possible to do PPR for a row in af:iterator?
Thanks for your reply. I got the iterator child component (UIXIterator) of the panel group layout, and hoped that UIXIterator#getChildren will return the component for the child rows. However, UIXIterator#getChildren always returns 1 child (panel group layout specified at design time), instead of multiple children representing the child rows. So I could not get hold of the child row and PPR on it. Thanks.
-
How to get first row from view iterator programatically?
Hi All,
I am using Jdeveloper 11g Release 2.
I want to fetch the first row of a view iterator in a bean. Can any one guide me through this use case.
Any help will be highly appreciated.
Thanks ... Best Regards
BilalUse the code snippet as below:
*// 1. Access the binding container*
DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
*// 2. Find a named iterator binding*
DCIteratorBinding iter = (DCIteratorBinding)bc.findIteratorBinding("<ITERATOR_NAME>");
*//3. Get the RowSetIterator Object*
RowSetIterator rsi = iter.getRowSetIterator();
*//4. Get the First Row*
Row firstRow = rsi.first();
Thanks,
Navaneeth -
Change the current row in an iterator and reflect the change on page
Hi there,
I have a jspx with a creation form created as usual draging and droping the data control. In same page, I inserted a commandButton which ActionListener executes a method in a managed bean called validate(). Through such a method what Im trying to do is to fill the form with data from specified entry of the database if certain condition is true. I know it is kinda twisted but unfortunately is the requirement for the page.
So basically in "validate" method, if the condition I mentioned is reached, I do the following:
// execute a Rollback (included in Page Definition) in order to cancel the previous auto-invoked "Create".
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
BindingContainer bindings =(BindingContainer)app.getVariableResolver().resolveVariable(context,"bindings");
OperationBinding opBinding = bindings.getOperationBinding("Rollback");
opBinding .execute();
//get the iterator and asociated VO from the binding container
ValueBinding vb = app.createValueBinding("#{bindings.AccountsVOIterator}");
DCIteratorBinding dciter = (DCIteratorBinding) vb.getValue(FacesContext.getCurrentInstance());
ViewObject view = dciter.getViewObject();
//and set the current row with the specified entry I have mentioned above.
Object keyValues[] = new Object[2];
keyValues[0] = "1"; keyValues[1] = "98543";
Row[] row = view.findByKey(new Key(keyValues),1);
AccountsVpnVORowImpl client = (AccountsVpnVORowImpl)row[0];
view.setCurrentRow(client);
view.executeQuery();
dciter.setCurrentRowWithKey(client.getKey().toStringFormat(true));
dciter.executeQuery();
opBinding = bindings.getOperationBinding("Execute");
opBinding.execute();
All this works perfectly when I debbug it but I cannot see the changes in the page(even refreshing browser). I need that when such a condition is met, the creation form turns into a modify-specific entry form, filling all fields with the specific data in order user can modify it, and all in the same page.
Any clue?
Thanks so much in advance for your time.Hi,
I could see the problem with call to executeQuery and execute methods at the end of your method which re-sets the current row.
Once you set the current row you should not call execute or executequery methods. Try removing those calls and also make sure that you have added partialTriggers property on the table is set to commandbutton id and partialSubmit property is set to true on commandButton to refresh the table partially on click of a button
Sireesha -
Split Rows in to another set as columns in sql ?
Hi,
I have a sample data..
Id
ENAME
GRADE
1
MILLER
2
2
CLARK
4
3
KING
7
4
ADAMS
5
5
FORD
1
6
JAMES
6
7
MARTIN
10
8
ALLEN
3
9
BLAKE
8
10
REDDY
1
I would like to split 5 rows in to another column set like this..
Id
ENAME
GRADE
Id1
ENAME1
GRADE1
1
MILLER
2
6
JAMES
6
2
CLARK
4
7
MARTIN
10
3
KING
7
8
ALLEN
3
4
ADAMS
5
9
BLAKE
8
5
FORD
1
10
REDDY
1
Please help me on this.
Thank you.You may be much better doing this at front end
But if you want to implement it in sql server this is the way to go
SELECT MAX(CASE WHEN GrpNo = 0 THEN Id END) AS Id,
MAX(CASE WHEN GrpNo = 0 THEN Ename END) AS ENAME,
MAX(CASE WHEN GrpNo = 0 THEN Grade END) AS Grade,
MAX(CASE WHEN GrpNo = 1 THEN Id END) AS Id1,
MAX(CASE WHEN GrpNo = 1 THEN Ename END) AS ENAME1,
MAX(CASE WHEN GrpNo = 1 THEN Grade END) AS Grade1,
MAX(CASE WHEN GrpNo = 2 THEN Id END) AS Id2,
MAX(CASE WHEN GrpNo = 2 THEN Ename END) AS ENAME2,
MAX(CASE WHEN GrpNo = 2 THEN Grade END) AS Grade2,
FROM
SELECT *,
(ROW_NUMBER() OVER (ORDER BY Id)-1)/5 AS GrpNo,
(ROW_NUMBER() OVER (ORDER BY Id)-1) % 5 AS Seq
FROM Table
)t
GROUP BY Seq
ORDER BY Seq
to make it dynamic see
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Hi All,
I need help to split a row by date.
For example.
in the two columns Effictive_start_date and effictive_end_date for the table per_all_people_f
is '01-01-2006' and '01-30-2010' respictivly for one row.
Then the resulting query should return 5 rows one for each year. and effective_end_date should be the last date of the year for each row
Thanks in advance.
Thanks\Kiran SSomething like this:
with sample_data as (select '12002' id, to_date('01-JAN-2006', 'DD-MON-YYYY') start_date, to_date('12-DEC-2010', 'DD-MON-YYYY') end_date from dual union all
select '12003' id, to_date('01-NOV-2006', 'DD-MON-YYYY') start_date, to_date('21-DEC-2009', 'DD-MON-YYYY') end_date from dual union all
select '12004' id, to_date('13-FEB-2007', 'DD-MON-YYYY') start_date, to_date('13-NOV-2008', 'DD-MON-YYYY') end_date from dual union all
select '12005' id, to_date('12-AUG-2008', 'DD-MON-YYYY') start_date, to_date('21-OCT-2008', 'DD-MON-YYYY') end_date from dual),
-- end of mimicking your sample_data
dummy_years as (select add_months(start_dt, (level - 1)*12) start_dt, add_months(start_dt, level*12) end_dt
from (select trunc(min(start_date), 'yyyy') start_dt,
add_months(trunc(max(end_date), 'yyyy'), 12) end_dt
from sample_data)
connect by level < months_between(end_dt, start_dt)/12 + 1)
-- this bit generates a list of years based on the gap between the lowest and highest years present in the sample_data subquery
select sd.id,
greatest(sd.start_date, dy.start_dt) new_start_date,
least(sd.end_date, dy.end_dt-1) new_end_date
from sample_data sd,
dummy_years dy
where trunc(sd.start_date, 'yyyy') <= dy.start_dt
and add_months(trunc(sd.end_date, 'yyyy'), 12) >= dy.end_dt
order by sd.id,
new_start_date,
new_end_date;
ID NEW_START_DATE NEW_END_DATE
12002 01/JAN/06 31/DEC/06
12002 01/JAN/07 31/DEC/07
12002 01/JAN/08 31/DEC/08
12002 01/JAN/09 31/DEC/09
12002 01/JAN/10 12/DEC/10
12003 01/NOV/06 31/DEC/06
12003 01/JAN/07 31/DEC/07
12003 01/JAN/08 31/DEC/08
12003 01/JAN/09 21/DEC/09
12004 13/FEB/07 31/DEC/07
12004 01/JAN/08 13/NOV/08
12005 12/AUG/08 21/OCT/08 -
Hi,
Is it possible to Split a single row into multiple rows using SQL statements/in-built functions?
ThanksHi,
Yes, this is a type of pivot. The usual technique involves cross-joining a counter table with the data table, like this:
WITH cntr AS
SELECT LEVEL AS n
FROM dual
CONNECT BY LEVEL <= 2
SELECT n
, empno
, CASE n
WHEN 1 THEN ename
WHEN 2 THEN job
END AS txt
FROM scott.emp
CROSS JOIN cntr
WHERE deptno = 10
ORDER BY empno
, n;Results:
N EMPNO TXT
1 7782 CLARK
2 7782 MANAGER
1 7839 KING
2 7839 PRESIDENT
1 7934 MILLER
2 7934 CLERKIn Oracle 11, you can use SELECT ... UNPIVOT. -
How to persist rows in ADF iterator using JPA
I am using Jdeveloper 11g R (11.1.2.3) & weblogic 10 G
In my pages I use JSF & Facelet
When using ADF face + EJB3 session beans and JPA , how I can find the rows inserted , updated or removed from Iterator on the
page that then use persist,update or remove for related entity in EJB session beans?
Is there any pattern for that?
ThanksI would suggest adding CSS style classes. 1 for the 'good' students and 1 for the 'normal' students.
Then use the EL in like you provide but use the name of the styleclass (in the styleClass prop).
This should be added to every column value. -
SELECT value FROM lsw_epv_var_value EVV
JOIN lsw_epv E ON E.epv_id = EVV.epv_var_id
AND E.name = 'AcessoTodasRegionais'
AND EVV.EPV_VAR_VALUE_ID = (SELECT MAX(EPV_VAR_VALUE_ID) FROM LSW_EPV_VAR_VALUE EVV JOIN lsw_epv E ON E.epv_id = EVV.epv_var_id AND E.name = 'AcessoTodasRegionais' WHERE EFFECTIVE_ON <= SYSDATE)
The result of the query above is
tw_admins_internal,Diretoria de Negocios Nacional,Administradores Teamworks
As you can see, the result is split by commas, I need to convert this result in many rows like below
tw_admins_internal
Diretoria de Negocios Nacional
Administradores Teamworks
How could I do that?
ThanksHi,
/* How to Split a Delimited String
This shows how to take a single row with a delimited string, such as
Animal amoeba,bat,cedusa,dodo
and transform it into multiple rows:
Animal 1 amoeba
Animal 2 bat
Animal 3 cedusa
Animal 4 dodo
PROMPT ========== -1. sep_char parameter ==========
VARIABLE sep_char VARCHAR2 (10)
EXECUTE :sep_char := ',';
SELECT :sep_char AS sep_char
FROM dual;
PROMPT ========== 0. string_test table ==========
DROP TABLE string_test;
CREATE TABLE string_test
( grp_name VARCHAR2 (10)
, list_txt VARCHAR2 (50)
INSERT INTO string_test (grp_name, list_txt) VALUES ('Animal', 'amoeba,bat,cedusa,dodo');
INSERT INTO string_test (grp_name, list_txt) VALUES ('Date', '15-Oct-1582,16-Oct-2008');
INSERT INTO string_test (grp_name, list_txt) VALUES ('Nothing', NULL);
INSERT INTO string_test (grp_name, list_txt) VALUES ('Place', 'New York');
INSERT INTO string_test (grp_name, list_txt) VALUES ('Skip', 'Hop,,Jump');
SELECT *
FROM string_test
ORDER BY grp_name;
PROMPT ========== Q1. Oracle 11 Query ==========
WITH cntr AS -- Requires Oracle 9
( -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
SELECT LEVEL AS n -- Requires Oracle 9
FROM dual
CONNECT BY LEVEL <= 1 + (
SELECT MAX ( REGEXP_COUNT (list_txt, :sep_char) ) -- Requires Oracle 11
FROM string_test
) -- End sub-query cntr, to generate n (1, 2, 3, ...)
SELECT grp_name
, n
, REGEXP_SUBSTR ( list_txt -- Requires Oracle 10
, '[^' || :sep_char || ']' -- Anything except sep_char ...
|| '+' -- ... one or more times
, 1
, n
) AS item_txt
FROM string_test
JOIN cntr -- Requires Oracle 9
ON n <= 1 + REGEXP_COUNT (list_txt, :sep_char) -- Requires Oracle 11
ORDER BY grp_name
, n;
/* Notes:
REGEXP_SUBSTR (s, '[^,]+', 1, n)
returns the n-th item in a comma-delimited list s.
If there are fewer than n items, it returns NULL.
One or more consecutive characters other than comma make an item, so
'Hop,,Jump' has two items, the second one being 'Jump'.
The sub-query cntr produces a list of integers 1, 2, 3, ..., w
where w is the worst-case (the largest number of items in any list).
This actually counts separators, not items, (e.g., it counts both
commas in 'Hop,,Jump', even though), so the w it produces may be
larger than is really necessary. No real harm is done.
PROMPT ========== Q2. Possible Problems Fixed ==========
WITH cntr AS
( -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
SELECT LEVEL AS n
FROM dual
CONNECT BY LEVEL <= 1 + (
SELECT MAX ( REGEXP_COUNT (list_txt, :sep_char) )
FROM string_test
) -- End sub-query cntr, to generate n (1, 2, 3, ...)
SELECT grp_name
, n
, REGEXP_SUBSTR ( list_txt
, '[^' || :sep_char || ']' -- Anything except sep_char ...
|| '+' -- ... one or more times
, 1
, n
) AS item_txt
FROM string_test
JOIN cntr ON n <= 1 + NVL ( REGEXP_COUNT (list_txt, :sep_char) -- Problem (1)
, 0
WHERE REGEXP_SUBSTR ( list_txt -- Problem (2)
, '[^' || :sep_char || ']' -- Anything except sep_char ...
|| '+' -- ... one or more times
, 1
, n
) IS NOT NULL
OR list_txt IS NULL -- Problems (1) and (2) together
ORDER BY grp_name
, n;
(Possible) Problems and Fixes
(1) If list_txt IS NULL, then REGEXP_COUNT (list_txt, :sep_char)
returns NULL, the join condition fails, and the output
contains nothing corresponding to the row from string_test.
If you want a NULL item to appear in the results, use
NVL to make sure the expression returns 0 instead of NULL.
(2) If list_txt contains multiple consecutive sep_chars (or if it
begins or ends with sep_char, then the original query
will return NULL items. To suppress these, add a WHERE
clause to test that the item_txt to be displayed IS NOT NULL.
PROMPT ========== Q3. Oracle 8.1 Query ===========
SELECT grp_name
, n
, SUBSTR ( list_txt
, begin_pos
, end_pos - begin_pos
) AS item_txt
FROM ( -- Begin sub-query to compute begin_pos and end_pos
SELECT grp_name
, n
, list_txt
, INSTR ( :sep_char || list_txt
, :sep_char
, 1
, n
) AS begin_pos
, INSTR ( list_txt || :sep_char
, :sep_char
, 1
, n
) AS end_pos
FROM string_test
, ( -- Begin sub-query cntr, to generate n (1, 2, 3, ...)
SELECT ROWNUM AS n
FROM all_objects
WHERE ROWNUM <= 1 + (
SELECT MAX ( LENGTH (list_txt)
- LENGTH (REPLACE (list_txt, :sep_char))
FROM string_test
) -- End sub-query cntr, to generate n (1, 2, 3, ...)
cntr
WHERE n <= 1 + ( LENGTH (list_txt)
- LENGTH (REPLACE (list_txt, :sep_char))
) -- End sub-query to compute begin_pos and end_pos
ORDER BY grp_name
, n;
/* Version-Dependent Features and Work-Arounds
The code above, Q3, runs in Oracle 8.1.
The following changes were made to Q1:
(11) REGEXP_COUNT was introduced in Oracle 11.
In earlier versions, to find the number of sep_chars in list_txt,
see how much the LENGTH changes when sep_chars are removed.
(10) REGEXP_SUBSTR was introduced in Oracle 10.
In earlier versions, use INSTR to find where the sep_chars are,
and use SUBSTR to get the sub-strings between them.
(Using this technique, 'Hop,,Jump' still contains three items,
but now item 2 IS NULL and item 3 is 'Jump'.)
(9.a) The WITH-clause was introduced in Oracle 9
In earlier versions, use in-line views.
(9.b) "CONNECT BY LEVEL < constant" doesn't work in Oracle 8.
Use ROWNUM from any sufficiently large table or view instead.
(9.c) ANSII join notation (JOIN table_name ON ...) was introduced in Oracle 9
In earlier versions, join condition go in a WHERE-clause.
*/ -
Split Rows and Store the selection
Hi all,
I have a table with a column where there is a numeric data and I developed a code that, if the user insert a number > 1 and he clicks on enter, he writes this row as many times as the number inserted.This table has not a ID that indentify the row, and if I select one or more rows and I click on Enter on numeric data I see that I lost my selection. I think because when I add new rows at my table, I make again the bind of the table, but... there is a method for to store my precedent selection (for ex. the rows that I don't want to split)?
Tks a lot.hi,
Use this code to get the index of row in which Enter is pressed.
DATA: lv_index TYPE i.
lo_el_cn_node = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
lv_index = lo_el_cn_node->get_index( ).
Now you can store this index and later after you are done with binding of more rows to the table, Set the lead selection index to lv_index.
lo_nd->set_lead_selection_index( lv_index ).
I hope it would help. -
Detecting click ( single and double) on row (displayed using iterator)
Hello All,
I am using jdev 11.1.1.6
I am displaying a list as below.
<trh:tableLayout>
<af:iterator value="#{pageFlowScope.Bean.List}" var="temp">
<trh:rowLayout>
<trh:cellFormat>
<af:outputText value="#{temp.value1}"/>
</trh:cellFormat>
<trh:cellFormat>
<af:outputText value="#{temp.value2}"/>
</trh:cellFormat>
<trh:cellFormat>
<af:outputText value="#{temp.value3}"/>
</trh:cellFormat>
<trh:cellFormat>
<af:outputText value="#{temp.value4}"/>
</trh:cellFormat>
</trh:rowLayout>
</af:iterator>
</trh:tableLayout>
My requirement is, when user clicks on a row, that row should be detected in backend and those value will be used.
My requirement is, On single click row should be detected(in backend/bean)
On double click, the values is saved(in backend/bean).
How can i detect single and double click on a particular row ?I have updated the code as below, single click and double click are getting detected on a row
<af:resource type="javascript">
function singleClick(){
alert("Single Click");
function doubleClick(){
alert("Double Click");
</af:resource>
<trh:tableLayout>
<af:iterator value="#{pageFlowScope.Bean.List}" var="temp" onclick="singleClick()" ondblclick="doubleClick()">
<trh:rowLayout>
<trh:cellFormat>
<af:outputText value="#{temp.value1}"/>
</trh:cellFormat>
<trh:cellFormat>
<af:outputText value="#{temp.value2}"/>
</trh:cellFormat>
<trh:cellFormat>
<af:outputText value="#{temp.value3}"/>
</trh:cellFormat>
<trh:cellFormat>
<af:outputText value="#{temp.value4}"/>
</trh:cellFormat>
</trh:rowLayout>
</af:iterator>
</trh:tableLayout>
Now,
suppose i have following values for some/any row,
value1=20, value2="abc", value3=009, value4="Language"
How can i retrieve these values in java script (if in backing bean then very good) -
How to stop row.setAttribute changing iterator?
Hi gang
I really could do with some help here please!
We have a data-action which creates a new row, then executes the following code:
protected void findForward(DataActionContext actionContext) throws Exception
DCBindingContainer bc = actionContext.getBindingContainer();
DCIteratorBinding iterator = bc.findIteratorBinding("ClinicalDataElementSetsView1Iterator");
HttpSession session = actionContext.getHttpServletRequest().getSession();
String cesId = session.getAttribute("CESCesId") != null ? session.getAttribute("CESCesId").toString() : null;
Row row = iterator.getCurrentRow();
row.setAttribute("CesId", cesId); // SUSPECT LINE
super.findForward(actionContext);
}When navigating to an UIX input-form which displays ClinicalDataElementSetsView1Iterator, if I comment out the SUSPECT LINE from above, the new record is correctly displayed.
However if I leave this line in, when navigating to the UIX page, the iterator is reset to the first record, not the newly created record.
How do I stop this from happening such that the new record is displayed?
Any help greatfully appreciated.
Cheers,
CM.
PS. JDev 10.1.2I could really do with some help with this one please.
-
Knowing row-count withour iterating resultset
Is there any way of knowing the
row-count of a resultset without
ever iterating the resultset?quite simply - NO.
only you can have a boolean
that can tell you whether or not
your resultset had any rows.
boolean isEmpty = true;
while(rs.next())
isEmpty = false;
}//Check for isEmpty to know whether
there was anything anywayz...
Maybe you are looking for
-
Cannot install windows, starting to get really pissed off with this PLEASE HELP
ok, i'm starting to get agitated with this. i cannot install windows XP, 2003, OR Longhorn on my machine. right now, i have the following setup: msi 865pe neo2 motherboard intel p4 3.2ghz w/HT (factory HS/Fan currently) 1 dimm of PC3200 crucial DDR40
-
how do I install adobe illustrator on my new laptop? I pay for it monthly just need it on new computer.
-
Pdf files unable to be downloaded from internet explorer
I have just purchased my first ipod nano, 4th generation. Since I have downloaded itunes to my computer I cannot view pdf files from internet explorer. I then removed itunes from the computer and pdf files could be downloaded from internet explorer.
-
Dynamic properties in a process
Hi everyone, I am trying to find a solution to create some dynamic properties in my process. JPD are good but too many things are hard-coded and changing them needs the project to be recompiled :( My aim is to remove most of the hardcoded values and
-
Image cropped during printing!
Hello, I have a tiff image that is 13 x 48 inches @ 300 dpi, that keeps getting cropped to 8 x 11 inches during printing. I do not understand what is happening. I have an Epson Stylus Photo 1400 printer. I set my paper size in the "manage custom size