w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
eclipse example template with an editor or multi-page editor not running due to following errors
Those are NOT ERRORS. Do not overreact. As it said, it's looking for the environmental variable HOME to have been set, but you can just go fill in information that it would guess from that in the Git preferences. These messages do not appear in newer versions of eGit. And just because you opened a Runtime Workbench does not mean your editor will be automatically opened. If it's not opening when you try to open one of its supported fie types, open a question with the stack traces of its failures.

Categories : Java

Remote attribute in editor template in asp.net mvc
It's passing your model through. So your JsonResult should be using your model, Country, not Name and Id individually. Like this: public JsonResult CheckCountryName(Country country) { return Json(!repository.Countries.Where(c => c.Id != country.Id) .Any(c => c.Name == country.Name), JsonRequestBehavior.AllowGet); }

Categories : Dotnet

How to get sequence/array index in Editor Template?
Use a for loop instead of for each and pass the indexer into the EditorFor extension; razor should handle the rest. @for(var i = 0; i < Model.count(); i++) { @Html.EditorFor(m => Model.ToArray()[i], new { index = i }) } Update: pass in the the index of the item using view data as show above. In your editor template access the item via the ViewBag <span> Item Index: @ViewBag.index </span>

Categories : Asp Net Mvc

Using a Radio Button Group in an Editor Template
To add your radio buttons to a group you could change your code to: @Html.RadioButton("GROUPNAMEHERE", "LABEL", BOOLVALUEFORCHECKED) Not sure if you actually need the RadioButtonFor in this instance. EDIT: If you do need RadioButtonFor, try this: @Html.RadioButtonFor(x => x.EVote, true, new { Name = "GROUPNAME" })

Categories : C#

How Do I Set the Name and Value of an Editor Template Specific to the Model Being Edited?
Use this in your Datepicker.cshtml template, and place it under Views/Shared/EditorTemplates: @model System.DateTime @Html.TextBox("", Model, new { @class = "datepicker" }) And, in your main View: @Html.EditorFor(model => model.EventDate) @Html.EditorFor(model => model.PublishDate)

Categories : Asp Net Mvc

MVC 4 Editor Template for Displaying Time in HH:mm Format
After reading this MVC 3 - Html.EditorFor seems to cache old values after $.ajax call , I realized that before binding, HtmlHelper will look into ModelState. Not sure what is the intention/benefit of checking the ModelState, instead of binding what ever the value supplied. However I added this code in my controller before setting the value. Now it works fine. ModelState.Remove("StartTime"); ModelState.Remove("EndTime"); bookingViewModel.StartTime = Convert.ToDateTime(startTime); bookingViewModel.EndTime = Convert.ToDateTime(endTime); return View("Booking", bookingViewModel);

Categories : C#

ASP MVC 4, passing data in custom editor template
@Html.Partial("~/Views/Shared/EditorTemplates/CustomDropdown.cshtml", CustomerCountrySelectionList) And the models goes straight into the view. @Html.Editor(), despite having 6 overloads, probably have none of them designed to pass a model inside the custom editor.

Categories : C#

MVC4 Kendo Grid DateTime template editor
I have an MVC kendo-ui grid in one of my projects and it works just fine with the date in edit mode. What I noticed as different from your code was that I didn't write any attributes on the DateTime property in the model. My model simply looked like this: public class TransactionViewModel { [Key] public int TransactionId { get; set; } public string Description { get; set; } [Required] public DateTime TransactionDate { get; set; } [Required] public decimal Amount { get; set; } } In the grid I bound the column in the following way: columns.Bound(p => p.TransactionDate).Title("Date").Format("{0:yyyy-MM-dd}").EditorTemplateName("TransactionDate"); And, even though my editor template looked a bit different than yours, the code you provided worked just fin

Categories : Asp Net Mvc

how does main view recognises which editor template is to be included
Now how EditorFor will recognise that template1 is to be included or template2? Thanks. If the template property is IEnumerable<Template> then it will include Template.cshtml. So here's the general rule: If the property you are using in the EditorFor call is not a collection (IEnumerable<T>) then ASP.NET MVC will look for a template which has the same name as the type of the property. For example: public MyViewModel FooBar { get; set; } will look for MyViewModel.cshtml. You could override this behavior using the UIHint attribute. Thus: [UIHint("Baz")] public MyViewModel FooBar { get; set; } will look for Baz.cshtml. If the property is a collection (IEnumerable<T>) then ASP.NET MVC will look for an editor template that has the same name as the type of the ele

