How to fire validation on Save button in Silverlight? - silverlight

How do I fire validation on a Save button in Silverlight?
I am not using any data forms. I am using a RIA domain service for other operations but I want to validate everything on a save button before saving the data.
How can I do it?

Here is something I've used to validate multiple things within a page before a save commits changes. You could also follow Zoltan's blog for a more complete structure. He's also presented at Mix '11 about this.

Related

When creating a microsoft forms trigger in a logic app I can only see forms I created

Sorry in advance if this question seems naïve.
I'm currently trying to configure a logic app that triggers based on a form being submitted via Microsoft Forms.
This form is located in one of my organizations groups (which my user has access to). When attempting to create the trigger the only forms I can see in the dropdown are ones that I created myself and are under My Forms in microsoft forms.
I'm unsure of the steps to make the form visible / available so I can create a trigger for it. Any help would be appreciated. FYI the logic app is going to be used to create a work item based on the form submission.
Ok I found the answer, not sure why I didn't catch this the first time I read this.

How do I submit two forms from a single page in adf?

I am using ADF to build the front end and Toplink for DB transactions. I wanted to show 2 create forms on a single jspx page. Both the forms are from two different objects i.e it doesn't have a parent child relationship. How can I submit the values of both the forms to the backend when the user clicks on the single submit button using ADF?
Any tutorials or examples would be appreciated.
Thanks
ADF doesn’t work the way you think it does: each page is a single form.
You may, however use two distinct af:panelFormLayout components that look as two different forms from UI perspective. But an af:button button will submit the the entire page as a single form.
Check some examples of ADF pages. You will see that the structure goes like: <af:document><af:view><af:form> ... any other components .
You need to overwrite the button method to call the two methods you want it to execute.
Here are the basics of how to overwrite a declarative button:
https://blogs.oracle.com/shay/doing-two-declarative-operations-with-one-button

Silverlight Refresh data

I don't know what is the best way to force a browser refresh when using silverlight.
The scenario is like this:
We have a silverlight application hosted on IIS
Two users opens the same page and that page contains a grid with some records.
Only one of the users modify one record and save the data in the database
How can the other user see that the data has been modified unless he refreshes the page manually?
Should I implement some automatic refresh?
Thanks in advance
I would think long and hard about the requirements here before you open up a can of worms. Is the grid editable? With the automatic refresh idea what happens to the user who is in the middle of an edit? Think about alternatives. Could you possilbly check whether the data has changed at the point of saving data and then provide an appropriate message to the user? If you want the data to automatically refresh you are going to get into looking at server to client notifications e.g WCF duplex calls or constant polling and refreshing of the underlying bound observablecollection

Multiple calls to data service from SL3?

I have an SL3 that makes asynchronous calls to a data service. Basically, there is a treeview that is bound to a collection of objects. The idea is that as a user selects a specific treeviewitem, a call is made to the data service, with a parameter specific to the selected treeviewitem being passed to the corresponding web method in the data service. The data service returns data back to the SL3 client, and the client presents the data to the user.
This works well. The problem is that when users start to navigate through the treeview using the arrow keys on their keyboard, they could press the down arrow key, for example, 10 times, and 10 calls will be made to the data service, and then each of the 10 items will be displayed to the user momentarily, until finishing with the data for the most recently selected treeview item.
So - onto the question. How can I put in some form of delay, to allow someone to navigate quickly through a treeview, then, once then stop at a certain treeviewitem, a call is made to the data service?
Thanks for any suggestions.
Chris
use Rx for silverlight
As suggested by funwithcoding, you could try using the Reactive Extensions for .Net (Rx), I've not used it myself but from what I hear it would do what you're after.
However if you don't feel like you want to / have time to learn Rx etc. maybe look at using a DispatcherTimer to create a slight delay in you Treeview selected event, before you call the service to retrieve the data.

How can I disable the Publish button in EPiServer's content editor?

I have an EPiServer project which is using the sequential workflow to validate content changes. This works fine, however we have a slight issue where content reviewers are just clicking Publish when they are happy with an editor's work. What they should be doing is using the workflow task window and indicating their approval through that.
To enforce this behaviour I would like to disable the Publish button in the content editor under certain circumstances (i.e. when there is an outstanding workflow task linked to the current page).
Does anyone have any ideas how I can do this, or even an alternative solution to the problem altogether?
Actually, I think you may want to revisit your workflow logic.
If a user with publishing rights publishes a page: that should be considered an approval. You could easily hook up to the Published event to see if the page is part of a currently running workflow.

Resources