without leave focus from control data not saved - dynamics-crm-2013

I have field on my project product form Price Per Unit when enter some value in textbox and without tab out click on save button, data is getting saved.
But when i have done the same thing with my custom save button that value doesn't save.

Data changes when controls lose focus, I managed to solve the same issue through HTMLElement.blur()
As in:
// This should be the first thing to do in custom-saving code
var elid = document.activeElement.id;
if (elid && elid != null && elid != '')
document.activeElement.blur();
This is unsupported by CRM but should work in all major desktop browsers.

I have solved this issue by following code :
if ($(“input[attrname='[field_logicalname]'”).length > 0 && $(“input[attrname='[field_logicalname]'”) != '') {
Xrm.Page.getAttribute(“[field_logicalname]”).setValue($(“input[attrname='[field_logicalname]'”).val());
}
Check the full discription here : debajitcrm.wordpress.com

Related

Readout the query in Google Custom Search Engine

I have implemented the Google Custom Search Engine (two-column type) on my website and everything works fine. Now I want to change the background of my website depending on the query which has been typed in the input box. How can I get this query from the input box after it was written in it?
Once I could get it out of the input box, I could compare it to a number of fixed keywords and change the background depending on the match.
I tried already this:
var query = google.search.cse.element.getElement("search").getInputQuery();
but it doesn't work.
I have looked already on the Google Developpers site:
https://developers.google.com/custom-search/docs/element
This is my code so far:
<script>
var query = google.search.cse.element.getElement("search").getInputQuery();
var wallpaper = document.getElementById("background")
if (query.localeCompare("hardware") == 0)
{wallpaper.id = "hardware";}
else if (query.localeCompare("software") == 0)
{wallpaper.id = "software";}
</script>
<gcse:searchbox gname="search"></gcse:searchbox>
<gcse:searchresults gname="search"></gcse:searchresults>
Anyone having any idea?

OpenERP v7 -> Issue when deleting many2many_tags. Deleted but still on screen

I've one "taxes" field in sale.order.line where it is rendered using many2many_tags. Basically, when we add a tag and then focus out, the value of the tag seems to be add in the field.
When I want to delete the tag, I click on the field, I see the box tag with its value and cross to delete it. Clicking on the cross delete the tag BUT when I focus out the value is still in the field...
I checked in openerp js sources but found nothing probant...
Any help ?
This issue is due to an inappropriate IF condition in openerp-web-7.0/addons/web/static/src/js/view_list.js near line 1048:
if (value instanceof Array && !_.isEmpty(value)
&& !record.get(column.id + '__display'))
Before adding m2m tag the '__display' attribute doesn't exist, so the condition passes succesfully. However, if you had a second tag, the '__display' attribute does exist, thus condition is false and the next part of the code updating document can't be done.
You need to override it and add another condition to check whether '__display' already exists.

Prevent user from selecting the highlighted item by enter key (combobox)

Actually, I'm trying to use a combo-box in Ext.Net to select a value from its selecting list. This combo-box is editable and user can type any value he want.
On selecting list, I want to prevent user from selecting the highlighted item by pressing Enter key and let him just select it by mouse click. for this, i tried to use an listener on bound list "ItemKeyDown" but it did nothing. Other events related to mouse par example, working fine but all events related to key are not working.
I don't know if i have missed something in configurations or what.
Anyone can give me any advise to make theses listeners work?
Thanks in advance,
var combo = Html.X().ComboBox().DisplayField(mark).ValueField(type).Editable(true)
.ID(combo_id).EnableKeyEvents(true).AutoSelect(false).SelectOnFocus(true)
.QueryMode(DataLoadMode.Local).ValidateOnBlur(false).ValidateOnChange(false)
.ListcConfig(Html.X().BoundList()
.Listeners(l => l.ItemKeyDown.Handler = "console.log('ItemKeyDown');")); /// ItemKeyDown not displayed in console.
I post the solution i got from Ext.Net support team so if someone need it in future:
#(Html.X().ComboBox()
.Listeners(events => {
events.Expand.Handler = #"this.listKeyNav.map.removeBinding({
key: Ext.EventObject.ENTER
});";
events.Expand.Delay = 1;
events.Expand.Single = true;
})
)

Tags getting appended to dojo editor content

I have a dojo editor on a jsp page. The dojo editor is one of the required fields and i have a validation in place for it. There is a scenario in which some tags are getting appended. I cannot find a particular pattern when it gets appended but most of the times it occurs after one selects and copies all the content and pastes on the editor. So the editor content in this case was
<div id="dijitEditorBody">content which user entered</div>
Issue: When the user deletes all content which was entered the tags are still there and get submitted. In this case atleast visually editor has no content but the field holds the following value:
<div id="dijitEditorBody"></div>
or
<div id="dijitEditorBody"><br /></div>
So it skips validation and displays an empty editor when data is retrieved from DB?
I am confused about why these tags are getting appended?
In RichText.js, this snippet :
if(dojo.isIE || dojo.isWebKit || (!this.height && !dojo.isMoz)){
// In auto-expand mode, need a wrapper div for AlwaysShowToolbar plugin to correctly
// expand/contract the editor as the content changes.
html = "<div id='dijitEditorBody'></div>";
setBodyId = false;
}else if(dojo.isMoz){
// workaround bug where can't select then delete text (until user types something
// into the editor)... and/or issue where typing doesn't erase selected text
this._cursorToStart = true;
html = " ";
}
Explains the reason why that tag is added...
Although you see it in your alertbox, I believe it's not present in the posted contents... right ?
The editor should take care of removing the extra-tags => not tested but pretty sure...

KERN-EXEC 3 when navigating within a text box (Symbian OS Browser Control)

I've had nothing but grief using Symbian's browser control on S60 3rd edition FP1. We currently display pages and many things are working smoothly. However, when inputting text into an HTML text field, the user will get a KERN-EXEC 3 if they move left at the beginning of the text input area (which should "wrap" it to the end) or if they move right at the end of the text input area (which should "wrap" it to the beginning).
I can't seem to trap the input in OfferKeyEventL. I get the key event, I return EKeyWasConsumed and the cursor still moves.
TKeyResponse CMyAppContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
if (iBrCtlInterface) // My browser control
{
TBrCtlDefs::TBrCtlElementType type = iBrCtlInterface->FocusedElementType();
if (type == TBrCtlDefs::EElementActivatedInputBox || type == TBrCtlDefs::EElementInputBox)
{
if (aKeyEvent.iScanCode == EStdKeyLeftArrow || aKeyEvent.iScanCode == EStdKeyRightArrow)
{
return EKeyWasConsumed;
}
}
}
}
I would be okay with completely disabling arrow key navigation but can't seem to do this.
Any ideas? Am I going about this the wrong way? Has anyone here even worked with the Browser Control library (browserengine.lib) on S60 3.1?
Update: Interestingly, if I switch to use Cursor Navigation, it works fine. For now, this is a workaround. I'm still curious to know if there are ways to resolve this.
You would get quicker answer probably in http://discussion.forum.nokia.com/forum/.
Interestingly, if I switch to use Cursor Navigation, it works fine. For now, this is a workaround. I'm still curious to know if there are ways to resolve this. For now, I'm calling this the answer.