HorizontalFieldManager skins ObjectChoiceField
Hello
I use a standard HorizontalFieldManager and ObjectChoiceField in my application.
I add a TextField to the HorizontalFieldManager and then the ObjectChoiceField, I do this rather than using the label of ObjectChoiceField I can 'space' label of choice.
However, when I do that the ObjectChoiceField is not visible on the screen, blurred or the focus, but it is there because if I focus on it and press the trackball, I can see the choices.
I beleve I had added the HorizontalFieldManager and the ObjectChoiceField otherwise I would not have the choice.
Could the ObjectChoiceField paint method be called not because it's in a HorizontalFieldManager?
Thank you
David
I think that the TextField object that can use the full available width, which will push the ObjectChoiceField off the screen to the right. Instead of a TextField, try a RichTextField using the USE_TEXT_WIDTH style. (Which won't help, of course, if the text is too wide for display.) Otherwise, you could eliminate the TextField and set the label of the ObjectChoiceField the text you want to display.
Tags: BlackBerry Developers
Similar Questions
-
DateField, HorizontalFieldManager + ObjectChoiceField = error
I am creating a page layout so that there a datefield and objectchoicefield in the horizontalfieldmanger even, and it throws me illegalarguementexception every time. Can someone help me? Here is the code example.
HFM HorizontalFieldManager = new HorizontalFieldManager();
HFM. Add (new DateField ("Some Text:", Date () .getTime (new),))
DateFormat.getInstance (DateFormat.TIME_DEFAULT)));HFM. Add (new ObjectChoiceField ("", new String [] {"some", "text"}));
Add (HFM);The problem here is that the DateField occupies the entire width. The ObjectChoiceField then try to deal itself. He seems to be referring to the treatment of layout of a RichTextField and pass the width that it must work, and the string to be converted (in this case, it is "a little"). RichTextField barfs with an Exception, because there is no way that 'some' can fit in the space provided (-1 pixel).
To get this working, you have to find a way to limit bandwidth claiming the DateField. I thought you'd be able to do by indicating the field to put his time left (style == DateField.FIELD_LEFT, but which did not work, so I went back to my usual substitutions and created what follows, that works.)
You can take it from here?
HFM HorizontalFieldManager = new HorizontalFieldManager();
HFM. Add (new DateField ("Some Text:", System.currentTimeMillis (),))
{DateFormat.getInstance (DateFormat.TIME_DEFAULT))}
public int getPreferredWidth() {}
Return to 150;
}
Protected Sub layout (int width, int height) {}
Super.Layout (getPreferredWidth (), height);
}
});
HFM. Add (new ObjectChoiceField ("", new String [] {"some", "text"}));
Add (HFM); -
Open objectChoiceField press ENTER, curve 8520 (JDE 5.0)
Hello
I added an objectChoiceField on horizontalfieldManager (hfm) and hfm is added to the main vericalfieldmanager.
I click the trackpad, opens my objectChoiceField and I am able to make the selection,
but when I press on enter (when ojectchoicefield is focused), the focus moves to the next field. I want to open choicefield when I press on enter the update choicefield.
Thanks in advance.
Thank you and best regards,
Fekri
I created this example... try what he's working on the press to enter the key
SerializableAttribute public class HelloWorldScreen extends form {}
ObjectChoiceField objectChoiceField;
public HelloWorldScreen()
{
setTitle ("Screen Test");objectChoiceField = new ObjectChoiceField ("Test", new String [] {"1", "2", "3"});
Add (objectChoiceField);}
{} protected Boolean keyChar (char c, int status, int time)
If (getFieldWithFocus () == objectChoiceField & c == Characters.ENTER) {}
EventInjector.invokeEvent (new EventInjector.NavigationEvent (EventInjector.NavigationEvent.NAVIGATION_UNCLICK, 0, 0, status))));
}
Returns true;
}}
-
Put two ObjectChoiceField side by side
Hello
I tried to put both components in a HorizontalFieldManager ObjectChoiceField, but I can't view both on the same line, it seems that the other is pushed off the screen to the right.
I tried with Manager.NO_HORIZONTAL_SCROLL nothing works.
Can anyone please help me;
Thank you very much
You can limit the width of one of them. These two talk on this subject, but for the different types of fields:
But if you are sure that they will hold next, you can set one on the left with the style
Field.FIELD_LEFT and I think he'll try to stay as close to the left as it can. Give it a try.
-
Listener for ObjectChoiceField
I am trying to add a listener for an ObjectChoiceField in the same way I did for a ButtonField in this code. But I get an error in this line ObjectChoiceField choiceSelected = field (ObjectChoiceField);
For now I check to headset ObjecChoiceField with a dialog.alert. If it works then I intend to add a BitmapField to the screen that would alter the images with different selections in the drop-down list (ObjectChoiceField).
Any help would be appreciated!
SerializableAttribute public class TestListeners extends UiApplication {}
Public Shared Sub main (String [] args) {}
PAP TestListeners = new TestListeners();
theApp.enterEventDispatcher ();
}
public TestListeners() {}
pushScreen (new TestListenersScreen());
}
final TestListenersScreen class extends form {}
public TestListenersScreen() {}
HorizontalFieldManager _fieldManagerBottom = new HorizontalFieldManager();
Add (_fieldManagerBottom);
ButtonField canadaButton = new ButtonField ("Canada");
ButtonField ukButton = new ButtonField ("UK");
ButtonField usButton = new ButtonField ("USA");
FieldChangeListener buttonListener = new FieldChangeListener() {}
' Public Sub fieldChanged (field field, int context) {}
ButtonField buttonPressed = field (ButtonField);
Status.Show (buttonPressed.getLabel () + "button has been pressed");
}};
canadaButton.setChangeListener (buttonListener);
ukButton.setChangeListener (buttonListener);
usButton.setChangeListener (buttonListener);
_fieldManagerBottom.Add (canadaButton);
_fieldManagerBottom.Add (ukButton);
_fieldManagerBottom.Add (usButton);
String [] choiceArray = {'image1', 'image2', 'image3'};
ObjectChoiceField choice = new ObjectChoiceField ("Drop-down list for choosing" choiceArray, 1);
ChoiceListener myChoiceListener = new ChoiceListener();
choice.setChangeListener (myChoiceListener);
Add (Choice);
}
}
}
/ public class ChoiceListener implements FieldChangeListener {}
' Public Sub fieldChanged (field field, int context) {}
ObjectChoiceField choiceSelected = (ObjectChoiceField) field.<-->-->
Dialog.Alert ("choice" + choiceSelected.getSelectedIndex () + "has been pressed");
}
};
What is the error you get?
I have field listeners that listen on the buttons and the ObjectChoiceFields. I use code like:
' Public Sub fieldChanged (field field, int context) {}
If (field instanceof ObjectChoiceField) {}
ObjectChoiceField test = field (ObjectChoiceField);
Dialog.Alert ("choice" + test.getSelectedIndex () + "has been pressed");
}
}
-
problem with my screen and ObjectChoiceField, help!
Hi, I have a screen where there are two objectChoiceField. I want to make is that, according to the value that we chose in the first objectChoiceField, the second objectChoiceField also selectable values change. I tried in the trackwheelclick, change the first objectChoiceField, repaint the screen with the choice in this election and that option objectChoiceField the second change, but I don't not do, what am I doing wrong? Thanks in advance and sorry for my English, this is my code:
public class MovimientoInvScreen extends MainScreen{ private InformesController controller; private HorizontalFieldManager containerHoriz; private RoundRectContainer containerDatosEco; private RoundRectContainer containerDatosRRHH; private RoundRectContainer containerInfoAmpli; private GridFieldManager containerGridEco; private GridFieldManager containerGridRRHH; private GridFieldManager containerGridInfoAmpli; private ButtonField buttonMover; private BasicEditField codigo; private ObjectChoiceField boxProv; private ObjectChoiceField boxCentro; private CentroDTO centro; private KeyValue provincia; private Vector centros; private KeyValue provinciaActual; public MovimientoInvScreen(InformesController controller) throws Exception{ this.controller = controller; controller.obtenerDetallesCentro(); centro = controller.getCentroSeleccionado(); provincia = controller.getProvinciaSeleccionada(); setTitle("Mov. inventario " + centro.getNombre()); containerHoriz = new HorizontalFieldManager(); String choiceProv[] = {"Almería", "Cádiz", "Córdoba", "Granada", "Huelva", "Jaen", "Málaga", "Sevilla"}; boxProv = new ObjectChoiceField ("Provincia",choiceProv, provincia.getDescripcion()); centros = controller.obtenerCentrosProvincia(provincia.getId()); Object choiceCentro[] = new Object [centros.size()]; for (int i=0; i< centros.size(); i++){ choiceCentro[i] = centros.elementAt(i); } boxCentro = new ObjectChoiceField ("Centro de destino", choiceCentro); codigo = new BasicEditField("Activo ", "", 10, BasicEditField.FILTER_NUMERIC | Field.FOCUSABLE); buttonMover = new ButtonField("Mover", Field.FIELD_HCENTER); add(boxProv); add(boxCentro); add(codigo); // add(buttonCamara); add(buttonMover); } protected void makeMenu(Menu menu, int instance) { super.makeMenu(menu, instance); } protected boolean trackwheelClick(int status, int time) { try{ if(boxProv.isDirty()){ provinciaActual = ((KeyValue) boxProv.getChoice(boxProv.getSelectedIndex())); if (provincia != provinciaActual){ boxProv.setDirty(false); this.controller.setProvinciaSeleccionada(provinciaActual); UiApplication.getUiApplication().popScreen(MovimientoInvScreen.this); UiApplication.getUiApplication().pushScreen(new MovimientoInvScreen(this.controller)); } }catch(Exception e){ Dialog.inform(e.getMessage()); } return super.trackwheelClick(status, time); } public boolean onClose() { int i = Dialog.ask(Dialog.D_YES_NO, "¿Desea cerrar la aplicación?"); if (i == Dialog.YES) System.exit(0); return true; } protected boolean keyChar(char key, int arg1, int arg2) { if(key == Characters.ESCAPE){ UiApplication.getUiApplication().popScreen(MovimientoInvScreen.this); return true; }else return super.keyChar(key, arg1, arg2); } }
I think that the example code provided by Dmitry is more complex that it must be to demonstrate this link. I hope that the following code is easier to understand.
import net.rim.device.api.i18n.*; import net.rim.device.api.system.*; import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; public class ObjectChoiceFieldTestScreen extends MainScreen implements FieldChangeListener { static String [] COUNTRIES = new String [] { "England", "US", "Canade" }; static String [] ENGLAND_CITIES = new String [] { "London", "Liverpool" }; static String [] US_CITIES = new String [] { "New York", "Washington", "Boston", "San Francisco" }; static String [] CANADA_CITIES = new String [] { "Montreal", "Toronto", "Vancouver" }; ObjectChoiceField _countryChoice = new ObjectChoiceField("Select Country:", COUNTRIES); ObjectChoiceField _cityChoice = new ObjectChoiceField("Select City:", null); public ObjectChoiceFieldTestScreen() { super(); this.setTitle("Test ObjectChoiceField Linking"); this.add(_countryChoice);; _countryChoice.setSelectedIndex(1); fieldChanged(_countryChoice, 0); // This just simulates the first 'setting' of the choice _countryChoice.setChangeListener(this); this.add(_cityChoice); } public void fieldChanged(Field f, int context) { if ( f != _countryChoice ) { return; } int countryIndex = _countryChoice.getSelectedIndex(); if ( countryIndex == 0 ) { _cityChoice.setChoices(ENGLAND_CITIES); } else if ( countryIndex == 1 ) { _cityChoice.setChoices(US_CITIES); } else { _cityChoice.setChoices(CANADA_CITIES); } } }
This illustrates the connection but hides a problem. Changing the initial index of 1 (US) to 0 (England) and see what happens to the width of the field of cities. There is a way around that. But let's get the first sorted sequence.
-
How to paint two ObjectChoiceField on the same line
Hello Experts!
I tried to draw two ObjectFieldChoice on the same line, but the work doesn´t, I found this post that have the same problem as me, but the fix doesn´t works for me.
My code:
... String[] tipos = new String[] {"BLA1", "BLA2" }; _tipo = new ObjectChoiceField(null, tipos, 0, FIELD_VCENTER) { protected void layout(int width, int height) { super.layout(width - 235, height); } }; _tipo.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1))); _tipo.setFont(Utils.getFont()); FCLabelField lblTipo = new FCLabelField(_tipo_filtro, FIELD_VCENTER, false); String[] opcoes = new String[] { "BLA3", "BLA4", "BLA5", "BLA6"}; _situacao = new ObjectChoiceField(null, opcoes, 0, FIELD_VCENTER) { protected void layout(int width, int height) { super.layout(width - 346, height); } }; _situacao.setBorder(BorderFactory.createSimpleBorder(new XYEdges(1, 1, 1, 1))); _situacao.setFont(Utils.getFont()); FCLabelField lbl = new FCLabelField(_filtro, FIELD_VCENTER, false); CustomButtonField btConsultar = new CustomButtonField("Submit"); HorizontalFieldManager hfmButton = new HorizontalFieldManager(FIELD_VCENTER); hfmButton.add(btConsultar); HorizontalFieldManager hfm = new HorizontalFieldManager(FIELD_LEFT); hfm.add(lblTipo); hfm.add(_tipo); hfm.add(lbl); hfm.add(_situacao); add(hfm); ...
I m waitting for more help.
Best regards, Rampelotti
The way I would approach this scenario is firstly by adding two fields of object list to a horizontal management.
Resize the fields until they are exactly where you want to be.
Once you did, then you can begin to add the label fields, centering, resizing and so on.
Do it step by step.
Also subtract 200 + pixels in width is not a good idea, especially on small devices.
Hope this helps
-
How to get the value in ObjectChoiceField
Hello
I've added two objectchoiceFields in a HFmanager and when I try to do, give me cast class exemptions
ObjectChoiceField field6 = (ObjectChoiceField) row6.getOriginal ();
int index = field6.getSelectedIndex ();
Var str As String = choiceItems [index];Also, I tried this
Field6 = (ObjectChoiceField) row6.getField ObjectChoiceField (0);
All of the suggestions!
My brother, I know why classcasexception is up-
First we need to see if the (index) getField method returned ObjectChoiceFIeld valid or not, and if this isn't the case, the type of cast on (ObjectChoiceField) will definitely give you classcastexception.
Object obj = row6.getField (1, 0 or watever all over);
If (obj instanceof ObjectChoiceField)
{
case Field6 = (ObjectChoiceField) obj;
Object sindex = field6.getChoice (1);
}
I start from the principle-row6 = HorizontalFieldManager and case field6 = ObjectChoiceField.
-
Add ObjectChoiceField at the end of the Manager
Hai friends...
I want to be on the same line, then I made custom Editfield expanding Editfield and add it on HorizontalFieldManager I EditFIeld and ObjectChoiceField.
Now, I want the OblectCoiceField on the other end of the Manager which is the end of the screen,
If I use FIELD_RIGHT way of ObjectChoiceField this is not provided at the end
How to do this
This should help:
http://www.BlackBerry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800508/... -
The skin looks to 'woodwork' I want to change the colors.
Then try the "hamburger" + Add on (or Alt + T + A)
-
My Windows 7 laptop updated to the latest version of firefox, all of a sudden, my skin was gone, my homepage has changed (easy fix), but all my modules where gone.
I have just re-downloaded adblock and pop-up block etc, but they don't seem to work as I see now adds absolutely everywhere, where I was not yet aware, they would have existed.
He drives me crazy!
I see an 'old firefox data' folder has been created on my desktop, but how to restore the same Add-ons that I had this issue before? and actually, they work or they don't work with the new version of firefox?I am connected to sync, but modules has been unchecked, so no luck there.
I really didn't care about skin, but please get rid of all those ads!I put lots of them modules adblock for facebook, you tube etc, but I don't know if they are in conflict with each other or they don't work.
Everything before I worked a charm. I only had 2 of them and they never show me ads.
No idea how to get them back and they work?
Thank you very muchvalegombi said
Now, I have to keep this old record data of firefox which is on my desk?
I suggest keep for a week or two in case you discover any other missing.
-
skin loading error: file not found
Impossible to stream/watch videos from PBS.org using Mozilla Firefox. No problem in contrast with Internet Explorer. Error message: "error loading skin: file not found."
Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem.
- Put yourself in the DEFAULT theme: Firefox/tools > Modules > appearance
- Do NOT click on the reset button on the startup window Mode safe
- https://support.Mozilla.org/KB/safe+mode
- https://support.Mozilla.org/KB/troubleshooting+extensions+and+themes
Clear the cache and delete cookies only from Web sites that cause problems.
"Clear the Cache":
- Firefox/tools > Options > advanced > network > content caching Web: 'clear now '.
'Delete Cookies' sites causing problems:
- Firefox/tools > Options > privacy > "Use the custom settings for history" > Cookies: "show the Cookies".
-
try to find skins for thunderbird
try to find skins for thunderbird
The quick method to install the theme addon:
In Thunderbird
Tools > Addons Menu icon or > Addons
new tab opens.Click on the "Get Add-ons". (icon in the top left)
Scroll to 'Featured topics' and click the 'view all '.
Show different themes and when you find one you like, click on the "+ add" that appears on the image of the theme when you hover over.
It should automatically install immediately.You will see that he added in the 'Appearance' icon (it looks like a painters palette)
-
I have a 42 minutes of Sport gold Rose with blue Sport Group and within 48 hours of warning had strong itching on the wrist to the area where the 'lock' metal touches the skin. This itch soon became a full eruption of rash and bleeding. After contacting the apple support, they asked a lot of questions to provide information to their engineers and asked me to stop wearing the watch. Within 48 hours to stop wearing the watch my rash subsided and finally healed. It is obvious that the metal in the sport Strip causes an allergic reaction. I need a resolution as soon as POSSIBLE for this issue.
Hello
It seems that you have an allergy to the Apple Watch.
Some users may have reactions to Apple Watch materials > Port Apple Watch - Apple Support
This is a user to user community, you do not directly communicate with Apple here. I'm sorry that you are having a bad reaction to the watch.
No guarantee, but you can request a refund > Contact - official Apple Support
You can also report the problem to Apple directly on Twitter: @AppleSupport
-
It's getting really boring I've barely recovered since the different and boring bugs in V26. I have disabled the automatic update as I'm hacked off the coast on ff not start correctly and crashing can quit smoking after every single update.
Such a bug which appeared around V26 was that a website (http://www.thecourier.co.uk/) blocking firefox. Just this site and just on my Mac and only on firefox. I can't reproduce the error on WinXP, Ubuntu or the computer of someone I know with the same version. the site blocks firefox without active plugins or addons, and this is what made me install NoScript first - that is, to block a JQuery? a script that was the cause of the crash.
V27 bugs:
Update Firefox 27 is to lose my tabs in the history after a restart, he remembers the favicons but displays 'new tab' in each and shows a blank page if clicked, thus freeing the favicon and history etc. There is nothing in the windows recently closed, etc..also, when of each restart my skin (Cotton Candy Swirl) is not displayed correctly: the title bar appears in gray Apple Mac and the lower bar shows pink massif.
When Firefox I: > > quitting smoking, it crashes (as can be shown in the details of the Mac error report). This forces me to open the Task Manager and the strength to quit smoking.
lose my history tabs after a reboot.
> What are the preferences of the history in your options menu?
'new tab' in each and shows blank page if clicked, thus freeing the favicon and history etc. There is nothing in recently closed windows etc.
-> by default, the tabs do not load until they are clicked on, this can be changed in the menu options on the tab.
-> in the recently closed window menu there are the features that should be lit to make it work:
Go to about: config and check these settings
type: sessionstore and right-click-> reset everything is bold, especially the browser.sessionstore.max_tabs_undo and the browser.sessionstore.max_windows_undo.If it repeats, try Safe Mode to ensure that it is not a plug-in that affect this and issues to troubleshoot Firefox in Safe Mode
For the swirl of cotton candy, please disable this or reinstall to ensure that it is up-to-date.
And this time, please try: Firefox crashes or does not - how to fix
We work on improving in all versions of Firefox. If you have any questions or need assistance, please let us know.
Maybe you are looking for
-
Lost everything iphoto library
My iPhoto with more library 80 000 photos disappeared. I tried to use the Time Machine backup, but not able to find the way to do it. Any help would certainly be appreciated.
-
What is the best file alternative film for Mac / windows use on a Web site?
Need to have windows user able to access our files of film on apple's site
-
disable the autorun on the labview executables feature * has not been resolved *.
Try to turn off the feature that automatically starts your executable when open labview. I know I could create a start button and all that jazz, but I prefer to disable this feature if possible.
-
My system is now and always has been set to English (United States). After hacker done his bad deeds, I reset pw and all security measures. Is always displayed in Arabic. Followed all of range them from suggestions to change the language - nothing