I am using mui-rte rich text editor (https://github.com/niuware/mui-rte) in a react project. I am not able to figure out how to input text to the rte input area when writing a selenium webdriver integration test.
As I understand correctly, mui-rte is a materia-ui wrapper of draftjs. The react code is simply:
<MUIRichTextEditor
onChange={onChange}
value={initial}
{...rest}
/ >
This generates the following html elements:
<div id="mui-rte-container" class="MUIRichTextEditor-container-73">
<div id="mui-rte-toolbar" class="MUIRichTextEditor-toolbar-84">
...
</div>
<div id="mui-rte-editor" class="MUIRichTextEditor-editor-75">
<div id="mui-rte-editor-container" class="MUIRichTextEditor-hidePlaceholder-79 MUIRichTextEditor-editorContainer-76">
<div class="DraftEditor-root">
<div class="DraftEditor-editorContainer">
<div aria-describedby="placeholder-9mnek" class="notranslate public-DraftEditor-content" role="textbox" spellcheck="false" style="outline:none;user-select:text;-webkit-user-select:text;white-space:pre-wrap;word-wrap:break-word" contenteditable="true">
<div data-contents="true"><div class="" data-block="true" data-editor="7kjuh" data-offset-key="8a2rc-0-0">
<div data-offset-key="8a2rc-0-0" class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr">
<span data-offset-key="8a2rc-0-0">
<br data-text="true">
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I can easily find any of the element but when I try this for example:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
from selenium.webdriver.support import expected_conditions as EC # available since 2.26.0
from selenium.webdriver.common.by import By
rte_editor = WebDriverWait(self.driver, 2).until(
EC.presence_of_element_located((By.ID, id))
)
rte_input = bio_rte.find_element_by_xpath("//div[#role='textbox']")
rte_input.send_keys("Hello")
I get:
E selenium.common.exceptions.ElementNotInteractableException: Message: Element <div class="notranslate public-DraftEditor-content"> is not reachable by keyboard
With all elements that I have tried.
What is the correct way to input text into draft.js rte with selenium-webdriver in python? I am quite new to selenium+webdriver and any help will be appreciated, be it in python, JavaScript or other flavor of selenium-webdriver API.
I have a sample project here: https://github.com/vessper/formik-mui-rte-example
update:
Including the stack trace from the error:
self = <test.TestBase testMethod=test_input_text_in_rte>
def test_input_text_in_rte(self):
rte_input = WebDriverWait(self.driver, 20).until(
EC.element_to_be_clickable(
> (By.XPATH, '//div[#class="notranslate public-DraftEditor-content" and #role="textbox"]'))
)
test.py:25:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <selenium.webdriver.support.wait.WebDriverWait (session="38c21bf5-27ea-499d-9831-e8755a10f57a")>
method = <selenium.webdriver.support.expected_conditions.element_to_be_clickable object at 0x7f7115fe7198>, message = ''
def until(self, method, message=''):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
screen = None
stacktrace = None
end_time = time.time() + self._timeout
while True:
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions as exc:
screen = getattr(exc, 'screen', None)
stacktrace = getattr(exc, 'stacktrace', None)
time.sleep(self._poll)
if time.time() > end_time:
break
> raise TimeoutException(message, screen, stacktrace)
E selenium.common.exceptions.TimeoutException: Message:
../../../.virtualenvs/ml2/lib/python3.7/site-packages/selenium/webdriver/support/wait.py:80: TimeoutException
================================================================= 1 failed in 24.70s ==================================================================
In my case it was a draft.js rich text editor with a contenteditable div
async sendKeysToContentEditableDiv(element, text) {
const script = `var txtarea = arguments[0],txt = arguments[1];
txtarea.dispatchEvent(new Event("focus"));
var txtEvt = document.createEvent("TextEvent");
txtEvt.initTextEvent("textInput", true, true, null, txt);
txtarea.dispatchEvent(txtEvt);
txtarea.dispatchEvent(new Event("blur"));`;
await this.driver.executeScript(script, element, text);
}
The desired element is a ReactJS enabled element so to locate and send a character sequence to the element you have to induce WebDriverWait for the element_to_be_clickable() and you can use either of the following solutions:
Using CSS_SELECTOR:
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.notranslate.public-DraftEditor-content[role='textbox']"))).send_keys("Vess_Perfanov")
Using XPATH:
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[#class='notranslate public-DraftEditor-content' and #role='textbox']"))).send_keys("Vess_Perfanov")
Note : You have to add the following imports :
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
Update
As the click() is still not invoked with WebDriverWait you can use ActionChains as follows:
Using CSS_SELECTOR:
element = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.notranslate.public-DraftEditor-content[role='textbox']"))).send_keys("Vess_Perfanov")
ActionChains(driver).move_to_element(element).click(element).send_keys("Vess_Perfanov").perform()
Using XPATH:
element = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[#class='notranslate public-DraftEditor-content' and #role='textbox']"))).send_keys("Vess_Perfanov")
ActionChains(driver).move_to_element(element).click(element).send_keys_to_element(element, "Vess_Perfanov").perform()
There is an inline label element from Material-UI that needs to be clicked first to uncover the underlying text field. So the following work for me.
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver import ActionChains
import unittest
class TestBase(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.get(URL)
def tearDown(self):
self.driver.close()
def get_by_id(self, id):
return WebDriverWait(self.driver, 5).until(
EC.presence_of_element_located((By.ID, id))
)
def test_input_text_in_rte(self):
description_msg = "Hello There"
rte_container = self.get_by_id('mui-rte-container')
rte_label = rte_container.find_element_by_xpath("//*[contains(text(), 'Description:')]")
actions = ActionChains(self.driver)
actions.move_to_element(rte_label)
actions.click(rte_label)
actions.perform()
rte_input = WebDriverWait(self.driver, 5).until(
EC.presence_of_element_located((By.XPATH,
'//div[#class="notranslate public-DraftEditor-content" and #role="textbox"]'))
)
rte_input.send_keys(description_msg)
Thanks to #DebanjanB for the suggestions that are incorporated in the code above.
Related
I've a screen with a list of components. When I scroll down the screen, go to the next screen from a button (lets say 20th component) and go back to the previous screen with back btn, the previous screen (with list of components) displays with the first component there. How can I show the screen with 20th component when backed?
Look at the video here
Container mainContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
mainContainer.setScrollableY(true);
for (Map<String, Object> entrySet : protectedPlantsList) {
String title = entrySet.get("title").toString();
String sname = entrySet.get("sname").toString();
String nname = entrySet.get("nname").toString();
Label plantSpeciesLabel = new Label(title);
TextArea family = new TextArea(sname);
TextArea nepaliName = new TextArea(nname);
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Button infoIcon1 = new Button("", "TextField");
infoIcon1.addActionListener(e -> {
new ThreatCategory(res, threatData1.getName(), infoIcon1.getName(), threatList).show();
});
mainContainer.add(BorderLayout.centerEastWest(plantSpeciesLabel, ...., .....));
}
Update 1:
ProtectedPlantAndSpecies class:
Container mainContainer = new Container(new BoxLayout(BoxLayout.Y_AXIS));
mainContainer.setScrollableY(true);
for (Map<String, Object> entrySet : protectedPlantsList) {
String title = entrySet.get("title").toString();
String sname = entrySet.get("sname").toString();
String nname = entrySet.get("nname").toString();
Label plantSpeciesLabel = new Label(title);
TextArea family = new TextArea(sname);
TextArea nepaliName = new TextArea(nname);
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Button infoIcon1 = new Button("", "TextField");
infoIcon1.addActionListener(e -> {
Form myDestinationForm = new ThreatCategory(res, cat, cat_description, threatList);
myDestinationForm.addShowListener(f -> infoIcon1.requestFocus());
myDestinationForm.show();
});
mainContainer.add(BorderLayout.centerEastWest(plantSpeciesLabel, ...., .....));
}
ThreatCategory class:
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
Command backCommand = new Command("Back", backFontImage) {
#Override
public void actionPerformed(ActionEvent evt) {
new ProtectedPlantAndSpecies(res, true).show();
}
};
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
Do something like this:
Form hi = new Form("Last", BoxLayout.y());
Button t = new Button("Next");
hi.add(t);
t.addActionListener(e -> {
Form f = new Form("Showing Last", BoxLayout.y());
for(int iter = 0 ; iter < 20 ; iter++) {
f.add(new Button("Button " + iter));
}
Button last = new Button("Last");
f.add(last);
f.addShowListener(ee -> last.requestFocus());
f.show();
});
I have two pickers. The 2nd picker should be active as soon as the 1st picker is selected. But If the 2nd picker is clicked at first, the empty picker string is opened and then dialog stating choose the 1st picker is shown. How can I not show the empty picker string list if the first picker is not selected ?
Picker datePicker = new Picker();
datePicker.addActionListener(e -> {
SimpleDateFormat sf = new SimpleDateFormat("y");
String a = sf.format(datePicker.getDate());
SimpleDateFormat sf1 = new SimpleDateFormat("M");
String b = sf1.format(datePicker.getDate());
SimpleDateFormat sf2 = new SimpleDateFormat("d");
String c = sf2.format(datePicker.getDate());
getStartDate = a + "-" + b + "-" + c;
});
stationPicker.addActionListener(e -> {
if (!getStartDate.equals("")) {
_ _ _ _ _ _ _ _ _ ___ _
_ _ _ _ _ _ _ _ _ ___ _
}else{
Dialog.show("Warning", "Please choose the date first", "ok", null);
stationPicker.setSelectedString("Select the service center");
}
});
Have a look at the video so that the issue is more clear.
https://www.youtube.com/watch?v=Fmg13qm08Is
I have website which is working on my one server now I have migrated to another server changed the connection string. But one weird thing is some pages working fine but some page show me " page can not be displayed error message. I am new in VBscript Can anyone help me what am missing"
Below is the code of page which is not working on new server but working on old server
Microsoft VBScript runtime error '800a01a8' : object required
<%#LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<% if session("MM_Username") = "" or isnull(session("MM_Username")) then
response.redirect("/login.asp")
end if
%>
<%
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_v3_STRING
MM_editTable = "dbo.custMessage"
MM_editColumn = "id"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "Change.asp"
MM_fieldsStr = "textarea|value"
MM_columnsStr = "message|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim change__MMColParam
change__MMColParam = "1"
If (Request("MM_EmptyValue") <> "") Then
change__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim change
Dim change_numRows
Set change = Server.CreateObject("ADODB.Recordset")
change.ActiveConnection = MM_v3_STRING
change.Source = "SELECT * FROM dbo.custMessage WHERE id = " + Replace(change__MMColParam, "'", "''") + ""
change.CursorType = 0
change.CursorLocation = 2
change.LockType = 1
change.Open()
change_numRows = 0
%>
<%
'setup database connection
dim conn
set conn = server.CreateObject ("ADODB.Connection")
conn.ConnectionString = "Provider=SQLOLEDB;User ID=***;Password=***;Initial Catalog=heart_Test;Data Source=****;"
conn.Open
%>
So here is the answer.
Start Internet Services Manager.
Click Default Web Site, and then click Properties.
Double-click ASP in the Features pane.
Expand Behavior.
Click Enable Parent Paths.
Click True for Enable Parent Paths.
Click Apply.
I am running into a problem where I am needing to accomplish something, but have never had experience with it before. I am currently running an asp site and using SQL Server for the database. I have a report that I takes the querysting from the filters page and then gives the information based on the querstring. It is an intake report, so there should only be a single line item and record per client hat appears in the report. On the report it gives information such as the date of first contact, and when the client started services with us. I am adding a new field to the report called services. It is possible and more common that there are many services to one client. Here is what I am needing to accomplish. I need for each service for that client to be listed in a single data cell on the report, without displaying multiple line items for that client. I was thinking that the answer may be accomplished by using BOF and EOF, but I am not sure how to take a stab at it. Here is the RecordSet that is already on the report, which contains every field with the exception of the new field, because I have tried to create a new RecordSet for that Field. Below are images that will hopefully give the idea of what I want to accomplish. Thank you so much for your input!
This image is what It looks like now... I want to put all of the services that show for aa aa to be in a single data cell rather than creating a new line for each service provided.
Image of what It looks like now.
This is an image I created in photoshop to show what I am really wanting it to look like.
This is a rough idea of What I want it to look like.
Here is the code so far.
<%
Dim rsClients
Dim rsClients_numRows
Set rsClients = Server.CreateObject("ADODB.Recordset")
rsClients.ActiveConnection = MM_ims_db_STRING
rsClients.Source = "SELECT" _
& " vClients.ClientID" _
& ", vClients.AgencyID" _
& ", vClients.OfficeID" _
& ", vClients.OfficeName" _
& ", vClients.LastName" _
& ", vClients.FirstName" _
& ", vClients.ClientTeamName" _
& ", vClients.EnrolledDate" _
& ", vClients.Agency" _
& ", ReferralSources.ReferralSourceID" _
& ", ReferralSourceText" _
& ", ReferralTypeID" _
& ", ReferralSources.ReferralSource" _
& ", ReferralType" _
& ", vClients.DataEntryDate" _
& ", vClients.DataEntryDays" _
& ", ReferralStaffID" _
& ", ReferralStaffName" _
& ", DataEntryStaffID" _
& ", Staff_1.FirstName + ' ' + Staff_1.LastName AS DataEntryStaffName" _
& ", vClients.Intake1stContactStaffID" _
& ", Staff.FirstName + ' ' + Staff.LastName AS Intake1stContactStaffName" _
& ", vClients.Intake1stContactAssignedDate" _
& ", vClients.Intake1stContactCompletedDate" _
& ",vClients. Intake1stScheduledStaffID" _
& ", Staff_2.FirstName + ' ' + Staff_2.LastName AS Intake1stScheduledStaffName" _
& ", vClients.Intake1stScheduledAssignedDate" _
& ", vClients.Intake1stScheduledCompletedDate" _
& ", vClients.IntakeAssessorStaffID" _
& ", Staff_3.FirstName + ' ' + Staff_3.LastName AS IntakeAssessorStaffName" _
& ", vClients.IntakeAssessorAssignedDate" _
& ", vClients.IntakeAssessorCompletedDate" _
& ", vClients.IntakeReviewerStaffID" _
& ", Staff_4.FirstName + ' ' + Staff_4.LastName AS IntakeReviewerStaffName" _
& ", vClients.IntakeReviewerAssignedDate" _
& ", vClients.IntakeReviewerCompletedDate" _
& ", vClients.IntakeServicesStaffID" _
& ", Staff_5.FirstName + ' ' + Staff_5.LastName AS IntakeServicesStaffName" _
& ", vClients.IntakeServicesAssignedDate" _
& ", vClients.IntakeServicesCompletedDate" _
& ", vClients.Intake1stContactAssignedDays" _
& ", vClients.Intake1stContactCompletedDays" _
& ", vClients.Intake1stScheduledAssignedDays" _
& ", vClients.Intake1stScheduledCompletedDays" _
& ", vClients.IntakeAssessorAssignedDays" _
& ", vClients.IntakeAssessorCompletedDays" _
& ", vClients.IntakeReviewerAssignedDays" _
& ", vClients.IntakeReviewerCompletedDays" _
& ", vClients.IntakeServicesAssignedDays" _
& ", IntakeServicesCompletedDays" _
& ", Staff_6.FirstName + ' ' + Staff_6.LastName AS Intake1stSessionStaffName" _
& ", vClients.Intake1stSessionDate" _
& ", vClients.Intake1stSessionDays" _
& ", vClientServices.PurposeCodeID" _
& ", vClientServices.PurposeType" _
& ", vClientServices.PurposeCode" _
& ", vClientServices.PurposeDescription" _
& ", vClients.Status" _
& " FROM vClients" _
& " LEFT OUTER JOIN dbo.Staff ON vClients.Intake1stContactStaffID = Staff.StaffID " _
& " LEFT OUTER JOIN dbo.vClientServices ON vClientServices.ClientID = vClients.ClientID " _
& " LEFT OUTER JOIN dbo.ReferralSources ON vClients.ReferralSourceID = ReferralSources.ReferralSourceID" _
& " LEFT OUTER JOIN dbo.Staff AS Staff_1 ON Staff_1.StaffID = vClients.DataEntryStaffID " _
& " LEFT OUTER JOIN dbo.Staff AS Staff_2 ON Staff_2.StaffID = vClients.Intake1stScheduledStaffID" _
& " LEFT OUTER JOIN dbo.Staff AS Staff_3 ON Staff_3.StaffID = vClients.IntakeAssessorStaffID " _
& " LEFT OUTER JOIN dbo.Staff AS Staff_4 ON Staff_4.StaffID = vClients.IntakeReviewerStaffID " _
& " LEFT OUTER JOIN dbo.Staff AS Staff_5 ON Staff_5.StaffID = vClients.IntakeServicesStaffID " _
& " LEFT OUTER JOIN dbo.Staff AS Staff_6 ON Staff_6.StaffID = vClients.Intake1stSessionStaffID " _
& rsClients__sqlFrom _
& " WHERE " & rsClients__sqlFilter _
& " ORDER BY " & rsClients__sqlSortBy & ""
rsClients.CursorType = 0
rsClients.CursorLocation = 2
rsClients.LockType = 1
rsClients.Open()
rsClients_numRows = 0
%>
<% If Not rsClients.EOF And Not rsClients.BOF Then %>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsClients.EOF))
%>
<tr class="gridItem">
<td align="center" nowrap="nowrap"><img src='/images/details16x16.gif' border='0' title='Client Details' /></td>
<td nowrap="nowrap"><%=rsClients.Fields.Item("FirstName").Value & " " & rsClients.Fields.Item("LastName").Value%></td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("Status").Value)%></td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("OfficeName").Value)%></td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("ClientTeamName").Value)%></td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("PurposeType").Value & " - " & rsClients.Fields.Item("PurposeDescription").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("EnrolledDate").Value)%></td>
<td><%=(rsClients.Fields.Item("ReferralType").Value)%></td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("ReferralSource").Value)%></td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("ReferralSourceText").Value)%></td>
<td><%=(rsClients.Fields.Item("ReferralStaffName").Value)%></td>
<td align="center" bgcolor="#CCCCCC"> </td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("DataEntryStaffName").Value)%></td>
<td><% If Not IsNull(rsClients.Fields.Item("DataEntryDate").Value) Then Response.Write(FormatDateTime(rsClients.Fields.Item("DataEntryDate").Value,vbShortDate)) End If %></td>
<td align="center"><%=(rsClients.Fields.Item("DataEntryDays").Value)%></td>
<td align="center" bgcolor="#CCCCCC"> </td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("Intake1stContactStaffName").Value)%></td>
<td><%=(rsClients.Fields.Item("Intake1stContactAssignedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("Intake1stContactAssignedDays").Value)%></td>
<td><%=(rsClients.Fields.Item("Intake1stContactCompletedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("Intake1stContactCompletedDays").Value)%></td>
<td align="center" bgcolor="#CCCCCC"> </td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("Intake1stScheduledStaffName").Value)%></td>
<td><%=(rsClients.Fields.Item("Intake1stScheduledAssignedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("Intake1stScheduledAssignedDays").Value)%></td>
<td><%=(rsClients.Fields.Item("Intake1stScheduledCompletedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("Intake1stScheduledCompletedDays").Value)%></td>
<td align="center" bgcolor="#CCCCCC"> </td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("IntakeAssessorStaffName").Value)%></td>
<td><%=(rsClients.Fields.Item("IntakeAssessorAssignedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("IntakeAssessorAssignedDays").Value)%></td>
<td><%=(rsClients.Fields.Item("IntakeAssessorCompletedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("IntakeAssessorCompletedDays").Value)%></td>
<td align="center" bgcolor="#CCCCCC"> </td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("IntakeReviewerStaffName").Value)%></td>
<td><%=(rsClients.Fields.Item("IntakeReviewerAssignedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("IntakeReviewerAssignedDays").Value)%></td>
<td><%=(rsClients.Fields.Item("IntakeReviewerCompletedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("IntakeReviewerCompletedDays").Value)%></td>
<td align="center" bgcolor="#CCCCCC"> </td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("IntakeServicesStaffName").Value)%></td>
<td><%=(rsClients.Fields.Item("IntakeServicesAssignedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("IntakeServicesAssignedDays").Value)%></td>
<td><%=(rsClients.Fields.Item("IntakeServicesCompletedDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("IntakeServicesCompletedDays").Value)%></td>
<td align="center" bgcolor="#CCCCCC"> </td>
<td nowrap="nowrap"><%=(rsClients.Fields.Item("Intake1stSessionStaffName").Value)%></td>
<td><%=(rsClients.Fields.Item("Intake1stSessionDate").Value)%></td>
<td align="center"><%=(rsClients.Fields.Item("Intake1stSessionDays").Value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsClients.MoveNext()
Wend
%>
You'll need to set a hold variable(s) for the column(s) you want to hinge on. Here would be some pseudo code that should get you down the right path:
strClientIdHold = ""
While NumRows <> 0 And Not EOF
If strClientIdHold <> rs("ClientId") Then
<td>rs("ClientId")</td>
<td>second column</td>
<td>third column</td>
<td>rs("Services")</td>
<td>fifth column</td>
<td>...</td>
strClientId = rs("ClientId")
Else
<td colspan="3"></td>
<td>rs("Services")</td>
<td colspan="8"></td>
End If
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsClients.MoveNext()
Wend
If you wanted you could do other checks too to see if other columns change... i.e. Can one client Id have more than one office or team that you'll want to pivot on and show that column too? You would then just have another hold variable for that as well.
I hope this helps.
Here is the HTML code for "CheckBoxListFor" which I copied from "http://www.codeproject.com/Articles/292050/CheckBoxList-For-a-missing-MVC-extension" Could you please help me out in converting this C# code into VB.Net?
#Html.CheckBoxListFor(model => model.PostedCities.CityIDs,
model => model.AvailableCities,
entity => entity.Id,
entity => entity.Name,
model => model.SelectedCities)
#Html.CheckBoxListFor(Function(model) model.PostedCities.CityIDs, _
Function(model) model.AvailableCities, _
Function(entity) entity.Id, _
Function(entity) entity.Name, _
Function(model) model.SelectedCities)
#Html.CheckBoxListFor(Function(model) model.PostedCities.CityIDs, _
Function(model) model.AvailableCities, _
Function(entity) entity.Id, _
Function(entity) entity.Name, _
Function(entity) If(Model.SelectedCities Is Nothing, False, Model.SelectedCities.Contains(entity.Id)),
htmlListInfo, Function(htmlAttribute) New With {.class = "chkBoxList"})