Search Results

Search found 54311 results on 2173 pages for 'right click menu'.

Page 121/2173 | < Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >

  • Dynamic select menu Rails, Javascript HABTM

    - by Jack
    Hi, I am following a tutorial in one of Ryan Bates' Railscasts here. Basically I want a form where there are 2 drop down menus, the contents of one are dependent on the other. I have Years and Courses, where Years HABMT Courses and Courses HABTM Years. In the tutorial, the javascript is as follows: var states = new Array(); <% for state in @states -%> states.push(new Array(<%= state.country_id %>, '<%=h state.name %>', <%= state.id %>)); <% end -%> function countrySelected() { country_id = $('person_country_id').getValue(); options = $('person_state_id').options; options.length = 1; states.each(function(state) { if (state[0] == country_id) { options[options.length] = new Option(state[1], state[2]); } }); if (options.length == 1) { $('state_field').hide(); } else { $('state_field').show(); } } document.observe('dom:loaded', function() { countrySelected(); $('person_country_id').observe('change', countrySelected); }); Where I guess country has many states and state belongs to country. I think what I need to do is edit the first for statement to somehow loop through all of the courses for each year_id, but don't know how to do this. Any ideas? Thanks

    Read the article

  • calling a function in a click event

    - by KATy
    hi, i ve data in d sql DB using those values i ve to call a function in the system.. data in sql location of func:c:\ namespace:calci class name:arith function name:add parameter 1: 1 parameter 2: 2 now we ve use the values c:\,calci,arith,add,1,2 using this we ve to calculate the result.. thanx..

    Read the article

  • jquery autocomplete on button click get hidden value

    - by gabriel
    using jquery autocomplete, we get hidden value by calling .result function like this $("#suggest").result(function(event, data, formatted) { $('#hidden').val(data[1]); }); This is only useful when we selected the option from autosuggest list and press enter. What i need is that i enter the option by typing the complete word without selecting it and clicking on Ok button? but i am always getting empty. <input type="text" id="suggest" /> <input type="button" value="Ok" onclick="GetValue()" /> <input type="hidden" id="hidden"/> function GetValue() { //get hidden field value - getting empty var hid=document.getElementById('hidden').value; }

    Read the article

  • click buttons error

    - by sara
    I will retrieve student information (id -number- name) from a database (MySQL) as a list view, each student have 2 buttons (delete - alert ) and radio buttons Every thing is ok, but how can I make an onClickListener, for example for the delete button because I try lots of examples, I heard that I can use (custom list or get view or direct onClickListener as in my code (but it is not working ) or Simple Cursor Adapter) I do not know what to use, I looked around for examples that can help me, but in my case but I did not find any so I hope this be reference for anyone have the same problem. this is my code which I use direct onClick with Simple Adapter public class ManageSection extends ListActivity { //ProgresogressDialog pDialog; private ProgressDialog pDialog; // Creating JSON Parser object // Creating JSON Parser object JSONParser jParser = new JSONParser(); //class boolean x =true; Button delete; ArrayList<HashMap<String, String>> studentList; //url to get all products list private static String url_all_student = "http://10.0.2.2/SmsPhp/view_student_info.php"; String cl; // JSON Node names private static final String TAG_SUCCESS = "success"; private static final String TAG_student = "student"; private static final String TAG_StudentID = "StudentID"; private static final String TAG_StudentNo = "StudentNo"; private static final String TAG_FullName = "FullName"; private static final String TAG_Avatar="Avatar"; HashMap<String, String> selected_student; // course JSONArray JSONArray student = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.manage_section); studentList = new ArrayList<HashMap<String, String>>(); ListView list1 = getListView(); list1.setAdapter(getListAdapter()); list1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int pos, long l) { selected_student =(HashMap<String, String>) studentList.get(pos); //member of your activity. delete =(Button)view.findViewById(R.id.DeleteStudent); cl=selected_student.get(TAG_StudentID); Toast.makeText(getBaseContext(),cl,Toast.LENGTH_LONG).show(); delete.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { Log.d("id: ",cl); Toast.makeText(getBaseContext(),cl,Toast.LENGTH_LONG).show(); } }); } }); new LoadAllstudent().execute(); } /** * Background Async Task to Load all student by making HTTP Request * */ class LoadAllstudent extends AsyncTask<String, String, String> { /** * Before starting background thread Show Progress Dialog * */ @Override protected void onPreExecute() { super.onPreExecute(); pDialog = new ProgressDialog(ManageSection.this); pDialog.setMessage("Loading student. Please wait..."); pDialog.setIndeterminate(false); } /** * getting All student from u r l * */ @Override protected String doInBackground(String... args) { // Building Parameters List<NameValuePair> params = new ArrayList<NameValuePair>(); // getting JSON string from URL JSONObject json = jParser.makeHttpRequest(url_all_student, "GET", params); // Check your log cat for JSON response Log.d("All student : ", json.toString()); try { // Checking for SUCCESS TAG int success = json.getInt(TAG_SUCCESS); if (success == 1) { // student found // Getting Array of course student = json.getJSONArray(TAG_student); // looping through All courses for (int i = 0; i < student.length(); i++)//course JSONArray { JSONObject c = student.getJSONObject(i); // read first // Storing each json item in variable String StudentID = c.getString(TAG_StudentID); String StudentNo = c.getString(TAG_StudentNo); String FullName = c.getString(TAG_FullName); // String Avatar = c.getString(TAG_Avatar); // creating new HashMap HashMap<String, String> map = new HashMap<String, String>(); // adding each child node to HashMap key => value map.put(TAG_StudentID, StudentID); map.put(TAG_StudentNo, StudentNo); map.put(TAG_FullName, FullName); // adding HashList to ArrayList studentList.add(map); } } else { x=false; } } catch (JSONException e) { e.printStackTrace(); } return null; } /** * After completing background task Dismiss the progress dialog * **/ protected void onPostExecute(String file_url) { // dismiss the dialog after getting all products pDialog.dismiss(); if (x==false) Toast.makeText(getBaseContext(),"no student" ,Toast.LENGTH_LONG).show(); ListAdapter adapter = new SimpleAdapter( ManageSection.this, studentList, R.layout.list_student, new String[] { TAG_StudentID, TAG_StudentNo,TAG_FullName}, new int[] { R.id.StudentID, R.id.StudentNo,R.id.FullName}); setListAdapter(adapter); // Updating parsed JSON data into ListView } } } So what do you think, why doesn't the delete button work? There is no error in my log cat. What is the alternative way ?.. what should I do ?

    Read the article

  • Display arabic text left to right in pdf using apache fop 0.95

    - by sangam
    Hi all. We are generating pdf using apache's xsl fo engine, namely fop 0.95. We have been successful in displaying arabic text from xml to pdf. But there is some problem in the direction of the displayed words. If we have 'sangam' (please assume that 'sangam' is in arabic) in xml, it gets displayed as 'magnas'. Has anyone encountered this before? What could be the solution? For example, I have one node in xml file like this: <empltmoblab>??????</empltmoblab> Now when displayed in pdf, this is displayed like this: ?????? This means I am getting just the reverse. I want it as it is in xml node. Thank you.

    Read the article

  • Excel VBA ComboBox2 doesn't get the right content

    - by Marc
    Hi, I'm having a problem with the content of a combobox. On my userform, there are 3 comboboxes. Depending on the chosen item from combobox1, combobox2 should display either set 1 or set 2. The same will be happening with the content of combobox 3, which depends upon the combination of chosen items from combobox 1 and 2. However, I'm running into problems with combobox 2, which is always populated by set 2, even if I select the item in combobox 1 that should generate set 1 in the second combobox. This is the code I used: Private Sub UserForm_Initialize() With ComboBox1 .Clear .AddItem "In contrast" .AddItem "Eng?" .AddItem "Trillers" .AddItem "Natuur(lijk)" .AddItem "Muziektrafiek" End With If ComboBox1.Value = "In contrast" Then GoTo LineComboBox1Set1 End If If ComboBox1.Value = "Eng?" Then GoTo LineComboBox1set2 End If If ComboBox1.Value = "Trillers" Then GoTo LineComboBox1set2 End If If ComboBox1.Value = "Natuur(lijk)" Then GoTo LineComboBox1set2 End If If ComboBox1.Value = "Muziektrafiek" Then GoTo LineComboBox1set2 End If LineComboBox1Set1: With ComboBox2 .Clear .AddItem "Op verkenning" .AddItem "Gehoord? Gezien?" .AddItem "On stage" .AddItem "Creabende" .AddItem "Ingeblikt" End With LineComboBox1set2: With ComboBox2 .Clear .AddItem "Op verkenning" .AddItem "Gehoord? Gezien?" .AddItem "On stage" .AddItem "Creabende" .AddItem "Ingeblikt" .AddItem "Speak up" .AddItem "In de kijker" End With Can anyone help me on this one? Thanks a lot in advance!! Kind regards, Marc

    Read the article

  • sql server 2005 - return single row when 2 records in right table

    - by Peanut
    Hi, I have two related sql server tables ... TableA and TableB. ***TableA - Columns*** TableA_ID INT VALUE VARCHAR(100) ***TableB - Columns*** TableB_ID INT TableA_ID INT VALUE VARCHAR(100) For every single record in TableA there are always 2 records in TableB. Therefore TableA has a one-to-many relationship with TableB. How could I write a single sql statement to join these tables and return a single row for each row in TableA that includes: a column for the VALUE column in the first related row in table B a column for the VALUE column in the second related row in table B? Thanks.

    Read the article

  • What is the right pattern for a async data fetching method in .net async/await

    - by s093294
    Given a class with a method GetData. A few other clients call GetData, and instead of it fetching data each time, i would like to create a pattern where the first call starts the task to get the data, and the rest of the calls wait for the task to complete. private Task<string> _data; private async Task<string> _getdata() { return "my random data from the net"; //get_data_from_net() } public string GetData() { if(_data==null) _data=_getdata(); _data.wait(); //are there not a problem here. cant wait a task that is already completed ? if(_data.status != rantocompletion) _data.wait() is not any better, it might complete between the check and the _data.wait? return _data.Result; } How would i do the pattern correctly? (Solution) private static object _servertime_lock = new object(); private static Task<string> _servertime; private static async Task<string> servertime() { try { var thetvdb = new HttpClient(); thetvdb.Timeout = TimeSpan.FromSeconds(5); // var st = await thetvdb.GetStreamAsync("http://www.thetvdb.com/api/Updates.php?type=none"); var response = await thetvdb.GetAsync("http://www.thetvdb.com/api/Updates.php?type=none"); response.EnsureSuccessStatusCode(); Stream stream = await response.Content.ReadAsStreamAsync(); XDocument xdoc = XDocument.Load(stream); return xdoc.Descendants("Time").First().Value; } catch { return null; } } public static async Task<string> GetServerTime() { lock (_servertime_lock) { if (_servertime == null) _servertime = servertime(); } var time = await _servertime; if (time == null) _servertime = null; return time; }

    Read the article

  • how to implement double click in android

    - by Sanal Varghese
    I am doing a project in which i want to display a particular message on single touch and another message on double touch using android.How can i implement it. My sample code is below if(firstTap){ thisTime = SystemClock.u`enter code here`ptimeMillis(); firstTap = false; }else{ prevTime = thisTime; thisTime = SystemClock.uptimeMillis(); //Check that thisTime is greater than prevTime //just incase system clock reset to zero if(thisTime > prevTime){ //Check if times are within our max delay if((thisTime - prevTime) <= DOUBLE_CLICK_MAX_DELAY){ //We have detected a double tap! Toast.makeText(AddLocation.this, "DOUBLE TAP DETECTED!!!", Toast.LENGTH_LONG).show(); //PUT YOUR LOGIC HERE!!!! }else{ //Otherwise Reset firstTap firstTap = true; } }else{ firstTap = true; } } return false;

    Read the article

  • preventing window blur/focusOut when selecting copy/paste menu

    - by jedierikb
    I am trying to determine when the user has moved focus out of the browser to: select copy/paste (but not to the google search box). Ffox handles this nicely. selecting another window/tab/external widget (e.g., the google search box). focusOut and blur listeners on window and document cannot seem to disambiguate between these two types of focus changes. Can IE do this? I want this distinction so that I can better support usability in my web app without losing focus.

    Read the article

  • ui:include disables menu

    - by Goran B
    <rich:tab id="profileInfoTab" label="Information" labelWidth="80"> <ui:include src="/panels/tab2.jsp" /> </rich:tab> <rich:tab id="profileReferenceTab" label="Referenser" labelWidth="80"> <ui:include src="/panels/tab3.jsp" /> </rich:tab> If I include all code in /panel/tab1.jsp instead of the ui:include everything is OK. If I use the ui:include nothing is rendered. Not even the tab-panel. Why? Workarounds?

    Read the article

  • How add class='active' to html menu with php

    - by meow
    Hello I want to put my html navigation in a separate php file so when I need to edit it, I only have to edit it once. The problem starts when I want to add the class active to the active page. I've got three pages and one common file. common.php : <?php $nav = <<<EOD <div id="nav"> <ul> <li><a <? if($page == 'one'): ?> class="active"<? endif ?> href="index.php">Tab1</a>/</li> <li><a href="two.php">Tab2</a></li> <li><a href="three.php">Tab3</a></li> </ul> </div> EOD; ?> index.php : All three pages are identical except their $page is different on each page. <?php $page = 'one'; require_once('common.php'); ?> <html> <head></head> <body> <?php echo $nav; ?> </body> </html> This simply won't work unless I put my nav on each page, but then the whole purpose of separating the nav from all pages is ruined. Is what I want to accomplish even possible? What am I doing wrong? Thanks EDIT: When doing this, the php code inside the li don't seem to run, it's just being printed as if it was html

    Read the article

  • Floating not right in ie ?

    - by Tom
    Hi, i want to do like the following format: So this is what i did : <style> .toptitle{ font-size:14px; } .toprating{ background:yellow; float:left; font-size:12px; } .topcontainer{ border-bottom:1px #CCCCCC solid; } </style> <div class="topcontainer"> <div class="toprating">256</div> <div class="toptitle">Lorem Ipsum...</div> </div> <br> <div class="topcontainer"> <div class="toprating">256</div> <div class="toptitle">Lorem Ipsum...</div> </div> Now, in firefox,chrome,safari, this works perfectly, but in IE the title goes about 30 px down. Is there a mistake in the code, or is there any better code to do this?

    Read the article

  • How to remove the upper right close button

    - by tahdhaze09
    I need to kill the close 'x' button at the top of a jQuery UI modal dialog box. I have a modal that opens with an OK button that redirects to the site. The site behind the modal is in an iframe. When the user agrees to the statement in the dialog box and clicks the 'OK' button, it redirects to the site that is outside the iframe. If the user clicks on the 'x', it goes to the iframe site, which I do not want to have happen. I need the modal to work as a one-way to the site it goes to. It basically forces the user to accept the user agreement. I would post code, but its an intranet site. Thanks everyone for your help! EDIT: This site is a government intranet portal, not a commercial site. So the goal is NOT to trap a user into the site, but rather to let the user know that the use of this site is restricted and to make sure you understand and accept the user agreement or you cannot use the site.

    Read the article

  • div refresh without click of the button

    - by fusion
    how do i make the div refresh, say after 10 secs and execute the run_query() function without clicking on the button? <script src="scripts/ajax.js" type="text/javascript"></script> <div id="quote"><strong>Quote of the Day</strong></div> <div><a style="cursor:pointer" onclick="run_query()">Next quote …</a></div>

    Read the article

  • How to get right values from Views touch event

    - by Pinker
    I have a problem with implementing touch events on GLSurfaceView. Views size is 1280x696, because of android (tablet) status bar at bottom with soft keys, time etc.., (screen resolution is 1280x800), but OnTouchListener is receiving touch events with coords [646.0,739.0], and thus my gluunproject method fails to return correct values is there any way to return events that respect these boundaries? or how should I recalculate the position?

    Read the article

  • Am I doing it right?

    - by LuckySlevin
    I have situation. I have to create a Sports Club system in JAVA. There should be a class your for keeping track of club name, president name and braches the club has. For each sports branch also there should be a class for keeping track of a list of players. Also each player should have a name, number, position and salary. So, I come up with this. Three seperate classes: public class Team { String clubName; String preName; Branch []branches; } public class Branch { Player[] players; } public class Player { String name; String pos; int salary; int number; } The problems are creating Branch[] in another class and same for the Player[]. Is there any simplier thing to do this? For example, I want to add info for only the club name, president name and branches of the club, in this situation, won't i have to enter players,names,salaries etc. since they are nested in each other. I hope i could be clear. For further questions you can ask.

    Read the article

  • GWT: What is the way to handle Click on GWT FlowPanel

    - by shaman.sir
    May be a dumb question, but GWT FlowPanel (raw div element) does not provides something to handle a mouseclick/mousemovement on it. Overriding onBrowserEvent do not works either. If setting onclick event using native JavaScript (need to specify positive height before, 'div' have a height of 0 if not specified), then catching these events is working properly. Is there a way to do it without using JSNI?

    Read the article

  • OnTouch event consumes click event and prevents execution in parent

    - by Taig
    I'm having a FrameLayout that has an extended ImageView (github) as a child. When I set an onClick()-Event to the FrameLayout it won't be triggered. The reason appears to be the onTouch() method's return value. If I set the ACTION_DOWN's return value to false the event is passed along properly - but then the Multitouch functionalities break. Also running performClick() in the ACTION_UP event comes to nothing. How to handle those events correctly?

    Read the article

  • gwt not showing the right image

    - by arinte
    I have a gwt image object . In my code I set my visibleRect like this: btnSearch.setVisibleRect(-64,-80,16,16); So when I run my code with firebug the html looks like this: <img border="0" style="width: 16px; height: 16px; background: url(&quot;http://tempest/deltaflow/Content/Images/icon.png&quot;) no-repeat scroll 64px 80px transparent;" src="http://127.0.0.1:8888/trunkui/clear.cache.gif"> Why is the '-' left off? When I edit it with firebug to have the '-' it works fine.

    Read the article

< Previous Page | 117 118 119 120 121 122 123 124 125 126 127 128  | Next Page >