Find hidden column value in a dynamacally bind html table with Sharepoint list - Javascript
I have following code. Now I want to get the hidden column value based on user selected row. I also want to highlight the entire row, not only the e.target.
Can someone please help me.
function getTermdetailsQuerySuccsess(sender, args) {
var listEnumerator = Termsitems.getEnumerator();
var datatable = document.getElementById("TermList");
while (listEnumerator.moveNext()) {
var oListItem = listEnumerator.get_current();
//var firstName = listEnumerator.get_current().get_item('Title');
//var secondName = listEnumerator.get_current().get_item('LastName');
var termID = listEnumerator.get_current().get_item('ID');
var startdate = listEnumerator.get_current().get_item('startdate');
var enddate = listEnumerator.get_current().get_item('Enddate');
var termtype = listEnumerator.get_current().get_item('TermType');
var Hours = listEnumerator.get_current().get_item('Hours');
var EdNone = listEnumerator.get_current().get_item('EdNoned');
var Specialty = listEnumerator.get_current().get_item('Specialty');
var Subspecialty = listEnumerator.get_current().get_item('Subspecialty');
var Hospital = listEnumerator.get_current().get_item('Hospital');
var DEMT = listEnumerator.get_current().get_item('DEMT');
var Supervisor = listEnumerator.get_current().get_item('Supervisor');
rowcount = rowcount + 1;
$("#TermList").append("<tr style='border-bottom:1px silver solid' align='middle' class='gradeA'>" +
"<td align='left' style='display:none'>" + termID + "</td>" +
"<td align='left'>" + startdate + "</td>" +
"<td align='left'>" + enddate + "</td>" +
"<td align='left'>" + termtype + "</td>" +
"<td align='left'>" + Hours + "</td>" +
"<td align='left'>" + EdNone + "</td>" +
"<td align='left'>" + Specialty + "</td>" +
"<td align='left'>" + Subspecialty + "</td>" +
"<td align='left'>" + Hospital + "</td>" +
"<td align='left'>" + DEMT + "</td>" +
"<td align='left'>" + Supervisor + "</td>" +
"</tr>");
$('#TermList').click(function (e) {
var tr = $(e.target).parent().index() ;
alert(tr);
alert($(e.target).text()); // using jQuery
// var Cells = tr.e.getElementsByTagName("td");
$(e.target).addClass('row-highlight');
var confirmationM = confirm("Do you want to edit this term deatils ?");
if (confirmationM == true) {
confirmation = "You pressed OK!";
else {
confirmation = "You pressed Cancel!";
$(e.target).removeClass('row-highlight');
$('#TermList').click(function (e) {
var tr = $(e.target).parent().index() ;
alert(tr);
alert($(e.target).text()); // using jQuery
// var Cells = tr.e.getElementsByTagName("td");
$(e.target).addClass('row-highlight');
var table = $("#TermList")[0];
var cell = table.rows[tr].cells[1];
alert(cell);
var confirmationM = confirm("Do you want to edit this term deatils ?");
if (confirmationM == true) {
confirmation = "You pressed OK!";
else {
confirmation = "You pressed Cancel!";
$(e.target).removeClass('row-highlight');
d.n weerasinghe
Hi,
According to your post, my understanding is that you want to customize a table to display the list items.
We can write CSS to customize the table style(background color, highlight, hover).
The following is an example for your reference:
Code:
<style>
#TermList table {
border-collapse: collapse;
margin-bottom: 2em;
width: 100%;
background: #fff;
#TermList td, th {
padding: 0.75em 1.5em;
text-align: left;
#TermList th {
background-color: #31bc86;
font-weight: bold;
color: #fff;
white-space: nowrap;
#TermList tbody tr:nth-child(2n-1) {
background-color: #f5f5f5;
transition: all .125s ease-in-out;
#TermList tbody tr:hover {
background-color: rgba(129,208,177,.3);
#TermList .HiddenColumn {
display:none;
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
ExecuteOrDelayUntilScriptLoaded(getAllListItems, "sp.js");
$("#TermList tbody").click(function(e){
//get hidden column value
var hiddenColumn=$(e.target).parent().find(".HiddenColumn").text();
alert(hiddenColumn);
function getAllListItems(){
var listName="CustomList01";
var context = new SP.ClientContext.get_current();
var web = context.get_web();
var list = web.get_lists().getByTitle(listName);
var query = SP.CamlQuery.createAllItemsQuery();
allItems = list.getItems(query);
context.load(allItems);
context.executeQueryAsync(Function.createDelegate(this, this.getSuccess), Function.createDelegate(this, this.failed));
function getSuccess() {
var ListEnumerator = this.allItems.getEnumerator();
while (ListEnumerator.moveNext()) {
var currentItem = ListEnumerator.get_current();
var itemID=currentItem.get_item("ID");
var name=currentItem.get_item("Title");
var email=currentItem.get_item("Email");
$("#TermList tbody").append('<tr><td class="HiddenColumn">'+itemID+'</td><td>'+name+'</td><td>'+email+'</td></tr>');
function failed(sender, args) {
alert("failed. Message:" + args.get_message());
</script>
<table id="TermList">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
Result:
Best Regards
Dennis Guo
TechNet Community Support
Similar Messages
-
How to bind ADF table with a collection of elements using backing bean.
Hi Experts,
My JDev version is 11.1.1.6.0.
I need to bind ADF table with a collection of elements using backing bean.
My backing bean consists of 6 lists of strings, where each list represents a column of table. How can I populate the entries of table with these lists.
Thanks
GopiHi,
Create an object representing the row (setter/getter). Then have a list of these objects. Drag and drop the table and point its value to the list and the type to the row object
Frank -
How to select column dynamically with sharepoint list as data source in ssrs report
Hi all,
I am creating reports from SharePoint list but i have requirements to select the column name dynamically with SharePoint list as data source. I didn't find any way of doing this..
Can anyone help me to resolve this issue..
There is no way of specifying column name dynamically here in data set query
<RSSharePointList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ListName>test list</ListName>
<ViewFields>
<FieldRef Name="ID" />
<FieldRef Name="ContentType" />
<FieldRef Name="Title" />
<FieldRef Name="Modified" />
<FieldRef Name="Created" />
<FieldRef Name="Author" />
<FieldRef Name="Editor" />
<FieldRef Name="_UIVersionString" />
<FieldRef Name="Attachments" />
<FieldRef Name="Edit" />
<FieldRef Name="LinkTitleNoMenu" />
<FieldRef Name="LinkTitle" />
<FieldRef Name="DocIcon" />
<FieldRef Name="ItemChildCount" />
<FieldRef Name="FolderChildCount" />
<FieldRef Name="test_x0020_date" />
<FieldRef Name="title2" />
</ViewFields>
</RSSharePointList>Hi MNRSPDev,
Sorry for the delay.
According to the current description, I understand that you want to specify column name in dataset query designer dynamically when using SharePoint list data source.
Based on my research, this is not supported by default. As a workaround, you can use XML data source. The XML content can be embedded directly within the query. This lets you use the expression capabilities within the processing engine to build queries and
data dynamically within the report. And it can be used for retrieving XML data directly from an external data source, passing it using parameters, and embedding it within the query.
Reference:
http://www.codeproject.com/Articles/56817/Dynamic-Reports-with-Reporting-Services
Hope this helps.
Regards,
Heidi Duan
Heidi Duan
TechNet Community Support -
How to populate column value from a sequence in adv table
Hi Everyone,
This is my requirement. When a user clicks on add another row button of advance table a new row should appear with ID column populated as a sequence value. For eg: When the page renders for the first time, no records are shown in the advance table. when user clicks on add another row button a new row should be added with the ID column poplulated as 1. When the user clicks on add another row button for the 2nd time, the ID coulmn value should be 2 and so on.
After user clicks on submit button data will be inserted to the data base table.
Please tell me how to populate the column values with a sequence 1,2,3 ..so on on click of add another row button.
Thanks in Advance
Sunny!Hi Gyan,
Below is the code I'm using in PFR.
OAAdvancedTableBean tableBean = (OAAdvancedTableBean)webBean;
OADBTransaction Tr=amobj.getOADBTransaction();
if ( (tableBean.getName().equals(pageContext.getParameter(SOURCE_PARAM)))
&& ADD_ROWS_EVENT.equals(pageContext.getParameter(EVENT_PARAM)))
System.out.println("in if clause");
Number lineNumber = Tr.getSequenceValue("paymentLineSequence");
testLineEOViewImpl vobj = amobj.gettestLineEOView1();
vobj.getCurrentRow().setAttribute("SundryRequestLineNumber",lineNumber);
When i click on Add Another Row button its throwing an exception as below.
oracle.apps.fnd.framework.OAException: java.lang.ClassCastException: oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean
at oracle.apps.fnd.framework.OAException.wrapperException(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageErrorHandler.processErrors(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at OA.jspService(_OA.java:71)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
## Detail 0 ##
java.lang.ClassCastException: oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean
at oracle.apps.ap.payments.webui.testCO.processFormRequest(testCO.java:98)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at OA.jspService(_OA.java:71)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
java.lang.ClassCastException: oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean
at oracle.apps.ap.payments.webui.testCO.processFormRequest(testCO.java:98)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(Unknown Source)
at OA.jspService(_OA.java:71)
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595) -
I want to change 'Modified By' column value of a file that is being uploaded using Client Object Model in SharePoint 2013. The problem is that the version of the file is changing. Kindly help me. The code that I am using is:
using (System.IO.Stream fileStream = System.IO.File.OpenRead(m_strFilePath))
Microsoft.SharePoint.Client.File.SaveBinaryDirect(m_clientContext, str_URLOfFile, fileStream, true);
Microsoft.SharePoint.Client.File fileUploaded = m_List.RootFolder.Files.GetByUrl(str_URLOfFile);
m_clientContext.Load(fileUploaded);
m_clientContext.ExecuteQuery();
User user1 = m_Web.EnsureUser("User1");
User user2 = m_Web.EnsureUser("User2");
ListItem item = fileUploaded.ListItemAllFields;
fileUploaded.CheckOut();
item["UserDefinedColumn"] = "UserDefinedValue1";
item["Title"] = "UserDefinedValue2";
item["Editor"] = user1;
item["Author"] = user2;
item.Update();
fileUploaded.CheckIn(string.Empty, CheckinType.OverwriteCheckIn);
m_clientContext.ExecuteQuery();Hi talib2608,
Chris is correct for this issue, when calling update using ListItem.update method, it will increase item versions, using SystemUpdate and UpdateOverwriteVersion will update the list item overwrite version.
these two methods are not available in CSOM/REST, only server object model is available for this.
Thanks,
Qiao Wei
TechNet Community Support -
SSRS Clustered Column Report with SharePoint List
Hi Guys,
I have a SharePoint List which has 3 columns: Team Status Date and i want to generate clustere column chart using SSRS report. Could you please provide me steps for the same?
X Axis - All the teams
Y Axis - Count
Legends
1. Pending - status <> "Completed"
2. Task Overdue - status <> "Completed" && (Date == Today between Date == Today - 30
please find attached sample of report.
This is what I have tried so far...
I just need help on forming expression.
Thanks, NileshHi Nilesh,
According to your description, you want to use a SharePoint list as datasource then create a chart.
In your scenario, we can add a calculated field which includes “pending” and “Task Overdue”. Then add the calculated field to the Series Groups panel. Please refer to the steps and results below:
1. Add a calculated field and specify the value with the expression below:
=switch(Fields!status.Value <> "Completed" and Fields!Date.Value <= now() and Fields!Date.Value >= dateadd("d",-30,now()),"TaskOverdue",Fields!status.Value <> "compeleted","pending")
2. Design the report like below and preview the report.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
How to add a running value from external field in a repeating table of SharePoint list
I'me creating an infopath form that will display a SharePoint list. I want to add a link control in a repeating table using the value of the first column per row but I'm getting an issue. the link control displays only the first row. thanks in advance.
Hi,
I found a similar thread posted by you here:
http://social.technet.microsoft.com/Forums/en-US/e1fa36c1-cb5c-456d-ba40-2f26301913d2/how-to-loop-through-each-row-in-a-repeating-table-using-sharepoint-workflows?forum=sharepointgeneralprevious
I suppose both the threads are reuqesting the method to get values from repeating table via workflow, so we can focus on the issue on the other case. If there is more requestment here, let me know.
Regards,
Rebecca Tu
TechNet Community Support -
Issue with Data binding in Table with Parameters
When we bind the table rows with parameter 'select', the data is not displayed in the table. Check the snippix file created for this issue: url: http://veui5infra.dhcp.wdf.sap.corp:8080/snippix/#70874
But the same parameter works with the odata service:
http://10.66.186.12:8000/OnlineShoppingAnalysis/Services/Analysis_Date_Range.xsodata/Sales_Periodwise?$select=Product_Name,Quantity
Credentials:
user: System
Password: Abcd1234I'm not able to access your service,so I can't test it.
You could try to do a read operation on your model and add the result to a new JSON model which you can bind on to your table:
var sServiceUrl ="http://services.odata.org/Northwind/Northwind.svc";
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl);
var oModelJson = new sap.ui.model.json.JSONModel();
oModel.read("/Customers", null, {select: "Product_Name,Quantity"} , true, function(oData, oResponse){
oModelJson.setData(oData.results);
sap.ui.getCore().setModel(oModelJson, "Model");
},function(){
alert("Read failed");});
OpenUI5 SDK - Demo Kit
Documentation/AdvancedTopics/DataBinding/ODataWrite – SAPUI5 Wiki (TIP CORE User Interface)
Kind regards,
Wouter -
To find the "column value" when clicked on Dynamic datatable
I ahve done a dynamic table where the first row alone i ahve declared as command link.So when I click on the commadn link I need to get either column name or column count or rowdata.If I Get then I have some logic based on it to do.
I have placed my dynamic datatable code below.
public class Datatable2 extends PageCodeBase
UIData dataTable =new UIData();
public Datatable2()
UIColumn col;
UIOutput out = null;
ArrayList al=new ArrayList();
al.add("Item");
al.add("Creation date");
al.add("Priority");
Application app = FacesContext.getCurrentInstance().getApplication();
int colCount = 3;
for(int j = 0; j < colCount; ++j) {
out = new UIOutput();
col = new UIColumn();
if(dataTable.getRowIndex()==-1)
MethodBinding mb = app.createMethodBinding("#{pc_DataTable.item}", null);
HtmlCommandLink link = (HtmlCommandLink)app.createComponent(HtmlCommandLink.COMPONENT_TYPE); link.setActionListener(mb);
link.setAction(mb);
link.setId("Command"+j);
ValueBinding vb1 = app.createValueBinding("#{commands" + j + "}");
link.setValueBinding("value",vb1);
link.setRendererType("javax.faces.Link");
HtmlOutputText O = new HtmlOutputText();
O.setValue(al.get(j).toString());
link.getChildren().add(O);
col.setHeader(link);
ValueBinding vb = app.createValueBinding("#{rows["+j+"]}");
out.setValueBinding("value", vb);
out.setRendererType("javax.faces.Text");
col.getChildren().add(out);
dataTable.getChildren().add(col);
public UIData getDataTable()
return dataTable;
public void setDataTable(UIData dataTable)
this.dataTable=dataTable;
public Object[] getTableRows()
Object[] test = new Object[]{new String[]{"1","2","3"},
new String[]{"4","5","6"},
new String[]{"7","8","9"},
new String[]{"10","11","12"},
new String[]{"13","14","15"}};
return test;
this is my jsp code
<f:view>
<P>Place content here.</P>
<h:form>
<h:dataTable binding="#{pc_Datatable2.dataTable}" value="#{pc_Datatable2.tableRows}" var= "rows" />
</h:form>
</f:view>
Could please tell how can i figure out my coulmn value when clicked on the command linkhello,
u can use two types methods u can create a dynamic action or by branching using conditional or java script code
for java script code just call the code when button clicked and in javascript function by using if condition u can redirect.
Regards,
Ramana -
How to pass hidden field values on a click of a table row
hi all,
href = "bookAndNonBook.do"
I am very new to struts. I have created a table using displaytable tag which displays results in a tabular format. In addtion, i have a hidden field (prodType), the table rows are getting highlighted when i get my mouse on a particular row.
Following is the code from the results.jsp file
<body
onload="addRowHandlers('row', 'rowMouseOver')"
bgcolor="#FFFFFF" text="#000000" leftmargin="100" topmargin="50"
marginwidth="" marginheight="" rightmargin="30">
<html:form action="/bookAndNonBook" method="post">
<display:table name="sessionScope.productSearchList" id="row"
sort="list" export="true" defaultsort="1" defaultorder="ascending"
pagesize="15" decorator="org.displaytag.decorator.TotalTableDecorator"
class="dataTable">
<display:column property="prodType" title="ProdType" class="prodType"
headerClass="prodType" media="html" />
<display:column title="Title" property="titleName" sortable="true"
class="title" headerClass="title" />
</display:table>
</html:form>
</BODY>
I am calling a funtion addRowHandlers which passes the table id (which is row) and the rowMouseover for highlighting the rows on mouse over.
the code for function addRowHandlers is
function addRowHandlers(tableId, rowClassName) {
var previousClass = null;
var table = document.getElementById(tableId);
var rows = table.getElementsByTagName("tr");
for (i = 1; i < rows.length; i++) {
rows.onmouseover = function () {
previousClass = this.className;
this.className = this.className + " " + rowClassName ;
this.style.cursor="hand";
rows.onmouseout = function () {
this.className = previousClass;
this.style.cursor='';
rows.onclick = function (){
var cell = this.getElementsByTagName("td")[0];
var ProdType = cell.innerHTML;
alert("value of prodType = " + ProdType);
when i run the above code and click on a particular row it returns me the value in the hidden field i.e. prodType for that particular row
Now where i am having problem is i want that on the basis of prodType my jsp file should call different actions for different prodType as returned....somwhat a function like this
function submitProduct(prodType) {
if(prodType == "BK")
resultsForm.action = "/bookProduct.do";
else if(prodType == "NB")
resultsForm.action = "/nonbookProduct.do";
but i am unable to figure out that how do i this..
Any help will be really appreciated
Thanks
Samcan you please suggest some good struts forums where i can post my question
thanks in advance
Sam -
How tu update a column having type 'Long raw' in oracle table with an image
Hello,
I must change the image loading in a column with 'long raw' type in the table. I find an image data already in the table.
I have my new imgae in a file .bmp.
What SQL instruction I mut use to update this column to load my new image ?
I work in Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod.
thanks for your helps.
Regards.Unless I'm missing something MSFT are making it unecessarily complex by not implementing the SQL/XML standard...
SQL> alter table emp add ( emp_xml xmltype)
2 /
Table altered.
SQL> update emp set emp_xml = XMLELEMENT("EMPLOYEE",xmlattributes(EMPNO as "id"), XMLElement("Name",ENAME))
2
SQL> /
14 rows updated.
SQL> set pages 0
SQL> select EMPNO, EMP_XML from EMP
2 /
7369
<EMPLOYEE id="7369">
<Name>SMITH</Name>
</EMPLOYEE>
7499
<EMPLOYEE id="7499">
<Name>ALLEN</Name>
</EMPLOYEE>
7521
<EMPLOYEE id="7521">
<Name>WARD</Name>
</EMPLOYEE>
7566
<EMPLOYEE id="7566">
<Name>JONES</Name>
</EMPLOYEE>
7654
<EMPLOYEE id="7654">
<Name>MARTIN</Name>
</EMPLOYEE>
7698
<EMPLOYEE id="7698">
<Name>BLAKE</Name>
</EMPLOYEE>
7782
<EMPLOYEE id="7782">
<Name>CLARK</Name>
</EMPLOYEE>
7788
<EMPLOYEE id="7788">
<Name>SCOTT</Name>
</EMPLOYEE>
7839
<EMPLOYEE id="7839">
<Name>KING</Name>
</EMPLOYEE>
7844
<EMPLOYEE id="7844">
<Name>TURNER</Name>
</EMPLOYEE>
7876
<EMPLOYEE id="7876">
<Name>ADAMS</Name>
</EMPLOYEE>
7900
<EMPLOYEE id="7900">
<Name>JAMES</Name>
</EMPLOYEE>
7902
<EMPLOYEE id="7902">
<Name>FORD</Name>
</EMPLOYEE>
7934
<EMPLOYEE id="7934">
<Name>MILLER</Name>
</EMPLOYEE>
14 rows selected.
SQL> -
Sql:How to find out Particular column Value in DB?
Hi,
I have to findout particular column value inDB ( I don't know table Name ).
can U tell me query for above.I want to find the 'name of that 27 year old male train passenger'. I don't know in which country. can you help me please... :-(..commmooon..
-
Multi-Row Hidden Column Submit Processing
Hi,
My attempts to select a hidden column value for use in Submit processing only works when I actually display the column in the report region. I want to store the column value in the array (htmldb_item.?????) without displaying it in the report region.
I have tried using the following htmldb_item functions: hidden, display_and_save, text. When I use the hidden function and set the column attribute to "Show" then the heading displays, no column data displays, and the htmldb_application.g_f01 value is present for use in Submit processing. When I set various column attributes to cause the column to not display then the column value is not present during Submit processing.
My code snippets for Region Select and Submit processing are:
"select htmldb_item.hidden(1, sac.student_acad_cred_id) q_acad_cred_id,..."
"BEGIN
for i in 1..htmldb_application.g_f01.count
loop..."
Couldn't find answer with Forum search or in the Guide. Thanks for any help!Bernhard,
There are two ways to build tabular forms (multi-row update forms). You can either use calls to the htmldb_item API in your query. Or you can use the built-in display types. The build-in types are generally the better option for a number of reasons, for example, the built-in form elements are only rendered for the rows you actually show on your current page. If you use the htmldb_item API and pagination with several pages, then you would make calls to PL/SQL for every row in your report, no matter whether they are shown or not.
With the built-in display types you can choose the display type âHiddenâ, which will actually append the hidden fields to the last column in your report, so the array is there, but you wonât have to deal with column headings and an empty column.
When using the htmldb_item API, you should simply append the hidden column to a displayed column, e.g. select htmldb_item.text(â¦)||htmldb_item.hidden(â¦) [column alias], ⦠from â¦
Hope this helps
Marc -
How to pass column value which is not present in source criteria
Hi,
In one of my report I want to pass a column value from Source report(a pivot table) to target report. The column which I want to pass is not present in the sorce report criteria. Is there any work around for this issue.
I added this column in criteria and hidden the column. But the issue is not solved.
Best Regards,
TKB.Swati,
I am navigating from Summary report to detail report. I am prompting the required fields in detail report. But I want to pass one more column value explicitly, which is not present in source request.
Best Regards,
TKB. -
Column values with invalid characters
How to find the column values with invalid chararcters
meaning value upper(col) not in ('ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890')
For ex.
1. CDAssyKit,DragonNaturallySpeaking�Preferred7.0,USEnglish
2. CDAssyKit,DragonNaturallySpeaking Preferred7.0,USEnglish
Query should retrieve only the first row, since it has extra � character in the column value.
Thanks for your help.Convert all letters and numbers to an arbitrary letter and then remove that letter. If there are any characters left, they are invalid according to your rules.
select *
from t
where replace(translate(lower(column_name), 'abcdefghijklmnopqrstuvwxyz0123456789', 'a'), 'a') is not null;
Maybe you are looking for
-
Windows XP system does not Sync
I have two Windows systems - a Vista and and XP Pro system and two iPhones. The Vista system has upgraded to iTunes 7.6 and all works fine. On the XP system, after the upgrade to iTunes 7.6 my wife's iPhone is not recognized by iTunes. Nothing in the
-
HP Solution Center won't open for HP C7280 Printer
Photosmart C7280 and Vista 64 bit First of all, I just wanted to say that before what's written below, I've not had an issue with this printer concerning printing/scanning/faxing. Now, here is the problem. I just moved, and since setting up my comput
-
Unable to install OS X update 10.9.5 updates via App store on MBP running Mavericks
Macbook Pro 13 (2012) 8GB of RAM, 512 GB SSD 2.9GHz Mavericks 10.9.4 When I click on the Appstore I see an OS X Update 10.9.5, Command Line Tools, and Digital Camera RAW Compatibility update 5.07. When I click Update for OS X Update 10.9.5 I get an
-
Document numbers missing in BI (Delta)
HI, we are extracting data from data source 0FI_GL_4 ( Daily dalta) When i reconcile the data from BW to R/3 , observed that on GL account showing wrong values in BW. Collected all document numbers associated to that perticular GL Account (GL Account
-
I might buy a iMac G5 iSight. I would probably upgrade it to 2GB RAM. Well, i usually have InDesign, Illustrator, Photoshop, MSN, mIRC, iTunes and Firefox opened at the same time. I have now 512mb of RAM and its soooooooo slow. With 2GB, is it too mu