How to name Objects dynamically?
Hi ,
i have a scenario where i need to create many JCheckBox objects
i need to name the JCheckBox objects as jcb1,jcb2,jcb3,jcb4,jcb5..................
in a loop how to make the JCheckBox objects with the name appended with 1,2,3 (based on the loop)
please any body help me.............
LoveOpensource wrote:
Hi ,
i have a scenario where i need to create many JCheckBox objects
i need to name the JCheckBox objects as jcb1,jcb2,jcb3,jcb4,jcb5..................
in a loop how to make the JCheckBox objects with the name appended with 1,2,3 (based on the loop)
please any body help me.............Objects don't have a name. A variable is not a name, and cannot be "dynamically" generated.
Use a Collection as already suggested.
Similar Messages
-
How to create objects dynamically (with dynamic # of parameters)
I need to create a set of objects based on a definition from an XML file (obtained from the server) and add them to my scene.
I understand how to create the object using getDefinitionByName (and the limitations regarding classes needing to be referenced to be loaded into the SWF).
But some objects require parameters for the constructor, and some don't. The XML can easily pass in the required parameter information, but I can't figure out how to create a new object with a dynamic set of arguments (something akin to using the Function.call(obj, argsArray) method.
For example, I need something like this to work:
var mc=new (getDefinitionByName(str) as Class).call(thisNewThing, argsArray)
Currently this is as far as I can get:
var mc=new (getDefinitionByName(str) as Class)(static, list, of, arguments)
Thoughts?I think what Dave is asking is a bit different.
He's wanting to know how to invoke the constructor of an object dynamically (when he only knows the # of constructor arguments at runtime).
This class I know will do it but seems to be a hack:
http://code.google.com/p/jsinterface/source/browse/trunk/source/core/aw/utils/ClassUtils.a s?spec=svn12&r=12
See the 'call' method, which first counts the # of arguments then invokes one of 'n' construction methods based on the number of constructor args.
I've yet to find a clean AS3 way of doing things ala 'call' though.
-Corey -
How to name a dynamically loaded swf
heres my prblem i have a set of button buried inside a mc
when they are clicked i need them to call upon a external mc. ive
tried some different code but nothing works.
_level0.contholder_mc.contractor_mc.gotoAndPlay() works but
only one time. if i click on another button and then go back to the
external mc i gives it another instance name. how do i stop it from
giving dynamic instances names.
thanks for the helpGeneral Flash procedure is to always code you movies separate
from one another. If the movie is external, all its methods,
actions and symbols should be embedded inside that movie.
Basically, get the buttons working in the smaller movie first. Once
they are doing what you want them to there, move over to the main
movie and test playback from there. Often times, there will be
minor changes necessary to an object or button to insure proper
playback in the main movie but they are more manageable if they are
resident to the loaded clip. So start by getting your buttons
working within the loaded movie's fla file then move over. That
should help you tremendously. -
How to create a lock object dynamically ?
Hi all,
I have a report with a selection screen having one parameter in which the user can put a table name(Custom table) and some other paremeters.Based on these parameters I need to delete records from table put on the selection screen.Before deeting I need to lock the table. As beforehand I dont know the table name how can I create lock object dynamically lock my table ?
Please suggest some idea...Hi,
check below link
lock objects
http://help.sap.com/erp2005_ehp_03/helpdata/EN/7b/f9813712f7434be10000009b38f8cf/frameset.htm
Regards,
Madhu -
How do I do to add and remove Shape3D objects dynamically from TransfGroup?
Hi, everyone,
How do I do to add and remove Shape3D objects dynamically from TransformGroup?
I have added two Shape3D objects in the TransformGroup and I wanted to remove one of it to add another. But, the following exception occurs when I try to use �removeChild� :
�Exception in thread "AWT-EventQueue-0" javax.media.j3d.RestrictedAccessException: Group: only a BranchGroup node may be removed at javax.media.j3d.Group.removeChild(Group.java:345)�.
Why can I add Shape3D objects and I can�t remove them? Do I need to add Shape3D object in the BranchGroup and work only with the BranchGroup? If I do, I think this isn�t a good solution for the scene graph, because for each Shape3D object I will always have to use an associated BranchGroup.
Below, following the code:
// The constructor �
Shape3D shapeA = new Shape3D(geometry, appearance);
shapeA.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shapeA.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
shapeA.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
shapeA.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
Shape3D shapeB = new Shape3D(geometry, appearance);
shapeB.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shapeB.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
shapeB.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
shapeB.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
BranchGroup bg = new BranchGroup();
bg.setCapability(ALLOW_CHILDREN_READ);
bg.setCapability(ALLOW_CHILDREN_WRITE);
bg.setCapability(ALLOW_CHILDREN_EXTEND);
TransformGroup tg = new TransformGroup();
tg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
tg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
tg.setCapability(TransformGroup.ALLOW_CHILDREN_READ);
tg.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
bg.addChild(tg);
tg.addChild(shapeA);
tg.addChild(shapeB);
// The method that removes the shapeB and adds a new shapeC �
Shape3D shapeC = new Shape3D(geometry, appearance);
shapeC.setCapability(Shape3D.ALLOW_GEOMETRY_READ);
shapeC.setCapability(Shape3D.ALLOW_GEOMETRY_WRITE);
shapeC.setCapability(Shape3D.ALLOW_APPEARANCE_READ);
shapeC.setCapability(Shape3D.ALLOW_APPEARANCE_WRITE);
tg.removeChild(shapeB);
tg.addChild(shapeC);Thanks a lot.
aads�Exception in thread "AWT-EventQueue-0"
javax.media.j3d.RestrictedAccessException: Group:
only a BranchGroup node may be removed I would think that this would give you your answer -
Put a branch group between the transform and the shape. Then it can be removed.
Another thing you could try: This doesn't actually remove the shape, but at least causes it to hide. If you set the capabilities, I think you can write the appearance of the shapes. So, when you want to remove one of them, write an invisible appearance to it. -
How to dinamically name objects in a for statement using addChild
Hi.
I was wondering where did go the for statement with
attachMovie from library in AS 3.
I mean i was having in AS 2:
for (i=0; i<5; i++) {
attachMovie("sim", "sim"+i, i);
Now in AS 3:
for (var i=0; i<5; i++) {
addChild(new sim());
I can't figure out how to name every instance of the "sim"
object from library that i add to the stage without using string.
How do I dinamically name the added instances of the object
from the library for future reference and usage throughout the
code?
Thanks a lot.Well except those items aren't named! :)
The sim class (BTW it is generally better practice to have
class names start capitalized so that they can be distinguished
from instances which should be lower case.) would need to have a
name property if you wan't to name the instances.
This code create a variable which refers to each Sim instance
and those variables have a "name" of sim0, sim1, etc. And I think
this would be close to replicating the AS2 behavior. But AS3 is a
shift in thinking about your content as well and I don't think this
is probably the best approach.
The bad thing here is that the references aren't typed. Which
disables a lot of the good things that the compiler can do for you.
The following code would do the same thing as clbeech's and give
each instance a name (assuming the class definition includes a name
property.)
var i:int;
for(i=0;i=5;i++){
var curSim:Sim=new Sim();
curSim.name="sim"+i;
addChild(curSim);
Then the trick which is new in AS3 is to use the
DisplayObjectContainer.getChildByName() method when you want to the
retrieve an instance by its name. The help files do caution that
this is slower than something like getChildAt() which retrieves the
values from an array.
So perhaps that points the way toward a better way of
managing these types of things. Perhaps you should create an array
and push a reference to each of your Sim instances onto that array.
But it all really depends upon what you are trying to accomplish. -
How to get the dynamic Crosstab header name ?
Hi ,
The crosstab resaults shows as below ,How to get the dynamic Crosstab header name ?
| Countryname |
| Province1 | Province2 |
| here to get CountryName | here to get CountryName |
how to get the Countryname in data ceil?
thanksCould you please elaborate on your requirement?
You want header to be dynamic? -
How to typecast Object Class object dynamically
Hai every one
i have a object of any particular class , but i don't know the variables in that class object. But i have string variable contains value of variables in that class object.
So i use following method for get value of variables in that class object.
class ObjectCLass
Sub s=new Sub();
public static void main(String[] args)
ObjectCLass a=new ObjectCLass();
try
System.out.println(*a.getClass().getDeclaredField("s").get(a)*);
catch(Exception e)
System.out.println("Exception");
class Sub
int i=5;
public void print()
System.out.println("Hello World!");
}Here the bolder line give Object class object. By using this Object class object i need access the variable i and method print(). So i need to cast Object class object into sub class
so how can i typecast it
i try with following methods , but i cant succeed
1.( *(a.getClass().getDeclaredField("s").get(a).getClass)* a.getClass().getDeclaredField("s").get(a) ).print() ;
2.( (Class.forName(�Sub�) ) a.getClass().getDeclaredField("s").get(a) ).print();Please any one one help me how to typecast it dynamically
By
ThiaguIf you know you're going to invoke the "print" method on an object, then you also need to know the type of the class, or interface, which has that method.
It seems what you are looking for is a tutorial on interfaces.
http://java.sun.com/docs/books/tutorial/java/IandI/index.html
In a nutshell, you can set up an interface which defines a "print" method, and create class(es) which implement that interface. Then as long as you have an object which implements that interface, but do not know the exact type of that object, you can simply cast it to the interface type and invoke the method. -
Installed Adobe XI Pro trial verison, when compared two pdf files it gives error "Expected a Name Object"..Can some one say how to fix this?
Installed Adobe XI Pro trial verison, when compared two pdf files it gives error "Expected a Name Object"..Can some one say how to fix this?
-
How to find Object name for a object?
Hi Experts,
How to find Object name for a particular Object? Is there a Tcode for it?
__Like Object name for__
Material number - materialnr
Goods receipts / return - matbeleg
Accounting documents - rf_beleg
How to find Object name for other Objects? Is there a particular way?
Thanks & Regards
ChandanHi,
You can find objects in SNRO transaction.
In SNRO search by giving long text...
for eg., Service .. for service entry sheet. keep the first letter in capital letter only.
Thanks & Regards,
Anand. -
How to Create View Object Dynamically
Hi,
I hav a requirement to create a view object dynamically.
can anybody plz help me.
Thanks
Nan:)Hi,
oracle.apps.fnd.framework.server.OAApplicationModuleImpl amImpl = (oracle.apps.fnd.framework.server.OAApplicationModuleImpl)AM;
OAViewDef viewDef = AM.getOADBTransaction().createViewDef();
viewDef.setSql(sql.toString());
viewDef.setExpertMode(true);
//viewDef.setViewObjectClass("oracle.apps.fnd.framework.server.OAViewObjectImpl");
//viewDef.setViewRowClass("oracle.apps.fnd.framework.server.OAViewRowImpl");
oracle.jbo.ViewObject oaviewobject=amImpl.createViewObject("TableVO",viewDef);
if(oaviewobject !=null)
TableBean.setViewUsageName("oaviewobject");
TableBean.setViewAttributeName("TncId");
Thanks
Nani:) -
How can we get Dynamic columns and data with RTF Templates in BI Publisher
How can we get Dynamic columns and data with RTf Templates.
My requirement is :
create table xxinv_item_pei_taginfo(item_id number,
Organization_id number,
item varchar2(4000),
record_type varchar2(4000),
record_value CLOB,
State varchar2(4000));
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'USES','fever','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'HOW TO USE','one tablet daily','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'SIDE EFFECTS','XYZ','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'DRUG INTERACTION','ABC','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'OVERDOSE','Go and see doctor','TX');
insert into xxinv_item_pei_taginfo values( 493991 ,224, '1265-D30', 'NOTES','Take after meal','TX');
select * from xxinv_item_pei_taginfo;
Item id Org Id Item Record_type Record_value State
493991 224 1265-D30 USES fever TX
493991 224 1265-D30 HOW TO USE one tablet daily TX
493991 224 1265-D30 SIDE EFFECTS XYZ TX
493991 224 1265-D30 DRUG INTERACTION ABC TX
493991 224 1265-D30 OVERDOSE Go and see doctor TX
493991 224 1265-D30 NOTES Take after meal TX
Above is my data
I have to fetch the record_type from a lookup where I can have any of the record type, sometime USES, HOW TO USE, SIDE EFFECTS and sometimes some other set of record types
In my report I have to get these record typpes as field name dynamically whichever is available in that lookup and record values against them.
its a BI Publisher report.
please suggestif you have data in db then you can create xml with needed structure
and so you can create bip report
do you have errors or .... ? -
How do I use dynamic JSP vars in a form tag with implicit sessions?
I'm using iAS 6 SP4 and 'lite' sessions w/ sticky LB on Win2K for development and need to use a dynamic variable (via an = scriptlet) to specify the URL a form tag's ACTION method posts to. The implicit URL session encoding attempts to add the hidden input tags to the form but part of it is getting cut off. If I remove the dynamic var scriptlet from the form tag it works fine. How can I use dynamic vars and implicit URL session encoding?
Here's my code sample:
<FORM NAME='Create' METHOD='POST' ACTION='<%= servletRootStr %>CreateServlet' TARGET='_top'>
Output is:
<FORM NAME='Create' METHOD='POST' ACTION='http://my.server.com/NASApp/WebStuffApp/Create' TARGET='_top'>T NAME="GXHC_gx_session_id_" TYPE="HIDDEN" VALUE="GXLiteSessionID--8351372849698357580" ></INPUT><INPUT NAME="GXHC_GX_jst" TYPE="HIDDEN" VALUE="d692bc3d662d6164" ></INPUT>
Because the <INPUT> tagon the first session var is cut off, up to the T, the page obviously fails. Can this be fixed with a config setting, or is it a bug in iPlanet??Thanks for helping me Anurag.
The problem I tried to solve was that I want the result from my service methods
in XML format. I thought a callback/polling was the best alternative, am I right?
Since the callback option doesn´t work I will try to poll the service.
Are there any other options for solving my problem??
Thanks again!!
/A
"Anurag Pareek" <[email protected]> wrote:
>
Andrej,
I guess you are trying to invoke a Webservice which defines a callback
method
from a JSP, and want the JSP to handle the callback made by the webservice.
For a client to be able to handle a callback made by a Webservice, it
has to be
a web service in itself.
Even some web service tools do not support 'Solicit responses' and hence
they
would not generate handlers for the callback methods by default. You
can download
a callback WSDL in such cases and implement it on the client side. The
server
side web service will then callback to that webservice.
The other option to callbacks is to use polling methods. This can be
done from
any client such as Java client/ JSP client or a .NET client.
Hope this helps. Let me know if you have any further questions.
Regards,
Anurag
"Andrej" <[email protected]> wrote:
I´ve tried this but with no success..
How do I recieve the data in a servlet/JSP-page?
Thanks. -
How to create a dynamic link in a Form to link to a specific FOLDER
Hello,
I have created a reports of all employees of my department.
This reports shows me the empno and ename
When I clicked on a empno ( for example empno = 1 ) then then I got a MASTER DETAIL FORM about that employee(empno = 1) .
Who he or she is and which course he or she had followed.
I want create a dynamic link in the MASTER DETAIL FORM which shows me directly the folder of that employee ( in this example folder 1 ).
If I clickt on the report with all employees of my department on an other number ( for example empno = 3333333) then if I click on the dynamic link in the MASTER DETAIL FORM I want to see the folder of employee 3333333 !!! You know what I mean ?
What I want to know is, how to create a dynamic link that shows me directly a folder which is dependent on which empno I had clicked on in the report ( report with employee numbers and ename )
Is there any way to pass some parameters into a link to a Folder ? Is this possible in Portal ? Does anyone know how to do this, or do you have a suggestion how to solve this problem ?
Thanks a lot !!!
Chu LamHi Chetan,
I am glad that someone had replied on my question.
I will explain it to you again.
I have created a report that shows me all employees. If I click on a employee number then I get an MASTER DETAIL FORM on my screen with all the information(where he works now and which number I have to dial ifhow can I reach him by telephone) of that employee on which number I clicked on.
I really like this mechanism. (You click on a number and the information that you see in the next screen is dependent of the number you clicked on ! )I have created all this. It works fine.
What I want is to expand this example.
Every employee has a FOLDER (yes, those ones in Content Area ) which they can insert text or image into that folder. The folder name is just the employee number. ( employee with employee number 3303, he owns a folder which is named 3303 and an employee with empno 9999, he or she owns a folder with the name 9999. )
Every employee can tell more about himself in that FOLDER by iserting text and images. For example : What he likes, pictures of his vacation, something like this.
What I want is this :
If I click on the first report,which provides me all employees on screen, on a employee number 3303 then I get a Master Detail Form on my screen with all information about that employee with employee number 3303. And I want in this MASTER DETAIL FORM to create a link that shows me directly the FOLDER of that employee ( 3303), so I can learn more about employee with employee number 3303. But I don't know how to create this link.
That link had to be dependent on the employee number. The difficult thing about this link is that this link had to be dynamic.
I hope this will make it clear to you :
(report all employees:)
empno ename
3301 john smith
3302 peter clark
3303 wilson jones
If I click on a empno ( for example 3303) then I get a MASTER DETAIL FORM which provides me information.
(MASTER DETAIL FORM )
EMPNO 3303
ENAME wilson jones
department New York
mobile number 98908763
Company tel. no day
AOL 097485838 monday till wednesday
Oracle 04848584333 thursday and friday
LINK
(what I want is to create a link here )
If I click on LINK in this MASTER DETAIL FORM then I want to link to the FOLDER of this employee ! ( In this example it is FOLDER 3303.
BUT IF I CLICKED ON THE FIRST REPORT ON A DIFFERENT NUMBER ( FOR EXAMPLE 3301) THEN IF I CLICK ON LINK IN THE MASTER DETAIL FORM THEN I HAVE TO LINKED TO FOLDER 3301.
I just want to know how to make a link like this ( create a dynamic link to a specific folder ).
Thanks in Advance.
Chu -
How to assign a dynamic value to the value property of a button ?
Hi Folks,
I have a need, can i know how to assign a dynamic value to the value property of a button. Scenario is like follows...
This is a struts based web application
1. I have a file which consists of login user details (user name and his previlages) for a web application.
2. I got those user details, into a List.
3. When a user logged into the web app, in the home page there are few buttons. The type and number of buttons shown depends on the type of user/ user. (Buttons have different combination and the number of buttons available are not constant, they will vary from user to user).
4. for each button, there will be a different action. I can pass the value of a button to an action class, but here button must have a dynamic value.
Here is my test code:
<%
if (List != null)
for (int i = 0; i <List.length; i++)
%>
<html:submit property="rduname" value= "<%=List%>" onclick="return submitRdu('<%=List[i] %>');"/>
<%
%>
But my problem is how to assign a dynamic value to the value property of the button ( i know 'value= "<%=List[i]%>" ' will not work, just wanted show you guys).
Thanks in advance,
UV
Edited by: UV_Dev on Oct 9, 2008 2:15 PMLet me try i know am not good at JSP but do we need double quotes here
value= <%=List%>i think JSTL should help you about the dynamic thing
Maybe you are looking for
-
Greetings, I have an nokia lumia 1020 produced in HK and I live in Romania. The denim update is released in HK and in Ro too, but my phone doesn't found any update, help me if you can. Regards Vlad Solved! Go to Solution.
-
Cisco Professional Configuration Issue with SG 500 52P
I have a new SG500-52P switch installed for a small business and am upgrading to a Cisco 2910 router this weekend. I am trying to view the new switch on CCPE but it keeps saying that the device is undiscoverable. I have HTTP and HTTPS enabled on the
-
I bought iPad yesterday. Downloaded latest iTunes. Plugged in the USB to the computer. Plugged in the connection to the iPad. Message popped up on my computer screen: This iPad cannot be used because the Apple Mobile Device service is not started. Wh
-
Hi, In R12, if i bring down services adstpall.sh, there are some concurrent managers and processes still running even after 15 minutes. I used to kill them. Is there a better way ? do I have to run cmclean.sql or bounce the database after killing pro
-
I also posted this in Bridge General Discussion. I'm setting up a new Macbook Pro, late 2013 15", 10.9.2 CS6 Production Premium, Also have Indesign CS6, LR5, Acrobat Pro 11. Camera RAW is version 8.4. Everything is up to date. Bridge and Camera RAW p