Sharepoint row hyperlink - xslt

I'm new to this Sharepoint design.
I have a created a new list page and I want one entry of each row to hyperlink to a different page.
Sl Title Topic Subject
1 ABC TABC SABC
2 DEF TDEF TSABC
So, basically what i want is when I click on ABC under title column it should take me to a page & when I click on DEF they would take me to a different page which I have added by Clicking on Hyperlink.
The current scenario is whenever I add a Hyperlink all the Column entries for Title automatically take the same link.
I tried to change this bit and individually add for each entry to no avail.
<xsl:value-of select="$thisNode/#*[name()=current()/#Name]" /></xsl:when>
<xsl:otherwise>
The xxx is the link to the one of the List Pages I created.
Can someone please help me with this.
Thanks,
Sandip

Currently your xslt assigns the same path to all hyperlinks.
What you need to do is enter a path for each item. Store it in a dedicated column, for example called PageLink. Then you can use that column within your xslt:
<xsl:value-of select="$thisNode/#*[name()=current()/#Name]" />
</xsl:when>

Related

//*[#id="gwt-uid-2423"] is getting changed every rime in selenium python2.7 chrome

HTML Code is ..
<div class="N1LCMI-ib-e" role="option" id="gwt-uid-2423" style="user-select: none;">Hotel ID</div>
There is one button when i click on it there are some categories to select Only one category can be selected in one time. So Id in xpath is getting changed every time when i am using Xpath of that category. below is code which i am using to select that category.
driver.find_element_by_xpath('//*[#id="gwt-uid-2423"]').click() #select Hotel ID
so only 2423 part is getting changed every time.
is there any other way to go for it. pls help....
As you mentioned that the 2423 part is getting changed every time for the id attribute, so we can create a unique css_selector or xpath as follows:
css_selector :
driver.find_element_by_css_selector("div[class='N1LCMI-ib-e'][id^='gwt-uid-']").click()
xpath :
driver.find_element_by_xpath("//div[#class='N1LCMI-ib-e'][starts-with(#id, 'gwt-uid-')]").click()
You can find the element by contained text using an XPath.
//div[.='Hotel ID']

Sharepoint XSL dropdown populated form a list

I'm trying to use a CEWP to display a list of items as a drop down list.
Specifically im trying to set the value to the url and then the title as the item shown in the drop down.
This is what I have so far
<xsl:template name="HubJumpTo" match="Row[#Style='HubJumpTo']" mode="itemstyle">
<select id="mySelect">
<xsl:for-each select="/item">
<option>
<xsl:attribute name="value"><xsl:value-of select="#value"/></xsl:attribute>
<xsl:value-of select="#name"/>
</option>
</xsl:for-each>
</select>
</xsl:template>
But the CEWP isn't showing any fields for me to specifiy which coloumn in the list should popul;ate value and name. Any suggestions why this might be?
The drop down isn't populating with anything and I assume this is because of this isse.
It might be a typo in your question (in which case, this answer will self-destruct...), but the problem may lie in this line
<xsl:for-each select="/item">
Because the xpath expression starts with a forward slash /, then this represents the document node, and so the expression is looking for the root element of the name item. There is only one root element in the document, and I guessing it is not called item!
You probably need to use a relative expression here, assuming item is a child element of the currently matched Row element.
<xsl:for-each select="item">
Your query seems bit ambiguous, you say CEWP i.e. "Content editor Webpart" how come you can use CEWP with XSLT for rendering list? it should be like, you need to add list view webpart and pass your custom xslt path to it.
also i see match="Row[#Style='HubJumpTo']" so do you have a column named 'Style'? and are there any rows with value "HubJumpTo"
DID this using SP services in the end.

ADF create form with combo box

