Posts

php - Dynamic field names in Laravel 5.1 -

i need create checkbox in laravel 5.1 name so: <input type="checkbox" name="groups[1]"> <input type="checkbox" name="groups[2]"> i using following code, doesn't work. know correct way code this? {!! form::checkbox('groups[{{ $user->id }}]', 'administrator', in_array('administrator', $user->roles()->lists('name')->toarray())) !!} the output is: <input checked="checked" name="groups[<?php echo e($user->email); ?>]" value="administrator" type="checkbox"> you cannot use blade inside php. concatinate id normal. try this: form::checkbox('groups['.$user->id.']', 'administrator', in_array('administrator', $user->roles()->lists('name')->toarray())) !!}

jquery - PHP write JSON file via AJAX -

i want post data via jquery/ajax json-file, don't receive data json object. my json content looks this: foo=abc&bar=def but want one: { "foo" : "abc", "bar" : "def } html <form id="foobar"> <label for="bar">a bar</label> <input id="foo" name="foo" type="text" value="" /> <input id="bar" name="bar" type="text" value="" /> <input type="submit" value="send" /> </form> js var request; $("#foobar").submit(function(event){ if (request) { request.abort(); } var $form = $(this); var serializeddata = $form.serialize(); request = $.post("datasaveajax.php", {json : json.stringify(serializeddata)}); event.preventdefault(); }); php ...

wso2esb - Can an excel datasource in WSO2 data service take a variable name for the excelURL -

the following excel data source definition in wso2 data service. there way define property in proxy , use excel url in excel data source of data service ? in other words, need excel file dynamically determined. following data source definition in data service <config id="organisationimportdatasource"> <property name="excel_datasource">c:/organisations.xls</property> </config> instead of this, possible use below <config id="organisationimportdatasource"> <property name="excel_datasource">get-property('filename', 'default') </property> </config> filename property defined in calling proxy the excel data source validated @ wso2 startup. trying above not work. re-aligned our requirement limitation excel data source need pre-defined , redefined our requirement ensure tenant specificity of excel data source. this, uploaded excel in specific locati...

Can I implement multiple icons for one Google Chrome extension? -

i'm trying develop extension has 2 icons, , each icon clicked new modal / pop-up showed. somehow possible? in manifest.json example when add array of .png default_icon non-image appears in google chrome instead of intended array of .png .

JQGrid: making all checkboxes checked by default -

after adding following in jqgrid :- models {name: 'checkbox', index: 'checkbox', width:"5%", formatter: "checkbox", formatoptions: { disabled: false } }, columns "select" jqgrid has displayed column having check boxes correct default check boxes checked not expected. i not sure if default behavior of jqgrid check box column. don't want display check boxes checked default. how fix this? per default checkboxes non-checked . can use defaultvalue property of formatoptions change default value: formatoptions: {defaultvalue: "yes"} by way setting of width in % (like width:"5%" ) not supported jqgrid.

Java - I need to update JTextFields in a Swing GUI program -

this question has answer here: watchservice java 6 [closed] 3 answers i have program looks single notepad file contains information similar to: cardiff : 3245658 bristol : 4726485 manchester : 4728945 these places , numbers coming out of automatic system, , numbers change every 20 seconds or so. need create loop(i'm guessing) when numbers change, program notepad file , update number in jtextfield p.s have created program looks file, gets information needs , puts in correct place, using arraylist, all need how make code automatically update when there change in file, , need without using sort of jbuttons , needs itself. my whole code stands: package window; import java.awt.color; import java.awt.eventqueue; import java.io.bufferedreader; import java.io.filenotfoundexception; import java.io.filereader; import java.io.ioexception; import java.util.arr...

mysql - Sql conditional count with join -

i cannot find answer problem here on stackoverflow. have query spans 3 tables: newsitem +------+----------+----------+----------+--------+----------+ | guid | supplier | lastedit | showdate | title | contents | +------+----------+----------+----------+--------+----------+ newsrating +----+----------+--------+--------+ | id | newsguid | userid | rating | +----+----------+--------+--------+ usernews +----+----------+--------+----------+ | id | newsguid | userid | readdate | +----+----------+--------+----------+ newsitem contains newsitems, newsrating contains ratings users give newsitems, , usernews contains date when user has read newsitem. in query want every newsitem, including number of ratings newsitem , average rating, , how many times newsitem has been read current user. what have far is: select newsitem.guid, supplier, count(newsrating.id) numberofratings, avg(newsrating.rating) rating, count(case usernews.userid when 3 1 else null end) numberofreads newsit...