I need to validate field in repeated region
I need to validate a form that is inside a repeated region,
therefore the
name of the form element changes, like ... name1, then same
field next row
is 'name2', and so forth ... I haven't been able to find help
nor tutorials,
I need to get this done over the weekend, does anyone knows
someone who I
can hire to do this job ?
A
I did, I just don't know how to validate them .... any clues
A
"Randy Edmunds" <[email protected]> wrote in
message
news:eesnug$bbd$[email protected]..
> Alejandro,
>
> To use form elements in a Repeat Region, you'll need to
setup a scheme to
> automatically generate unique ids/names for each
element. And do it in
> such as way that you can interpret the data later.
>
> HTH,
> Randy
>
>
>> I have a page that updates multiple records, the
first field in the
>> repeated region is a date.
>>
>> I need to validate that the information entered in
such field is a date,
>> keep in mind this is not just one field but a
repeated region. I tried
>> using my regular form validation extensions but none
work.
>> Is there a way to validate form elements inside a
repeated region ?
Similar Messages
-
Hi There,
I am trying to sum a field in a repeat region.
That is, the repeat region displays on page as per normal but then have a total field based on the sub total fields stored in the data base for each record.
Any help is appreciated.
CheersHere's a quick idea of how to do it in CF. If you use PHP the principle would be the same.
<cfset ThisRowTotal = 0 >
<cfloop query="getPageLinks">
<cfset ThisRowTotal = ThisRowTotal + YourSubTotalVariable>
<cfoutput>#ThisRowTotal#<cfoutput>
</cfloop>
That's how it would look, what it is doing is each loop it is adding that loop's subtotal to the "ThisRowTotal" variable, then outputting it, so each loop will show the cumulative sub total.
Hope this helps.
Lawrence Cramer - *Adobe Community Professional*
http://www.Cartweaver.com
Shopping Cart for Adobe Dreamweaver
available in PHP, ColdFusion, and ASP
Stay updated - http://blog.cartweaver.com -
Need to validate a existing field in the table maitainence Generator events
Hi EXPERTS,
There is one Z-table and for that TMG also there. There is custom transaction for sm30. Now I need to validate one field BNAME for new entries I have created event -05(creating new entry) it is validating correctly. But now another requirement is if user also wants to change the existing values for the field BNAME it should also be validated needs to populate error mesg and does not allow to save it. I used event 01(before saving data) 07 ( before correcting the contents of selected field) 18 ( after checking whether data has changed)but not working any of these events. Please suggest me which event is suitable for my requirement. Orelse I need to put the code in the flow logic of the screen under PAI module I think this is not a good practice.
Code:
FORM data_changed.
DATA : l_bname TYPE xubname.
CONSTANTS: c_mesg TYPE char16 VALUE 'Invalid SAP User',
c_error TYPE char1 VALUE 'E'.
* Validation on BNAME field
IF zps_capex_appr-bname IS NOT INITIAL.
SELECT SINGLE bname FROM usr01 INTO l_bname
WHERE bname = zps_capex_appr-bname.
IF sy-subrc NE 0.
MESSAGE c_mesg TYPE c_error.
ENDIF.
ENDIF.
ENDFORM. "DATA_CHANGED
Please suggest me how to proceed.
<Added code tags>
<< Priority normalized >>
Awaiting for your replyu2026
Thanks in Advance..
Edited by: Rob Burbank on Mar 2, 2012 9:23 AMHello Sreekanth,
How are you populateing the field zps_capex_appr-bname ? I'm pretty much sure that this is not getting populated at runtime.(put a break-point & check)
In order to access the data in the TMG [Event01|http://help.sap.com/saphelp_nw04s/helpdata/en/91/ca9f0ba9d111d1a5690000e82deaaa/content.htm], we have to use the TMG system tables - TOTAL & EXTRACT.
If your validation of BNAME fails, remember to:
1. Set SY-SUBRC to a non-zero value,
2. Set the flag VIM_ABORT_SAVING to 'X'.
BR,
Suhas -
URGENTLY NEED HELP WITH NESTED REPEAT REGION
Im using dreamweaver to deevelop a page that displays questions in ann assessment to the user. First of all the page shows the assessment name to the user and then it gets some information about the questions in the assessment from the table called Item. It gets the Question_ID and then there is a repeat region which uses the Question_ID to display the questions in the assessment. There is a nested repeat region inside this which displays the possible answers the user can respond to the question with It gets this information from a table called outcome. The page should display each question and then all the possible answers but i am having problems and im not sure wether i am doing this in the correct way. What is wrong with my code? PLEASE HELP! can someone tell me what is going wrong and how i can fix this problem thamks.
here is my code.
Driver DriverassessmentRecordset = (Driver)Class.forName(MM_connAssessment_DRIVER).newInstance();
Connection ConnassessmentRecordset = DriverManager.getConnection(MM_connAssessment_STRING,MM_connAssessment_USERNAME,MM_connAssessment_PASSWORD);
PreparedStatement StatementassessmentRecordset = ConnassessmentRecordset.prepareStatement("SELECT Assessment_ID, Assessment_Name, Time_Limit, Display_Random, Record_Answers FROM Assessment.assessment WHERE Assessment_ID = '" + session.getValue("AssessmentID") + "' ");
ResultSet assessmentRecordset = StatementassessmentRecordset.executeQuery();
boolean assessmentRecordset_isEmpty = !assessmentRecordset.next();
boolean assessmentRecordset_hasData = !assessmentRecordset_isEmpty;
Object assessmentRecordset_data;
int assessmentRecordset_numRows = 0;
%>
<%
Driver DriveritemRecordset = (Driver)Class.forName(MM_connAssessment_DRIVER).newInstance();
Connection ConnitemRecordset = DriverManager.getConnection(MM_connAssessment_STRING,MM_connAssessment_USERNAME,MM_connAssessment_PASSWORD);
PreparedStatement StatementitemRecordset = ConnitemRecordset.prepareStatement("SELECT Question_ID, Assessment_ID FROM Assessment.item WHERE Assessment_ID = '" + session.getValue("AssessmentID") + "' ");
ResultSet itemRecordset = StatementitemRecordset.executeQuery();
boolean itemRecordset_isEmpty = !itemRecordset.next();
boolean itemRecordset_hasData = !itemRecordset_isEmpty;
Object itemRecordset_data;
int itemRecordset_numRows = 0;
%>
<%
Driver DriverquestionRecordset = (Driver)Class.forName(MM_connAnswer_DRIVER).newInstance();
Connection ConnquestionRecordset = DriverManager.getConnection(MM_connAnswer_STRING,MM_connAnswer_USERNAME,MM_connAnswer_PASSWORD);
//PreparedStatement StatementquestionRecordset = ConnquestionRecordset.prepareStatement("SELECT Question_Type, Number_Outcomes, Question_Wording FROM Answer.question WHERE Question_ID = '" + (((itemRecordset_data = itemRecordset.getObject("Question_ID"))==null || itemRecordset.wasNull())?"":itemRecordset_data) +"' ");
//ResultSet questionRecordset = StatementquestionRecordset.executeQuery();
%>
<%
Driver DriveroutcomeRecordset = (Driver)Class.forName(MM_connAnswer_DRIVER).newInstance();
Connection ConnoutcomeRecordset = DriverManager.getConnection(MM_connAnswer_STRING,MM_connAnswer_USERNAME,MM_connAnswer_PASSWORD);
PreparedStatement StatementoutcomeRecordset = ConnoutcomeRecordset.prepareStatement("SELECT Outcome_Number, Outcome_Text, Score, Feedback FROM Answer.outcome WHERE Question_ID = '" +itemRecordset.getObject("Question_ID")+ "' ");
ResultSet outcomeRecordset = StatementoutcomeRecordset.executeQuery();
boolean outcomeRecordset_isEmpty = !outcomeRecordset.next();
boolean outcomeRecordset_hasData = !outcomeRecordset_isEmpty;Object outcomeRecordset_data;
int outcomeRecordset_numRows = 0;
%>
<%
int Repeat1__numRows = -1;
int Repeat1__index = 0;
itemRecordset_numRows += Repeat1__numRows;
%>
<%
int Repeat2__numRows = -1;
int Repeat2__index = 0;
assessmentRecordset_numRows += Repeat2__numRows;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/assessment.dwt.jsp" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Assessment</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="../css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="1000" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="190"><img src="../img/assessment_login.png" alt="" name="navigation" width="1000" height="190" border="0" id="navigation" /></td>
</tr>
<tr>
<td height="19"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="19"><!-- InstanceBeginEditable name="main" -->
<table>
<tr>
<td width="990">Assessment Name:<%=(((assessmentRecordset_data = assessmentRecordset.getObject("Assessment_Name"))==null || assessmentRecordset.wasNull())?"":assessmentRecordset_data)%> </td>
</tr>
<tr>
<td><% int count = 1; %> </td>
</tr>
<tr>
<td valign="top"><table>
<% while ((itemRecordset_hasData)&&(Repeat1__numRows-- != 0)) { %>
<tr>
<td width="21">
</td>
<td width="86">Question:<%= count %></td>
</tr>
<tr>
<td></td>
<td>
<%
PreparedStatement StatementquestionRecordset = ConnquestionRecordset.prepareStatement("SELECT Question_Type, Number_Outcomes, Question_Wording FROM Answer.question WHERE Question_ID = '" +itemRecordset.getObject("Question_ID")+"' ");
ResultSet questionRecordset = StatementquestionRecordset.executeQuery();
boolean questionRecordset_isEmpty = !questionRecordset.next();
boolean questionRecordset_hasData = !questionRecordset_isEmpty;
Object questionRecordset_data;
int questionRecordset_numRows = 0;
%> <%= questionRecordset.getObject("Question_Wording") %></td>
</tr>
<tr>
<td></td>
<td>
</td>
</tr>
<tr>
<td></td>
<td>
<table>
<% while ((outcomeRecordset_hasData)&&(Repeat2__numRows-- != 0)) {%>
<tr>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Number"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Text"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Score"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Feedback"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Question_ID"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
</tr>
<%
Repeat2__index++;
outcomeRecordset_hasData = outcomeRecordset.next();
%>
</table>
<table>
<tr> </tr>
<tr> </tr>
</table></td>
</tr>
<%
Repeat1__index++;
itemRecordset_hasData = itemRecordset.next();
count++;
//questionRecordset.close();
//StatementquestionRecordset.close();
//ConnquestionRecordset.close();
%>
Here is the exception i am gettingorg.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 115 in the jsp file: /delivery/session.jsp
Generated servlet error:
C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:220: cannot find symbol
symbol : variable outcomeRecordsetRecordset_data
location: class org.apache.jsp.delivery.session_jsp
out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Number"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
^
An error occurred at line: 116 in the jsp file: /delivery/session.jsp
Generated servlet error:
C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:223: cannot find symbol
symbol : variable outcomeRecordsetRecordset_data
location: class org.apache.jsp.delivery.session_jsp
out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Text"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
^
An error occurred at line: 117 in the jsp file: /delivery/session.jsp
Generated servlet error:
C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:226: cannot find symbol
symbol : variable outcomeRecordsetRecordset_data
location: class org.apache.jsp.delivery.session_jsp
out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Score"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
^
An error occurred at line: 118 in the jsp file: /delivery/session.jsp
Generated servlet error:
C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:229: cannot find symbol
symbol : variable outcomeRecordsetRecordset_data
location: class org.apache.jsp.delivery.session_jsp
out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Feedback"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
^
An error occurred at line: 119 in the jsp file: /delivery/session.jsp
Generated servlet error:
C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java:232: cannot find symbol
symbol : variable outcomeRecordsetRecordset_data
location: class org.apache.jsp.delivery.session_jsp
out.print((((outcomeRecordset_data = outcomeRecordset.getObject("Question_ID"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data));
^
An error occurred at line: 119 in the jsp file: /delivery/session.jsp
Generated servlet error:
Note: C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java uses or overrides a deprecated API.
An error occurred at line: 119 in the jsp file: /delivery/session.jsp
Generated servlet error:
Note: Recompile with -Xlint:deprecation for details.
An error occurred at line: 119 in the jsp file: /delivery/session.jsp
Generated servlet error:
Note: C:\Servers\Tomcat 5.0\work\Catalina\localhost\assessment\org\apache\jsp\delivery\session_jsp.java uses unchecked or unsafe operations.
An error occurred at line: 119 in the jsp file: /delivery/session.jsp
Generated servlet error:
Note: Recompile with -Xlint:unchecked for details.
5 errors
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Hi,
Dont have much time to go through your code, but apparently i can see the error is becoz of the following reason.
In the following code, you have used "outcomeRecordset_data ", but its not declared. You need to declare the variable first before you can use it.
<% while ((outcomeRecordset_hasData)&&(Repeat2__numRows-- != 0)) {%>
<tr>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Number"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Outcome_Text"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Score"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Feedback"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
<td><%=(((outcomeRecordset_data = outcomeRecordset.getObject("Question_ID"))==null || outcomeRecordset.wasNull())?"":outcomeRecordsetRecordset_data)%></td>
</tr>
<%
Repeat2__index++;
outcomeRecordset_hasData = outcomeRecordset.next();
%>Try declaring the "outcomeRecordset_data " on top as an object
Hope it helps -
Plants are needed to validate against company in Component Tab - IW31
Hi Experts ,
Module PM , T Code IW31 ,
Plants are needed to validate against company in Component Tab and need to populate error message in status bar . Thereafter user possible to correct whatever the error and save it .
Can you please help me to solve this issue.
Component Data is populated in Data grid (Data Table). These user exits are not fired within a loop( Not repeating with line of components).
Is there way to read whole table ?
Already i tried BADI -IW O1_ORDER_BADI and
exit -
PRM0003 User field: Maintenance plan
WO10001 Create a PM sub-order
WO10002 PM maintenance order: Customer check for order release
WO10004 Maintenance order: Customer check for order completion
WO10005 Maintenance order: Cust.-specif. determination of profit ctr
WO10006 Maint. order: Fcode exclusion through cust. enhancement
WO10007 Maint.order: Customer enhancement - permits in the order
WO10008 Cust. enhancement: Determination of tax jurisdiction code
WO10009 PM Order: Customer Check for 'Save' Event
WO10010 Maint. order: Cust. enhancement for determining WBS element
WO10012 Maintenance order: Priority handling on central header
WO10015 Maintenance order: F4 Help for user fields on operation
WO10016 PM Order: Cust. enhancement to check operation user fields
WO10017 Determine external order number by customer logic
WO10018 Maintenance order: User fields on order header
WO10020 Maintenance order: Automatically include task list
WO10021 Automatic task list transfer when creating order from notif.
WO10022 Determine calendar from user exit
WO10025 PM/SM order: Finding responsible cost center
WO10026 User check on setting status 'Do not perform'
WO10031 Hide personnel number in PM/SM order
WO20001 PM order: User exit to pass routing to order
EXIT_SAPLCOMK_004 (Enhancement - CNEX0013)
COZF0002
COZF0001
Thanks,
RehanHi,
I am not completely clear with ur question, i think system will give message if component is selected from other company code, but if ur looking for something specfic ..check the below
CNEX0037 : Check a newly assigned component.
CNEX0038: Check a changed component.
regards
pushpa -
Php/MySQL Repeated region which doen't include the last item?
Hi,
I hope somebody can help me with this. I use php/MySQL.
I need t create a repeated region which doen't include the last item (post) added to the table.
Does somebody know how to establish this?In SQL, there is no native concept of the last item inserted. It's up to you to control that. What is your definition of the last item? Is it the row with the greatest datetime stamp? An autoincrement id field? Something else?
Using an autoincrement id field as an example, the last row inserted will have the largest value, so
Select * from MyTable where MyID != (select max MyID from MyTable) -
How to create a repeating region like the attachements in Gmail
I don't even know how to begin Googling or searching here for
this topic. But I've got a form and I want to have two fields show
up for inputting the fabric type and then the pattern name. This
site will allow them to request fabric swatches to see in person
how they look and make a decision for their furniture. And if
customers want to ask for more than one sample, I want to be able
to have a link that says, "Request another" and when clicked, it
creates another instance of those two fields automagically, just
how the attachments in Gmail work.
Is this something possible with Spry? I'd like to think it
is, but it might need some jury rigging to ensure that the ids for
those text inputs are all unique and such. But like I said, I don't
even know how to begin searching for this topic since "repeating
area" or "repeating region" brings back 1000s of unrelating
results.
Anyone have any experience doing something like this and
could shed some light on it and/or point me toward some resources
that could help out?
Thanks!Hi unnamed,
Suppose you have an id that identifies your record.
Go to Report definiton, tab report attirbutes.
Select the id of your record.
Create a link to the page you want to go to.
Hope this helps.
If not, I suggest you to create a from with report, and analyze the way the wizard has generated it.
Leo -
Creating links in repeat regions
How do I link a downloadable word document in a repeat region displaying information from a database. The word document would be different for each record. Thanks.
I posted this question 9 hours ago and have not received a reply. I am not sure that you understant my question and so I will try to make it clearer.
1. I created a database and stored the name of the word document in the cv_name field.
2. I created a repeat region that displays the name of the word documents in the recordset
3 All I need to do is to link the name of the word document to the word file in dreamweaver
4 I highlight the name field, open the property inspector, click the folder icon, set the link to use Data Sources, and select the recordset column that holds the word document name.
5 However when I click on the file name that is displayed on the website I get an error.
Thanks for any assistanceHi Avci,
Try this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN">
<HTML><HEAD><TITLE>Home</TITLE>
<META http-equiv=Content-Type content="text/html;
charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR>
<style>
.redlnk {
FONT-SIZE: 9px;
COLOR: red;
LINE-HEIGHT: 15px;
FONT-STYLE: normal;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
TEXT-DECORATION: none;
.redlnk:hover{
FONT-SIZE: 9px;
COLOR: red;
LINE-HEIGHT: 15px;
FONT-STYLE: normal;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
TEXT-DECORATION:underline;
.bluelnk {
FONT-SIZE: 9px;
COLOR: blue;
LINE-HEIGHT: 15px;
FONT-STYLE: normal;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
TEXT-DECORATION: none;
.bluelnk:hover{
FONT-SIZE: 9px;
COLOR: blue;
LINE-HEIGHT: 15px;
FONT-STYLE: normal;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
TEXT-DECORATION:underline;
.greenlnk {
FONT-SIZE: 9px;
COLOR: green;
LINE-HEIGHT: 15px;
FONT-STYLE: normal;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
TEXT-DECORATION: none;
.greenlnk:hover{
FONT-SIZE: 9px;
COLOR: green;
LINE-HEIGHT: 15px;
FONT-STYLE: normal;
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
TEXT-DECORATION:underline;
</style>
</HEAD>
<BODY topmargin="0" leftmargin="0" rightmargin="0" >
<a class="redlnk" href="red.htm"
title="red">Red</a>
<br/>
<a class="bluelnk" href="blue.htm"
title="blue">Blue</a>
<br/>
<a class="greenlnk" href="green.htm"
title="green">Green</a>
</BODY>
</HTML>
I hope this helps.
shanthi -
Assigning "position" in repeat region
I have a site that runs a contest and displays winners from
across the
nation. Through the year they compete and can go online to
see where they
stand in relation to others in their same territory. In order
to display
the winner's positions on the page, I sort the underlying
data in sql using
the necessary criteria, then on my asp page, as part of the
repeat region, I
run code that loops through the recordset and uses an x+1
method of
displaying each person's position. Whether or not this is the
best way to
do this, it works.
MY PROBLEM...
Up until now I only needed to display the positions based on
one selected
territory. So my results would always simply show 1 -x, in
order.
Joe territory1 1
Van territory1 2
Tim territory1 3
Bob territory1 4
NOW I am being asked to show the entire nation on one page
for
administrators. They want to see ALL the territories and the
positions of
each person for each territory, and have the ability to sort
based on
various columns. So now my "positions" column will have
several people in
1st position, several in 2nd, etc.
Joe territory1 1
Jen territory2 1
Van territory1 2
Sue territory2 2
Tim territory1 3
Len territory2 3
Bob territory1 4
Ken territory2 4
I'm not sure how to go about this, and would greatly
appreciate any advice!In the actual case the criteria for winning is that 1) ALL
criteria are met
(there are actually four of them, not two as shown in my
example), and then
2) you have the highest perentage.
So in the case below, remembering that each territory has its
own set of
winners, it would look like this (if sorted by winning
position - keeping in
mind that I need to allow sorting on ANY column by the user):
name territory Criteria_A Criteria_B Criteria_C POS
Bob 1 74% Y Y
1
Tim 1 42% Y Y
2
Van 1 25% Y Y
3
Len 2 66% N Y
1
Sue 2 56% N Y
2
Joe 1 43% Y N
4
Ken 2 82% N N
3
Jen 2 68% N N
4
Here you can see that Bob, Tim, and Van all have Y for both
their B & C
criteria, so they are sorted to the top (how I do that is
somewhat secondary
at this point -- you can just assume that Y=10 and N=0 and
I'll sort on the
sum of those columns).
Then Len, Sue, and Joe each have one Y and one N, so they are
grouped
together based on that, then sorted by percent. Note that Joe
has a
position of 4 because he is in Territory 1.
Lastly, Ken and Jen have "N" for both criteria, so they are
sorted last, and
then by their percentage.
I put a dashed line in there as a visual aid -- doesn't need
to be in my
results.
"Pizza Good" <[email protected]> wrote in message
news:[email protected]...
> Hmm...interesting.
>
> In the sample data below, can you please sort them how
you want them to
> appear? I want to see how you handle the Y's and N's.
>
>
> "HX" <[email protected]> wrote in message
> news:[email protected]...
>> Because "position" isn't a field in the database -
it's determined based
>> on sorting the list on various criteria. For
example, let's say the
>> winner for each territory will have met all of
criteria_B and _C and then
>> will have the highest % in criteria_A . All I have
in my database is:
>>
>> name territory Criteria_A Criteria_B Criteria_C
>> Joe 1 43% Y N
>> Jen 2 68% N N
>> Van 1 25% Y Y
>> Sue 2 56% N Y
>> Tim 1 42% Y Y
>> Len 2 66% N Y
>> Bob 1 74% Y Y
>> Ken 2 82% N N
>>
>> For Territory 1 I can pull out those names, sort
based on my criteria,
>> then loop in my repeat region and assign their
positions right there in
>> the asp.
>>
>> But when I combine ALL of them onto one page, I
can't do that.
>>
>> Is there some way to set those positions in the
sub-query (for each
>> territory) and reference that field in a 2nd query?
>>
>>
>>
>>
>> "Pizza Good" <[email protected]> wrote
in message
>> news:[email protected]...
>>> Why not just sort by both fields?
>>>
>>> Not sure what your fields are called so I will
use:
>>>
>>> territory
>>> position
>>>
>>> ORDER BY territory ASC, position ASC
>>>
>>>
>>>
>>>
>>> "HX" <[email protected]> wrote in
message
>>> news:[email protected]...
>>>>I have a site that runs a contest and
displays winners from across the
>>>>nation. Through the year they compete and can
go online to see where
>>>>they stand in relation to others in their
same territory. In order to
>>>>display the winner's positions on the page, I
sort the underlying data
>>>>in sql using the necessary criteria, then on
my asp page, as part of the
>>>>repeat region, I run code that loops through
the recordset and uses an
>>>>x+1 method of displaying each person's
position. Whether or not this is
>>>>the best way to do this, it works.
>>>>
>>>> MY PROBLEM...
>>>>
>>>> Up until now I only needed to display the
positions based on one
>>>> selected territory. So my results would
always simply show 1 -x, in
>>>> order.
>>>>
>>>> Joe territory1 1
>>>> Van territory1 2
>>>> Tim territory1 3
>>>> Bob territory1 4
>>>>
>>>> NOW I am being asked to show the entire
nation on one page for
>>>> administrators. They want to see ALL the
territories and the positions
>>>> of each person for each territory, and have
the ability to sort based
>>>> on various columns. So now my "positions"
column will have several
>>>> people in 1st position, several in 2nd, etc.
>>>>
>>>> Joe territory1 1
>>>> Jen territory2 1
>>>> Van territory1 2
>>>> Sue territory2 2
>>>> Tim territory1 3
>>>> Len territory2 3
>>>> Bob territory1 4
>>>> Ken territory2 4
>>>>
>>>> I'm not sure how to go about this, and would
greatly appreciate any
>>>> advice!
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
> -
Dreamweaver CS3
ASP / VBScript
Hi,
I'm trying to create a nested repeat region to display a list
of categories
and, in brackets afterwards, a count of the number of
sub-categories
contained in it E.g.
Cats (12)
Dogs (43)
Fish (92)
Etc
I have managed to create my repeat region ok because as soon
as I drop a
field in from the recordset, it loops through them all and
displays them
correctly. However, when I try and simply write out the total
number of
records found, it doesn't display anything.
Recordset 1 is a straighforward select from the table.
Recordset 2 adds a
WHERE clause usinga variable based on the 1st recordset. Here
is the code
i'm using for the 2 recordsets:
Recordset 1 :
<%
Dim Level1
Dim Level1_cmd
Dim Level1_numRows
Set Level1_cmd = Server.CreateObject ("ADODB.Command")
Level1_cmd.ActiveConnection = MM_SemiDirectory_STRING
Level1_cmd.CommandText = "SELECT * FROM TBL_Level1 ORDER BY
[Description]
ASC"
Level1_cmd.Prepared = true
Set Level1 = Level1_cmd.Execute
Level1_numRows = 0
%>
Recordset 2 :
<%
Dim Level2__varLink
Level2__varLink = "1"
If (level1.fields.item("Level1_ID").value <> "") Then
Level2__varLink = level1.fields.item("Level1_ID").value
End If
%>
<%
Dim Level2
Dim Level2_cmd
Dim Level2_numRows
Set Level2_cmd = Server.CreateObject ("ADODB.Command")
Level2_cmd.ActiveConnection = MM_SemiDirectory_STRING
Level2_cmd.CommandText = "SELECT * FROM TBL_Level2 WHERE
Level1_ID = ? ORDER
BY Level1_ID ASC"
Level2_cmd.Prepared = true
Level2_cmd.Parameters.Append
Level2_cmd.CreateParameter("param1", 5, 1, -1,
Level2__varLink) ' adDouble
Set Level2 = Level2_cmd.Execute
Level2_numRows = 0
%>
Now for the repeated code :
<%
While ((Repeat1__numRows <> 0) AND (NOT Level1.EOF))
%>
<li><a
href="category.asp?level1=<%=(Level1.Fields.Item("Level1_ID").Value)%>"><%=(Level1.Fields .Item("Description").Value)%>
(<%=(Level2_total)%>)
</li></a>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Level1.MoveNext()
Wend
%>
Can anyone tell me what I need to do to this code to make it
display the
number of sub-categories?
Thanks!!!Ok folks,
I found a way to get what I want. It's not pretty as I had to
make an extra
query in the database (that select of the count of all child
table results
for each parent category) and am pulling from that but it
works and that's
the main thing. I'm sure there is a more effective way of
doing it but
that's life!
I'm still interested in knowing the 'proper' way (if there is
such a thing)
so if you have the time to show me, i'm all ears!
Cheers!
"Mintyman" <[email protected]> wrote in message
news:[email protected]...
> Ok,
>
> So I closed the <li> code before the <a>
code. D'oh!
>
> Anyway, it returns a number now........the problem now
is that it returns
> the same value for each parent repeat!!!
>
> "Mintyman" <[email protected]> wrote in message
> news:[email protected]...
>> Dreamweaver CS3
>> ASP / VBScript
>>
>> Hi,
>>
>> I'm trying to create a nested repeat region to
display a list of
>> categories and, in brackets afterwards, a count of
the number of
>> sub-categories contained in it E.g.
>>
>> Cats (12)
>> Dogs (43)
>> Fish (92)
>> Etc
>>
>> I have managed to create my repeat region ok because
as soon as I drop a
>> field in from the recordset, it loops through them
all and displays them
>> correctly. However, when I try and simply write out
the total number of
>> records found, it doesn't display anything.
>>
>> Recordset 1 is a straighforward select from the
table. Recordset 2 adds a
>> WHERE clause usinga variable based on the 1st
recordset. Here is the
>> code i'm using for the 2 recordsets:
>>
>> Recordset 1 :
>>
>> <%
>> Dim Level1
>> Dim Level1_cmd
>> Dim Level1_numRows
>>
>> Set Level1_cmd = Server.CreateObject
("ADODB.Command")
>> Level1_cmd.ActiveConnection =
MM_SemiDirectory_STRING
>> Level1_cmd.CommandText = "SELECT * FROM TBL_Level1
ORDER BY [Description]
>> ASC"
>> Level1_cmd.Prepared = true
>>
>> Set Level1 = Level1_cmd.Execute
>> Level1_numRows = 0
>> %>
>>
>> Recordset 2 :
>>
>> <%
>> Dim Level2__varLink
>> Level2__varLink = "1"
>> If (level1.fields.item("Level1_ID").value <>
"") Then
>> Level2__varLink =
level1.fields.item("Level1_ID").value
>> End If
>> %>
>> <%
>> Dim Level2
>> Dim Level2_cmd
>> Dim Level2_numRows
>>
>> Set Level2_cmd = Server.CreateObject
("ADODB.Command")
>> Level2_cmd.ActiveConnection =
MM_SemiDirectory_STRING
>> Level2_cmd.CommandText = "SELECT * FROM TBL_Level2
WHERE Level1_ID = ?
>> ORDER BY Level1_ID ASC"
>> Level2_cmd.Prepared = true
>> Level2_cmd.Parameters.Append
Level2_cmd.CreateParameter("param1", 5,
>> 1, -1, Level2__varLink) ' adDouble
>>
>> Set Level2 = Level2_cmd.Execute
>> Level2_numRows = 0
>> %>
>>
>>
>> Now for the repeated code :
>>
>>
>> <%
>> While ((Repeat1__numRows <> 0) AND (NOT
Level1.EOF))
>> %>
>> <li><a
>>
href="category.asp?level1=<%=(Level1.Fields.Item("Level1_ID").Value)%>"><%=(Level1.Fields .Item("Description").Value)%>
>> (<%=(Level2_total)%>)
>> </li></a>
>>
>>
>> <%
>> Repeat1__index=Repeat1__index+1
>> Repeat1__numRows=Repeat1__numRows-1
>> Level1.MoveNext()
>> Wend
>> %>
>>
>> Can anyone tell me what I need to do to this code to
make it display the
>> number of sub-categories?
>>
>> Thanks!!!
>>
>>
>>
>
> -
Calculate Total In Repeat Region
Hi,
I need to calculate a total based on fields in a repeat
region, these values
are stored in an SQL db, all are numeric and written in ASP.
fields are
TOTAL_COST VAT GRANDTOTAL (Page selects records based on
field parameter and displays in a repeat region)
At bottom of page need to show total sum like
TOTAL_COST(sum of above)
VAT(sum of above)
GRANDTOTAL(sum of above)
Thanks in advance
SimonAbove your repeat region declare three values like this
<%
Dim TCost = 0
Dim VAT=0
Dim GTotal = 0
%>
Then inside the repeat region simply have a line like this
<%
TCost = TCost + recordset.fields.item("cost").value
%>
Finally where you want the numbers to display you would have
the following
calculations
<%
VAT = TCost * .01
GTotal = TCost + VAT
%>
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver
Valleybiz Internet Design
www.valleybiz.net
"Simon Gare" <[email protected]> wrote in message
news:e71gpa$8la$[email protected]..
> Hi,
>
> I need to calculate a total based on fields in a repeat
region, these
> values
> are stored in an SQL db, all are numeric and written in
ASP.
>
> fields are
>
> TOTAL_COST VAT GRANDTOTAL (Page selects records based
> on
> field parameter and displays in a repeat region)
>
>
> At bottom of page need to show total sum like
>
> TOTAL_COST(sum of above)
> VAT(sum of above)
> GRANDTOTAL(sum of above)
>
> Thanks in advance
> Simon
>
> -
Formatting Recordset - Repeating Region
Hi,
I am a newbie and trying to format dynamic content. I've created the link to the database and established a repeating region to return one field from the table. Currently, a new line is created for each field and would prefer to format in paragraph style.
This:
item1 item2 item3 item4 item5
Not this:
item1
item2
item3
item4
item5
Any help is appreciated.
the current code looks something like below:
<?php do { ?>
<h1 class="item_stuff"><?php echo $row_Recordset1['item']; ?></h1>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>I think I got it... needed to update html tags...thanks anyway
-
Issue with layout / repeat region
Can someone have a look at this please?
Basically two versions of a details page based on a recordset
using two tables and an interlinking lookup table.
The idea is to display a person's details at the top of the
page on the left (from the 'Candidates' table), and on the right
any job 'profiles' for that person (from a 'Profiles' table). The
page is obviously just showing the details for the selected
Candidate, but needs to show *all* the associated profiles.
So in the first page, the details are correct, but because it
shows the first record from the query.
So I thought it would be a simple case of adding a repeat
region to the 'Profiles' row on the right hand side. But when I do
that, most of the contact details don't display - only the ID and
firstname fields.
http://www.searchtechuk.com/database/candidates2.php
http://www.searchtechuk.com/database/candidates3.php
Any clues?
Iainthere's no urls with your request.
"Iain71" <[email protected]> wrote in
message
news:eaqnht$il4$[email protected]..
> Can someone have a look at this please?
>
> Basically two versions of a details page based on a
recordset using two
> tables
> and an interlinking lookup table.
>
> The idea is to display a person's details at the top of
the page on the
> left
> (from the 'Candidates' table), and on the right any job
'profiles' for
> that
> person (from a 'Profiles' table). The page is obviously
just showing the
> details for the selected Candidate, but needs to show
*all* the associated
> profiles.
>
> So in the first page, the details are correct, but
because it shows the
> first
> record from the query.
>
> So I thought it would be a simple case of adding a
repeat region to the
> 'Profiles' row on the right hand side. But when I do
that, most of the
> contact
> details don't display - only the ID and firstname
fields.
>
> example 1
>
> example 2
>
> Any clues?
>
> Iain
>
>
> -
Issue with layout / repeat region part 2..
Seems I haven't cracked this just yet - basically have a
details page that is split into three - with a candidate's details
at the top left, their work profile at the top right, with a long
CV text appearing below both.
All the fields are from the Candidates table, except the
profiles - so the profiles need to be a repeat region to list them
all.
I can't for the life of me get the layout to work as I'd like
- it's as tho' anything appearing afer the repeat region won't
display.
See here :
link
Below the CV header the CV field should appear - as in :
<tr>
<td colspan="2" valign="top"
class="labelcell">CV</td>
</tr>
<tr>
<td class="profilecell"><?php echo
$row_Candidates['CV']; ?></td>
</tr>
But when you view source, the <?php echo
$row_Candidates['CV']; ?> is AWOL, and appear as :
<tr>
<td colspan="2" valign="top"
class="labelcell">CV</td>
</tr>
<tr>
<td class="profilecell"></td>
</tr>
Anyone spot what's up here?
Just as I thought I had this page's layout done and dusted,
as usual, there had to be something not quite right!
IainIain -
I'm gonna have to take a look at this first thing in the
monring man, sorry.
I had a problem that got me all tied up.
If you want, email me at crash blat cdcdigital dotcom and
i'll answer in
email for a bit quicker response.
"Iain71" <[email protected]> wrote in
message
news:[email protected]...
>
quote:
what does your code look like? what languages are you using?
>
> I'm using PHP/mySQL
>
> This is the current PHP at the top of the page :
>
> <?php
require_once('../Connections/connSearchTechUK.php'); ?>
> <?php
> $maxRows_Candidates = 10;
> $pageNum_Candidates = 0;
> if (isset($_GET['pageNum_Candidates'])) {
> $pageNum_Candidates = $_GET['pageNum_Candidates'];
> }
> $startRow_Candidates = $pageNum_Candidates *
$maxRows_Candidates;
>
> $colname_Candidates = "1";
> if (isset($_GET['CandidateID'])) {
> $colname_Candidates = (get_magic_quotes_gpc()) ?
$_GET['CandidateID'] :
> addslashes($_GET['CandidateID']);
> }
> mysql_select_db($database_connSearchTechUK,
$connSearchTechUK);
> $query_Candidates = sprintf("SELECT * FROM Profiles
INNER JOIN (Candidates
> INNER JOIN CandidateProfiles ON Candidates.CandidateID =
> CandidateProfiles.CandidateID) ON Profiles.ProfileID =
> CandidateProfiles.ProfileID WHERE Candidates.CandidateID
= %s",
> $colname_Candidates);
> $query_limit_Candidates = sprintf("%s LIMIT %d, %d",
$query_Candidates,
> $startRow_Candidates, $maxRows_Candidates);
> $Candidates = mysql_query($query_limit_Candidates,
$connSearchTechUK) or
> die(mysql_error());
> $row_Candidates = mysql_fetch_assoc($Candidates);
>
> if (isset($_GET['totalRows_Candidates'])) {
> $totalRows_Candidates = $_GET['totalRows_Candidates'];
> } else {
> $all_Candidates = mysql_query($query_Candidates);
> $totalRows_Candidates = mysql_num_rows($all_Candidates);
> }
> $totalPages_Candidates =
> ceil($totalRows_Candidates/$maxRows_Candidates)-1;
> ?>
>
> The data is being displayed using PHP echo lines, eg :
>
> <?php echo $row_Candidates['FirstName']; ?>
>
>
quote:
You said all fields were created from the Candidates table -
so that
> means
> the left and bottom sections, yet?
>
> The profiles section is fed by another table, yes?
What's your SQL look
> like for this? Are you searching by userID, by
userClass,. how are you
> determininig what profieles are assocaited with what
Person?
>
> Yup - basically a Candidates table, and a Profiles
table, looking up on
> CandidateID - the SQL looks like :
>
> SELECT *
> FROM Profiles INNER JOIN (Candidates INNER JOIN
CandidateProfiles ON
> Candidates.CandidateID = CandidateProfiles.CandidateID)
ON
> Profiles.ProfileID =
> CandidateProfiles.ProfileID
> WHERE Candidates.CandidateID = colname
>
>
quote:
What does your recordset produce when you test it?
>
> The recordset looks fine - in the code 'FirstName'
displays correctly near
> the
> top amongst the main details, but it should also appear
immediately to the
> left
> of "'s CV' - the code in the page is exactly the same
(as it should be, as
> the
> field is just dragged into place from the bindings
panel) as :
>
> <tr>
> <td colspan="2" valign="top"
class="labelcell"><?php echo
> $row_Candidates['FirstName']; ?>'s CV</td>
> </tr>
>
> It (and the 'CV' field) display fine when there's no
repeat region on the
> 'Profile' field, but as soon as I add the repeat region,
the go AWOL.
>
> Iain
> -
PHP help with nested repeat region
Hopefully someone can help me out with this one.
I basically have some SQL returning results of a search page,
where you can search on various keywords by checking boxes, and it
returns Employers that match those keywords :
mysql_select_db($database_myDatabase, $myDatabase);
if (isset($_GET['ckbox'])){
// get profile keys
$ckbox = array_keys($_GET['ckbox']);
// sql string
$sql = 'SELECT Employers.*, EmployerContacts.* FROM
EmployerContacts
INNER JOIN Employers ON EmployerContacts.EmployerID =
Employers.EmployerID
INNER JOIN EmployerProfiles ON EmployerProfiles.EmployerID =
EmployerContacts.EmployerID
WHERE EmployerProfiles.ProfileID IN(' . implode(',',
$ckbox).')
GROUP BY Employers.EmployerID
ORDER BY Employers.EmployerID DESC';
$rsContacts = mysql_query($sql) or die(mysql_error());
$row_rsContacts = mysql_fetch_assoc($rsContacts);
@$totalRows = mysql_num_rows($rsContacts);
else
echo 'You did not check any profiles.';
?>
The results are drawing fields from the Employers table and
EmployerContacts table, hopefully to look like :
Employer1
Employer1.Contact 1
Employer1.Contact 2
Employer1.Contact 3
Employer2
Employer2.Contact 1
Employer2.Contact 2
Employer2.Contact 3
etc
However, I can only seem to get it to repeat the Employers,
and show just the first Contact for each, like this :
Employer1
Employer1.Contact 1
Employer2
Employer2.Contact 1
etc
So I guess I'm looking for help with looping through the
Contacts for each Employer.
The code currently looks like this :
[code attached]
Hope that makes sense.
Many thanks.Iain71,
The DW Repeat Region cannot be nested because both loops use
the same
variable names (e.g. $RepeatSelectionCounter_1).
You will have to manually edit the code, and DW may not
recognize it
after you do, but you should be able to get it working fairly
easily. I
think that you just need to change the variable names in the
inner loop
so that they do not conflict with the similar names in the
outer loop
(e.g. rename $RepeatSelectionCounter_1 to
$RepeatSelectionCounter_2).
Does that make sense?
HTH,
Randy
> I basically have some SQL returning results of a search
page, where you can
> search on various keywords by checking boxes, and it
returns Employers that
> match those keywords :
Maybe you are looking for
-
Installing Solaris 10 1/06
Hi, i have a problem installing Solaris 10 1/06. My md5sum for the DVD image is 3993081fd5d8cde9c065f5ff584a8d17 I get the following error after configuring the disks: Exiting (caught signal 4) Type install-solaris to restart. Solaris installation pr
-
Problem in Displaying Date for Culture th-TH in SSRS 2010
Hello, I have a text box of date/time type. And Language of the report is set to a parameter ex: @P_Culture_Name and parameter will take a value from Prompt (UI). Suppose default value of date/time text box is 1/22/2013 12:00:00 AM when i pass 'en-US
-
E-Reader throws an error when trying to activate the ebook (DRM)
On my e-Reader (Poketbook touch lux) is adobe digital editions allready installed, so I should be able to activate my books on the reader. When I open the acsm file it tells me that I have to activate my book. So I enter my Adobe ID and Password. The
-
I upgraded from design premium cs5.5 to design premium cs6 and am unable to install. I get all the way to where it asks for the serial number of my prior product. Then it complains that the serial number dosent represent an eligible product. The inst
-
How can I download a previous version of firefox? for mac
I am a gov employee and only the older versions of firefox are compatible with our fedtraveler website. They list we must use firefox 3.0, 3.5, 3.6, 4.o, 5.0, 6.0, or 7.0 (for Mac osx Lion) only. The latest version 9.0 either does not work or is bloc