I'm starting with Oracle ADF and JDeveloper. I'm doing some basic tutorials first.
From the HR database schema, I'm trying this exercise: create a new location, but in CountryId attribute, show all countries list.
This is more user-friendly, so the user can select Italy instead of typing IT .
For this, I'm doing this steps:
In Locations view , choose CountryId attribute and create a LOV. This one must read from CountriesView1, with value CountryId attribute, and show CountryName attribute.
Drop LocationsView1 in a page and select ADF Form.
Select CountryId as a combo box.
Drop Create operation from LocationsView1 as a button.
Drop Commit operation as a button.
When running this page, I see all country names, but when I choose one of them, it does not show me it as selected, and, when commit the new data, CountryId is inserting with null value.
Obviously, I'm doing something in a wrong way. How can I do this simple form, with CountryId as a list?
Can anyone help me, please?
Thanks in advance. Best regards
EDIT: code of dataEntry.jspx
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1" binding="#{backingBeanScope.backing_dataEntry.d1}">
<af:messages binding="#{backingBeanScope.backing_dataEntry.m1}" id="m1"/>
<af:form id="f1" binding="#{backingBeanScope.backing_dataEntry.f1}">
<af:panelStretchLayout id="psl1"
binding="#{backingBeanScope.backing_dataEntry.psl1}">
<f:facet name="center">
<af:panelFormLayout binding="#{backingBeanScope.backing_dataEntry.pfl1}"
id="pfl1">
<af:panelFormLayout binding="#{backingBeanScope.backing_dataEntry.pfl2}"
id="pfl2">
<af:inputText value="#{bindings.LocationId.inputValue}"
label="#{bindings.LocationId.hints.label}"
required="#{bindings.LocationId.hints.mandatory}"
columns="#{bindings.LocationId.hints.displayWidth}"
maximumLength="#{bindings.LocationId.hints.precision}"
shortDesc="#{bindings.LocationId.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it1}"
id="it1">
<f:validator binding="#{bindings.LocationId.validator}"/>
<af:convertNumber groupingUsed="false"
pattern="#{bindings.LocationId.format}"/>
</af:inputText>
<af:inputText value="#{bindings.StreetAddress.inputValue}"
label="#{bindings.StreetAddress.hints.label}"
required="#{bindings.StreetAddress.hints.mandatory}"
columns="#{bindings.StreetAddress.hints.displayWidth}"
maximumLength="#{bindings.StreetAddress.hints.precision}"
shortDesc="#{bindings.StreetAddress.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it2}"
id="it2">
<f:validator binding="#{bindings.StreetAddress.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.PostalCode.inputValue}"
label="#{bindings.PostalCode.hints.label}"
required="#{bindings.PostalCode.hints.mandatory}"
columns="#{bindings.PostalCode.hints.displayWidth}"
maximumLength="#{bindings.PostalCode.hints.precision}"
shortDesc="#{bindings.PostalCode.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it3}"
id="it3">
<f:validator binding="#{bindings.PostalCode.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.City.inputValue}"
label="#{bindings.City.hints.label}"
required="#{bindings.City.hints.mandatory}"
columns="#{bindings.City.hints.displayWidth}"
maximumLength="#{bindings.City.hints.precision}"
shortDesc="#{bindings.City.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it4}"
id="it4">
<f:validator binding="#{bindings.City.validator}"/>
</af:inputText>
<af:inputText value="#{bindings.StateProvince.inputValue}"
label="#{bindings.StateProvince.hints.label}"
required="#{bindings.StateProvince.hints.mandatory}"
columns="#{bindings.StateProvince.hints.displayWidth}"
maximumLength="#{bindings.StateProvince.hints.precision}"
shortDesc="#{bindings.StateProvince.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.it5}"
id="it5">
<f:validator binding="#{bindings.StateProvince.validator}"/>
</af:inputText>
<af:inputListOfValues id="countryIdId"
popupTitle="Search and Select: #{bindings.CountryId.hints.label}"
value="#{bindings.CountryId.inputValue}"
label="#{bindings.CountryId.hints.label}"
model="#{bindings.CountryId.listOfValuesModel}"
required="#{bindings.CountryId.hints.mandatory}"
columns="#{bindings.CountryId.hints.displayWidth}"
shortDesc="#{bindings.CountryId.hints.tooltip}"
binding="#{backingBeanScope.backing_dataEntry.countryIdId}">
<f:validator binding="#{bindings.CountryId.validator}"/>
</af:inputListOfValues>
<af:commandButton actionListener="#{bindings.Create.execute}"
text="Create"
disabled="#{!bindings.Create.enabled}"
binding="#{backingBeanScope.backing_dataEntry.cb1}"
id="cb1"/>
<af:commandButton actionListener="#{bindings.Commit.execute}"
text="Commit"
disabled="#{!bindings.Commit.enabled}"
binding="#{backingBeanScope.backing_dataEntry.cb2}"
id="cb2"/>
</af:panelFormLayout>
</af:panelFormLayout>
<!-- id="af_one_column_stretched" -->
</f:facet>
</af:panelStretchLayout>
</af:form>
</af:document>
</f:view>
<!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_dataEntry-->
</jsp:root>
Well, I did it!
The steps are:
Drop LocationsView1 in a page and select ADF Form...
Drop Create operation from LocationsView1 as a button.
Drop Commit operation as a button
Remove CountryId input text
(Re)Drop CountryId from LocationsView1. When JDeveloper asks, choose Select One
Choice...
In Bindings section, select CountryId and edit (pen icon)
Choose Dynamic List radio button and CountriesView1 in
ListDataSource combo
Match CountryId from Data Value with CountryId List attribute. Select CountryName in the below section.
Well, finally, all countries from COUNTRIES table are listed, and data are inserted into LOCATIONS table.
I hope this will be useful.
Regards

