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.

inside custom component

Java Development

Reply
Regular Contributor
hitesh171285
Posts: 95
Registered: ‎07-16-2010
My Device: 8520

EditField contant hide on scroll cursor

code : HorizontalFieldManager hfm1 =new HorizontalFieldManager(HORIZONTAL_SCROLL);
            EditField   emailfield = new EditField("","",100,EditField.NO_NEWLINE | EditField.FILTER_EMAIL );

            hfm1.add(emailfield);

 

now when i enter text in editfied and after when i scrol cursor right that time text goes left inner side and not visible

 

like as show in image i type "abcdefgh" and then i scorol track ped right side and text like that

emailfield.png

 

problem in os 7 and i tested in 5 its ok

 

help thanks in advance

 

Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: EditField contant hide on scroll cursor

there must be more code, the snippet you posted would not lead to this display.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
hitesh171285
Posts: 95
Registered: ‎07-16-2010
My Device: 8520

Re: EditField contant hide on scroll cursor

hii simon_hain thanks for replay

 

and more code here

 

and also i upload image well image not display in crom browser its good in firefox

 

		VerticalFieldManager vfmMain=new VerticalFieldManager()
		{
			protected void sublayout(int maxWidth, int maxHeight) 
			{
				super.sublayout(ConstantData.deviceWidth,ConstantData.deviceHeight-ConstantData.headerHight-ConstantData.footerHight);
				super.setExtent(ConstantData.deviceWidth,ConstantData.deviceHeight-ConstantData.headerHight-ConstantData.footerHight);
			}
		};
		VerticalFieldManager vfmbody = new VerticalFieldManager(Manager.VERTICAL_SCROLL);
		////////////////////////////////// name ////////////////////////////////////
		VerticalFieldManager vfmname=new VerticalFieldManager();
		////////////////////////////////// emial ////////////////////////////////////
		HorizontalFieldManager hfmsubmobile =new HorizontalFieldManager(NO_HORIZONTAL_SCROLL  | NO_VERTICAL_SCROLL)
		{
			protected void sublayout(int maxWidth, int maxHeight) 
			{
				super.sublayout(ConstantData.deviceWidth-155,30);
				super.setExtent(ConstantData.deviceWidth-155,30);
			}
		};
		HorizontalFieldManager hfm1 =new HorizontalFieldManager(HORIZONTAL_SCROLL);
		emailfield = new EditField("","",100,EditField.NO_NEWLINE | EditField.FILTER_EMAIL );
		hfm1.add(emailfield);
		hfmsubmobile.add(hfm1);
		vfmname.add(hfmsubmobile);

		////////////////////////////////// password ////////////////////////////////////

		HorizontalFieldManager hfmsubemail =new HorizontalFieldManager()
		{
			protected void sublayout(int maxWidth, int maxHeight) 
			{
				super.sublayout(ConstantData.deviceWidth-155,30);
				super.setExtent(ConstantData.deviceWidth-155,30);
			}
		};
		HorizontalFieldManager hfm2=new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL);
		passfield = new PasswordEditField("","",100,EditField.NO_NEWLINE);
		hfm2.add(passfield);
		hfmsubemail.add(hfm2);
		vfmname.add(hfmsubemail);
		vfmbody.add(vfmname);
		vfmMain.add(vfmbody);
		add(vfmMain);

 

Please use plain text.
Regular Contributor
hitesh171285
Posts: 95
Registered: ‎07-16-2010
My Device: 8520

Re: EditField contant hide on scroll cursor

please any help

Please use plain text.
Developer
simon_hain
Posts: 16,190
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: EditField contant hide on scroll cursor

my first guess would be that it is due to the scrollable hfm2.
I still don't see where the round border comes from though.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
hitesh171285
Posts: 95
Registered: ‎07-16-2010
My Device: 8520

Re: EditField contant hide on scroll cursor

[ Edited ]

hii simon_hain thanks for replay

 

and sorry for that i dont send u all thinga in last code

so now here i make sample in that i have issue

 

import net.rim.device.api.ui.UiApplication;
public class MyApp extends UiApplication
{
    public static void main(String[] args)
    {
        MyApp theApp = new MyApp();       
        theApp.enterEventDispatcher();
    }
    public MyApp()
    {        
        pushScreen(new LoginScreen());
    }    
}
===========================================================
package mypackage;

import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.Manager;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.component.NullField;
import net.rim.device.api.ui.component.PasswordEditField;
import net.rim.device.api.ui.container.HorizontalFieldManager;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.container.VerticalFieldManager;
import net.rim.device.api.ui.decor.BackgroundFactory;

public final class LoginScreen extends MainScreen
{	
	NullField ntemp;

