xpages and dojo.query and get parent in view panel - view

I am building an application on xpages and I am using the code Code published in Open NTF XSnippets.
The code works when I have only one view panel, however when I have more than one, it shares the function variables. I thought about getting the id of the view panel in the code snippet below, to be able to conditionally treat the view panel. But I have not seen a function for the element xspCheckBoxViewColumn takes the id of the view panel.
dojo.query(".xspCheckBoxViewColumn").connect('onclick', function() {
if (id== id current view panel)
I accept other suggestions to address the problem.

Related

Pin a personal view in D365

How to I pin a personal view in D365. It is a child entity to the case entity (not in the left navigation menu).
It is not appearing on the recent items in the main page when I go Advanced find -> Saved views and run the view.
Recent items are appearing for the views and record from the main page which I could pin from.
This should work, add/replace this part in browser address bar - &pagetype=entitylist&etn=YOUR_ENTITY_NAME.
Make sure you’re changing the entity name, then this will land on that main grid page. From there you can change to personal view and pin it.
If you know the view guid - then try similar to this:
Url="/main.aspx?appid=e2bc1066-488f-eb11-b1ac-000d3a56ead9&pagetype=entitylist&etn=account&viewid=%7b<GUID value of view id>%7d"
Read more

Oracle APEX takes a value from a function and uses it to open a new page

I have a function that returns a value (e.g.27).
I am put this value to my page item (P2120_SYMPTOM_ID) and i want with this value to open with button another page (P2140).
I am going to button Link builder - target and i am using P2120_SYMPTOM_ID like this:
but unfortunatendly this value doesn't pass to my new page criteria.
How can i use this value?
If you're just navigating to another page (as opposed to opening a modal window) then use action "Submit" on your button and create a branch to the new page. That is how navigation is supposed to be done. The link builder links are generated when the page is rendered and do not pick up session values.
This is a common question, and relates to the fact the link uses values during page render, not what may have happened during interaction with the page
A common solution is presented in the Oracle forums here
https://community.oracle.com/tech/developers/discussion/3725149/pass-client-side-state-to-modal-dialog
Alternatively, there is a free & supported FOEX Redirect plugin that also solves this problem
https://fos.world/ords/f?p=10000:1080

Mvc Telerik Window does not post values of partial view

Good day,
I have the following scenario:
I have a Razor view with a "#using(Html.BeginForm(....))" statement at the top of the page. Inside the using statement I have a few textboxes, whose values get populated by the user, and a button.
At the click of that button, a telerik modal window (displaying a partial view of the same model as the initial view) pops up so that the user can populate some more fields. Inside the modal window there is a button that must submit the entire form, which it does, however after I debug my action, I notice that the model is missing the values which were entered in the popup (partial view).
My code for the telerik window resides inside the using statement and looks as follows:
Html.Telerik().Window()
.Name("AddEditScaleWindow")
.Title("Save Scale")
.Content(#<text>#Html.Partial("AddUpdateFeeScale")</text>)
.Buttons(e => e.Close())
.Height(250)
.Width(350)
.Modal(true)
.Draggable(true)
.Visible(false)
.Render();
I tried different methods of getting the window to post its values but to no avail.
If I view source, I can see that the window (partial view) is inside the form. If I do a network trace I can see that the values being posted are all values that were entered on the view, but none from the partial view.
Does anyone have any idea why the values inside the window don't get posted?
Thank you in advance.
Matei
You might need to check this because I am guessing, but many dialog renderers create their dom elements below document and outside of your Form element. If that is the case with Telerik, you will need to do a bit of work on the client to copy the values from the dialog back to your other form.

how to use razor as user control

Example Scenario:
Let's say I need to create a user control which displays a list of products for specified category (CategoryID passed as input to Index GET controller).
Also, it has a "Add" button below list which calls Category Details (GET) controller (passing categoryID to controller) which displays a form with Text box and button to add new category.
Once user enters category Details and press submit, Details (POST) controller is called which saves data and should redirect user back to page from where it was called.
This user control (razor file) can be used multiple times on same page.
Queries
1) What is best approach to integrate such a control in page views such that form in every user control is self contained and doesn't conflicts with other instances of same user control in same page?
2) I tried Html.RenderAction("Index","Category",new {categoryName = "toys"})
This works well in displaying category and clicking on Add button does takes user to "Add a new category" page. Problem is, what code should I write such that I can take user back to the same view page, where the user control was embedded (even better if I can scroll window to the position where control was placed)?
thanks!
When Data is posted in a partial view to the corresponding Action , It has no context of the main view/action. So we can post data to the main action so that modelstate is preserved and can be validated.
But if you want to post data to the partial view/action, we can redirect to main view/action post product is added.(But if some invalid data is entered, we cannot display any validation error)
[HttpPost]
public PartialViewResult AddProduct(string productId,string returnUrl)
{
//Add product
return Redirect(returnUrl);
}
What you are looking for is a partial view, namely an editor template.
In your Views folder, create a Shared folder and inside that create an EditorTemplates folder. From there create a strongly typed partial view named the same as the part of the model.
Then on your main view call EditorFor.

SL3 dataform validation indicators don't show in tab pages

I have a Prism/SL3 application with a tab control and each page of the tab control is a "Region" that has its own view and viewModel. when I want to validate the main page, I call dataForm.ValidateItem(), then I go to all the child views and do the same. the problem is, only the pages which user has clicked on them (on the tab page), get instantiated and the pages that are never shown, don't have their view instantiated, thus I can't validate them.
any help?
I created a psuedo work around for this. It's very hacky, but it does work. My example involved walking the visual tree (up and down) to find respective controls that are invalid and then "expanding" the selected item. I have used an accordian in my example, but have also tested this with tab:
http://thoughtjelly.wordpress.com/2009/09/24/walking-the-xaml-visualtree-to-find-a-parent-of-type-t/
HTH,
Mark
EDIT: Link updated.

Resources