How do i use Arrays and For Loops in Loading Multiple Images?
I am struggling to load a sequential array of images to appear like a moving image. So when u click the button the images load one after the other.
The code below is what i have so far, but it fails to do what i seek in that there's only one image loading which is the last image in the array, so either because the images are stacking up atop each other, or because i simply dont understand the basics...
And, i am unclear about what you said kglad, that my solution will be more complicated because i need to preload my image sequence and then use a loop to load it?
import flash.net.URLRequest;
import flash.display.Loader;
var count:int = 0;
var imageArray:Array=["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg",
"8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg"];
for(var i:uint=0;i<imageArray.length;i++){
var btn:YourButton=new YourButton();
btn.ivar=i;
addChild(btn);
btn.x=0;
btn.y=0;
btn.addEventListener(MouseEvent.CLICK,clickF);
var ldr:Loader=new Loader();
addChild(ldr);
ldr.x=20;
ldr.y=20;
function clickF(e:MouseEvent){
ldr.load(new URLRequest("D:/flash cs5.5/image_sequence/twirlSeq/"+imageArray[e.currentTarget.ivar]));
function loadComplete(e:Event){
// first process loaded image, then...
count++;
if(count < imageArray.length){
loadCurrentImage(); // load the next image
} else {
// sequencial loading complete, carry on to next activity
function loadCurrentImage(){
ldr.load(imageArray[count]);
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);
create a new fla, add btn and add the code i suggested. test.
var count:int;
var imageArray:Array=["1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7. jpg",
"8.jpg","9.jpg","10.jpg","11.jpg","12.jpg","13.jpg"];
var ldr0:Loader=new Loader();
ldr0.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);
var ldr1:Loader=new Loader();
ldr1.contentLoaderInfo.addEventListener(Event.COMPLETE,loadCompleteF);
btn.addEventListener(MouseEvent.CLICK,clickF);
function clickF(e:MouseEvent):void{
// initialize count
count=0;
// call loadF
loadF();
function loadF():void{
// add one of the loaders to the top of the displaylist and load the next image
addChild(this["ldr"+count%2])
this["ldr"+count%2].load(new URLRequest(imageArray[count]));
function loadCompleteF(e:Event):void{
// increment count
count++;
// check if the last has loaded
if(count<imageArray.length){
// if not clear the content out of the next loader.
if(this["ldr"+count%2].content){
this["ldr"+count%2].unloadAndStop();
// and call loadF so the next loader can load the next image in the array
loadF();
} else {
// if the last has loaded.
// last load completed
Similar Messages
-
How do I use an enhanced for loop / for each on my ViewObjectImpl ?
Guys and Gals,
With all of my newly acquired Java knowledge in tow, I spent this weekend cleaning up all of my code, dealing mainly with for loops. I converted them from a huge mess to a for each type loop using language such as ...
RowSet priceUpdateRows = (RowSet)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
for (Row priceUpdateRow: priceUpdateRows)
{ // do operations on row... which makes perfect sense to me. For each Row in the RowSet, do something. It doesn't, however, makes sense to the compiler. It pouts and gives me a "foreach not applicable to expression type" error. So I read up on iterators and such, messed with code examples, and still can't get the RowSet to iterate with the above code. Could I make RowSet implement Iterable? How would I do that? I tried to create a class called RowSetExt which extended RowSet and implemented Iterable, but then I got a class cast exception.
I know I could implement something like the following or a while(hasNext()) but they're really not what I'm looking for.
ViewObject vo = … < Get ViewObject > …
RowSetIterator rsi = vo.createRowSetIterator("rowsRSI");
while (rsi.hasNext())
Row row = rsi.next();
row.setAttribute("YourAttribute",your_value);
rsi.closeRowSetIterator();How do I make the for(Row row : <RowSet>) example work? Or could someone point me in a direction?
WillOne thing I tried was to make a framework extension class for my ViewObjectImpls
public class PcsViewObjectImpl
extends ViewObjectImpl
implements Iterable<Row>
Set<Row> set = new HashSet<Row>();
public Iterator<Row> getRows()
return set.iterator();
public Iterator<Row> iterator()
return getRows();
}AppModuleImpl
PriceUpdateRowsViewRowImpl priceUpdateRows = (PriceUpdateRowsViewRowImpl)((PriceUpdatesViewRowImpl) priceUpdate).getPriceUpdateRowsView();
for (Row priceUpdateRow: priceUpdateRows)
{However, this gives me a class cast exception at runtime. But I would think some kind of extension class would be the way to go ... ? -
Why use cursor and for loop?
Hi All
So in general why would we use a cursor and a for loop to do update in a stored procedure?
Why wouldnt we just use a single update statement ?
is there compelling reason for using a cursor and a for loop: I am reading some code from a co-worker that the business logic for the select (set need to be updated) is complex but the update logic is simple (just set a flag to (0 or 1 or 2 or 3 or 4).
But eventually the select come down to a key (row_id) so I re-write it using just a single sql statement.
The size of the main table is about 2.6 to 3million rows
Any thoughts on that??
The code below I just do a google for cursor for update example in case for something to play with
-Thanks for all your input
create table f (a number, b varchar2(10));
insert into f values (5,'five');
insert into f values (6,'six');
insert into f values (7,'seven');
insert into f values (8,'eight');
insert into f values (9,'nine');
commit;
create or replace procedure wco as
cursor c_f is
select a,b from f where length(b) = 5 for update;
v_a f.a%type;
v_b f.b%type;
begin
open c_f;
loop
fetch c_f into v_a, v_b;
exit when c_f%notfound;
update f set a=v_a*v_a where current of c_f;
end loop;
close c_f;
end;
exec wco;
select * from f;
drop table f;
drop procedure wco;
Joining multiple tables
create table numbers_en (
id_num number primary key,
txt_num varchar2(10)
insert into numbers_en values (1, 'one' );
insert into numbers_en values (2, 'two' );
insert into numbers_en values (3, 'three');
insert into numbers_en values (4, 'four' );
insert into numbers_en values (5, 'five' );
insert into numbers_en values (6, 'six' );
create table lang (
id_lang char(2) primary key,
txt_lang varchar2(10)
insert into lang values ('de', 'german');
insert into lang values ('fr', 'french');
insert into lang values ('it', 'italian');
create table translations (
id_num references numbers_en,
id_lang references lang,
txt_trans varchar2(10) not null
insert into translations values (1, 'de', 'eins' );
insert into translations values (1, 'fr', 'un' );
insert into translations values (2, 'it', 'duo' );
insert into translations values (3, 'de', 'drei' );
insert into translations values (3, 'it', 'tre' );
insert into translations values (4, 'it', 'quattro');
insert into translations values (6, 'de', 'sechs' );
insert into translations values (6, 'fr', 'six' );
declare
cursor cur is
select id_num,
txt_num,
id_lang,
txt_lang,
txt_trans
from numbers_en join translations using(id_num)
left join lang using(id_lang)
for update of translations.txt_trans;
rec cur%rowtype;
begin
for rec in cur loop
dbms_output.put (
to_char (rec.id_num , '999') || ' - ' ||
rpad (rec.txt_num , 10 ) || ' - ' ||
rpad(nvl(rec.txt_trans, ' '), 10 ) || ' - ' ||
rec.id_lang || ' - ' ||
rpad (rec.txt_lang , 10 )
if mod(rec.id_num,2) = 0 then
update translations set txt_trans = upper(txt_trans)
where current of cur;
dbms_output.put_line(' updated');
else
dbms_output.new_line;
end if;
end loop;
end;
/Edited by: xwo0owx on Apr 25, 2011 11:23 AMAdding my sixpence...
PL/SQL is not that different from a SQL perspective than any other SQL client language like Java or C# or C/C++. PL/SQL simply integrates the 2 languages a heck of a lot better and far more transparent than the others. But make no mistake in that PL/SQL is also a "client" language from a SQL perspective. The (internal) calls PL/SQL make to the SQL engine, are the same (driver) calls made to the SQL engine when using Java and C and the others.
So why a cursor and loops in PL/SQL? For the same reason you have cursors and loops in all these other SQL client languages. There are the occasion that you need to pull data from the SQL engine into the local language to perform some very funky and complex processing that is not possible using the SQL language.
The danger is using client cursor loop processing as the norm - always pulling rows into the client language and crunching it there. This is not very performant. And pretty much impossible to scale. Developers in this case views the SQL language as a mere I/O interface for reading and writing rows. As they would use the standard file I/O read() and write() interface calls.
Nothing could be further from the truth. SQL is a very advance and sophisticated data processing language. And it will always be faster than having to pull rows to a client language and process them there. However, SQL is not Turing complete. It is not the procedural type language that most other languages we use, are. For that reason there are things that we cannot do in SQL. And that should be the only reason for using the client language, like PL/SQL or the others, to perform row crunching using a client cursor loop. -
Using Cursor and FOR LOOP to INSERT the data into table
Hi all,
I have SELECT statement that returns 3 rows:
PROCESSNAME
PROTDATE
IMM
2013-12-18
Metrology
2013-11-18
CT
2013-12-04
SELECT processName, MAX(NVL(protStartDate, protCreateDate)) AS protDate
FROM TABLE(SEM_MATCH("{
?ipc rdf:type s:Protocol .
?ipc s:protocolNumber ?protNum .
?ipc s:protocolCreateDate ?protCreateDate .
OPTIONAL {?ipc s:protocolSchedStartDate ?protStartDate }
?ipra rdf:type s:ProcessAggregate .
?ipra s:hasProtocol ?iprot .
?iprot s:protocolNumber ?protNum .
?ipra s:processAggregateProcess ?processName.
}",sem_models("PROTS", "LINEARS"),NULL, SEM_ALIASES(SEM_ALIAS("","http://VISION/Data/SEMANTIC#"),SEM_ALIAS("s","http://VISION/DataSource/SEMANTIC#")),NULL))
Group by processName
Now I need to INSERT these values into the table along with the other values.
these other values come from different table.
INSERT INTO MODEL_CLASS_COUNTS (MODEL_NAME, CLASS_NAME, INS_COUNT, COUNT_DATETIME, PROCESS_NAME, PROT_DATE)
VALUES
("$MODEL",
"${i}",
(SELECT COUNT (DISTINCT S) FROM TABLE(SEM_MATCH(
"{?s rdf:type :${i} . }",SEM_Models("$MODEL"),NULL, SEM_ALIASES(SEM_ALIAS("","http://VISION/DataSource/SEMANTIC#")),NULL))),
SYSTIMESTAMP, %%here need to insert PROCESSNAME, PROTDATE%%
t was giving me error:
PL/SQL: ORA-22905: cannot access rows from a non-nested table item
so i enclosed sparql query into single quotes.
The code is as follows:
declare
type c_type is REF CURSOR;
cur c_type;
v_process varchar2(200);
v_pdate varchar2(200);
begin
open cur for
' SELECT processName, MAX(NVL(protStartDate, protCreateDate)) AS protDate <-- it's complaining about this being too long identifier, i think...
FROM TABLE
(SEM_MATCH (
?ipc rdf:type s:Protocol .
?ipc s:protocolNumber ?protNum .
?ipc s:protocolCreateDate ?protCreateDate .
OPTIONAL {?ipc s:protocolSchedStartDate ?protStartDate }
?ipra rdf:type s:ProcessAggregate .
?ipra s:hasProtocol ?iprot .
?iprot s:protocolNumber ?protNum .
?ipra s:processAggregateProcess ?processName.
}",SEM_Models("XCOMPASS", "XPROCESS"),NULL,
SEM_ALIASES(SEM_ALIAS("","http://VISION/Data/SEMANTIC#"),
SEM_ALIAS("s", "http://VISION/DataSource/SEMANTIC#")),NULL))
Group by processName';
loop
fetch cur into v_process, v_pdate;
exit when cur%NOTFOUND;
--here I need to insert v_process , v_pdate into my table along with other values...
dbms_output.put_line('values for process and prod_date are: ' || v_process || v_pdate );
end loop;
close cur;
end;
exit;
Now, I get an error:
ORA-00972: identifier is too long
Does anyone know way around this?Hi,
I tested something similar with insert into select and it worked fine :
insert into t_countries(ID,CITY ,POPULATION, DESCRIPTION, located, insdate )
SELECT 1 id, city, o , city||' is a nice city' description, max(nvl(locatedAt,'unknown')) as located,
SYSTIMESTAMP
FROM TABLE(SEM_MATCH(
'{GRAPH :gCH {<http://www.semwebtech.org/mondial/10/countries/CH/> :hasCity ?cityID .
?cityID :name ?city .
OPTIONAL{?cityID :locatedAt ?locatedAt .}
?cityID :population ?o .
SEM_Models('VIRT_MODEL_MONDIAL'),
SEM_Rulebases(null),
SEM_ALIASES(SEM_ALIAS('','http://www.semwebtech.org/mondial/10/meta#'),
SEM_ALIAS('prv','http://www.semwebtech.org/mondial/10/countries/CH/provinces/')
null))
group by city,o
order by city;
Or with execute immediate :
declare
v_country varchar2(200) :='http://www.semwebtech.org/mondial/10/countries/F/';
v_text varchar2(2000);
begin
v_text := 'insert into t_countries(ID,CITY ,POPULATION, DESCRIPTION, located, insdate )
SELECT 1 id, city, o , city||'' is a nice city'' description, max(nvl(locatedAt,''unknown'')) as located,
SYSTIMESTAMP
FROM TABLE(SEM_MATCH(
''{<'||v_country||'> :hasCity ?cityID .
?cityID :name ?city .
OPTIONAL{?cityID :locatedAt ?locatedAt .}
?cityID :population ?o .
SEM_Models(''VIRT_MODEL_MONDIAL''),
SEM_Rulebases(null),
SEM_ALIASES(SEM_ALIAS('''',''http://www.semwebtech.org/mondial/10/meta#'') ),
null))
group by city,o
order by city';
dbms_output.put_line(v_text);
delete from t_countries;
execute immediate v_text ;
commit;
end;
Marc -
How to add cursor and for loop
PROCEDURE "TEST" is
bala number;
ins1 number;
ins2 number;
BEGIN
select sum(bal) into bala from (select sum(acp.acp_totbal) bal,acp_instruid from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and c_srm_prncplinsid=acp_instruid
and acp_acntnum!='SG030001'
group by acp_instruid
union
select sum(acp.acp_totbal) bal,acp_instruid from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and acp_acntnum!='SG030001'
and acp_instruid=c_srm_prntinsid
group by acp_instruid)view1;
dbms_output.put_line(bala);
select acp_instruid into ins1 from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and c_srm_prncplinsid=acp_instruid
and acp_acntnum='SG030001';
dbms_output.put_line('principal'||ins1);
select acp_instruid into ins2 from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and acp_acntnum='SG030001'
and acp_instruid=c_srm_prntinsid;
dbms_output.put_line('parent'||ins2);
update cs_acpos_bkp
set acp_totbal=-bala
where acp_instruid=ins2
and acp_acntnum='SG030001';
END;
i have written this code,i need to use cursor and for loops to get more than one rows and update also.
if there are more than 1 rows in cs_strmap_t,then the procedure throws an error stating that it cannot take 2 rows.
Edited by: 850836 on Apr 7, 2011 11:43 PMPROCEDURE "TEST" is
bala number;
ins1 number;
ins2 number;
CURSOR cur_1 IS
select sum(bal) bala from (select sum(acp.acp_totbal) bal,acp_instruid from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and c_srm_prncplinsid=acp_instruid
and acp_acntnum='SG030001'
group by acp_instruid
union
select sum(acp.acp_totbal) bal,acp_instruid from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and acp_acntnum='SG030001'
and acp_instruid=c_srm_prntinsid
group by acp_instruid)view1;
BEGIN
select acp_instruid into ins1 from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and c_srm_prncplinsid=acp_instruid
and acp_acntnum='SG030001';
dbms_output.put_line('principal'||ins1);
select acp_instruid into ins2 from cs_strmap_t map,cs_instru_strips strip,cs_acpos_bkp acp
where c_int_instruid=c_srm_prncplinsid
and acp_acntnum='SG030001'
and acp_instruid=c_srm_prntinsid;
dbms_output.put_line('parent'||ins2);
for var_for in cur_1
loop
update cs_acpos_bkp
set acp_totbal=var_for.bala
where acp_instruid=ins2
and acp_acntnum='SG030001'
and abs(acp_totbal)>abs(bala);
dbms_output.put_line(bala);
end loop;
END;
i wrote the following procedure,but the balance is not getting updated.
Getting this errors when there are more than 1 row in cs_strmap_t table
ORA-01422: exact fetch returns more than requested number of rows
ORA-06512: line 22
ORA-06512: at line 2 -
Is there arrays or FOR loops in ABAP?
Hi everyone!
Is there an array and FOR loops in ABAP similar to the C Language?
If there is, please give example. _
Thanks a lot!Hi,
There is no array concept in ABAP but there are field-symbols which are same as pointers in C.As for the FOR loop there is no such command in SAP/ABAP but we do have the do..while and loop...endloop commands.There is also CASE statements and if..endif commands.
Thanks,
Sandeep. -
Dear Support Team,
Every time i tried to logon Icloud its gives me wrong user name or password and at the end it show me error " This Apple ID is valid but is not an ICloud Account" then how can i use one account for same Apple ID and ICloud?
ThanksIt is not possible to create a new iCloud account using a Windows machine. You must create the account using a Mac (10.7.5 or more) or an IOS device (iPhone etc). Once that is done you can sign into and use the account on your Windows machine.
-
How do I use Qt and OpenGL with Visual Studio
Hi! I mainly want to program in C++ and I want to use Qt and OpenGL with Visual Studio.
I am currently revising C++ and later on i am going to start reading Qt and OpenGL. I have a background of
Embedded firmware design(C and Assembly).
The Visual Studio Version I have is 2013 ultimate. How do I use Qt and OpenGL with Visual Studio?
Thanks
AlexandrosHi ClassicalGuitar,
The forum supports VS setup and installation. And your issue is not about the forum. I will move the thread to off-topic forum. Thanks for your understanding.
Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey. -
How do I use the VIs for the Fluke Hydra Series 2620a multimeter?
This message refers to the VIs found at this link:
http://sine.ni.com/apps/we/niid_web_display.download_page?p_id_guid=E3B19B3E9468659CE034080020E74861
How do I use the VIs for the Fluke Hydra Series 2620a multimeter? I am conducting a Senior Design Project at Temple University. It is a Control System where I need to read voltages from sensors and output voltages to different system components. I am trying to set up a VI using the VIs found above to make sure that I can successfully read and send voltages. There was no documentation given with the 2620a VIs.Unfortunately, you've got a very old driver for an old instrument. The only available help is to turn on Context Help and move your mouse over the VI icon. It doesn't appear to have any help for individual controls and indicators. The only good news is that it appears to be a simple instrument with only a few functions. There's some main ones line initialize (to set serial port), configure channel, configure instr, and read values. One main thing is whether you're using gpib or serial, Each front panel has a setting. If it's gpib, set the port to the gpib address. If it's serial, set the port to one number less than the com port you're connected to. For example, if you're using Com1, set the port to 0. For the other controls, I'm afraid that you're going to have to try and compare what's there with the controls and settings of the actual instrument. Having access to the instrument manual will be essential. I would engourage you to experiment a little. There's probably very little chance of damaging the instrument especially if nothing is hooked up to it. Send a command and see what happens or set the instrument up manually and see if you can reproduce that via remote control.
-
HT2534 how do i use itunes and the app store without any credit card or gift card?
i just got my iphone and i used to use itunes all the time before when downloading all songs were completly free, how do i use itunes and the app store to find free stuff to download without having to add a credit card or gift card with my account?
Create a NEW account/ID for her using these instructions. Make sure you follow the instructions. Many do not and if you do not you will not get the None option. You must use an email address that you have not used with Apple before. Make sure you specify a birthdate that results in being at least 13 years old
Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card
More details of how:
http://ipadhelp.com/ipad-help-tips-tricks/how-to-get-free-apps-from-the-app-stor e-without-a-credit-card/ -
How do i use appl id for my phone?
how do i use appl id for my phone?
Sign into the device with the Apple ID.
Reading the User's Guide might also allow you to ask a more intelligent question and have a much better understanding of how the device works. -
How do i use my number for imessaging instead of my email
how do i use my number for imessage instead of email
Hello there, qbullard.
The following Knowledge Base article reviews the process for adding your number to iMessage:
iOS 6 and OS X Mountain Lion: Link your phone number and Apple ID for use with FaceTime and iMessage
http://support.apple.com/kb/HT5538
Thanks for reaching out to Apple Support Communities.
Cheers,
Pedro D. -
How do i use parallel compression for 4 drum tracks in Logic pro 7.2.3 Please
how do i use parallel compression for 4 drum tracks in Logic pro 7.2.3 Please. my version is 7.2.3 and my son did his drums on 4 tracks. 2 OH's 1 Kick and 1 Snare. Were confused because we cant figure out how to do parallel compression on the older logic version 7.2.3?
I can't remember when the Aux tracks became the new buss tracks, so I'll spell this out using busses.
The way I do it, is I assign all my drum tracks to a buss, say buss 1.
Then, on buss 2, I assign it's INPUT to buss 1.
So buss 1 (all the drums) are feeding into buss 2 simultaneously.
Put a compressor on buss 2, turn the fader down all the way, then as the track is playing, bring buss 2's fader up slowly, until you hear the effect you're after.
You could also do this using sends on the 4 drum tracks, set to feed the buss with the compressor on it.
I hope I haven't forgotten anything particular to that version of Logic. See if this helps... -
HT3354 how can i use one table for reference to another
how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using
you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
Here is an example of something you can do with two tables:
The table on the right is title "Data" and stores a list of names with age and favorite color.
The table on the left uses the value in the first column to lookup up information in the table Data
in the table on the left:
B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
I know this look complicated. so I'll break it up into smalled pieces:
first the "&" is called the concatenate operator and joins two strings. like this:
a string is a set of characters between double quotes.
so "string 1" & "string 2" becomes "string 1string2" or "Sam " & "Jones" becomes "Sam Jones"
you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
so if cell A1 contains "Hi " and the cell A2 contains "There" then A1 & A2 will result in "Hi There"
so you could add the formula
A3=A1 & A2
this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
OK. So the formula I provided concatenates several items together:
it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data". If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
You will find the Numbers users guide and function reference helpful. You can download then from Apple here:
http://support.apple.com/manuals/#productivitysoftware -
How can I use jbo:InputSelect for a char type filed?
How can I use <jbo:InputSelect for a char type filed?
I have two tables. One is room (primary key is room(type is char)), another table is responsibility (foreign ker is room(type is char)). Both tables have same length for room column.
There is a problem:
If I use (in the "DataEditComponent.jsp" file)
<jbo:InputSelect multiple="false" datasource="dsEdit" displaydatasource="roomData" displaydataitem="ROOM" displayvaluedataitem="ROOM" ></jbo:InputSelect>
to get the room input for responsibility from combobox(Datasource roomData is from room table). In the form the room field cannot bind the data in combobox, alway select the first item. And if I select one item and click the update button.There is an error message:
Error Message: JBO-27010: Attribute set with value H409 for Room in Responsibility has invalid precision/scale
I found If I changed the field type from char to varchar2 in database also change the entity objects, it works well. I wonder if there are any diffrence using <jbo:InputSelect tag in char and varchar2 type. How can I use <jbo:InputSelect for a char type filed as i don't want to change my datatype in database at this stage.
I try this in JDeveloper 9.03, 9.034, 9.04. The result is the same.If I were in your shoes, here's how I would do it:
<%-- Assuming you have dsRoom and dsResponsibility --%>
<%-- Select is an HTML tag --%>
<select name="ROOM" size="1">
<% char roomID =""; // Init your character var
// Open a rowsetIterator to get the records and add them to the LOV
<jbo:RowsetIterate datasource="dsResponsibility" changecurrentrow="true" >
<% roomID = (char)dsResponsibility.getRowSet().getCurrentRow().getAttribute("ROOM"); // Grab the char value
// add the value to the LOV
%>
<option value="<%=roomID%>"><%=roomID%></option>
</jbo:RowsetIterate>
</select>
If you are using this as part of an edit page you may want to utilize the "selected" option of the <option> tag. In one instance I am doing this on an edit page because the use may open an existing record. If I don't account for it, then it will change the DB to contain the first value from the list! You can do a simple check like:
//Set the current record's char
char curRecord = (char)rowEdit.getAttribute("ROOM");
// inside the iterate:
if (curRecord == roomID) {
<option value="<%=roomID%>" selected><%=roomID%></option>
} else {
<option value="<%=roomID%>" ><%=roomID%></option>
Hope that helps!
Maybe you are looking for
-
No matter where I save or what im saving, same thing adobe crashes, closes and sends an error report. Any suggestions? Where is adobe's default working directory?
-
Instances is not creating for 10g BPEL process but Polling is happening
Hi All , I am using Jdev 10.1.1.3 . I created a process to poll data from DB adapter. Polling is happening (i mean in the DB, status is moving from unread value to read value), but after deployment, no instance is creating for my bpel process. Please
-
Copy and paste are still not working even after many workarounds
This usually happens to me randomly. I would say that there is about a 25% chance that my paste works. The copy function seems to work, but when it comes to pasting, my browser does not offer the pasting button and it stays invisible. I have disabled
-
Hi -- Is there anyway to control the vertical positioning of bullet images in a <ul>? The reason I ask is that on this page: http://www.alterra-group.com/alterra_group_services.htm the bullet image displays next to the first line of text in each <li>
-
GR date and PO date..
Hi, In EKBE table which one is PO date and GR date.