Categories : Asp Net Mvc

Template editor not applied when using Ajax for partial view
I don't know the reason, but after investigating for some time, I can assure that the final call to @Html.TextBox("", value, attributes), on an Ajax request behaves in a different way than on a PartialView render. In a PartialView render, it creates the desired input element, with the provided formatted value. However, in an ajax request, it looks up for info on the model and creates its own version of the textbox, including the unobstrusive validation attributes and so on. The only way to solve this problem is not to use the TextBox method, but create an input writing it directly with a TagBuilder. Pay attention to the way of getting the Id and name for the input element. @{ string value = ... // Format as desired // Create the required attributes // NOTE: HtmlAttributes is simply a c

Categories : Asp Net Mvc

Drop Down List value not being selected when using custom editor template
First of all, you should not create a static method to get the list of countries. Add the list of countries to your ViewModel like this: namespace PSP.ViewModels { public class ViewModel1 // Choose a more meaningful name for your ViewModel { public short CountryID { get; set; } public IEnumerable<Country> CountriesList { get; set; } } } Then, in your Controller Action, you'll have: public ActionResult Create() { ViewModel1 VM1 = new ViewModel1(); VM1.CountryID = 50; //just pre-selecting a country id in the dropdown list using(AccDBEntities db = new AccDBEntities()) { VM1.CountriesList = (from ct in db.Countries select ct).ToList(); } return View(VM1); } And, in your View, you'll have

Categories : C#

MVC3 boolean editor template with multiple controls for the same property
I cooked up a brute force apporach syncronizing each of the inputs using javascript & jquery. Please post if you find a better way TEST FORM @using BooleanEditorTemplate.Controllers @model bool @{ var modelname = "mmm"; } @using(Html.BeginForm("Index","Home")){ <div class="hide-for-small"> <div class="hide-for-touch"> <div class="editor-field"> @Html.CheckBox(modelname, Model) </div> </div> </div> <div class="show-for-small"> <div class="hide-for-touch"> <div class="editor-field"> @{ List<BoolString> ynb = new List<BoolString>(); ynb.Add(new BoolString(false, "No")); ynb.Add(new BoolString(true, "Yes"));

Categories : Asp Net Mvc

UIHInt template conflicts with defautl editor templates MVC4
I dont know why this error is coming, can somebody advise? Use the appropriate model type in your DFDateTime.cshtml template: @model DateTimeOffset ...

Categories : Asp Net Mvc

Template is being parsed, data is correct, but no elements are added to DOM
One problem I can think of could be that your services.index route needs some content, so when doing this.transitionToRoute('services.index'); without passing along the model/content the transition would succeed but no content is displayed. So continuing guessing you need to pass along also some content/model to be used, like this.transitionToRoute('services.index', this.get('content')); or whatever content your services.index route needs. Hope it helps.

Categories : Ember Js

KendoUI Editor Template Issue With KendoUI Grid
This is likely markup added by BrowserLink. I recommend you disable it for this scenario. http://www.poconosystems.com/software-development/how-to-disable-browser-link-in-visual-studio-2013/

Categories : Asp Net Mvc

I need place values in the correct location on the newly created template sheet
With some changes, you can rewrite your code to make it start filling up values from row 4 and prevent duplicate insertions if it already has the column F value on the template sheet, this way: Sub Redemption() Dim wsDatatable As Worksheet Dim wsTempelate As Worksheet Dim rangeFound As Range Dim rangeNames As Range Dim NameCells As Range Dim stringFirst As String Dim stringNames As String Dim stringUniqueNames As String Set wsDatatable = Sheets("DATA INPUT TABLE") Set wsTempelate = Sheets("CLASS GROUPING ID") Set rangeNames = wsDatatable.Range("A2", wsDatatable.Cells(Rows.Count, "A").End(xlUp)) For Each NameCells In rangeNames.Cells If InStr(1, "|" & stringUniqueNames & "|", "|" & NameCells.Text & "|", vbTextCompare) = 0 Then stringUniqueNames = stringUniqu

Categories : Vba

Django 1.5 - url template tag and reverse function not generating correct url based on current_app instance
I've come up with a successful work around for anyone interested. For the blog_new view function that I listed in the opening question, the desired preview_url can be acquired by doing the following: def blog_new(request, *args, **kwargs): ... r = resolve(request.path) context = { ... 'current_namespace': r.namespace, 'preview_url': reverse(r.namespace + ':new_preview') ... } return render(request, template_name, context, current_app=r.namespace) Notice the change in the call to reverse(). This time I constructed the viewname parameter to use the current namespace rather than a default one. The same goes for using the url template tag. In the following I use the "with" tag to construct the viewname based on the current_namespace cont

Categories : Django

Load Rich Word document into RichText Editor of telerik editor
You can see this live demo: http://demos.telerik.com/aspnet-ajax/editor/examples/rtfexport/defaultcs.aspx and this blog post: http://blogs.telerik.com/aspnet-ajax/posts/13-07-19/how-to-enhance-the-rtf-export-of-radeditor-for-asp.net-ajax

Categories : C#

Change the editor for editor form field for a specific view
Simply use editor="tinymce|none" this will give a list of precedence, if tinymce should not be available it will try none. I guess your editors list can be of any length. Separate editors with pipe "|"

Categories : Joomla

Kendo UI Editor - Remove a specific tool from editor-menu
Got it. Need to remove all the tools first of all, and then add each tool one by one. There is a method Clear() for it. Here is the code. @(Html.Kendo().Editor() .Name(name) .Tools(tools => tools.Clear() //remove all tools .Bold().Italic().Underline().Strikethrough() .FontName().FontSize().FontColor().BackColor() .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull() .InsertUnorderedList().InsertOrderedList().Indent().Outdent() .FormatBlock().CreateLink().Unlink() .SubScript().SuperScript().ViewHtml() ) Please let me know if there is any other way of doing this.

Categories : Kendo Ui

Event based editor like in StarCraft 2 Editor (algorithm)
Sounds like a job for jQuery UI. When the user creates a custom area in your editor all it's attributes are stored inside an object (that you can save as JSON) that would then be applied to a div as param when loading the map (using html-attributes. function create_areas(areas){ var map = $('#map_area'); for(var i=0;i<areas.length;i++){ map.append($('<div>', area[i].params)); } } whereas params would look something like this: params = { width: 100, height: 200, .... mousedown: function(){ play_music('hello'); }, keydown: function(e){ alert('you pressed ' + e.keyCode; } } also the jQuery UI tools like draggable and resizeable should ease up building your editor.

Categories : Javascript

Ace editor doesn't format the data inside the editor div
Ace doesn't support formatting the code, you can either use beautify.js or browsers built-in json formatter var val = editor.session.getValue() var o = JSON.parse(val) // may throw if json is malformed val = JSON.stringify(o, null, 4) // 4 is the indent size editor.session.setValue(val)

Categories : Javascript

Mirroring with Ace Editor. How to Remove Text of Mirrored Editor
You can use mirror class from https://github.com/ajaxorg/ace/blob/master/lib/ace/worker/mirror.js

Categories : Javascript

change default editor (core.editor) to notepad over SSH
It is not possible to launch a GUI program in Windows over a typical ssh session. If you would like to switch the default editor to a different terminal editor such as nano, you can do that with: git config --global core.editor "nano" Source

Categories : GIT

Getting the editor content - Ext-Js html editor
You need to use the getValue method of the editor to retrieve its content. handler is an option of the button. You'll need a reference to the editor in the handler, to get its content. You can get it from the form with the findField method, or with a component query. Here's how to update your code to alert the content of the editor when clicking the save button. I've added a second save button to show you the component query method. I've tested it in this fiddle. Ext.onReady(function() { Ext.tip.QuickTipManager.init(); var top = Ext.create('Ext.form.Panel', { frame:true, title: 'HtmlEditor plugins', bodyStyle: 'padding:5px 5px 0', //width: 300, fieldDefaults: { labelAlign: 'top', msgTarg

Categories : Javascript

Kendo Grid - Line Editing Using A Drop-Down List Editor (Editing Custom Editor)
Try changing the following. var Category = [ { 'CategoryName': 'Beverages', 'CategoryID': 1 }, { 'CategoryName': 'Condiments', 'CategoryID': 2 }, { 'CategoryName': 'Confections', 'CategoryID': 3 }, { 'CategoryName': 'Dairy Products', 'CategoryID': 4 }, { 'CategoryName': 'Grains/Cereals', 'CategoryID': 5 }, { 'CategoryName': 'Meat/Poultry', 'CategoryID': 6 }, { 'CategoryName': 'Produce', 'CategoryID': 7 }, { 'CategoryName': 'Seafood', 'CategoryID': 8 } ]; and as the datasource use $('<input required data-text-field="CategoryName" data-value-field="CategoryID" data-bind="value:' + options.field + '"/>') .appendTo(container) .kendoDropDownList({ autoBind: fal

Categories : Javascript

eclipse juno showing error editor does not contain main file, i think the editor has some error not the code
It is the code. Looks like you've got a copy/paste error. Method declarations are not permitted within the body of other methods. Remove this partial method declaration from the main method String java.io.BufferedReader.readLine() throws IOException

Categories : Java

Rich Text Editor (YUI Simple Text Editor used) not sending data to next page
The saveHTML() method you used does not seem to save the value to the textarea element. And because the browser doesn't care about YUI Editor and just submits what is there already in the textarea (which is null), it submits the input as null.. You should set the value of the textarea to the editor value so the browser will submit that value instead of null.. Which can be achieved using this little line: document.getElementsById("msgpost").value = html; See this working JsFiddle I made for you. However you had HTML syntax errors too. The onSubmit attribute should be on the form element not the submit button. And listening to the event is not practical when you can simply call a function when the form submits.. (See the JsFiddle)

Categories : Javascript

Meteor template: Pass a parameter into each sub template, and retrieve it in the sub-template helper
When you use {{> child myParam}}, it's calling the child template and associates myParam as current template data context, meaning that in the template you can reference {{paramName}}. In someOtherHelper you could use this.paramName to retrieve "paramValue". However, when you're using {{#each nodes}}{{> child}}{{/each}}, it means that you pass the content of the current list item (fetched from a LocalCursor or directly an array item) as the template data of child, and you can reference the list item properties using {{field}} in html or this.field in js. What's happening here is when you call {{> child myParam}}, the myParam helper content OVERWRITES the current node item as template data, that's why it's messing your node list. A quick (dirty) trick would be to simply extend t

Categories : Meteor

Which Editor is the best Ember.js editor on Mac
Sublime Text (2/3) seems to be very popular amongst Emberists. I use a combination of Sublime Text and Jetbrains Webstorm, which is a 'heavier' IDE. See their respectives sites for full details.

Categories : Ember Js

Why is the related model not loading into the template even though request returned the correct related model?
Could you provide your router and the name of the badge template you defined in the script tag? It would be very helpful. I would suggest to rename your Badge Route to App.BadgeIndexRoute and use a template called badge/index. I've had an issue recently and the reason was that I was not using the correct route and template.

Categories : Ember Js

Android - correct (stack based, correct back and forth) animations between activities
To achieve such behaviour you need to know the reason of pause and resume. Like if its another activity is going to be presented then app plays one animation in onPause() but if its not (so its any other reason) then you play another animation. Same in onResume() - if it was some activity started and now its finished and that's why onResume() triggered then you play one corresponding animation but if onResume() is not triggered by finishing activity (returning to app after a phone call for instance) then you play another animation. I'd done something similair in the following way: public class MainMenuActivity extends Activity{ ... protected boolean isGoingToAlarmActivity; protected boolean isGoingToSettingsActivity; @Override protected void onPause() { // for anim

Categories : Android

Search the correct data with the correct date and print it in excel vba
you could filter it by the date column using Autofilter then copy those records to your destination sheet. maybe like this: Dim xSheet1 As Worksheet Dim xSheet2 As Worksheet Dim iLastRow As Integer Set xSheet1 = Sheets("sheet1") Set xSheet2 = Sheets("Sheet2") iLastRow = xSheet1.Range("A" & xSheet1.Rows.Count).End(xlUp).Row xSheet2.Cells.Clear Range("F1").Value = "check" Range("F2:F" & iLastRow).Formula = "=IF(AND(B:B=""Nike"",TEXT(D:D,""DD/MM/YYYY"")=""23/05/2013""),1,0)" Range("F1").AutoFilter Field:=1, Criteria1:="1" Range("A2:D" & iLastRow).Copy xSheet2.Range("A2").PasteSpecial Paste:=xlPasteAll, SkipBlanks:=True With xSheet1 .Range("F1").AutoFilter .Range("F1:F" & Range("A1").End(xlDown).Row).Clear End With

Categories : Excel

template template alias to a nested template?
At first consider using typename keyword to state that this is a nested type no matter if one is a type (e.g. struct, class, etc), template type, typedef or alias. Alias specification requires you to use a type-id to specify a previously defined type. In this particular case correct using of type-id will look like this: template< template<typename> class F, class T> using neg_v2 = typename neg_f<F>::template map<T>; // or struct foo {}; template< template<typename> class F> using neg_v1 = typename neg_f<F>::template map<foo>; What you try to do originally is to use template-name neg_f<F>::mapas a type-id. This is not correct. Probably you want to deduce somehow the T parameter from F to be used at template map<T> but this

Categories : C++

I have written C# code for login check and user type check. Logic seems to be correct but why is the output not correct?
Connect the first and second ifs with else: while (dr.Read()) { password = dr["Password"].ToString(); type = dr["Type"].ToString(); if ((password == txtPassword.Text.ToString()) && (type == "admin")) { Response.Redirect("administrator.aspx"); } else if ((password==txtPassword.Text.ToString()) && (type=="general")) { Response.Redirect("userspage.aspx"); } } lblMessage.Text = "wrong userid or password"; Update: while (dr.Read()) { type = dr["Type"].ToString(); if (type == "admin") { Response.Redirect("administrator.aspx"); Response.End();

Categories : C#

How can I modify this query to add total count of 'Questions' per survey, total correct and percentage correct?
try something like this select Count(sq.surveyId) as 'total # of answered questions per survey' sq.question, sc.choice, sq.CorrectAnswer, sa.score from Survey s INNER JOIN SurveyQuestions sq ON s.surveyId = sq.SurveyId INNER JOIN SurveyChoices sc ON sq.questionId=sc.questionId INNER JOIN SurveyAnswers sa ON sc.choiceId = sa.choiceId INNER JOIN tblLogin tl ON sa.username = tl.username WHERE tl.username = 'JohnSmith' and sq.surveyId = 12 Group sq.question, sc.choice, sq.CorrectAnswer, sa.score ORDER BY sq.questionId

Categories : SQL

function in c++ not calculating correct results, but on adding a cout it is giving correct results
Try to allocate x[] and y[] dynamically instead of allocating it on the stack. AFAIK you have a about 500k allocated if your image is 256x256*2*sizeof(float) Don't forget to free the memory after you are done. Since the function doesn't use the array after it is done, you could also allocate it globally or statically only once, so you don't need to allocate and free it several times. updated A quick and dirty way to solve your problem would be this: void getFeatures(Mat img, long double* feat, float *x, float *y) { int k = 0; ... a = x[n]; } main() { float *x = new float[256*256]; float *y = new float[256*256]; while() { obj.getFeatures(img_bw, feat, x, y); } delete [] x; delete [] y; } However if this class is reused, you should conside

Categories : C++

Wordpress adding a news page with custom template loads wrong template
Create a php file inside your theme folder with the name 'page-news.php'. Copy the same code as your 'page.php' file inside page-news.php. This is the file that will be loaded when you enter http://www.website.be/news. Customize this file as you wish.

Categories : PHP

ambiguous template pattern matching when using variadic template arguments of function overloads
The essence is from the comment of WhozCraig: When you drop the T* in both templates the program will compile (with warnings -Wreorder) and give the expected output. operator<<(std::ostream& stream, X<H*,T...> const & x) operator<<(std::ostream& stream, X<vector<V*>*, T...> const & x) After going through [14] Templates without any enlightenment, I think there is a compiler bug. A modified test: #include <iostream> #include <vector> #include <boost/type_traits/is_fundamental.hpp> #include <boost/utility/enable_if.hpp> using namespace std; #define USE_VARIADIC_TEMPLATE 1 #define USE_AMBIGUOUS 1 template <typename ... T> struct X; template <> struct X <> { }; template <typename H, typename .

Categories : C++

Eclipse - Java Template - static import - Template variable '' has incompatible types
This should work: ${imp:import(org.junit.Test)} ${impst:importStatic('org.hamcrest.MatcherAssert.*')} @Test public void ${testName}() throws Exception { ${cursor} } edit: If I recall correctly the first parts acts as the name variable and the second part is the type (import, var, ...). For example the following also won't work ${:newType(org.eclipse.swt.widgets.ExpandItem)} if (${:var(boolean)}) { ${cursor} } else { } You could remove imp or impst from my answer and it would also still work. In a template you can perform multiple actions on a variable, a good example is the List template. ${type:newType(org.eclipse.swt.widgets.List)} ${list:newName(org.eclipse.swt.widgets.List)}= new ${type}(${parent:var(org.eclipse.swt.widgets.Composite)}, ${style:link('SWT.MU

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.