We want to give option to author to create multi steps tabs or wizard. This number of steps/tabs should be configurable in Form Start component in Edit button. Once author selects the number of steps/tabs then steps/tabs will be created automatically and then author can drag and drop other components like "File Upload", etc.. Please refer to the attached screenshot.
Kindly let me know how to proceed on this.
You can try to leverage the OOTB tabctrl component provided in geometrixx-outdoors along with the OOTB form component. The only customization needed would be changing the form end component to accomodate prev and next buttons, and then adding a bit of javascript to navigate the tabs on click of those buttons.
Steps to create this.
Drag and drop the default form component on page.
Inside the form drag and drop the tab control component.
Configure the number of tabs required and the contents within each tab in the tab control component.
Modify the form end component to accomodate the previous and next buttons.
Attach handlers for the previous and next buttons using the following JS(currently consists only of the basic functionality. Can be modified according to your requirements).
JS:
jQuery(function ($) {
$(document).on('click', '.prev', function(){ // 'prev' is class of previous button
var tabctrl = $(this).closest('form').find('.tabctrl');
var currentItemHeader = $(tabctrl).find(".tabctrl-header li.active");
$(currentItemHeader).prev().find('a').click();
});
$(document).on('click', '.next', function(){ // 'next' is class of next button
var tabctrl = $(this).closest('form').find('.tabctrl');
var currentItemHeader = $(tabctrl).find(".tabctrl-header li.active");
$(currentItemHeader).next().find('a').click();
});
});
NOTE: Try to include the appropriate clientlibs in geometrixx site before testing this, else tabctrl wouldn't work properly. Or else, you can check this dierctly in geometrixx-outdoors site.
Related
We're using one of the new responsive themes of PrimeFaces 8 (Mirage if that matters) I've implemented a dynamic menu to create the menu of my page. Depending on several parameters, the landing page can be different. Example:
Suppose there's a communications environment in which the menu items are
Documents (opens by default)
E-mail
Pictures
When arriving in the communications environment, the application checks whether there are new e-mails. If so, the user won't arrive on the "Documents" page but on the "E-mails" page.
The theme uses cookies to restore the menu state based on what the user has chosen previously. So suppose last time (s)he has chosen "Pictures", the result now is that the menu item "Pictures" is marked as active-menuitem but the displayed page is "E-mail".
I was already able to clear the cookies so that no menu item is active, but now I'm trying to activate the correct menu item. I got most successful by calling
PF('sidebarMenu').activate($('.custom-active-menuitem').closest('li'));
PF('sidebarMenu').activate($('.custom-active-menuitem').closest('ul').closest('li'));
but since the page is rebuild using ajax, this only works once 🤨. Using the build-in .active-menuitem doesn't work so that's why I introduced .custom-active-menuitem that I set in Java code:
DefaultMenuItem.builder()
.value("E-mail")
.icon("fa fa-letter")
.command("#{communicationBean.openEmailPage()}")
.styleClass("custom-active-menuitem") // or something else to mark this item active
.process("#this")
.update(":page");
So now I'm puzzled. Can someone please get me in the correct direction? How can I make the theme show the menu item I choose as active one?
binding adf control value to a bean property and run the jsf or jspx file on browser , then value can not be displayed
Here is a vidoe to explain the problem .. would you please have a key
for this . can not execute a lot of work because of this
https://www.facebook.com/mohamed.morsy.71697/videos/1449889981768665/
You will need to wrap the output text inside a group component ( maybe a panel group layout) and set it's partial trigger property with the button Id. This way the panel will listen button actions and is how the text will be updated when you click it.
I have a jface Wizard, I have a link on the bottom of the wizard and when I click the link the wizard should start a fresh from the start and all the previous selections must go ,It should work as if i'm opening a new wizard again with no selections remaining from current selections.
I've tried opening the first page on the widget selection but it doesn't seem to work, I'm unable to hit the next button
In a WizardPage you could do something like:
IWizard wizard = getWizard();
IWizardPage page = wizard.getPage("page name");
IWizardContainer container = wizard.getContainer();
container.showPage(page);
"page name" is the name of the wizard page you specified in its Constructor.
This will show the particular page, you will need to clear the contents in the setVisible method.
I'm currently trying to implement an "import wizard" for an application using JFace Wizard.
Basically I have to add the next page "just in time" based upon the input from the user, as each "step" within the wizard is depends upon the previous ones.
So, in the constructor of WizardImport I would add the first page, using:
addPage(new WizardImportSourcePage(data));
Within this page (WizardImportSourcePage) I would then like to add the next page, depending upon the chosen source, e.g.:
btnCsv.addSelectionListener(new SelectionAdapter() {
#Override
public void widgetSelected(SelectionEvent arg0) {
data.getWizard().addPage(new WizardImportSourcePage(data));
setPageComplete(true);
}
});
As you can see all of this happens in the appropriate Listener. Unfortunately this doesn't work. The Wizard is missing the "Next" button, but only shows the "Finish" button, as it doesn't know anything about the next page until the button is actually being pressed. I've already tried to invoke updateButtons(), but it didn't change anything.
So, any suggestions how to make it work? What would be the right way to build the wizard pages dynamically? Most tutorials seem to assume that the pages are created in the beginning and only the ordering is changed using getNextPage().
In your code extending Wizard you can override
public IWizardPage getNextPage(IWizardPage page)
which lets you decide which page to return next given the current wizard page (there is also a getPreviousPage.
Using Javascript how to disable a link after clicking it once.
The scenario is that:
I have a left navigation pane, having links to distinct JSP's which get displayed in .What I want to accomplish is that after I click a link it should open in the center and the hyperlink should be disabled in the left pane.
I am able to navigate through the left navigation pane. But not able to disable the link of the page which shows up in center.
Any help would be greatly appreciated.
create an hidden span next to the link.
your link
<span style="display:none">your alter link text</span>
then on the script do
$("#myLink").click(function(){ $(this).hide().next().show(); });
You need to declare a hidden element and give it a flag value that keeps if the link is disabled or not. Now whenever you click on the link the hidden element will be read by the server and in the second load you can disable your link according to the value of the flag with a simple check in the jsp.
Something like the following should work:
<a onclick="
var el = this;
setTimeout(function(){el.onclick=function(){return false;}},1);
" ... >link</a>
You can do that way:
jQuery(document).ready( function() {
jQuery("a#yourLinkId").click( function(event) {
jQuery(this).attr('disabled', '');
// You can optionally prevent default processing and implements your own:
event.preventDefault();
});
});
$("#click").click(function(e){
...
e.preventDefault();
$(this).unbind('click');
});