Odoo 8 - What is the difference between t-call and xpath - odoo-8

I cant understand what is the difference between the xpath with inside position method and make a t-call in a t element and later add some code inside it.

xpath is used to make the view of odoo backend.
t-call is used to make the view of odoo fronend.
Now if you add an element with XPath & position inside that updated view effect will be shown when its parent view is getting loaded.
With qweb t-call the view you are calling will not change & will not show your changed effect if you call the main template on any page, to see your changes you must use template id in which you are are using t-call & making changes.

Related

Is it possible to call a component inside "AfterOnCellMouseDown?

I need to load a form when certain cell is clicked.
I just typed my component name inside "AfterOnCellMouseDown" buy nothing happened.

Vuetify - dynamically create a form with v-text-fields + CRUD - v-model issue

in a Vuetify project I would like to dynamically create all the required fields to perform CRUD Actions:
I prepared a working sample here:
https://codepen.io/jslab-it/pen/KKqyBdX
Everything's working not bad, but when I click on the edit button, the dialog appears but fields are not populated:
I assume that problem is that v-model is "calculated":
:v-model="'editedItem.'+f.name"
in fact in the last field that is not generated but hardcoded and thus has
v-model="editedItem.calories"
the field is automatically populated.
I tried also using a computer property for editedItem, but without success
Can suggest if it is possible and the right path?
Thanks
You can use editedItem[f.name], which is a standard way to access dynamic property in js.

Sitecore page editor dropdown

I would kindly ask for your help :) From couple of days I am trying to achieve "linked" custom field in content editor and dropdown in page editor.
Basically I want to have dropdown in page editor and content editor which are responsible for a same thing.
In my c# code i have enums which represent directions. I created custom field which accepts assembly and class with overridden onload method and successfully populate dropdown values in the content editor. So far so good but i have no idea how to create dropdown which will represent the same functionality inside page editor.
So please give me any ideas...
Judging from your reply to my comment you need to think of the following: How is my field value being rendered onto a page?
If you are always using 1 control to do this then you just need to ensure that this control has 2 different rendering modes depending on the Context.PageMode
But as I understand it you want this dropdown to also appear when someone renders your custom field using a <sc:FieldRenderer>. In this case you'll need to look into the RenderField pipeline of Sitecore. There you find a processor called RenderWebEditing. Possibly through some manipulation here you can get your dropdown appear as you wish.

HTML tag specifically for storing arbitrary data

I am loading a Razor View via AJAX and putting the content into a div on a page.
If I want to send some arbitrary data from the view to our AJAX framework, is there a recommended HTML tag to do this with? A hidden field sounds like the wrong this to use for this. I could use an empty div with custom data- attributes, but again, a div sounds wrong.
My data isn't relevant to any element within this view, more related to the view itself.
Yes - this is simply a question of systematics and aesthetics.
I use data-* attributes, and try to find and attach them to already existing related elements. This convention is also used by asp.net mvc framework itself - when link target needs to be loaded, data-ajax-* is attached to anchors. When you need to set update target of form submit, you attach data-ajax-* to form, so in most cases it is possible to find good candidate for it. If it is not possible in any particular case, I do not see problems using body instead.

making primeFaces ajax call in dataTable

I am using JSF 2 with PrimeFaces 2.2. I tried making an ajax call through a select box onchange event in a dataTable. I was able to see the System.outs printing but, I could not see the components given in the update attribute getting updated. I have given the dataTableId in the update attribute.
I guess the problem now is the selectbox is getting populated again and an ajax call is made. Should we give only the parent tags in the update attirbute, for the ajax call to work. Please help me out in this.
When the ID in the update attribute does not start with :, it becomes relative to the ID of the current component inside the same NamingContainer component. But since the h:dataTable is an NamingContainer component, you need to reference it by an absolute ID. Rightclick the JSF page in the webbrowser and choose View Source to see the generated HTML DOM tree. Locate the HTML <table> element which is generated by the <h:dataTable>, determine the value of its id attribute and use exactly that id in the update attribute, prefixed with :.

Resources