Cannot get List Lookup XSL param to use in HTML tag using SharePoint 2010 Designer

So I am adding a span tag to a few column fields in a couple of view all forms in SP 2010 Designer that have a Hexadec string in them, i'm using an inline style to display a block with a coloured background rather than the hexadec itself, so pretty simple.
I successfully achieved this in the first view but in the second view I cannot seem to return the value to use in the inline style, below is the original xsl and the row param is thisNode. The only difference in the views is one is the view all for a custom list(this one is working) and the other is the view all for another custom list with the previous lists value as a Lookup column, the columns xsl value is below.
<xsl:value-of select="$thisNode/#*[name()=current()/#Name]" disable-output-escaping="yes" />
I have tried adding the {$thisNode/#*[name()=current()/#Name]} to the inline css but get nothing returned when I should see a block of colour when viewing the form. I have also tried other ways to get the value from the thisNode row but have had no luck, can anyone tell me what I should be doing or what I am doing wrong?
Worked it out!
So the first step was to remove the hyperlink around the Loopup column:
<xsl:value-of select="substring-before(substring-after($thisNode/#*[name()=current()/#Name],'>'), '<')" disable-output-escaping="yes"/>
This then shows the Lookup column value as text; so we can use this method to create another param or variable and add the value to our css parameter like so:
<xsl:param name="thisNode" select="."/>
<xsl:param name="thisColour" select="substring-before(substring-after($thisNode/#*[name()=current()/#Name],'>'), '<')"/>
<span style="display:block;background:{$thisColour};width:20px;height:20px;" title=""></span>
This then shows my Hexadec colour as a 20px block rather than the Hexadec code as text, so hope this helps anyone else with the same problem, enjoy!

Filtering DVWP with xslt with parameter from connected LVWP in Sharepoint Designer

My setup is as follows:
A custom page on a Sharepoint 2010 site with a list view web part and a Data view web part. When I select an item in the LVWP I want to filter the DVWP with a multi lookup field value. So I've connected to two web parts such that the DVWP gets the parameter from the LVWP. I filter the DVWP with the following:
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[contains($pDataAftaleID,concat(#ID,';#',#ID))]"/>
where pDataAftaleID is the parameter from the LVWP.
My problem is: Everything works well if the selected item from the LVWP has a value in the parameter field, but if it doesn't, Sharepoint doesn't seem to write the null/empty or zero value to the parameter and the filter parameter keeps the value from the last selected item in the LVWP with a value, and the DVWP therefore shows the items from some previous selected item and not "no items to show".
Is there some way to force the writing of the empty field, or is it possible to set the parameter to zero each time the DVWP loads? Any suggestions?
<xsl:variable name="Rows">
<xsl:choose>
<xsl:when test="/dsQueryResponse/Rows/Row[contains($pDataAftaleID,concat(#ID,';#',#ID))]">
<xsl:text>/dsQueryResponse/Rows/Row[contains($pDataAftaleID,concat(#ID,';#',#ID))]</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Please check if this or a variation of this works for you.