05-21-2012 07:47 AM
If I use this code not work!
public void fieldChanged(Field field, int eventType){
if(field == tipoVisitaInput){
int indice = tipoVisitaInput.getSelectedIndex();
ZssdTipoVi auxTipoVis = (ZssdTipoVi) tipoVisitaInput.getChoice(indice);
String idCurso = auxTipoVis.getTipoVisit();
if(idCurso.equalsIgnoreCase("CU")){
motivoInput = new ObjectChoiceField(null, motivos, 0, ObjectChoiceField.NON_FOCUSABLE);
situacionInput = new ObjectChoiceField(null, choiceSituacion, 0, ObjectChoiceField.NON_FOCUSABLE);
}
}
}
05-21-2012 07:50 AM
You cant achieve this by just instantiating the same object with the new style...you need to remove the obl one from screen and add the new one into screen.
05-21-2012 07:56 AM
And how I can do this in the method fieldChanged? Can you give me an example?
05-21-2012 08:01 AM
suppose your object field is in a horizontal manager... hfm
Create a Method RefreshObjectField
hfm.deleteAll();
if( disablemode){
hfm.add(new Object choice fild with NON_FOCUS)
else{
hfm.add(new Object choice fild)
}
and set the boolean value disablemode in Field change method and call this refresh method
Hope this helps
05-21-2012 09:55 AM
I installed 4.6.0 and in Eclipse, Windows-> Preferences-> Installed Components, I have selected Blackberry JDE 4.6.0. I recompiled and got the following error, what happens?
Building GestionComercialCecofar at Mon May 21 15:55:04 CEST 2012. C:\Archivos de programa\Research In Motion\BlackBerry JDE 4.6.0\bin\rapc.exe -javacompiler="C:\Archivos de programa\Java\jdk1.5.0_15\bin\javac.exe" -quiet import="..\..\..\..\..\Archivos de programa\Research In Motion\BlackBerry JDE 4.5.0\lib\net_rim_api.jar" codename=..\GestionComercialCecofar\GestionComercialCecofar ..\GestionComercialCecofar\GestionComercialCecofar .rapc warnkey=0x52424200;0x52435200;0x52525400 @GestionComercialCecofar_build.files C:\Paco\Proyectos\faffe\faffeworkspace\GestionCome rcialCecofar\src\com\cecofar\consultavisitas\bb\sc reens\NuevaVisitaScreen.java:355: cannot find symbol symbol : variable VISUAL_STATE_DISABLED location: class net.rim.device.api.ui.Field situacionInput.setVisualState(Field.VISUAL_STATE_D ISABLED); ^ Note: C:\Paco\Proyectos\faffe\faffeworkspace\GestionCome rcialCecofar\src\com\near\bb\util\callbacks\ListCa llback.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error Error!: Error: java compiler failed: C:\Archivos de programa\Java\jdk1.5.0_15\bin\javac.exe @C:\DOCUME~1\Paco\CONFIG~1\Temp\rapc_427bc71 ... Project GestionComercialCecofar built.
05-21-2012 09:58 AM
From the error it is clear that , compiler using JDE 4.5.0
Set the Build path in project-properties to 4.6
05-21-2012 10:18 AM - edited 05-21-2012 11:40 AM
In the Build Path I added an External JAR net_rim_api.jar of version 4.6.0, and I having the same error
05-21-2012 10:26 AM
check the library u r using to build ur project
properties->java build path - library... remove 4.5 and add 4.6
05-21-2012 11:41 AM
Initially there was nothing in the library tab, I've added the version 4.6.0 net_rim_api.jar, you can see it in the image
05-21-2012 11:46 AM
I am not talking about the external jar file....Check you JRE System Library
Set this to4.6.0
Click Properties
java build path
click on libraries tab
click Add library
select JRE ssystem library
click Alternate JRE
Select Blackberry 4.6.0
remove the external jar u added