Using a Providers linkHint and tooltipHint

Hi,

Could you help me understand using both the linkHint and tootipHint when adding Rows to my Provider?

I want to be able to recreate the functionality of the Activites Archive, where you can complete the activity by clicking on the checkbox.

I've tried to fathem it out and came up with the following, which is not working for me:

row.ColumnData.Add("Completed", new ArchiveColumnData("1","","nav=toggleActivityCompleted&document_id=" + row.RowKey));

My provider needs to work in both Windows and Web.

Cheers

Rich

RE: Using a Providers linkHint and tooltipHint

At the top of SoCrm Archives.config you will find some information on Win specific configuration issues.

In Win, the archive control is not data-driven on a cell level.
In Web one often sees a hypertext underline when hovering over a cell, yet nothing happens. It has a smarter control and let's face it, netserver was designed for Web, not Win.

Add the following attribute to your completed column:  displaytypeoverride="activecheckbox"

You will also need:
    <live document="true" ></live>
to get live updates on document entities.


All lower case!

activecheckbox turns the column type into a checkbox with mouse-over feedback so a mouseclick will be handled. This is probably where Win & Web differ greatly. Win must know beforehand what to expect.
Now the cell click will look into its linkHint and attempt to find an action to execute.
The format for Toggle Completed is for example: nav=toggleActivityCompleted&document_id=19.
(Again, win is case sensitive in all matters concerning static text, known at compile time)

The format for a tooltip hint is e.g.: {document_id=19}
Tooltips should work on all cells in Win.

ToggleCompleted is subject to Sentry. If sentry says no, nothing will happen. This is silent. The checkbox does not give you any feedback for this!

Conrad

Af: Conrad Weyns 8. apr 2017

RE: Using a Providers linkHint and tooltipHint

Thankyou Conrad, I have this working in Windows now!

Do you have any pointers on getting this working in Web?

Af: Rich Hacker 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

None whatsoever!
Let's see if we can get Tony's attention... Tony?
Conrad

Af: Conrad Weyns 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Let's start at the beginning. What's the column definition look like in the archive provider, or extenderbase ?

A typical checkbox column ArchiveColumnInfo declaration looks like this:

protected ArchiveColumnInfo _colCompleted = new ArchiveColumnInfo( ArchiveActivityRow.ColumnCompleted, RC.SR_ACTIVITYARCHIVE_ISDONE, RC.SR_ACTIVITYARCHIVE_ISDONE_TOOLTIP, Constants.DisplayTypes.Checkbox,
AllowOrderBy, Visible, ColumnHelper.DefaultCheckboxWidth, Constants.RestrictionTypes.Bool );

Is this what yours look like?

Af: Tony Yates 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Hi Tony,

My column in my Provider is defined as below:

private readonly ArchiveColumnInfo _colCompleted = new ArchiveColumnInfo("Completed", "Completed", "Completed", Constants.DisplayTypes.Checkbox, true, true, ColumnHelper.DefaultCheckboxWidth);

And when adding the row:

row.ColumnData.Add("Completed", new ArchiveColumnData("1", "{document_id=" + reader.GetValue(documentInfo.DocumentId).ToString() + "}", "nav=toggleActivityCompleted&document_id=" + row.RowKey));

Cheers

Rich

Af: Rich Hacker 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Ok, that looks OK. 

As for adding the column, I'm going to assume you that, since you are working towards the DocumentTableInfo, you also has an instance of the AppointmentTableInfo, and therefore populate the column as:

AppointmentStatus status = (AppointmentStatus)reader.GetInt16(_ourAppointmentTable.Status);

if (WantColumnForOutput(_colCompleted))
{
int documentId = reader.GetInt32(_ourAppointmentTable.DocumentId);

FieldRight completedRight = reader.GetFieldProperty(_ourAppointmentTable.Status).FieldRight;

row.AddOverlappingIntColumn(_colCompleted.Name, (status == AppointmentStatus.Completed ? 1 : 0),
"{document_id=" + documentId + "&showdone=true}",
completedRight.CanDo( EFieldRight.Write ) ? "nav=toggleActivityCompleted&document_id=" + documentId : string.Empty,
_ourAppointmentTable.Status);
}

Ok?

Af: Tony Yates 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Tony,

Yes, I was doing it slightly different but essentially the same.

The problem I have is that it is working in Windows but crashing in web. The provider displayes correctly the rows which are checked as per the appointment status.