	private EditField emailfield;
	private String useremail="";
	private PasswordEditField passfield;
	int deviceWidth=100,deviceHeight=100;
	public LoginScreen()
	{
		deviceHeight=net.rim.device.api.system.Display.getHeight();
		deviceWidth=net.rim.device.api.system.Display.getWidth(); 

		VerticalFieldManager vfmMain=new VerticalFieldManager()
		{
			protected void sublayout(int maxWidth, int maxHeight) 
			{
				super.sublayout(deviceWidth,deviceHeight);
				super.setExtent(deviceWidth,deviceHeight);
			}
		};
		vfmMain.setBackground(BackgroundFactory.createSolidBackground(Color.GRAY));

		VerticalFieldManager vfmbody = new VerticalFieldManager(Manager.VERTICAL_SCROLL);

		VerticalFieldManager vfmname=new VerticalFieldManager()
		{
			protected void sublayout(int maxWidth, int maxHeight) 
			{
				super.sublayout(deviceWidth,120);
				super.setExtent(deviceWidth,120);
			}
			protected void paint(Graphics graphics) 
			{
				graphics.setColor(Color.BLACK);
				graphics.setFont(Font.getDefault().derive(Font.PLAIN,20));

				graphics.drawText("Email",12,(40-graphics.getFont().getHeight())/2);
				graphics.drawText("Password",12,50+(40-graphics.getFont().getHeight())/2);

				graphics.setColor(Color.WHITE);
				graphics.fillRoundRect(112,2,deviceWidth-124,36,15,15);
				graphics.fillRoundRect(112,52,deviceWidth-124,36,15,15);
				super.paint(graphics);
			}
		};
		vfmname.setBackground(BackgroundFactory.createSolidBackground(Color.DARKGRAY));
		////////////////////////////////// emial ////////////////////////////////////
		HorizontalFieldManager hfmsubmobile =new HorizontalFieldManager(NO_HORIZONTAL_SCROLL  | NO_VERTICAL_SCROLL)
		{
			protected void sublayout(int maxWidth, int maxHeight) 
			{
				super.sublayout(deviceWidth-155,30);
				super.setExtent(deviceWidth-155,30);
			}
		};
		HorizontalFieldManager hfm1 =new HorizontalFieldManager(HORIZONTAL_SCROLL);
		emailfield = new EditField("","",100,EditField.NO_NEWLINE | EditField.FILTER_EMAIL )
		{
			protected void paint(Graphics graphics) 
			{
				graphics.setColor(Color.BLACK);
				super.paint(graphics);
			}
			protected void onFocus(int arg0) 
			{
				LoginScreen.this.invalidate();
				super.onFocus(arg0);
			}
			protected void onUnfocus() 
			{
				LoginScreen.this.invalidate();
				super.onUnfocus();
			}
		};

		emailfield.setFont(Font.getDefault().derive(Font.PLAIN,20));
		emailfield.setMargin((30-emailfield.getFont().getHeight())/2,0,0,0);
		hfm1.add(emailfield);
		hfmsubmobile.add(hfm1);
		hfmsubmobile.setMargin(5,0,0,120);
		vfmname.setMargin(20,0,0,0);
		vfmname.add(hfmsubmobile);

		////////////////////////////////// password ////////////////////////////////////

		HorizontalFieldManager hfmsubemail =new HorizontalFieldManager()
		{
			protected void sublayout(int maxWidth, int maxHeight) 
			{
				super.sublayout(deviceWidth-155,30);
				super.setExtent(deviceWidth-155,30);
			}
		};
		HorizontalFieldManager hfm2=new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL);

		passfield = new PasswordEditField("","",100,EditField.NO_NEWLINE)
		{
			protected void paint(Graphics graphics) 
			{
				graphics.setColor(Color.BLACK);
				super.paint(graphics);
			}
			protected void onFocus(int arg0) 
			{
				LoginScreen.this.invalidate();
				super.onFocus(arg0);
			}
			protected void onUnfocus() 
			{
				LoginScreen.this.invalidate();
				super.onUnfocus();
			}
		};

		passfield.setFont(Font.getDefault().derive(Font.PLAIN,20));
		passfield.setMargin((30-passfield.getFont().getHeight())/2,0,0,0);
		hfm2.add(passfield);
		hfmsubemail.add(hfm2);
		hfmsubemail.setMargin(20,0,0,120);
		
		vfmname.setMargin(50,0,0,0);
		vfmname.add(hfmsubemail);
		vfmbody.add(vfmname);
		vfmMain.add(vfmbody);
		add(vfmMain);
	}
}

 emailfield.png

 

i type "abcdefghij"  and after scroll right usinf trachped

in os 7.0 device

 

and yes i need scroll in editfield so i able to type as long as i want

Please use plain text.
Regular Contributor
hitesh171285
Posts: 95
Registered: ‎07-16-2010
My Device: 8520

Re: EditField contant hide on scroll cursor

hello anyone can help........!

Please use plain text.
Developer
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: EditField contant hide on scroll cursor

You have given us a lot of code.  Too much for me to investigate in detail atm sorry. 

 

I agree with SImon's suggestion, you have a HFM that is scrollable, and when you move the trackpad on that Field, it scrolls. There are some other oddities in your code that might be getting in the way too - like the way you force the extent for some Managers.

 

Rather than try to fix your current code, i suggest you review this KB article and rework your code around how it does it.

 

http://supportforums.blackberry.com/t5/Java-Development/Sample-Code-Scrollable-one-line-text-input-f...

 

 

Please use plain text.
Regular Contributor
hitesh171285
Posts: 95
Registered: ‎07-16-2010
My Device: 8520

Re: EditField contant hide on scroll cursor

ok peter thanks for replay

 

you and simon find my exact problem thats horizontal scroll i also test and rech at there

 

my upper given code is silliler as peter given KB Artical code

 

as given in KB artical i test both code but in that also same issue if u run that in os 7 and write some string then scroll it right its text hide while still space is available on horizontal field
 as given upper image

 

in short i want one line editfield and also scrollable but need scroll after at the end of its manezer width limit

but hete if u type a single character and scroll right its hide character

 

is there any good way to solve that issue ?

Please use plain text.
Developer
peter_strange
Posts: 19,607
Registered: ‎07-14-2008
My Device: Not Specified

Re: EditField contant hide on scroll cursor

Just to confirm, the problem is that the code from the KB article does not work correctly in OS 7.0?  Specifically, in OS 7.0 you can use the trackpad and scroll right to hide the text?

Please use plain text.