Search Results

Search found 28 results on 2 pages for 'buttonfield'.

Page 1/2 | 1 2  | Next Page >

  • ASP.NET Conditionally Change ButtonField text at runTime

    - by Rodney Vinyard
    ASP.NET Conditionally Change ButtonField text at runTime   <asp:ButtonField CommandName="Edit" HeaderText="" Text="Edit" ButtonType="Link" />       protected void gvRequests_RowDataBound(object sender, GridViewRowEventArgs e)     {         if (e.Row.RowType == DataControlRowType.DataRow)         {             //----------------------------------------------------             // If status = "Saved", change buttonField.LinkButton.Text to "Copy"             //----------------------------------------------------             if (e.Row.Cells[(int)gCol.Status].Text == "Saved")             {                 //----------------------------------------------------                 // no !                 //----------------------------------------------------                 //string x = e.Row.Cells[(int)gCol.EditLink].Text;                 //e.Row.Cells[(int)gCol.EditLink].Text = "Copy";                   //----------------------------------------------------                 // yes !                 //----------------------------------------------------                 LinkButton linkButton = (LinkButton)e.Row.Cells[(int)gCol.EditLink].Controls[0];                 linkButton.Text = "Copy";             }         }     }

    Read the article

  • buttonField clicking problem in blackberry

    - by Master
    hi when i am setting the BackGround image through VerticalField Manager. only one buttonField is gettin clicked ,other button field is not working. can i have the solution for it. please if not i want alternative which will position the buttonfield ,set by user. and i want a image as a background help me out. its urgent.. public GreetingsMainScreen() { homeBackgroundImage=Bitmap.getBitmapResource("com/greetings/Images/HomeBackgroundImage.jpg"); exitField=new ButtonField("Exit",ButtonField.CONSUME_CLICK); exitField.setChangeListener(this); greetField=new ButtonField("GREET",ButtonField.CONSUME_CLICK); greetField.setChangeListener(this); VerticalFieldManager manager = new VerticalFieldManager() { protected void sublayout(int width, int height) { width=fwidth; height=fHeight; super.sublayout(width,height); setPositionChild(greetField, width-232, height-150); setPositionChild(exitField, width-205, height-110); setExtent(width, height); } }; manager.setBackground(BackgroundFactory.createBitmapBackground(homeBackgroundImage)); manager.add(exitField); manager.add(greetField); add(manager); } public void fieldChanged(Field field, int context) { if(field == exitField) { Dialog.alert("Hi"); System.exit(0); } if(field == greetField) { System.exit(0); } } } Thanks alot

    Read the article

  • Placement of ButtonField

    - by rupesh
    Hi i want to place the Buttons as displayed in the image: for this i am using the following code but it is not working for me can any one please help me out topbarManager = new HorizontalFieldManager(); topbarLeftManager = new HorizontalFieldManager(Field.FIELD_LEFT); topbarRightManager = new HorizontalFieldManager(Field.FIELD_RIGHT); topbarCenterManager = new HorizontalFieldManager(Field.FIELD_HCENTER); topbarLeftManager.add(new ButtonField("first")); topbarRightManager.add(new ButtonField("second")); topbarCenterManager.add(new ButtonField("third")); topbarManager.add(topbarLeftManager); topbarManager.add(topbarCenterManager); topbarManager.add(topbarRightManager); i am not getting the result as i required. can any one please Help me out. Thanks a lot

    Read the article

  • Blackberry Development, adding dynamic number of buttons and setting Fieldchangelistener() for them

    - by Nikesh Yadav
    Hi, I am adding dynamic number of buttons in a Blackberry application and trying to get different events on each button click. I am not able to apply the setchangelistener() for these array of buttons as once the loop finishes after adding all the buttons, the events gets generated only for the last indexed button. If I make us of getIndex(), it runs fine only if I am not adding any other fields on my screen, but if I add other fields along with these array of buttons, the getIndex() function count them in the indexing as well. Can anyone please help me out in setting FieldChangeListener to array of ButtonField? Here is a sample code of the way I am using the array of ButtonField. I the code I have added two test LabelField at the top of the screen, if I remove them the code will run fine and I will get different result for each button click, but if I keep them active, the indexing gets effected and the Button wont work. package buttonclickloop; import net.rim.device.api.ui.DrawStyle; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.FieldChangeListener; import net.rim.device.api.ui.component.ButtonField; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.container.HorizontalFieldManager; import net.rim.device.api.ui.container.MainScreen; public class ButtoncClickLoop extends MainScreen { int i = 0; private ButtonField[] btn = new ButtonField[50]; public ButtoncClickLoop() { // TODO Auto-generated constructor stub LabelField Field1 = new LabelField("Field1"); LabelField Field2 = new LabelField("Field2",DrawStyle.RIGHT | ButtonField.USE_ALL_WIDTH); HorizontalFieldManager FieldHmgr = new HorizontalFieldManager(); FieldHmgr.add(Field1); FieldHmgr.add(Field2); FieldHmgr.setMargin(0,0,10,5); add(FieldHmgr); while (i < 3){ FieldChangeListener listener = new FieldChangeListener() { public void fieldChanged(Field field, int context) { context = field.getIndex(); if (field == btn[context]){ add(new LabelField("Label" + context + "")); } } }; btn[i] = new ButtonField("Button" + i + ""); btn[i].setChangeListener(listener); add(btn[i]); i = i + 1; } } } Thanks, Nikesh

    Read the article

  • Gridview buttonfield works LinkButton doesn't

    - by Karsten
    I've been fighting this problem for many hours now and could really use some help :-) This is the grid <asp:GridView ID="annonceView" runat="server" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="dataSourceAnnoncer"> <Columns> <asp:BoundField DataField="Productname" HeaderText="Productname" /> <asp:buttonfield buttontype="Link" commandname="Delete" text="Delete"/> <asp:TemplateField HeaderText="Administration"> <ItemTemplate> <asp:LinkButton ID="lnkBtnDelete" runat="server" Text="Delete" CausesValidation="False" CommandName="Delete" OnClientClick="return confirm('Delete?')" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> <asp:LinqDataSource ID="dataSourceAnnoncer" runat="server" ContextTypeName="Namespcae.TheContext" EnableDelete="True" TableName="Annoncer"> </asp:LinqDataSource> Clicking the buttonfield deletes the record just fine. Clicking the LinkButton doesn't work. I get a postback and the grid is shown as empty and no record is deleted. Seems like an empty databinding. I have tried to create a custom OnClick, OnCommand event for the LinkButton, but neither are fired. The OnRowCommand isn't fired either. I don't manually DataBind in the codebehind.

    Read the article

  • gridview commandargument on buttonfield pagination used

    - by ClareBear
    Hello all, I am using c#.net I have a gridview which needs to contain a 'Use' button (appointmentId set as the commandargument). Source Code <asp:GridView ID="resultsReturned" runat="server" AllowPaging="True" AutoGenerateColumns="False" EnableSortingAndPagingCallbacks="True" OnPageIndexChanged="resultsReturned_PageIndexChanged" onrowcommand="resultsReturned_RowCommand"> <Columns> <asp:BoundField DataField="UserAppointmentId" HeaderText="App ID" /> <asp:BoundField DataField="UserBookingName" HeaderText="Booking Name" /> <asp:TemplateField> <ItemTemplate> <asp:Button runat="server" ID="UseButton" Text="Use" CommandName="Use" CommandArgument="UserAppointmentId" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Code-Behind protected void resultsReturned_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Use") { correctAppointmentID.Value = (e.CommandArgument.ToString()); } } This is used for the pagination: private void BindAppointments() { var results = appointmentRepos.GetBookingIdBySearchCriteria(catgoryid, resultsReturned.PageIndex * resultsReturned.PageSize, -1); resultsReturned.DataSource = results; resultsReturned.DataBind(); } I am binding the appointments to the gridview within the PageLoad/search_Click This is the error I am receiving: Callbacks are not supported on TemplateField because some controls cannot update properly in a callback. Turn callbacks off on 'resultsReturned'. Thanks in advance for any help Clare

    Read the article

  • Gridview changing text in a button column

    - by Bob Avallone
    I am working in asp.net using the gridview control. I have a button column that I create dynamically as such: ButtonField bfSelect = new ButtonField(); bfSelect.HeaderText = "View"; bfSelect.ButtonType = ButtonType.Link; bfSelect.CommandName = "View"; bfSelect.Text = "View"; grdAttachments.Columns.Add(bfSelect); The text on the button is the same for every row. I was wondering if there was any way to have the text be different for different rows depending on a condition. When I try to look at the text property of a particular row it is blank, if I try to set it, it does not change. Thanks in advance. Bob

    Read the article

  • Blackberry storm 9530 tracing touch events while scrolling

    - by SWATI
    hey in my screen there is a an edit field and 2 custom button fields as "OK" and "CANCEL" Below buttonfield there are some more focussable label fields when i write a name in edit field and press enter then focus comes to "OK" button but how to set focus on "CANCEL" button. Moreover while scrolling the focus does not automatically move ahead??? what to do may be i m confused with touch events and their handling!!! Kindly help!!!!!!!!!!!! Code: txt_Name = new EditField(TextField.NO_NEWLINE) { public void paint(net.rim.device.api.ui.Graphics g) { g.setColor(Color.MAROON); super.paint(g); } }; txt_Name.setFont(font); v1 = new VerticalFieldManager(); v1.add(txt_Name ); ButtonField btn1 = new ButtonField("OK",ButtonField.CONSUME_CLICK); ButtonField btn2 = new ButtonField("CANCEL",ButtonField.CONSUME_CLICK); v2 = new VerticalFieldManager(); v2.add(btn1); v2.add(btn2); LabelField l1 = new LabelField("Hello Moon ",Field.Focussable); LabelField l2 = new LabelField("Hello Citizen",Field.Focussable); LabelField l3 = new LabelField("Hello People",Field.Focussable); LabelField l4 = new LabelField("Hello world",Field.Focussable); v3 = new VerticalFieldManager(); v3.add(l1); v3.add(l2); v3.add(l3); v3.add(l4); add(v1); add(v2); add(v3); } protected boolean navigationClick(int status, int time) { if(OK.isFocus()) { //execute some code return true; } if(CANCEL.isFocus()) { //execute some code return true; } }

    Read the article

  • How to determine the type of object in blackberry application?

    - by SIA
    Hi Everybody On my screen i have ButtonField and CustomButtonField. Both have been added to Listner of my screen. myScreen.add(new ButtonField("click me")); myScreen.add(new CustomButtonField("click me Again")); Now i want to know which button is clicked and type of object in fieldChanged function. public void fieldChanged(Field field, int context) { //Here- how to determine the type of object //which object has been clicked //ButtonField or CustomButtonField???? } Kindly Help Thanks SIA

    Read the article

  • Two Button Columns on a GridView Control

    - by Bob Avallone
    I have a grid view will two different button columns. I want to perform a different action depending on what button the user presses. How in the SelectedIndexChanged event do I determine what colmun was pressed. This is the code I use to generate the columns. grdAttachments.Columns.Clear(); ButtonField bfSelect = new ButtonField(); bfSelect.HeaderText = "View"; bfSelect.ButtonType = ButtonType.Link; bfSelect.CommandName = "Select"; bfSelect.Text = "View"; ButtonField bfLink = new ButtonField(); bfLink.HeaderText = "Link/Unlink"; bfLink.ButtonType = ButtonType.Link; bfLink.CommandName = "Select"; bfLink.Text = "Link"; grdAttachments.Columns.Add(bfSelect); grdAttachments.Columns.Add(bfLink);

    Read the article

  • My blackberry app will not display on simulator even thou it tells me I have no errors

    - by user1334120
    I am trying to run this code on my blakberry simulator, but it will not appear on the main menu. Can anybody please help me out. import net.rim.device.api.ui.FieldChangeListener; import net.rim.device.api.ui.Field; import net.rim.device.api.ui.UiApplication; import net.rim.device.api.ui.component.ButtonField; import net.rim.device.api.ui.component.LabelField; import net.rim.device.api.ui.container.MainScreen; public class FirstScreen extends MainScreen implements FieldChangeListener { ButtonField theButton; public FirstScreen() { add(new LabelField("First Screen")); theButton = new ButtonField("New Screen", ButtonField.CONSUME_CLICK); theButton.setChangeListener(this); add(theButton); } public void fieldChanged(Field field, int context) { if (field == theButton) { UiApplication.getUiApplication().pushScreen(new SecondScreen()); } } public class SecondScreen extends MainScreen { public SecondScreen() { add(new LabelField("Second Screen")); } } }

    Read the article

  • BlackBerry - TouchEvent on multiple managers

    - by rupesh
    Hi all i am new to blackberry application development here is my question i am using two verticalfieldmanager "layout" and "manager" in my application. layout has three custom button field and layout is inside manager. i am not able to implement touch event , here is my code: public class MenuScreen extends MainScreen { public MenuScreen() { super(Screen.DEFAULT_CLOSE); Bitmap menuBackgroundImage = Bitmap .getBitmapResource("com/greetings/Images/MenuBackground.jpg"); final VerticalFieldManager layout = new VerticalFieldManager() { public boolean touchEvent(TouchEvent message) { int x = message.getGlobalX(1); int y = message.getGlobalY(1); if (getExtent().contains(x, y)) { int fieldI = getFieldAtLocation(x, y); Field field = getField(fieldI); field.setFocus(); return super.touchEvent(message); } return false; } }; ButtonField categories = new ButtonField("Categories") { public void run() { Dialog.alert("one"); } public boolean touchEvent(TouchEvent message) { int x = message.getX(1); int y = message.getY(1); int w = getWidth(); int h = getHeight(); if (x >= 0 && x <= w && y >= 0 && y <= h) { switch (message.getEvent()) { case TouchEvent.DOWN: setFocus(); return true; case TouchEvent.UNCLICK: run(); return true; } } return false; } }; ButtonField help = new ButtonField("Help") { public void run() { Dialog.alert("help"); } public boolean touchEvent(TouchEvent message) { int x = message.getX(1); int y = message.getY(1); int w = getWidth(); int h = getHeight(); if (x >= 0 && x <= w && y >= 0 && y <= h) { switch (message.getEvent()) { case TouchEvent.DOWN: setFocus(); return true; case TouchEvent.UNCLICK: run(); return true; } } return false; } }; ButtonField developer = new ButtonField("Developer") { public void run() { Dialog.alert("Developer"); } public boolean touchEvent(TouchEvent message) { int x = message.getX(1); int y = message.getY(1); int w = getWidth(); int h = getHeight(); if (x >= 0 && x <= w && y >= 0 && y <= h) { switch (message.getEvent()) { case TouchEvent.DOWN: setFocus(); return true; case TouchEvent.UNCLICK: run(); return true; } } return false; } }; layout.add(categories); layout.add(help); layout.add(developer); VerticalFieldManager manager = new VerticalFieldManager() { protected void sublayout(int width, int height) { width = Display.getWidth(); height = Display.getHeight(); super.sublayout(width, height); setPositionChild(layout, width - 245, height - 350); setExtent(width, height); } }; manager.setBackground(BackgroundFactory .createBitmapBackground(menuBackgroundImage)); manager.add(layout); add(manager); } }

    Read the article

  • Blackberry - application settings save/load

    - by Max Gontar
    Hi! I know two ways to save/load application settings: use PersistentStore use filesystem (store, since SDCard is optional) I'd like to know what are you're practicies of working with application settings? Using PersistentStore to save/load application settings The persistent store provides a means for objects to persist across device resets. A persistent object consists of a key-value pair. When a persistent object is committed to the persistent store, that object's value is stored in flash memory via a deep copy. The value can then be retrieved at a later point in time via the key. Example of helper class for storing and retrieving settings: class PSOptions { private PersistentObject mStore; private LongHashtableCollection mSettings; private long KEY_URL = 0; private long KEY_ENCRYPT = 1; private long KEY_REFRESH_PERIOD = 2; public PSOptions() { // "AppSettings" = 0x71f1f00b95850cfeL mStore = PersistentStore.getPersistentObject(0x71f1f00b95850cfeL); } public String getUrl() { Object result = get(KEY_URL); return (null != result) ? (String) result : null; } public void setUrl(String url) { set(KEY_URL, url); } public boolean getEncrypt() { Object result = get(KEY_ENCRYPT); return (null != result) ? ((Boolean) result).booleanValue() : false; } public void setEncrypt(boolean encrypt) { set(KEY_ENCRYPT, new Boolean(encrypt)); } public int getRefreshPeriod() { Object result = get(KEY_REFRESH_PERIOD); return (null != result) ? ((Integer) result).intValue() : -1; } public void setRefreshRate(int refreshRate) { set(KEY_REFRESH_PERIOD, new Integer(refreshRate)); } private void set(long key, Object value) { synchronized (mStore) { mSettings = (LongHashtableCollection) mStore.getContents(); if (null == mSettings) { mSettings = new LongHashtableCollection(); } mSettings.put(key, value); mStore.setContents(mSettings); mStore.commit(); } } private Object get(long key) { synchronized (mStore) { mSettings = (LongHashtableCollection) mStore.getContents(); if (null != mSettings && mSettings.size() != 0) { return mSettings.get(key); } else { return null; } } } } Example of use: class Scr extends MainScreen implements FieldChangeListener { PSOptions mOptions = new PSOptions(); BasicEditField mUrl = new BasicEditField("Url:", "http://stackoverflow.com/"); CheckboxField mEncrypt = new CheckboxField("Enable encrypt", false); GaugeField mRefresh = new GaugeField("Refresh period", 1, 60 * 10, 10, GaugeField.EDITABLE|FOCUSABLE); ButtonField mLoad = new ButtonField("Load settings", ButtonField.CONSUME_CLICK); ButtonField mSave = new ButtonField("Save settings", ButtonField.CONSUME_CLICK); public Scr() { add(mUrl); mUrl.setChangeListener(this); add(mEncrypt); mEncrypt.setChangeListener(this); add(mRefresh); mRefresh.setChangeListener(this); HorizontalFieldManager hfm = new HorizontalFieldManager(USE_ALL_WIDTH); add(hfm); hfm.add(mLoad); mLoad.setChangeListener(this); hfm.add(mSave); mSave.setChangeListener(this); loadSettings(); } public void fieldChanged(Field field, int context) { if (field == mLoad) { loadSettings(); } else if (field == mSave) { saveSettings(); } } private void saveSettings() { mOptions.setUrl(mUrl.getText()); mOptions.setEncrypt(mEncrypt.getChecked()); mOptions.setRefreshRate(mRefresh.getValue()); } private void loadSettings() { mUrl.setText(mOptions.getUrl()); mEncrypt.setChecked(mOptions.getEncrypt()); mRefresh.setValue(mOptions.getRefreshPeriod()); } }

    Read the article

  • BlackBerry:Reduce space between 2 buttons in HorizontalFieldManager

    - by user469999
    hi In blackberry i have created a horizontal field managar and added some buttons of small size to it to display toolbar at the bottom of the screen.But my problem is there is too much space between the 2 buttons.I have to reduce this space between 2 buttons so that i can manage to place atleast 6 buttons at the bottom of the screen.I am using the BFmsg.setMargin(305,0,0,40) statement. can anyone please help me on this. Following is my code : BFcontacts = new ButtonField("Cnt") { protected void paint(Graphics graphics) { //Bitmap contactsbitmap = Bitmap.getBitmapResource("contacts.jpg"); //graphics.drawBitmap(0, 0, contactsbitmap.getWidth(), contactsbitmap.getHeight(), contactsbitmap, 0, 0); graphics.setColor(Color.WHITE); graphics.drawText("Cnt",0,0); } }; BFcontacts.setMargin(305,0,0,10);//vertical pos,0,0,horizontal pos HFM.add(BFcontacts); BFmsg = new ButtonField("Msgs") { protected void paint(Graphics graphics) { //Bitmap msgsbitmap = Bitmap.getBitmapResource("messages.jpg"); //graphics.drawBitmap(0, 0, msgsbitmap.getWidth(), msgsbitmap.getHeight(), msgsbitmap, 0, 0); graphics.setColor(Color.WHITE); graphics.drawText("Msgs",0,0); } }; BFmsg.setMargin(305,0,0,40);//vertical pos,0,0,horizontal pos : original HFM.add(BFmsg); add(HFM) Thanks in advance

    Read the article

  • "pushModalScreen called by a non-event thread" thrown on event thread

    - by JGWeissman
    I am trying to get my Blackberry application to display a custom modal dialog, and have the opening thread wait until the user closes the dialog screen. final Screen dialog = new FullScreen(); ...// Fields are added to dialog Application.getApplication().invokeAndWait(new Runnable() { public void run() { Application.getUiApplication().pushModalScreen(dialog); } }); This is throwing an Exception which says "pushModalScreen called by a non-event thread" despite the fact that I am using invokeAndWait to call pushModalScreen from the event thread. Any ideas about what the real problem is? Here is the code to duplicate this problem: package com.test; import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; public class Application extends UiApplication { public static void main(String[] args) { new Application(); } private Application() { new Thread() { public void run() { Application.this.enterEventDispatcher(); } }.start(); final Screen dialog = new FullScreen(); final ButtonField closeButton = new ButtonField("Close Dialog"); closeButton.setChangeListener(new FieldChangeListener() { public void fieldChanged(Field field, int context) { Application.getUiApplication().popScreen(dialog); } }); dialog.add(closeButton); Application.getApplication().invokeAndWait(new Runnable() { public void run() { try { Application.getUiApplication().pushModalScreen(dialog); } catch (Exception e) { // To see the Exception in the debugger throw new RuntimeException(e.getMessage()); } } }); System.exit(0); } } I am using Component Package version 4.5.0.

    Read the article

  • CustomButton Field not aligning in the center

    - by rupesh
    Hi all I have created a custom button and i am placing the bunch of Custombuttons in a verticalfieldManager , I have aligned the verticalField Manager in the center. when i am creating a default buttonField then verticalfield Manager is able to align the buttonfield in the center. but when i am assigning custombuttonfield in the verticalField Manager it's not aligning in the center. here is my custombuttoncode enter code herepublic CustomButtonField(String label,long style) { super(style); this.label = label; onPicture = Bitmap.getBitmapResource(onPicturePath); font = getFont(); this.setPadding(5,5, 5, 5); } public String getLabel() { return label; } public int getPreferredHeight() { return onPicture.getHeight(); } public int getPreferredWidth() { return onPicture.getWidth(); } protected void layout(int width , int height) { setExtent(Math.min(width, Display.getWidth()), Math.min(height,getPreferredHeight())); } protected void paint(Graphics graphics) { int texty =(getHeight()-getFont().getHeight())/2; if (isFocus()) { graphics.setColor(Color.BLACK); graphics.drawBitmap(0, 0, getWidth(), getHeight(),onPicture , 0, 0); graphics.setColor(Color.WHITE); graphics.setFont(font); graphics.drawText(label,0,texty,DrawStyle.ELLIPSIS,getWidth()); } else { graphics.drawBitmap(0, 0, getWidth(), getHeight(),onPicture , 0, 0); graphics.setColor(Color.WHITE); graphics.setFont(font); graphics.drawText(label,0,texty,DrawStyle.ELLIPSIS,getWidth()); } } public boolean isFocusable() { return true; } protected void onFocus(int direction) { super.onFocus(direction); invalidate(); } protected void onUnfocus() { super.onUnfocus(); invalidate(); } protected boolean navigationClick(int status, int time) { fieldChangeNotify(0); return true; } protected boolean keyChar(char character, int status, int time) { if (character == Keypad.KEY_ENTER) { fieldChangeNotify(0); return true; } return super.keyChar(character, status, time); } }

    Read the article

  • Adding fields until screen is full

    - by Eric
    For the sake of this question, let us suppose that I want a row of buttons. I want to put as many buttons in that row as I can fit on the screen, but no more. In other words, as long as a prospective button will not be cut off or have its text shortened, add it. It seems that I should be able to do something like: HorizontalFieldManager hfm = new HorizontalFieldManager(); int remainingWidth = Display.getWidth(); int i =0; while(true) { ButtonField bf = new ButtonField("B " + i); remainingWidth -= bf.getWidth(); if(remainingWidth<0) break; hfm.add(bf); i++; } add(hfm); But this doesn't work. bf.getWidth() is always 0. I suspect that this is because the button has not yet been laid out when I query for the width. So, perhaps I could just make sure the buttons are always the same size. But this won't work for a few reasons: Different BB platforms have different looks for buttons and text that will fit on a button on a Curve won't fit on a button on a Storm. 3rd party themes may change the look of buttons, so I can't even count on buttons being a certain size on a certain platform. Is there no way for me to actually check the remaining space before adding a button? It feels like a fairly useful feature; am I just missing something?

    Read the article

  • Image rescale and write rescaled image file in blackberry

    - by Karthick
    I am using the following code to resize and save the file in to the blackberry device. After image scale I try to write image file into device. But it gives the same data. (Height and width of the image are same).I have to make rescaled image file.Can anyone help me ??? class ResizeImage extends MainScreen implements FieldChangeListener { private String path="file:///SDCard/BlackBerry/pictures/test.jpg"; private ButtonField btn; ResizeImage() { btn=new ButtonField("Write File"); btn.setChangeListener(this); add(btn); } public void fieldChanged(Field field, int context) { if (field == btn) { try { InputStream inputStream = null; //Get File Connection FileConnection fileConnection = (FileConnection) Connector.open(path); if (fileConnection.exists()) { inputStream = fileConnection.openInputStream(); //byte data[]=inputStream.toString().getBytes(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int j = 0; while((j=inputStream.read()) != -1) { baos.write(j); } byte data[] = baos.toByteArray(); inputStream.close(); fileConnection.close(); WriteFile("file:///SDCard/BlackBerry/pictures/org_Image.jpg",data); EncodedImage eImage = EncodedImage.createEncodedImage(data,0,data.length); int scaleFactorX = Fixed32.div(Fixed32.toFP(eImage.getWidth()), Fixed32.toFP(80)); int scaleFactorY = Fixed32.div(Fixed32.toFP(eImage.getHeight()), Fixed32.toFP(80)); eImage=eImage.scaleImage32(scaleFactorX, scaleFactorY); WriteFile("file:///SDCard/BlackBerry/pictures/resize.jpg",eImage.getData()); BitmapField bit=new BitmapField(eImage.getBitmap()); add(bit); } } catch(Exception e) { System.out.println("Exception is ==> "+e.getMessage()); } } } void WriteFile(String fileName,byte[] data) { FileConnection fconn = null; try { fconn = (FileConnection) Connector.open(fileName,Connector.READ_WRITE); } catch (IOException e) { System.out.print("Error opening file"); } if (fconn.exists()) try { fconn.delete(); } catch (IOException e) { System.out.print("Error deleting file"); } try { fconn.create(); } catch (IOException e) { System.out.print("Error creating file"); } OutputStream out = null; try { out = fconn.openOutputStream(); } catch (IOException e) { System.out.print("Error opening output stream"); } try { out.write(data); } catch (IOException e) { System.out.print("Error writing to output stream"); } try { fconn.close(); } catch (IOException e) { System.out.print("Error closing file"); } } }

    Read the article

  • Blackberry (Java) - Setting scrolling be not focused on objects on the screen

    - by paullb
    I have a mainscreen which currently scrolls (and I have the arrows on the right) but the scrolling seems to be focused on the ButtonField objects that I have on the page. Is there any way to set the scrolling to be non-focused scrolling (moving a few pixels each time). Is there a way to set this? Other ideas I have had (which sound hacky so I want to avoid): - Placing NullFields around to scroll - Manually listening to the trackwheelRoll event and moving appropriately

    Read the article

  • Binding a Button to a GridView

    - by Tyler
    This a pretty simple question, I'm just not sure how to do it exactly. I would like to bind a Button or perhaps ImageButton to a GridView in ASP.NET/C#. Currently, the GridView has two columns and is bound to a DataTable with two columns. I want to add a third column to the GridView, which will include the Button. I know GridView has ButtonField, but I'm not too sure how to go about using it to do what I want. I want to dynamically generate these Buttons and add them to the GridView. Here is how my GridView looks right now: <asp:GridView ID="GridView1" Runat="server"> <Columns> <asp:HyperLinkField HeaderText="Display Name" DataNavigateUrlFields="DISPNAME" DataNavigateUrlFormatString="ViewItem.aspx" DataTextField="DISPNAME"> <ItemStyle Width="70%" /> </asp:HyperLinkField> <asp:BoundField DataField="TypeDisp" HeaderText="Type"> <ItemStyle Width="20%" /> </asp:BoundField> </Columns> </asp:GridView>

    Read the article

  • Using POST or SESSION to capture data

    - by Karinne
    Hi all! I'm currently working on web application using VB in ASP.NET. Right now I have 1 page with panels that we are using to show/hide depending on the flow. When the user first comes in, he/she is presented with a gridview containing a list of clients. Then the user, clicks a link from a row and is presented a form where he/she can update the clients' info. Originally, I had a HYPERLINKFIELD that put the clientId in the url, then I'd grab the url and do the code appropriately <asp:HyperLinkField Text='<%$ Resources:Resource, ManageClient %>' DataNavigateUrlFields="CLIENT_ID" DataNavigateUrlFormatString="~/clients/manage.aspx?clientId={0}" /> Now, I'm rethinking that and wondering if it's better to use SESSIONs to grab the clientID via this instead <asp:TemplateField Visible="false"><ItemTemplate><asp:Label runat="server" ID="hidClientId" Text='<%# Bind("CLIENT_ID")%>' Visible="false" /></ItemTemplate></asp:TemplateField> <asp:ButtonField Text='<%$ Resources:Resource, ManageClient %>' CommandName="Manage" /> Or use the POST method, which I'm not sure how it works in .NET (but I've used it in PHP) Any help would be greatly appreciated.

    Read the article

1 2  | Next Page >