Adding Parameter to href tag before uri - jsp-tags

I have Jsp with JSTL Tags.I want to add disp=true parameter in href before adding uri
I have added href="<r:url?&disp=true uri="utb:open" mode="view" lateBinding="true" />" like this but it's givinng and Error.Anyone can please tell me how to add that parameter .
Here is the Code:
<a id="utb-edit-mode-quicklink" href="<r:url uri="utb:open" mode="view" lateBinding="true" />" title="${editModeDesc}"><portal-fmt:text key="toolbar.editPage" bundle="com.ibm.wps.toolbar.resources.Toolbar"/></a>
Thanks in Advance!!!!!!!!!!!!

Try like this(not shure what the r:url tag does though)
href="<r:url uri="utb:open" mode="view" lateBinding="true" />&disp=true"
P.S. posting the error could help.

Related

How to make Hybris CMSParagraphComponent print variable value

Is there a way to make CMSParagraphComponent print variable values?
On my controller I have something like this:
model.addAttribute("isInvoiceAvailable", currentBaseStore.isAccountPaymentAvailable());
return ControllerConstants.Views.Pages.Account.PAYMENT_OPTIONS_LANDING_PAGE;
My jsp look like this:
<cms:pageSlot position="Section1" var="feature">
<c:set var="adjustPosition" value="${true}" />
<cms:component component="${feature}" element="div" class="span-24 section1Template7 cms_disp-img_slot"/>
</cms:pageSlot>
The above mentioned component is a CMSParagraphComponent.
The CMSParagraphComponent content look like this:
UPDATE CMSParagraphComponent ; $contentCV[unique=true] ; uid[unique=true] ; content[lang=$lang]
; ; paymentOptionsParagraph ; "
<h3>Payment Options</h3>
<br>
${isInvoiceAvailable}
$isInvoiceAvailable
<h4>Credit card</h4>
<br>
<p>
MasterCard, Visa
</p>"
And when the page loads it's printing the content as if there were no variables, like this:
Is there a way to make the component print some variable value from the page contenxt?
CMSParagraphComponent is rendered using CMSParagraphComponentRenderer.java, so the Expression Language is not available at the moment of the rendering, and as a result, what you are trying to do is not possible.
I think for your use case a JSPIncludeComponent is more appropriate, another solution would be to create your own component type and use a JSP file to render it.

How to use siblings() and closest() in Geb test

I am trying to write a script to click an icon which is a part of the table header. Each column in the table has this icon in it (ascending order and descending order sorting icons). I am using Geb to do this. Here is how I am trying to do it:
In my SortingSpec.groovy file:
header.closest("div.customSortDownLabel").click()
I also tried
header.siblings('div.customSortDownLabel').first().click()
In the SortingPage.groovy file:
header {
grid.$(class: 'div.customHeaderLabel', text: 'Country')
}
In my html:
<div>
<div class="customHeaderLabel">{{params.displayName}}</div>
<div *ngIf="params.enableSorting" (click)="onSortRequested('asc', $event)" [ngClass]="ascSort" class="customSortDownLabel">
<i class="fa fa-long-arrow-alt-down"></i></div>
<div *ngIf="params.enableSorting" (click)="onSortRequested('desc', $event)" [ngClass]="descSort" class="customSortUpLabel">
</div>
None of them worked for me. It is not able to find the selector. Any suggestions are appreciated.
Error I see is:
geb.error.RequiredPageContentNotPresent: The required page content 'header - SimplePageContent (owner: SortingGrid, args: [], value: null)' is not present
That error looks like header isn't matching. Assuming that grid matches, and you're using some Javascript framework like Angular to substitute 'Country' for params.displayName, I would guess that maybe Geb is failing to find header before 'Country' is substituted. So, I would try making header wait for it:
header(wait: true) { grid.$(class: 'div.customHeaderLabel', text: 'Country') }
By the way, closest() goes in the wrong direction, to an ancestor, but siblings() looks good.
siblings() didnt work for me but next() worked for me. next() grabs the next sibling elements of the current context elements.
Example:
1. header.next().click() clicks the very next sibling
header.next("div.customSortDownLabel").click() looks for the very next sibling with the matching selector of 'div.customSortDownLabel' and then clicks it.

Watir and <script>

I am very new to programming so trying to solve the following issue with Watir:
I have a webpage that is full of fields, I'm trying to scrape values from inside ==$. The values inside start from var pageData if that helps.
X path is //*[#id="innerpage"]/script[48]
How can I achieve this?
Thanks
I don't know what ==$ means or what var pageData means, but to get the element at the provided XPath you use:
element = browser.element(id: 'innerpage').script(index: 47)
Though hopefully there's something more unique you can use than just the 48th script element.
From there you get the information at the element as desired:
element.text
element.value
element.attribute(attribute_name)

Kentico Tag output but not links

With help from Branded, i have tag working. At this point, we don't need tags to link, so i have tags being displayed like this (in an ascx transformation):
<p class='date'><%# IfEmpty(Eval("DocumentTags"),"",Eval("DocumentTags").ToString() + " | ") %><%# FormatDateTime(Eval("Date"),"MMM d, yyyy") %></p>
This works, but i get the tags wrapped in double quotes. I'm traying TrimEnd, or LastIndexOf, but just getting errors.
Use the method Replace() on the double quotes. Something like Eval<string>("DocumentTags").Replace("\"", "") should work.

Why do I get this error in SPFieldCollection.AddFieldAsXml()? "The specified field name is too long"

I am getting an error when I call SPFieldCollection.AddFieldAsXml().
Why is that? Here is the string I'm using:
"<Field Type='Note' Required='FALSE' NumLines='6' RichText='FALSE' Sortable='FALSE' ID='{aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa}' StaticName='tempField' Name='tempField' />"
Naturally, I'm using a different guid.
EDIT: MOSS2007/WSS3.0
EDIT2: Rephrased as question.
I forgot the DisplayName attribute. The following works:
"<Field Type='Note' Required='FALSE' NumLines='6' RichText='FALSE' Sortable='FALSE' ID='{aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa}' DisplayName='tempField' StaticName='tempField' Name='tempField' />"

Resources