Search Results

Search found 16738 results on 670 pages for 'lwuit button'.

Page 5/670 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to wrap text of html button with fixed width

    - by Peter
    I just noticed that if you give a html button a fixed width, the text inside the button is never wrapped. I've tried it with word-wrap, but that cuts of the word even though there are spaces available to wrap on. How can I make the text of an html button with a fixed width wrap like any tablecell would? <td class="category_column"> <input type="submit" name="ctl00$ContentPlaceHolder1$DataList1$ctl12$ProCat_NameButton" value="Roos Sturingen / Sensors" id="ctl00_ContentPlaceHolder1_DataList1_ctl12_ProCat_NameButton" class="outset" style="height:118px;width:200px;font-size:18px;color:#7F7F7F;width:200px;white-space:pre;" /> </td> the css classes do nothing but adding borders and modify the padding. If I add word-wrap:break-word to this button, it will wrap it like this: Roos Sturingen / Sen sors And I dont want it to cut of in the middle of a word if it is possible to cut it off between words. Thanks

    Read the article

  • Trying to Make mini Jeopardy flash game button help pls

    - by Jinnra
    Hey im a noob in flash cs3 and i want to create a jeopardy game where when a button is pressed we go in to the main question scene and when we come back the button the we pressed is now disabled via 'button._visible=flase'...pls any help...any suggestions or links to tutorials or tutorials from you guys or girls will grateful thanx...

    Read the article

  • Dashcode newbie question: Change a button's label programmatically

    - by Koning Baard XIV
    Hi all! I'm new to Mac OS X Dashboard developement. Now, I have a button with id b_start. When that button is clicked, I want the label of the button to change to "Round". Now I have tried these, but none of them work: document.getElementById("b_start").label = "Round"; document.getElementById("b_start").text = "Round"; document.getElementById("b_start").innerText = "Round"; document.getElementById("b_start").object.setValue("Round"); document.getElementById("b_start").value = "Round"; Does anyone how I can change the button's label? Thanks in advance.

    Read the article

  • Android: Goto HTTP Url on Button Click

    - by George
    Hi all, I want to go to a web page on the click of a button in my android app. So say, I have a button called "Google", when the user clicks on that button I want google.com to open up on the screen. How is this achieved? Also, is there a way I can gain control back to my app once the user is finished with google? Thanks George

    Read the article

  • Remove the complete stying of a html button/submit

    - by Saif Bechan
    Is there a way of completely removing the styling of a button in Internet Explorer. I use a css sprite for my button, and everything looks ok. But when i click the button, it moves to the top a little, it makes it look out of shape. Is there a css click state, or mousedown? I don't know what triggers that state. I know it't not a really big deal, but sometimes it's the small things that matter.

    Read the article

  • [IE] Remove the complete styling of an HTML button/submit

    - by Saif Bechan
    Is there a way of completely removing the styling of a button in Internet Explorer? I use a css sprite for my button, and everything looks ok. But when I click the button, it moves to the top a little, it makes it look out of shape. Is there a css click state, or mousedown? I don't know what triggers that state. I know it's not a really big deal, but sometimes it's the small things that matter.

    Read the article

  • ASP.Net IE6 disable button

    - by RemotecUk
    Hi, I have the following code running as part of my OnClientclick attribute on my custom ASP.Net button.... function clickOnce(btnSubmit) { if ( typeof( Page_ClientValidate ) == 'function' ) { if ( ! Page_ClientValidate() ) { return false; } } btnSubmit.disabled = true; } There is a validator on the page. If a given text box is empty then the validator activates no problem. If a given text box is populated then the button disables but a post back does not occur. The rendered markup looks like this... <input type="submit" name="TestButton" value="Test Button" onclick="clickOnce(this);WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;TestButton&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="TestButton" class="euva-button-decorated" /> This works nicely in Firefox but not in IE6. Its almost like after the button has been disabled it simply does not run the post back javascript. Any ideas welcomed. EDIT: I have tried returning true from the function as well.

    Read the article

  • Create a jQueryUI 1.8 Button menu

    - by Brian M. Hunt
    Now that jQueryUI 1.8 is out, I was browsing through the updates and came across the new Button widget, and in particular one of the demos with the SplitButton with a dropdown. This demo seems to suggest that the Button widget could be used to create a dropdown menu here. As a matter of discussion, I was wondering what ways there are to go about creating a dropdown menu with this new Button widget. Cheers.

    Read the article

  • Changing the color of a Rebol button

    - by Dave Matuszek
    I want to ask multiple choice questions in Rebol. Possible answers will be on buttons. I want to turn a button red when it is clicked and it is the wrong answer. When the correct button is pressed, I want to proceed to the next question. I can change the color of a box (mybox/color: red show mybox). I can set up a toggle with two colors (but I can't change it based on the result of an arbitrary test (is the answer correct?). It seems like there is probably a simple way to change the color of a button, without having to create my own button-like face objects. Isn't there?

    Read the article

  • Stupid Facebook Connect question about customizing the share-button

    - by Geuis
    I really hate asking about anything retarded as Facebook Connect on SO, but their own development forums are horrendous. We're implementing a Facebook share button using this: <fb:share-button class="url" href="http://oursite.com/"></fb:shared-button> This is documented(poorly) here: http://wiki.developers.facebook.com/index.php/Fb:share-button I need to be able to change the text from "Share" to something else. I've spent 2 hours looking for an answer to this and have come up short. Thanks a lot for any help, and sorry for asking about something this retarded.

    Read the article

  • ASP: button to input submit

    - by vishnu
    Hi All, I am trying to use literalcontrol to add a button as input type="submit" litLevelList.Text += string.Format(" &lt input type='submit' id='{0}' value='{1}' name='{2}' >", btnSave.ClientID, Lang.Trans("Save Changes " ) , btnSave. ??); I could get the button ID using CLientID but without the name the data doesnt seems to be submitted. Could anyone tell me how i could access the name value rendered by ASP for a button control. thanks, vishnu

    Read the article

  • focus not going to another button in android

    - by Rajendar
    Hi, I wrote a code for pinging of given URL.It works fine for me.But whenever i clicked on the start ping button, pinging started but that time focus always is on start button and no widget of the screen working that time. After pressing many times it will gives the force close error.If iam giving URL which is not pinging then that time , all the widgets are working fine.After some time i need to stop the pinging by using my stop button.But it is not working.Please give me advise.Iam using Runtime.exec() for ping command in my android.Plz give me advise.

    Read the article

  • changing "enabled" value of a button during runtime in flex

    - by ruchir patwa
    i want to make a button disabled if a datagrid is empty and it should be enabled when there is atleast 1 entry.the entries in the grid are made at runtime.I tried this this is the button: <mx:Button id="update" label="Update Contact" enabled="{isButtonEnabled()}"/> and the function is defined as where dg_contact is the datagrid: public function isButtonEnabled():Boolean { if(dg_contact.selectedIndex==-1) { return false; } else { return true; } } where am i going wrong?

    Read the article

  • Different button's name at the opening of jquery dialog

    - by Luca Belluco
    Hello, I have a dialog form and when I open it I have the button "add a task", I would like to keep this "name", when I open the form from an empty case, but I want to have a button named "edit this task" when I open an already existing task. I also want to send the form with this button when I push enter key, no matter where I am on the form. Thank you.

    Read the article

  • Keep PyGTK Button from Resizing on Label Change

    - by Cap
    I'm working on a PyGTK app with some Buttons that, when clicked, give a text entry dialog, then set the text on the button to whatever was entered in the box. The problem is that if the text is longer than the button can show, the button changes size to accomodate. How do I keep GTK Buttons from resizing when the text changes?

    Read the article

  • Extjs 3.4 - Button Icon does not show or does not center

    - by Chris
    I want to fill a button with an icon I created but whatever I have tried just seems to put the icon either half cut off and way left, or it doesn't show at all. I've been trying different combinations of CSS and the icon, iconcls, cls button options. I was following the Ext 3 buttons example page but that doesn't seem to display anything for me... This code is an item inside my form panel (I try to replicate this with different buttons in the panel) { xtype: 'container', layout: { type: 'table', columns: 2, tableAttrs: { cellspacing: 5 } }, // padding: 5, pack: 'center', align: 'middle', items: [{ xtype: 'button', width: 40, // scale: 'medium', ref: '../drawToolsBtn', tooltip: 'Drawing Tools', icon: 'img/draw.png', iconAlign: 'top', baseCls: 'x-plain', // iconCls: 'drawBtn', enableToggle: true, // padding: 3, toggleHandler: function(btn, state) { this.showDrawToolsWin(state); }, scope: this },{ xtype: 'label', // columnWidth: 1, // remainder of container padding: 3, text: 'Click button to open Drawing Tools Menu' }] } CSS -------------------- .drawBtn{ background: url(../img/draw.png) !important; } Thank you for any help!

    Read the article

  • Why does this CSS button mess with <a> tags?

    - by Ian McCullough
    Here is my CSS button { border: 0 none; cursor: pointer; padding: 0 15px 0 0; text-align: center; height: 30px; line-height: 30px; width: auto; } button a { color:white; text-decoration:none; } button.rounded { background: transparent url(/images/button/btn_right.png) no-repeat scroll right top; clear: left; font-size: 0.8em; } button span { display: block; padding: 0 0 0 15px; position: relative; white-space: nowrap; height: 30px; line-height: 30px; } button.rounded span { background: transparent url(/images/button/btn_left.png) no-repeat scroll left top; color: #FFFFFF; } button.rounded:hover { background-position: 100% -30px; } button.rounded:hover span { background-position: 0% -30px; } button::-moz-focus-inner { border: none; } Here is the code for my "button" with a link in it. <button class="rounded"><span><a href="profile.php">Profile</a></span></button> The issue is it does not link to the href when i click on it. Anyone know why?

    Read the article

  • Using Radio Button in GridView with Validation

    - by Vincent Maverick Durano
    A developer is asking how to select one radio button at a time if the radio button is inside the GridView.  As you may know setting the group name attribute of radio button will not work if the radio button is located within a Data Representation control like GridView. This because the radio button inside the gridview bahaves differentely. Since a gridview is rendered as table element , at run time it will assign different "name" to each radio button. Hence you are able to select multiple rows. In this post I'm going to demonstrate how select one radio button at a time in gridview and add a simple validation on it. To get started let's go ahead and fire up visual studio and the create a new web application / website project. Add a WebForm and then add gridview. The mark up would look something like this: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" > <Columns> <asp:TemplateField> <ItemTemplate> <asp:RadioButton ID="rb" runat="server" /> </ItemTemplate> </asp:TemplateField> <asp:BoundField DataField="RowNumber" HeaderText="Row Number" /> <asp:BoundField DataField="Col1" HeaderText="First Column" /> <asp:BoundField DataField="Col2" HeaderText="Second Column" /> </Columns> </asp:GridView> Noticed that I've added a templatefield column so that we can add the radio button there. Also I have set up some BoundField columns and set the DataFields as RowNumber, Col1 and Col2. These columns are just dummy columns and i used it for the simplicity of this example. Now where these columns came from? These columns are created by hand at the code behind file of the ASPX. Here's the code below: private DataTable FillData() { DataTable dt = new DataTable(); DataRow dr = null; //Create DataTable columns dt.Columns.Add(new DataColumn("RowNumber", typeof(string))); dt.Columns.Add(new DataColumn("Col1", typeof(string))); dt.Columns.Add(new DataColumn("Col2", typeof(string))); //Create Row for each columns dr = dt.NewRow(); dr["RowNumber"] = 1; dr["Col1"] = "A"; dr["Col2"] = "B"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["RowNumber"] = 2; dr["Col1"] = "AA"; dr["Col2"] = "BB"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["RowNumber"] = 3; dr["Col1"] = "A"; dr["Col2"] = "B"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["RowNumber"] = 4; dr["Col1"] = "A"; dr["Col2"] = "B"; dt.Rows.Add(dr); dr = dt.NewRow(); dr["RowNumber"] = 5; dr["Col1"] = "A"; dr["Col2"] = "B"; dt.Rows.Add(dr); return dt; } And here's the code for binding the GridView with the dummy data above. protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GridView1.DataSource = FillData(); GridView1.DataBind(); } } Okay we have now a GridView data with a radio button on each row. Now lets go ahead and switch back to ASPX mark up. In this example I'm going to use a JavaScript for validating the radio button to select one radio button at a time. Here's the javascript code below: function CheckOtherIsCheckedByGVID(rb) { var isChecked = rb.checked; var row = rb.parentNode.parentNode; if (isChecked) { row.style.backgroundColor = '#B6C4DE'; row.style.color = 'black'; } var currentRdbID = rb.id; parent = document.getElementById("<%= GridView1.ClientID %>"); var items = parent.getElementsByTagName('input'); for (i = 0; i < items.length; i++) { if (items[i].id != currentRdbID && items[i].type == "radio") { if (items[i].checked) { items[i].checked = false; items[i].parentNode.parentNode.style.backgroundColor = 'white'; items[i].parentNode.parentNode.style.color = '#696969'; } } } } The function above sets the row of the current selected radio button's style to determine that the row is selected and then loops through the radio buttons in the gridview and then de-select the previous selected radio button and set the row style back to its default. You can then call the javascript function above at onlick event of radio button like below: <asp:RadioButton ID="rb" runat="server" onclick="javascript:CheckOtherIsCheckedByGVID(this);" /> Here's the output below: On Load: After Selecting a Radio Button: As you have noticed, on initial load there's no default selected radio in the GridView. Now let's add a simple validation for that. We will basically display an error message if a user clicks a button that triggers a postback without selecting  a radio button in the GridView. Here's the javascript for the validation: function ValidateRadioButton(sender, args) { var gv = document.getElementById("<%= GridView1.ClientID %>"); var items = gv.getElementsByTagName('input'); for (var i = 0; i < items.length ; i++) { if (items[i].type == "radio") { if (items[i].checked) { args.IsValid = true; return; } else { args.IsValid = false; } } } } The function above loops through the rows in gridview and find all the radio buttons within it. It will then check each radio button checked property. If a radio is checked then set IsValid to true else set it to false.  The reason why I'm using IsValid is because I'm using the ASP validator control for validation. Now add the following mark up below under the GridView declaration: <br /> <asp:Label ID="lblMessage" runat="server" /> <br /> <asp:Button ID="btn" runat="server" Text="POST" onclick="btn_Click" ValidationGroup="GroupA" /> <asp:CustomValidator ID="CustomValidator1" runat="server" ErrorMessage="Please select row in the grid." ClientValidationFunction="ValidateRadioButton" ValidationGroup="GroupA" style="display:none"></asp:CustomValidator> <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="GroupA" HeaderText="Error List:" DisplayMode="BulletList" ForeColor="Red" /> And then at Button Click event add this simple code below just to test if  the validation works: protected void btn_Click(object sender, EventArgs e) { lblMessage.Text = "Postback at: " + DateTime.Now.ToString("hh:mm:ss tt"); } Here's the output below that you can see in the browser:   That's it! I hope someone find this post useful! Technorati Tags: ASP.NET,JavaScript,GridView

    Read the article

  • When a asp.net button is clicked, add #button to the url

    - by Blankman
    Using jquery, when a button is clicked (server side), I want to append #button to the url. This will only be used when there is validation errors, I want the browser to scroll to the bottom where the button is. I already tried MaintainScrollPositionOnPostback but it doesn't work here since the validation rows are made visible upon clicking the button.

    Read the article

  • How to maintain the state of button cutom listview in android

    - by Akshay
    I have custom ListView with three TextView three Button and three Chronometer. And the situation is I am loading the ListView properly.But while loading ListView I am disabling some button in the ListView by checking one parameter. Up to this point ListView is showing it's row properly. But when I am scrolling the ListView at that time previously enabled Button are getting disabled.What I am doing wrong I am not getting can one please point out my mistake Or any suggestion. Here is my Adapter class. public class OrderSmartKitchenAdapter extends BaseAdapter { private int flagDeliveryComplete = 0; private int flagPreparationComplete = 0; private int flagPreparationStarted = 0; private List<OrderitemdetailsBO> list = new ArrayList<OrderitemdetailsBO(); private int orderStatus; public OrderSmartKitchenAdapter() { // TODO Auto-generated constructor stub } public void setOrderList(List<OrderitemdetailsBO> orderList) { this.list = orderList; } @Override public int getCount() { // TODO Auto-generated method stub Log.i("OrderItemList Size :-", Integer.toString(list.size())); return list.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return null; } @Override public long getItemId(int position) { // TODO Auto-generated method stub return 0; } @Override public View getView(final int position, View convertView,ViewGroup parent) { // TODO Auto-generated method stub final ViewHolder viewHolder ; if (convertView == null) { layoutInflater = LayoutInflater.from(myContext); convertView = layoutInflater.inflate(R.layout.table_row_view,null); viewHolder = new ViewHolder(); viewHolder.txtTableNumber = (TextView) convertView.findViewById(R.id.txtTableNumber); viewHolder.txtMenuItem = (TextView) convertView.findViewById(R.id.txtMenuItem); viewHolder.txtQuantity = (TextView) convertView.findViewById(R.id.txtQuantity); viewHolder.txtOrderAcceptanceTime = (TextView) convertView.findViewById(R.id.txtOrderAcceptanceTime); viewHolder.txtElapsedTimeOfOrderAcceptance = (Chronometer) convertView.findViewById(R.id.txtElapsedTimeOfOrderAcceptance); viewHolder.btnPreparationStart = (Button) convertView.findViewById(R.id.btnPreparationStart); viewHolder.btnPreparationStart.setTag(position); viewHolder.txtElapsedTimeForPreparation = (Chronometer) convertView.findViewById(R.id.txtElapsedTimeForPrepatration); viewHolder.btnPreparationComplete = (Button) convertView.findViewById(R.id.btnPreparationCompleted); viewHolder.btnPreparationComplete.setTag(position); viewHolder.txtElapsedTimeForDeliveryComplete = (Chronometer) convertView.findViewById(R.id.txtElapsedTimeForCompleation); viewHolder.btnDeliveryComplete = (Button) convertView.findViewById(R.id.btnOrderComplete); viewHolder.btnDeliveryComplete.setTag(position); convertView.setTag(viewHolder); } else{ viewHolder = (ViewHolder)convertView.getTag(); viewHolder.btnDeliveryComplete.setTag(position); viewHolder.btnPreparationComplete.setTag(position); viewHolder.btnPreparationStart.setTag(position); } if (list.get(position) != null) { OrderitemdetailsBO orderitemdetailsBO = new OrderitemdetailsBO(); orderitemdetailsBO = list.get(position); viewHolder.txtTableNumber.setText(orderitemdetailsBO.getOrderitemid().toString()); viewHolder.txtMenuItem.setText(orderitemdetailsBO.getMenuitemname().toString()); viewHolder.txtQuantity.setText(orderitemdetailsBO.getQuantity().toString()); Log.i("Table Number :-", Long.toString(orderitemdetailsBO.getOrderitemid())); Log.i("Menu Name :-", orderitemdetailsBO.getMenuitemname().toString()); Log.i("Quantity", orderitemdetailsBO.getQuantity().toString()); Date acceptTime = new Date(); acceptTime = orderitemdetailsBO.getOrderdatetime(); viewHolder.txtOrderAcceptanceTime.setText(DateUtil.getDateAsString(acceptTime,"HH:mm")); Log.i("Order Accept Time :-", acceptTime.getMinutes() + ":"+ acceptTime.getSeconds()); orderStatus = orderitemdetailsBO.getOrderstatus(); Date preparationStartTime = new Date(); preparationStartTime = orderitemdetailsBO.getPreparationstarttime(); if(preparationStartTime != null) { Log.i("OrderSmartKitchenActivity", "2 Order Acceptance Time :-" + "Menu Item id "+ orderitemdetailsBO.getOrderitemid() + " Preparation Start time " + orderitemdetailsBO.getPreparationstarttime() ); viewHolder.txtElapsedTimeOfOrderAcceptance.stop(); Log.i("Preparation Start Time :-",preparationStartTime.getMinutes() + ":" + preparationStartTime.getSeconds()); viewHolder.txtElapsedTimeOfOrderAcceptance.setText(DateUtil.getDateAsString(preparationStartTime,"MM:ss")); viewHolder.txtElapsedTimeOfOrderAcceptance.stop(); viewHolder.btnPreparationStart.setEnabled(false); viewHolder.btnPreparationStart.setClickable(false); viewHolder.btnPreparationStart.setBackgroundColor(Color.LTGRAY); } else { Long n = acceptTime.getTime(); Log.i("OrderSmartKitchenActivity", "Order Acceptance Time :-" + "Menu Item id "+ orderitemdetailsBO.getOrderitemid() + " Acceptance time" + Long.toString(n) + " Preparation Start time " + orderitemdetailsBO.getPreparationstarttime() ); // Calculate Time difference viewHolder.txtElapsedTimeOfOrderAcceptance.setBase(SystemClock.elapsedRealtime() - System.currentTimeMillis() + n); viewHolder.txtElapsedTimeOfOrderAcceptance.getBase(); viewHolder.txtElapsedTimeOfOrderAcceptance.start(); viewHolder.txtElapsedTimeOfOrderAcceptance.setFormat("%s"); } viewHolder.btnPreparationStart.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { // TODO Auto-generated method stub if (flagPreparationStarted == 0) { flagPreparationStarted++; v.startAnimation(playAnimation()); handler.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub v.clearAnimation(); Date currentTime = new Date(); // Set Preparation Start Time. viewHolder.txtElapsedTimeOfOrderAcceptance.stop(); Date setTime = new Date(currentTime.getTime() * 1000); OrderitemdetailsBO orderitemdetailsBO = list.get(position); orderitemdetailsBO.setPreparationstarttime(setTime); String orderDetails = "2"; String getPosition = Integer.toString(position); viewHolder.btnPreparationStart.setBackgroundColor(Color.LTGRAY); new sendOrderStatusToServer().execute(orderDetails,getPosition); } }, 5000); } else { handler.removeCallbacksAndMessages(null); v.clearAnimation(); flagPreparationStarted = 0; Log.i("Handler Removed. :-", "Here"); } } }); String preparationTime = orderitemdetailsBO.getOrderpreparationtime(); if(preparationTime != null && orderStatus == order_preparationComplete) { viewHolder.txtElapsedTimeForPreparation.setText(preparationTime); viewHolder.txtElapsedTimeForPreparation.stop(); viewHolder.btnPreparationComplete.getTag(position); viewHolder.btnPreparationComplete.setEnabled(false); viewHolder.btnPreparationComplete.setClickable(false); viewHolder.btnPreparationComplete.setBackgroundColor(Color.LTGRAY); } else if( orderStatus == order_preparationStart || orderStatus == orderReceived || orderStatus == order_delivered){ Long n = acceptTime.getTime(); Log.i("Preparation Start Time :-", Long.toString(n)); viewHolder.txtElapsedTimeForPreparation.setBase(SystemClock.elapsedRealtime() - System.currentTimeMillis() + n); viewHolder.txtElapsedTimeForPreparation.getBase(); viewHolder.txtElapsedTimeForPreparation.start(); viewHolder.txtElapsedTimeForPreparation.setFormat("%s"); } viewHolder.btnPreparationComplete.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { // TODO Auto-generated method if (flagPreparationComplete == 0) { flagPreparationComplete++; v.startAnimation(playAnimation()); handler.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub v.clearAnimation(); OrderitemdetailsBO orderitemdetailsBO = list.get(position); Date date = orderitemdetailsBO.getPreparationstarttime(); if(date != null) { viewHolder.txtElapsedTimeForPreparation.stop(); Date currentTime = new Date(); Calendar calendar = Calendar.getInstance(); int minute = calendar.get(Calendar.MINUTE); int second = calendar.get(Calendar.SECOND); orderitemdetailsBO.setOrderpreparationtime(calendar.get(Calendar.MINUTE) +":" +calendar.get(Calendar.SECOND)); String orderDetails = "3"; String getPosition = Integer.toString(position); viewHolder.btnPreparationComplete.setBackgroundColor(Color.LTGRAY); new sendOrderStatusToServer().execute(orderDetails,getPosition); } else { Toast.makeText(myContext, "Please Enter Preparation Start Time.", Toast.LENGTH_LONG).show(); } } }, 5000); } else { handler.removeCallbacksAndMessages(null); v.clearAnimation(); flagPreparationComplete = 0; } } }); String deleveredTime = orderitemdetailsBO.getOrderdeliverytime(); if(deleveredTime != null && orderStatus == order_delivered) { Date delevered = new Date(Long.parseLong(deleveredTime)); viewHolder.txtElapsedTimeForPreparation.setText(DateUtil.getDateAsString(delevered,"MM:ss")); Log.i("Preparation Start Time :-", delevered.getMinutes()+":"+delevered.getSeconds()); viewHolder.txtElapsedTimeForPreparation.stop(); viewHolder.btnDeliveryComplete.getTag(position); viewHolder.btnDeliveryComplete.setEnabled(false); viewHolder.btnDeliveryComplete.setClickable(false); viewHolder.btnDeliveryComplete.setBackgroundColor(Color.LTGRAY); } else if(orderStatus == 3 || orderStatus == 2 || orderStatus == 1) { Long n = acceptTime.getTime(); Log.i("Preparation Start Time :-", Long.toString(n)); viewHolder.txtElapsedTimeForDeliveryComplete.setTag(list.get(position)); viewHolder.txtElapsedTimeForDeliveryComplete.setBase(SystemClock.elapsedRealtime() - System.currentTimeMillis() + n); viewHolder.txtElapsedTimeForDeliveryComplete.getBase(); viewHolder.txtElapsedTimeForDeliveryComplete.start(); viewHolder.txtElapsedTimeForDeliveryComplete.setFormat("%s"); } viewHolder.btnDeliveryComplete.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { // TODO Auto-generated method stub if (flagDeliveryComplete == 0) { flagDeliveryComplete++; v.startAnimation(playAnimation()); handler.postDelayed(new Runnable() { @Override public void run() { // TODO Auto-generated method stub v.clearAnimation(); OrderitemdetailsBO orderitemdetailsBO = list.get(position); Date date = orderitemdetailsBO.getPreparationstarttime(); String preparationComplete = orderitemdetailsBO.getOrderpreparationtime(); if(date != null && preparationComplete != null ) { Date currentTime = new Date(); Calendar calendar = Calendar.getInstance(); viewHolder.txtElapsedTimeForDeliveryComplete.stop(); orderitemdetailsBO.setOrderdeliverytime(calendar.get(Calendar.MINUTE) +":"+calendar.get(Calendar.SECOND)); String orderDetails = Integer.toString(order_delivered); String getPosition = Integer.toString(position); viewHolder.btnDeliveryComplete.setBackgroundColor(Color.LTGRAY); new sendOrderStatusToServer().execute(orderDetails,getPosition); } else { Toast.makeText(myContext, "Please Enter Preparation Start Time & Preparation Complete Time.", Toast.LENGTH_LONG).show(); } } }, 5000); } else { handler.removeCallbacksAndMessages(null); v.clearAnimation(); flagDeliveryComplete = 0; } } }); } return convertView; } } private static class ViewHolder { protected TextView txtTableNumber; protected TextView txtMenuItem; protected TextView txtQuantity; protected TextView txtOrderAcceptanceTime; protected Chronometer txtElapsedTimeOfOrderAcceptance; protected Button btnPreparationStart; protected Chronometer txtElapsedTimeForPreparation; protected Button btnPreparationComplete; protected Chronometer txtElapsedTimeForDeliveryComplete; protected Button btnDeliveryComplete; }

    Read the article

  • Programming an Android Button to update EditText views

    - by bergler77
    Ok guys, I have a button in android that i'm trying to use to update 8 EditText Views with different random numbers. Everything works up until I click the button. It appears I am missing a resource according to the debugger, but I'm not sure what. I've tried several different ways of implementing the button. Here is what I have after looking at several posts. import java.util.Random; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; public class MyCharNewChar extends MyCharActivity { private OnClickListener randomButtonListener = new OnClickListener(){ public void onClick(View v) { //Button creates a set of random numbers and updates the values //of the EditText views. Random rand = new Random(); int STR = 1 + rand.nextInt(12); int AGI = 1 + rand.nextInt(12); int DEX = 1 + rand.nextInt(12); int WIS = 1 + rand.nextInt(12); int INT = 1 + rand.nextInt(12); int CON = 1 + rand.nextInt(12); int HP = 1 + rand.nextInt(20); int AC = 1 + rand.nextInt(6); EditText str = (EditText) findViewById(R.id.str); str.setText(STR); EditText agi = (EditText) findViewById(R.id.agi); agi.setText(AGI); EditText dex = (EditText) findViewById(R.id.dex); dex.setText(DEX); EditText wis = (EditText) findViewById(R.id.wis); wis.setText(WIS); EditText intel = (EditText) findViewById(R.id.intel); intel.setText(INT); EditText con = (EditText) findViewById(R.id.con); con.setText(CON); EditText hp = (EditText) findViewById(R.id.baseHP); hp.setText(HP); EditText ac = (EditText) findViewById(R.id.baseAC); ac.setText(AC); } }; @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.newchar); Button randomButton = (Button) findViewById(R.id.randomButton); randomButton.setOnClickListener(randomButtonListener); } } Here is the xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayoutNew1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/background" > <TextView android:id="@+id/newCharLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/new_character_screen" android:textSize="24dp" android:textColor="@color/splash" android:textStyle="bold" android:gravity="center"/> <TextView android:id="@+id/nameLabel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/nameLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="10" android:inputType="textPersonName" > <requestFocus /> </EditText> <TableLayout android:id="@+id/statsLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp"> <TableRow android:id="@+id/tableRow01" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp"> <TextView android:id="@+id/strLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/strLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/str" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number" /> <TextView android:id="@+id/agiLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/agiLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/agi" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/dexLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/dexLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/dex" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> </TableRow> <TableRow android:id="@+id/tableRow02" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp"> <TextView android:id="@+id/intLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/intLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/intel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/wisLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/wisLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/wis" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/conLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/conLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/con" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> </TableRow> </TableLayout> <LinearLayout android:id="@+id/linearlayoutNew02" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" android:gravity="center"> <TextView android:id="@+id/baseHPLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hpLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/baseHP" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> <TextView android:id="@+id/baseACLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/acLabel" android:textSize="18dp" android:textColor="@color/splash"/> <EditText android:id="@+id/baseAC" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="3" android:inputType="number"/> </LinearLayout> <LinearLayout android:id="@+id/linearlayoutNew03" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/randomButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="@string/randomButton" android:textSize="16dp" android:clickable="true"/> </LinearLayout> </LinearLayout> I have also tried setting the onClick in xml to setup a specific onClick method. Still the same error so I must have a problem elsewhere. Any suggestions would be great!

    Read the article

  • Button click doesn't call function even when button attribute OnClick is set to that function

    - by Silmaril89
    Hi, I have an aspx page with two buttons, one of the buttons has an OnClick attribute to a function that should be run when clicked. When the other button is clicked there is an if statement checking if the page is a postback, if it is then I run some statements that need to be run when that button is clicked. That postback button works fine. However, the other button, when it's clicked the function it's supposed to call never executes, and the statements inside if (Page.IsPostBack) get executed instead. What can I do to fix this? Is there a way to make the button that calls a function not do a Post back?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >