Is there a way we can create user interactive content within amp stories? - amp-story

I am building an amp story where I need to take user input as choice. Let say there are 3 buttons Button 1, Button 2 and Button 3. If user clicks Button 1 content for choice 1 would be shown and similarly for other buttons.
I was trying to use AMP.setState for that. It works on a plain AMP page, but when amp story is added to the page, it doesn't work.
Here is the code for the above mentioned experiment
Please have a look and propose some suitable solution.
Thanks.

amp-story is not compatible with amp-bind.
Stories have an experimental feature under development called "branching" that allows user interactivity by splitting content state across different pages of the same story (see the work in progress documentation).
In your example, you would need to create separate pages of the story for the user to land on for if they've clicked Button 1, Button 2, or Button 3, respectively.

Related

Desiggning a nice looking user account dashboard with react-bootstrap

So I'm looking for advice. This is my first job, and I'm trying to make a dashboard. Basically, the design idea is to use a react-bootstrap card for a profile picture and some info, another card with basic clickable options, and when a user clicks on an option, another card is rendered to the right of it, containing more specific list items.
I have no clue how to do clickable ListGroup.Item, nor do I know how to make it render/remove additional page components.
Any help would be appreciated!
My main panel is a column of width 4, and I'll be using no more than 3 columns, so 12 more than 12 cells wide.

NVDA screen reader reads clickable word on text

Any idea why NVDA reads clickable word when tabbing through text in html example:
<h1 tabindex="1"> testing </h1>
NVDA will read clickable testing
In first place remember that tabindex are not a good practice in a11y, and also headers don't need a tabindex NVDA provides a header navigation with the H key. About the clickable I can say from my experience is a known issue for NVDA, if you check that in other SR (Voice over or Chromebox) should be read properly
Short answer:
the tabindex attribute implies functionality to some screenreaders.
Long answer:
Two primary ways that a screen reader user will navigate your webpage are by skipping through interactive elements or by headings. Interactive elements are things like links, buttons, form fields and any other piece of functionality that the user will initiate on your page. These are navigated by using the 'tab' key.
The other primary way they will navigate your page is by headings. In fact, a survey from webaim lists headings overwhelmingly as the primary method of navigating a page to find information (source). In your example, you have given the heading a tabindex which will give the impression that it has some functionality or interactivity to it. To my understanding, both JAWS and NVDA will read out 'clickable' on elements that have a tabindex, as they could easily (and typically would) have some javascript click handlers that are not evident from the screenreader.
Answer:
It's because of attribute tabindex which makes this element keyboard focusable. One can focus it by pressing TAB key on a keyboard.
Hint #1: Attribute tabindex with value above 0 should be generally avoided!
Don't use tabindex="1", tabindex="2" and so on. Only tabindex="0" or tabindex="-1" can be useful in some cases. Otherwise you can create a complete mess for a user experience.
Read more:
Google: Using a tabindex greater than 0 is considered an anti-pattern.
WebAIM (accessibility): This is almost always a bad idea.
MDN: Avoid using tabindex values greater than 0.
Hint #2: Generally no need to make focusable elements that a user cannot interact with.
As in specific case no sense to make a heading element keyboard focusable if a user cannot interact with it.
If you are concerned about screen reader users have no worries as they read non focusable content just fine. A quote from Accessibility Developer Guide: As opposed to keyboard only users, screen reader users usually do not use the Tab key to read a page! Read the "Screen readers browse and focus modes" to know the difference between navigation using Arrow keys and Tab key.
But... Exception to the rule exists
Exception to the rule exists and it's probably a good idea in cases where developers set tabindex="-1" to headings which they want the focus to be moved programmatically for the purpose of accessibility. Such cases are for example fresh content update with AJAX in single page applications. The focus would be moved to a heading for a user to get aware of the content update and to be able to start from there. Also it can be useful when currently focused content is about to get removed from the DOM (a.g. deleting currently focused table entry) or moving a focus to an error summary heading after a form submit trial etc.
In my case (VoiceOver on MacOS), it seems that H1 is announced as clickable only on Firefox. On Chrome, it's announced correctly.
This leads me to believe it's a Firefox bug.

DotNetNuke Nested Controls Redirection Method

