Well, I have this button
The problem is I need put a default context in my module but since V9 string xpath search was deprecated, that's good I think. But I need replace this button and the only name it has is this thing:
<button name="%(action_account_invoice_payment)d" type="action" states="open" string="Register Payment" groups="account.group_account_invoice" class="oe_highlight"/>
How the heck gonna replace this button if this has no name putting a context?
Sometimes this kind of things are not in the documentation and is very awful the no explanation from the code.
PS: I cannot alter the core code because I have a module for that :(
Related
I have a regular view in my views folder with the model= set etc. I am displaying fields with no issues. I just just need to compose a link and to complete this, all I need is the current record ID then hopefully I can do something as simple as this:
Report
Unfortunately the views documentation only tells me how to use fields which is not compatible with what I need.
My understanding is that any regular view is a QWeb view thats really in a <template> tag, so according to this QWeb documentation I tried this:
<a href="/rpt/the-report-for-widget?id=t-esc="id"'>Report</a> and
<a t-attrf-href="/rpt/the-report-for-widget?id=#{id}'>Report</a> and
<a t-attrf-href="/rpt/the-report-for-widget?id=#{model.id}'>Report</a> and
<a t-attrf-href="/rpt/the-report-for-widget?id=#{record.id}'>Report</a>
and about a dozen other things and nothing seems to work.
(just so you don't ask, yes I am updating the module before checking the result in the view)
I would prefer not to use t-attf-href when I could simply use href. A pointer to specific documentation would be great.
you can try this.
<a t-attrf-href="/rpt/the-report-for-widget?id={{id}}'>Report</a>
Using Spring / Thymeleaf i18n, I'd like to create a HTML paragraph message like "Click here", in which there is a link only for the word "here". What is the best way to do this?
The way I tried doesn't look nice and also results in a like break:
In messages.properties file:
error.generic.click=Click
error.generic.here=here
And in the HTML file:
<p th:text="#{error.generic.click}"></p><p><a th:text="#{error.generic.here}" th:href="#{/contact}"></a></p>
Answer
Your way seems okay to me. If you just want to fix the newline issue go ahead with the following one:
<p>
<span th:text="#{error.generic.click}"></span>
<a th:text="#{error.generic.here}" th:href="#{/contact}"></a>
</p>
The span will make "Click" stay on the same line as "here". However i'd just go for a link that say "Click here" instead of just "here".
For example in german you could say "Hier klicken". "Hier" would mean "here" and "klicken" would mean "click". The Problem is that the meaning for the words changed but the position didn't. You would end up with a link saying "klicken" instead of "Hier".
Not recommented
There is another approach, but it has some drawbacks. You could use:
<p th:utext="#{error.generic}"></p>
with the following messages.properties:
error.generic=Click here
The drawback on this one is that you can't use th:href anymore. I would not recomment this way. However this can be helpfull when using no th:* and just plain html tags. So i wanted to mention it.
I'm writing a Module for Joomla! 2.5. In my Backend I've got a textarea, in which values should be written line by line. If the value is to big the line breaks and it looks really confusing and chaotic.
In normal html I would add a wrap="off" to the textarea-tag (I know it's not conform html, but it works), but the textarea is defined in the module's xml-file:
<field name="content" type="textarea" label="LWTAGCLOUD_CONTENT_LABEL" description="LWTAGCLOUD_CONTENT_DESCRIPTION" rows="20" cols="60" class="lw_tagcloud_textarea" default="VALUE; LINK"></field>
Has anyone an idea how to solve this problem?
If you cannot solve the problem using css only, and since you cannot add wrap="off" to the textarea type in Joomla, what you could do is to create a custom parameter type, the same like textarea, just with wrap=off already defined.
For more details on how to do it, have a look at http://docs.joomla.org/Creating_custom_template_parameter_types and http://www.sanjeevshrestha.com.np/2010/01/creating-color-element-in-joomla-for-custom-parameter-type/, it's not hard to make it
just use
for line break !
hope this help for anyone who ask
I have DateFrom and DateTo fields. I want to submit those data to action which will do some business logic but nothing changes on the original GSP, and nothing is updated. How do I manage this? I've tried this:
<g:formRemote name="formName" url="[action: 'myAction']">
Everything is fine but except my action tries to render myAction.jsp.
This is a great place to read how it works.
Basically you need to specify what controller as well:
<g:formRemote name="formName" update="updateMe" url="[controller: 'controller', action:'myAction']">
The "updateMe" is the id of an html-object, preferably div, that you want to alter after submit (but it's not mandatory). It also uses the actionName.gsp to "supply" the answer, this is why you need to have this page create as well.
Remote forms are a bit tricky in the beginning, but they're super simple once you get a hang of it!
This is how I did it:
GSP:
<g:formRemote name="formName" update="updateMe" url="[controller: 'controller', action:'myAction']">
<div id="updateMe">
<g:render template="updateTemplate"/>
</div>
Action:
...
render template:"updateTemplate"
updateTemlate and updateMe div are both empty.
If you have better solution please tell me.
you can use remoteFunction
you need to write submit button inside form and then after it will fire action and some changes shown into div..
Folks,
I have an image with the following HTML code:
<div unselectable="on" class="x-grid-cell-inner x-unselectable" style="; text-align: right;" id="ext-gen1453">
<img alt=""src="data:image/gif;base64,FRFRFR/GFFFFFFFFFF==" class="x-action-col-icon x-action-col-0 folder-action-add folder-action" data-qtip="Add New Music File" id="ext-gen1300">
When I click on the image it should open a pop up so that I can add new music file, I tried a few things but I am not able to click on that image. Any suggestions?
Thanks a lot
You can click on it by the class or a partial match of the class.
#browser.image(:class=>/folder-action-add folder-action/).click
Here is a list of the identifiers you can use for watir, I think it's mostly the same for watir-webdriver.
So far, you haven't got a consistent way of actually identifying the element. From what you've said in the comments, you've tried the 'text' attribute which doesn't exist, and the 'id' attribute which is auto generated and different every time.
You need to find a way of consistently identifying the element. It's usually preferable to use a semantic class on the element to make styling and testing easier and less brittle. You have a few classes declared, perhaps 'folder-action-add' expresses the intent of the button clearly? If not, you could add one such as 'add-music-file'.
Then you should be able to use watir to select an element by it's class, I'm not familiar with the syntax but at a guess, #browser.image(:class => 'add-music-file') might do the job.