Posts

ActionEvent get source of button JavaFX -

i have 10 buttons going sent same method. want method identify source. method knows button "done" has evoked function. can add switch case of if statement handle them accordingly. have tried //call: btndone.setonaction(e -> test(e)); public void test(actionevent e) { system.out.println("action 1: " + e.gettarget()); system.out.println("action 2: " + e.getsource()); system.out.println("action 3: " + e.geteventtype()); system.out.println("action 4: " + e.getclass()); } output result: action 1: button@27099741[styleclass=button]'done' action 2: button@27099741[styleclass=button]'done' action 3: action action 4: class javafx.event.actionevent done text on button. can see use e.gettarget() and/or e.getsource() i'll have substring it, "done" appears. there other way string in apostrophe instead of having substring. update: have tried passing butt...

vb6 - How to remove selected item from msflexgrid -

i using vb6 , in using msflexgrid want remove complete row selected user , once done automatically set focus textbox, while searching on internet useful problem when click on button remove rows first row header of flexgrid , don't want remove first row. here code private sub cmddell_click() dim integer grdarticles 'the msflexgrid if .rowsel <> 0 'check if there selected row = .rowsel .rows - 2 'loop selected row las row .textmatrix(i, 0) = .textmatrix(i + 1, 0) 'set rows 1 .textmatrix(i, 1) = .textmatrix(i + 1, 1) .textmatrix(i, 2) = .textmatrix(i + 1, 2) .textmatrix(i, 3) = .textmatrix(i + 1, 3) next .rows = .rows - 1 'make rows 1 less else msgbox "selecet row delete!!!", vbexclamation end if end end sub if allow 1 row selected @ time need use me.msflexgrid1.removeitem me.msflexgr...

react jsx - Material-ui example -

i got code snippet material-ui (simple example) website , seems doesn't work copying , paste directly. it throws error unexpected token ("line#") while parsing , particularly in handlechange = ....... . i'm using visual studio code , i'm new using material-ui in jsx. what missing? please help. import react 'react'; import dropdownmenu 'material-ui/lib/dropdownmenu'; import menuitem 'material-ui/lib/menus/menu-item'; export default class dropdownmenusimpleexample extends react.component { constructor(props) { super(props); this.state = {value: 2}; } handlechange = (event, index, value) => this.setstate({value}); render() { return ( <dropdownmenu value={this.state.value} onchange={this.handlechange}> <menuitem value={1} primarytext="never"/> <menuitem value={2} primarytext="every night"/> <menuitem value={3} primarytext="weeknights...

javascript - Why datepicker not working in firefox? -

my javascript code : $('#idtourdatedetails').datepicker({ monthnames: [ "januari", "februari", "maret", "april", "mei", "juni", "juli", "agustus", "september", "oktober", "november", "desember" ], daynames: [ "minggu", "senin", "selasa", "rabu", "kamis", "jumat", "sabtu" ], daynamesmin: [ "m", "s", "s", "r", "k", "j", "s" ], // showon: 'both', dateformat: 'yy-mm-dd', changemonth: true, changeyear: true, inline: true, yearrange: '-100:-12', defaultdate: '1916-01-01' }); demo , complete code : http://jsfiddle.net/oscar11/93etu/1751/ when using firefox browser ...

jquery - why add new option empty tag after load from ajax -

i have 2 dropdowns list category , subs . when user changed category dorpdown, second dropdown become reload server : <select id="cats"> @foreach($all_cat $c) <option value="{{$c->id}}">{{$c->title}}</option> @endforeach </select> <br /> <select id="subs"> </select> my jquery code : $('#cats').on('change', function() { var cats = $('#cats').val(); $('#subs option').remove(); $.post('{{base_url()}}cp/vitrinsection/getcategoriesbyajax' , {cats:cats , subs:0 , subs2:0 } , function(data){ $("#subs").append(data); console.log(data); }) }); $('#subs').on('change', function() { }); everything works fine after use append function empty option alternate added subs dropdown list ! my console log after data : <option value='1'>a<option><option value='2'>b...

centos7 - Linux command line rm /* -

centos 7, sudo su . not pro in linux command line. wanted delete files inside current directory. , putted: rm /* after many commands doesn't worked (ls example). command did? , how might harm system? you removed on hard drive! don't run commands super user if don't know , do! rm command removes something. / means root directory. in unix-based os linux, directories this: / ├── bin -> usr/bin ├── boot ├── dev ├── etc ├── home ├── lib -> usr/lib ├── lib64 -> usr/lib ├── lost+found ├── media ├── mnt ├── opt ├── proc ├── root ├── run ├── sbin -> usr/binvar ├── srv ├── sys ├── tmp ├── usr └── var and of them inside root directory show / and should * in terminal means "everything" (code 42). so asked remove "everything inside / directory" inside linux os deleted (exept if stoped before process compeleted) anyway, insatall fresh centos , startover. , thank god didn't write this: rm -rf /* try learn commands webs...

ios - How can i get the data from Swift based IBOutlet UITextField? -

@iboutlet var firstname:uitextfield? @iboutlet var lastname:uitextfield? let string = firstname!.text print(string) the output below: optional("ohh") how can data without optional text , double quotes? your issue text attribute of uitextfield optional - means must unwrapped. that, add ! end, produces string instead of string? . you can conditionally unwrap optional using syntax if let , here be if let string = firstname!.text{ print(string) //outputs if text exists }else{ //text didn't exist }