Any DNN developers out there who have figured this out?
I have a user control (ascx) (DotNetNuke extension) with 4 user controls. There are buttons on the first view form to access the others.
When you access another control, you can access other controls from that control. I'm looking for the best way to redirect the user back to the previous control the user was on regardless of the 'level' of the control.
Here's an example.
1) First view form: People list
Buttons available:
2) User Addresses
3) User Downloads
4) User Videos
5) Another user related module
Let's say I choose 2) User Addresses
On that user control I have buttons to 3, 4 and 5
If I want to return to the first view control (1), I simply use DotNetNuke.Nvigation.NavigateURL and pass in the parameter of the user I was querying about. That works fine.
But now instead of going back to 1 I choose to go to 3) User Downloads
When the user hits the 'Return' button to go to the previous screen (not the browser back button; this is a button on my form) I want to go back to 2) User Addresses, not back to the first view control (1).
I've tried adding the first view control as another control in the same extension, and using EditURL to call it, but the screen shows up blank on redirect (except for the DNN menu etc).
How do I redirect a user to the previous control, not the first control of the module?
If this doesn't make sense, let me know and I'll try to explain it better.
Thanks.
You likely will want to pass a querystring parameter in the request to the various controls so that you can keep track of where they were, and how to get back.
Example:
Instead of just calling ctl=controlvalue try calling ctl=controlvalue&prevvalue=edit
THen you can wire up your Return code to use the querystring value of "prevvalue"
Chris
Check out my DNNHero.com video tutorials on Module Views, Settings & Navigation. I give code and instruction on different ways of doing module view navigation.
I decided to write a custom solution for this. It works really well, but it's a bit involved.
1) I wrote a SourceType enum to list the different forms in my application.
2) Any page can serve as the 'base page." On form load I read a property in settings for "base page url" and if it's not there yet, I write the base page's rawurl to the setting along with the enum value of which form (SourceType) it is.
3) Since sub-controls all use the same settings as the base page, whenever navigation occurs, I pass in the base page's enum value to the new form; in the new form I read the base page URL in the Page_Load of the new form and, if the current form's enum value is different from the enum value passed in (which it is), I use that base URL for the link 'back'.
4) If the user goes to another form from the second form, the process is repeated. But I pass both 'prevous' form enums to the third form so it shows two links to choose from to return to.
5) This can be repated as long as possible. One caveat: you have to remove the current form from the SourceType enum before you pass the SourceForms property back to a previous form; if you don't do this, the form you are coming from will also be listed as a 'go back to' form which you don't want.
Hope this helps someone having trouble figuring out a clean DNN redirection solution within multiple controls in a module.
If this isn't clear hit me up and I'll show some of my code.

Customizing Navigation Buttons' Bar in MS Access Form

I am creating a form in MS Access. My form appears to the user in form of a modal pop-up box. At the bottom of the form we get Navigation Buttons, New Entry (which I have disabled), Filter and Search Options.
I want to customize this Navigation Button Bar. For example, I do not want 'Record' word to appear at the left most position in this bar.
I have been searching ways to do the same. I am not sure if the same can be achieved, but still hopeful.
Thanks in anticipation.
Jay
You can disable Navigation Buttons in form properties, which means the bar does not appear and in Access 2007 and 2010, you can set the Navigation Caption, which means you can have something instead of "Record", but you cannot customize the bar itself.
If you must have custom navigation, disable the bar and add your own navigation options.
You can change the Record into something else, but not customize the other bits of the navigation bar as far as I know.
Will show as:
If you want to go further than that, you may be able to intercept windows messages and change the wording on the fly, but that would complex and certainly a lot of work for not much.
On the other hand you could simply not show the navigation bar and create your own navigation using buttons and a bit of VBA instead.

Visualforce Custom lookup visualforce page

I was wondering if there is a way to override the native functionality of the lookup field in Salesforce and replace it with a visualforce page. The reason I'm trying to override this button is because when the user does a look up, the look up returns everybody with that name. What we want to return is a list of all the contacts by account for the contact being searched.
Here's what I'm trying to achieve:
When the user clicks the lookup button my visualforce page will launch and allow the user to see the account and all the contacts of that account.
Is this even possible? What other ways would you suggest going about this?
Here's a screen shot of what I'm trying to change:
Thanks for all your help!
It sounds really like you just need to customise the columns on the lookup to make it better suited to your needs. If you go to Setup -> Customize -> Contacts -> Search Layouts, you'll see entries for Lookup Dialogs and Lookup Phone Dialogs, there you can edit the columns displayed in the lookup windows.
If you really need a custom solution:
You can't override the lookup page itself, but you could create a new visualforce page for your account, using <apex:detail> and other similar tags to make your life simpler. Then you could include a search section underneath, where a user can enter various search terms which you put into a dynamic SOQL query and then render the results for them to choose from.
yeah its possible by javascript as i did by visual force page that will show the records of related lists and upon selection id of that record passed to parent window by jscipt. and performed same functionality ..
As far as I know - NO.
As a workaround you can use JavaScript.
What we did in our situation? We implement everything in JavaScript. We created an inputText and right on the right of this inputText we placed image with this lookup icon. On image click we create ExtJS popup window (I think you can simply create VF page and show this page in popup window). After window was closed you fill in the inputText field.
There's no out-of-the-box override for this button, last I checked, so something custom would be required. If you're set on having a popup and do not want an inline solution, I'd recommend reviewing this tutorial to get familiar with some of the issues with popups in Visualforce.
But considering what you are looking to accomplish, you could also have your account and filtered list of all contacts associated with that account appear inline on your page when the user clicks a new, custom search button. Of course that page would itself be in Visualforce (or inline Visualforce in a standard page layout) - which you may or may not want to have to code and maintain.
The AJAX Toolkit might also be a good place to start if you want to go with a custom JavaScript button placed on a standard page layout.

Resources