Search Results

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

Page 2/2 | < Previous Page | 1 2 

  • Layout question with BlackBerry IDE FieldManagers; how to emulate HTML's rowspan

    - by canadiancreed
    Hello all I'm trying to create a page where a list of items are displayed in a row where there are multiple columns on the left, but only one on the right, encased within a horizontialFieldManager. Currently I have the following code to attempt to do the following: VerticalFieldManager mainScreenManager = new VerticalFieldManager(); mainScreenManager.add(titleField); for (int i = 0; i < 10; i++) { HorizontalFieldManager itemAreaManager = new HorizontalFieldManager(); VerticalFieldManager itemTextFieldsAreaManager = new VerticalFieldManager(); itemTextFieldsAreaManager.add(new RichTextField(contentArticleTitle[i])); itemTextFieldsAreaManager.add(new RichTextField(contentArticleDate[i])); itemTextFieldsAreaManager.add(new SeparatorField()); itemAreaManager.add(itemTextFieldsAreaManager); itemAreaManager.add(new ButtonField("", 0)); mainScreenManager.add(itemAreaManager); }; add(mainScreenManager); Now the issue I'm experiencing is probably obvious to those familiar with managers; the horizontialFieldManager has the first item added to it consuming the entire width available, thereby never showing the button. What I'm wondering is how can I tell this in an extended class to only take up a certain percentage of the available width? I've tried subLayout and setting the width to be a certain amount, but it will just show the button instead of the text (pretty much same problem, just reversed)

    Read the article

  • Grid View Button Passing Data Via On Click

    - by flyersun
    Hi, I'm pretty new to C# and asp.net so aplogies if this is a really stupid question. I'm using a grid view to display a number of records from a database. Each row has an Edit Button. When the button is clicked I want an ID to be passed back to a funtion in my .cs file. How do I bind the rowID to the Button field? I've tired using a hyper link instead but this doens't seem to work because I'm posting back to the same page which already has a Permanter on the URL. asp.net <asp:GridView ID="gvAddresses" runat="server" onrowcommand="Edit_Row"> <Columns> <asp:ButtonField runat="server" ButtonType="Button" Text="Edit"> </Columns> </asp:GridView> c# int ImplantID = Convert.ToInt32(Request.QueryString["ImplantID"]); Session.Add("ImplantID", ImplantID); List<GetImplantDetails> DataObject = ImplantDetails(ImplantID); System.Data.DataSet DSImplant = new DataSet(); System.Data.DataTable DTImplant = new DataTable("Implant"); DSImplant.Tables.Add(DTImplant); DataColumn ColPostCode = new DataColumn(); ColPostCode.ColumnName = "PostCode"; ColPostCode.DataType = typeof(string); DTImplant.Columns.Add(ColPostCode); DataColumn ColConsigneeName = new DataColumn(); ColConsigneeName.ColumnName = "Consignee Name"; ColConsigneeName.DataType = typeof(string); DTImplant.Columns.Add(ColConsigneeName); DataColumn ColIsPrimaryAddress = new DataColumn(); ColIsPrimaryAddress.ColumnName = "Primary"; ColIsPrimaryAddress.DataType = typeof(int); DTImplant.Columns.Add(ColIsPrimaryAddress); DataColumn ColImplantCustomerDetailsID = new DataColumn(); ColImplantCustomerDetailsID.ColumnName = "Implant ID"; ColImplantCustomerDetailsID.DataType = typeof(int); DTImplant.Columns.Add(ColImplantCustomerDetailsID); foreach (GetImplantDetails Object in DataObject) { DataRow DRImplant = DTImplant.NewRow(); DRImplant["PostCode"] = Object.GetPostCode(); DRImplant["Consignee Name"] = Object.GetConsigneeName(); DRImplant["Primary"] = Object.GetIsPrimaryAddress(); DRImplant["Implant ID"] = Object.GeTImplantCustomerDetailsID(); DTImplant.Rows.Add(DRImplant); <--- this is what I need to be added to the button } gvAddresses.DataSource = DTImplant; gvAddresses.DataBind();

    Read the article

  • Blackberry - Exception when sending SMS programmatically

    - by user213199
    Hello all, I am developing a Blackberry application. I am trying to send SMS programmatically to GSM number. I have gone through many queries and answers related to that and finally added the code for that as below. When the code tries to execute sending some text message to the particular mobile number, it doesn't send and throws exception as "blocking operation not permitted on event dispatch thread". So i created a separate background thread where i put the SMS code and running the code now. But still observing the same exception. Could someone please suggest what am i doing wrong (or) how to do that? class DummyFirst extends MainScreen { private Bitmap background; private VerticalFieldManager _container; private VerticalFieldManager mainVerticalManager; private HorizontalFieldManager horizontalFldManager; private BackGroundThread _thread; CustomControl buttonControl1; public DummyFirst() { super(); LabelField appTitle = new LabelField("Dummy App"); setTitle(appTitle); background = Bitmap.getBitmapResource("HomeBack.png"); _container = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR) { protected void paint(Graphics g) { // Instead of these next two lines, draw your bitmap int y = DummyFirst.this.getMainManager() .getVerticalScroll(); g.clear(); g.drawBitmap(0, 0, background.getWidth(), background .getHeight(), background, 0, 0); super.paint(g); } protected void sublayout(int maxWidth, int maxHeight) { int width = background.getWidth(); int height = background.getHeight(); super.sublayout(width, height); setExtent(width, height); } }; mainVerticalManager = new VerticalFieldManager( Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR) { protected void sublayout(int maxWidth, int maxHeight) { int width = background.getWidth(); int height = background.getHeight(); super.sublayout(width, height); setExtent(width, height); } }; HorizontalFieldManager horizontalFldManager = new HorizontalFieldManager(Manager.USE_ALL_WIDTH); buttonControl1 = new CustomControl("Send", ButtonField.CONSUME_CLICK, 83, 15); horizontalFldManager.add(buttonControl1); this.setStatus(horizontalFldManager); FieldListener listner = new FieldListener(); buttonControl1.setChangeListener(listner); _container.add(mainVerticalManager); this.add(_container); } class FieldListener implements FieldChangeListener { public void fieldChanged(Field f, int context) { if (f == buttonControl1) { _thread = new BackGroundThread(); _thread.start(); } } } private class BackGroundThread extends Thread { public BackGroundThread() { /*** initialize parameters in constructor *****/ } public void run() { // UiApplication.getUiApplication().invokeLater(new Runnable() UiApplication.getUiApplication().invokeLater(new Runnable() { public void run() { try { MessageConnection msgConn = (MessageConnection) Connector .open("sms://:0"); Message msg = msgConn .newMessage( MessageConnection.TEXT_MESSAGE); TextMessage txtMsg = (TextMessage) msg; String msgAdr = "sms://+919861348735"; txtMsg.setAddress(msgAdr); txtMsg.setPayloadText("Test Message"); // here exception is thrown msgConn.send(txtMsg); System.out.println("Sending" + " SMS success !!!"); } catch (Exception e) { System.out.println(e.getMessage()); e.printStackTrace(); } } // run }); } } public boolean onClose() { System.out.println("close event called, request to be" + " in the backgroud...."); UiApplication.getUiApplication().requestBackground(); return true; } } I resolved this issue by creating a separate thread and then not using Port etc. Here it is: SMSThread smsthread = new SMSThread("Some message",mobNumber); smsthread.start(); class SMSThread extends Thread { Thread myThread; MessageConnection msgConn; String message; String mobilenumber; public SMSThread( String textMsg, String mobileNumber ) { message = textMsg; mobilenumber = mobileNumber; } public void run() { try { msgConn = (MessageConnection) Connector.open("sms://+"+ mobilenumber); TextMessage text = (TextMessage) msgConn.newMessage(MessageConnection.TEXT_MESSAGE); text.setPayloadText(message); msgConn.send(text); msgConn.close(); } catch (Exception e) { System.out.println("Exception: " + e); } } }

    Read the article

< Previous Page | 1 2