Customize button clear in Orbeon - forms

Is it possible to customize 'clear' button in form runner? I want to keep some default values in form (after user clics on this button), and I want to 'clear' button leave those values and doesn't clear them.
Now I want to add refresh button or add refresh action to clear button. In my properties I have line:
<property
as="xs:string"
name="oxf.fr.detail.buttons.*.*"
value="refresh pdf save-draft review workflow-send"/>
But unfortunately in form runner I don't see refresh button

If you add 'fr:buttons' tag into your form, you're able to add your own buttons. This tag should be placed in '<fr:view>' just after the '</fr:body>'. If you have configured the property oxf.fr.detail.buttons.*.* to define the buttons that you want to show, it will override it. You have to explicitly place the buttons that you want to show, e.g. <fr:save-button/>.
I've created a quick example to show it. The following fr:buttons would show a custom clean button together with Orbeon's 'Save' and 'PDF' buttons:
<fr:buttons xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:xbl="http://www.w3.org/ns/xbl">
<fr:button>
<xf:label ref="'Clear'"/><!--You can change it to a localized path-->
<xf:action ev:event="DOMActivate">
<!--Clean fields, but keep values for lastname and phone fields-->
<xf:setvalue xxf:iterate="instance('fr-form-instance')/section-1/*[name()!='lastname' and name()!='phone']"/>
</xf:action>
</fr:button>
<fr:pdf-button/> <!--Orbeon PDF button-->
<fr:save-button/> <!--Orbeon save button-->
</fr:buttons>
You can see another example about custom buttons in the following link: http://wiki.orbeon.com/forms/how-to/fb-fr/form-builder-wizard

Related

primeng accordion header button

I have Angular 5 application and I am using PrimeNG components. I created the PrimeNG accordion with defined header where are the title and some action buttons, like this:
<p-accordion>
<p-accordionTab>
<p-header>
<span>Some card title</span>
<p-button title="Delete" (onClick)="deleteCard()"></p-button>
</p-header>
</p-accordionTab>
</p-accordion>
Issue is that when I click on the button inside accordion header, the particular accordionTab fire toggle open/close click event, which looks very weird. How I can separate these two clicks?
Thanks for advice.
I know this is an old post, but I'm posting for anyone that comes across this like I did.
In the click method of the button, add $event.stopPropagation(); followed by your own event, such as deleteCard() like in OPs post.
<p-accordion>
<p-accordionTab>
<p-header>
<span>Some card title</span>
<p-button title="Delete" (onClick)="$event.stopPropagation(); deleteCard()"></p-button>
</p-header>
</p-accordionTab>
</p-

Open Model on edit in list view

In backpack list view when I click in edit button then I get redirected to another page instead of I want model window where I edit and save the record. Also want for Add New.
How can I do that?
The system really isn't designed for that behaviour to be changed, but if you REALLY need it i guess you can create new files in your resources/views/vendor/backpack/crud. This will make Backpack use those views instead of the ones in the package. You can copy views from the package and change them to fit your need:
- list.blade.php would include edit.blade.php in a bootrap modal;
- buttons/edit.blade.php should trigger the right modal on click;
- edit.blade.php should submit the form with ajax instead and catch the errors, to show them inside the modal;
The same process needs to be repeated for the create.blade.php file.
It won't be easy...

need help to create custom keypad INSIDE a dialogFragment. do not want system keyboard to pop out

i have created an XML and dialog fragment consist of Edittext and numeric buttons (keypad). i had searched alot but only found creating custom softkey solutions. my objective is very simple. i already had all the buttons created in XML. what should i add to so that when "1" is pressed, edittext will display "1", "2" is pressed display "12", 3 will display "123"... etc. some source code for me would be useful,
I know how to display "1" in edit text when i pressed "1", which method to use to display 2 next to 1 when i press 2
In XML insert onClick commands for each button. In your activity, create a method for each onClick defined, this way:
In XML:
<Button ...
android:onClick="one" />
In the activity you should have a method like this one:
public void one(View v) {
yourEditText.setText(yourEditText.getText().toString() + "1");
}
It should work. You can always use getText() to get the content and setText(newText) to set the content. Please note that if you click on the EditText this way you will still get the system keyboard pop up, if you want to only show the value use a TextView instead.
Hope it helps.

rails 3 - Add a Button that won't submit a form

I am trying to add a few "next" and "back" buttons to a form. The Idea is to divide the filling-out process into several steps and with these buttons, the div of the current step gets hidden and the next resp. previous step is displayed.
My Problem is that when I add buttons in the following way...
<button class="proceed_button" id="loan_information">Proceed</button>
<button class="cancel_button" id="loan_information">Cancel</button>
... they submit the form.
Is every button inside a form-tag considered to be a submit-button?
If so, how can I change this behavior?
If not, why are they doing it then?
Ok, the solution is that the button needs a type.
<button type="button" class="proceed_button" id="loan_information">Proceed</button>
<button type="button" class="cancel_button" id="loan_information">Cancel</button>
Like this, it won't submit the form anymore.
According to http://w3schools.com/html5/att_button_type.asp the default type is depending on the browser, so you should always specify the type.
I'm not sure that you want a button, maybe you want it to look like a button. Either way, refer to this post: rails 3: display link as button?
Once you have your button, you'll need to update your javascript to prevent anything from happening when it's clicked (assuming you have jquery). It's still nice to provide a real fallback for those dinosaurs without js, so assuming your proceed button submits for users without js, for those with js you'd do something like:
$('#proceed_button').click(function(e) { e.preventDefault(); // Show and hide your divs here });
Also note that in your posted code you should not have two buttons with the same id, your ids and classes look swapped.

ExtJS: disable checkbox toggle on label click

I am designing a checkbox for a for and I absolutely cannot have the checkbox to toggle when the user clicks on its label, as this label contains a link to open a small infobox where the user gets to know what he or she is accepting by selecting the checkbox.
How can I disable checkbox toggle when clicking on its label?
The code looks simply like this (this element is inside a FormPanel items list:)
{
xtype:'checkbox',
id: 'privacyCheck',
fieldLabel: 'I have read, understood and accepted the privacy policy of ABCDE'
}
Instead of using the boxLabel property or field label on the checkbox, create a separate label object next to the checkbox. This should make it easier to manipulate your handler for the label. Otherwise, you will need to dig through the appropriate DOM element for the boxLabel (not pretty) to get at it.
I know, this topic is rather old, but I found it, searching for a solution to the exact same problem. So I'd like to share.
I needed to modify the browsers behaviour to mimick the behaviour of a legacy site, while making said site "accessible". (The for-attribute of the label tag is needed and a label without a for-attribute can not be used.)
I don't know about ExtJS, but since the legacy site uses jQuery in the frontend, I solved the problem this way:
//[...]
$(document).ready(function () {
$('.donotToogleCheckbox').click(function (event) {
event.preventDefault();
// do other stuff like displaying a dialog or something
})
});
//[...]
<label class='donotToogleCheckbox' for='myCheckbox'>DaLabel</label>
<input id='myCheckbox' name='myCheckbox' type="checkbox">
//[...]