The problem occurs when I click the checkbox, an animated blue circular wait cursor appears and then it just sits there and the IIS Worker process eats memory until I restart IIS.

Interestingly, the row that I checked or unchecked has changed when I go back into SO.

I have checked SO Error Log, the Browser console and the event Log but cannot see anything obvious.

Cheers

Rich

 

Af: Rich Hacker 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Ok, how about sharing a picture of what markup you see for the checkbox?

Here is one I have for a document in the project activities archive:

<div class="ArchiveContentContainer" width="" style="height:;text-align:left;">
				<input type="checkbox" checked="checked" id="_ctl2_row_9060331_row_9060331_Checkbox_tabFocus" class="SoTriStateCheckboxTabFocus" onclick="javascript:ToggleActivity(event,ProjectActivityArchiveArchiveControl,'email_id=0&amp;nav=document&amp;document_id=9060331');" onmousemove="javascript:ToolTipManager.Show(event,&quot;19b4b0fe8d6e427eb4695969fbef0afc&quot;,&quot;{document_id=9060331&amp;showdone=true}&quot;,true);" onmouseout="javascript:ToolTipManager.Hide();" onchange="javascript:ToggleTwoStateCheckbox(document.getElementById('_ctl2_row_9060331_row_9060331_Checkbox_tabFocus'),'row_9060331_State');" onmouseup="javascript:ToggleTwoStateCheckbox(document.getElementById('_ctl2_row_9060331_row_9060331_Checkbox_tabFocus'),'row_9060331_State');"><img src="/SuperOffice/Images/System/web/shadowblank.png" id="_ctl2_row_9060331_row_9060331_Checkbox_tabFocus_img" onmouseup="javascript:ToggleTwoStateCheckbox(document.getElementById('_ctl2_row_9060331_row_9060331_Checkbox_tabFocus'),'row_9060331_State');" onclick="javascript:ToggleActivity(event,ProjectActivityArchiveArchiveControl,'email_id=0&amp;nav=document&amp;document_id=9060331');" style="position:relative;top:-2px;left:-13px;"><span class="SoTriStateCheckboxCaption" onmouseup="javascript:ToggleTwoStateCheckbox(document.getElementById('_ctl2_row_9060331_row_9060331_Checkbox_tabFocus'),'row_9060331_State');"></span>
			</div>

As for log files, in the web site config file (or on the web services web server is in remote mode), set enablescaffolding to true (verbose logging) and check again. There has to be some indications of a problem somewhere. 

Best regards.

Af: Tony Yates 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Tony, many thanks I will try the logging:

Here is the markup for one of the checkbox:

type="checkbox"

checked="checked"

id="_ctl5_row_225272_row_225272_Checkbox_tabFocus"

class="SoTriStateCheckboxTabFocus"

onclick="javascript:ToggleActivity(event,eDocumentFilterActivityArchive2ArchiveControl,'nav=document&amp;document_id=225272');"

onmousemove="javascript:ToolTipManager.Show(event,&quot;1a66eb679baf4de78e4f6a5152125319&quot;,&quot;{document_id=225272}&quot;,true);"

onmouseout="javascript:ToolTipManager.Hide();"

onchange="javascript:ToggleTwoStateCheckbox(document.getElementById('_ctl5_row_225272_row_225272_Checkbox_tabFocus'),'row_225272_State');"

onmouseup="javascript:ToggleTwoStateCheckbox(document.getElementById('_ctl5_row_225272_row_225272_Checkbox_tabFocus'),'row_225272_State');">

Cheers

Rich

Af: Rich Hacker 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Hi Rich,

Has there been any customizations to the Javascript files, or any part of the application other than custom archiveproviders? 

Best regards

Af: Tony Yates 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Tony,

No, I'm solely working on Archive Providers, as you may have guessed given all my posts! I do appologise for bombarding the forum, but I'm rather new to SuperOffice!

Cheers

Rich

Af: Rich Hacker 11. apr 2017

RE: Using a Providers linkHint and tooltipHint

Hi Rich,

In the javascript handing of ToggleActivity, I can see that when it gets the nav parameter from the link hint, it does not do any encoding/decoding handing and the problem might be due to the &amp characters in your nav linkhint.

Does it work if you simply use: nav=document­&document_id=225272

Hope this helps!

Af: Tony Yates 12. apr 2017