Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009

Re: Disable screen elements ??¿¿

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);
				
			}
		}
}

 

Please use plain text.
Developer
rabiray
Posts: 141
Registered: ‎07-13-2011
My Carrier: Vodafone

Re: Disable screen elements ??¿¿

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.

Please use plain text.
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009

Re: Disable screen elements ??¿¿

And how I can do this in the method fieldChanged Can you give me an example?

Please use plain text.
Developer
rabiray
Posts: 141
Registered: ‎07-13-2011
My Carrier: Vodafone

Re: Disable screen elements ??¿¿

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

Please use plain text.
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009

Re: Disable screen elements ??¿¿

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\GestionComercialCecofar\src\com\cecofar\consultavisitas\bb\screens\NuevaVisitaScreen.java:355: cannot find symbol
symbol  : variable VISUAL_STATE_DISABLED
location: class net.rim.device.api.ui.Field
				situacionInput.setVisualState(Field.VISUAL_STATE_DISABLED);
                                                                   ^
Note: C:\Paco\Proyectos\faffe\faffeworkspace\GestionComercialCecofar\src\com\near\bb\util\callbacks\ListCallback.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.

 


Please use plain text.
Developer
rabiray
Posts: 141
Registered: ‎07-13-2011
My Carrier: Vodafone

Re: Disable screen elements ??¿¿

From the error it is clear that , compiler using  JDE 4.5.0

 

Set the Build path in project-properties to 4.6

Please use plain text.
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009

Re: Disable screen elements ??¿¿

[ Edited ]

In the Build Path I added an External JAR net_rim_api.jar of version 4.6.0, and I having the same error

build path.JPG

Please use plain text.
Developer
rabiray
Posts: 141
Registered: ‎07-13-2011
My Carrier: Vodafone

Re: Disable screen elements ??¿¿

check the library u r using to build ur project

 

properties->java build path - library... remove 4.5 and add 4.6

Please use plain text.
Developer
zaratustraelimp
Posts: 171
Registered: ‎03-04-2009

Re: Disable screen elements ??¿¿

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

Please use plain text.
Developer
rabiray
Posts: 141
Registered: ‎07-13-2011
My Carrier: Vodafone

Re: Disable screen elements ??¿¿

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 

Please use plain text.