This content has been marked as final. Show 26 replies
Here is myproject : http://failiem.lv/u/txdpcrh
And here are code of my db table's territories (TERITORIJAS_STATUSS) and clones(KLONU_DATI):
CREATE TABLE "DB_091RDB106"."TERITORIJAS_STATUSS" ( "TER_ID" NUMBER, "TERITORIJA" VARCHAR2(30 BYTE), PRIMARY KEY ("TER_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TT_091RDB106" ENABLE )
and for table where values are saved:
CREATE TABLE "DB_091RDB106"."KLONU_DATI" ( "KLONU_PK" NUMBER, "STAD_MAT_TIPS" VARCHAR2(30 BYTE), "BIOLOG_VEC" VARCHAR2(30 BYTE), "POTZ_VEC" NUMBER(8,2), "POTEJ_VEC" NUMBER(8,2), "KLONI" NUMBER, "ATKART_SKAITS" NUMBER, "IDENTIF" VARCHAR2(30 BYTE), PRIMARY KEY ("KLONU_PK") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "TT_091RDB106" ENABLE )
I will be very gratefull to you Amesh :)
CREATE TABLE "DB_091RDB106"."KLONI_TERITORIJA" ( "K_ID" NUMBER, "T_ID" NUMBER, CONSTRAINT "KLONI_TERITORIJA_KLONU_DA_FK1" FOREIGN KEY ("K_ID") REFERENCES "DB_091RDB106"."KLONU_DATI" ("KLONU_PK") ENABLE, CONSTRAINT "KLONI_TERITORIJA_TERITORI_FK1" FOREIGN KEY ("T_ID") REFERENCES "DB_091RDB106"."TERITORIJAS_STATUSS" ("TER_ID") ENABLE )
Your modified project code is: http://adf-use-cases.googlecode.com/files/fg.rar
Download the code and test it thoroughly. Let me know if there are any issues.
The major change was:
The iterator binding, KloniTeritorijaView2Iterator in pageDef. You were using KloniTeritorijaView1Iterator.
KloniTeritorijaView2Iterator should be used as shown in http://adf-use-cases.googlecode.com/files/iteratorbinding.png
Because the territories(TId) related to KlaunPK should be shown as selected which can be found through the view link between KlonuDatiView and KloniTeritorijaView. The iterator for this is KloniTeritorijaView2Iterator .
The same iterator reference is used in the helper.java.
Hope it clarifies the changes made.
wow men you are amazing, i would buy you a beer if we met :) )
And i have 1 more question , task:
I need saving selectmany component's multiple selected values saved in DB 1 row as string where selected values are seperated with ;
For that i will make 1 new db table where klonu_pk releated attribute will be the same KPk and 1 new row TId which type will be varchar2
But can you tell me if it is possible to do this ? and later read values from db ?
What must i change here to do this task...
Edited by: Raivis on May 14, 2012 1:55 AM
Do you want to save the selected values in SelectMany component in the same code? If yes, I think I modified that code as well..
You can test all the functionality.
1. Insert a new record.
2. Select the Territory in the selectManyList/SelectManycheckBox component. And the values are saved in the db.
3. You can retreive the values from db and see them on UI.
4. You can unselect values from SelectmanyList/SelectManyCheckBox component and on clicking will save to db.
I tested and all worked fine, but i have 2nd task to do
and for example now all is working and saving in DB like this :
C_ID | T_ID
1 | 3
1 | 6
2 | 1
But 2nd task ir that i need modifie code and save selected values in DB as string, where values are sepereted with ; or ,
C_ID | Teritories
1 | City; wood;
2 | City; Other teritory;
C_ID | Teritories
1 | 4;5;1;
2 | 1;4;9;
hope you understand what i mean with this.
If you feel it is completely answered, you can mark this thread as answered to the replies and close this thread.
And post your new question in a separate thread, as this thread is going too long.
Edited by: umesh.agarwal on May 14, 2012 3:28 AM
Edited by: umesh.agarwal on May 14, 2012 3:30 AM