i want to use validation on multiple component.In the form there are three h:selectOneMenu components and some h:inputText components. on change of first h:selectOneMenu i need to change content of second without validating other fields.Here i have use immediate="true".
Similarly for second h:selectOneMenu components onchanging need to change content of third SelectList here to i want to skip validation for others and i used immediate=true for this component too. Problem is" immediate= true and FacesContext.getCurrentInstance().renderResponse()" work for nonImediate components only.but as there are two component with immediate=true , on changing first Select one error is shown on second SelectOne list.Do anyone have any idea about this ?
Thanks in advanced.
I am using JSF 1.2
On selecting first h:selectOneMenu you can use value change listener in which you can do your stuff in the bean and can change the content of the second h:selectOneMenu.You need to re render this component. This way your immediate="true" part will be eliminated from the
So now you can put just one immediate="true" in the page and you can do your valdiation only on one field.
If re rendering and value change listener is not what you want to use, then you can put the first immediate="true" component inside the first form and second immediate="true" inside another form.
This way since both the forms are different your validation in both the cases will run only when that particular form is submitted or processed.
Related
I want to generate report for my diagram, I've created a simple template:
I want to have only activity task elements listed in my report table, without events, pools and other fields.
I have tried to set elements as non-printable, I was using "Hide annonymous elements" flag, and changed this field in element details, and also I was using Exclude filters. I don't know what is going on but at the end my generated report contains either all elements or none. Is there any magic flag or something? No matter what I change, at the end it does'nt matter, because report is always the same....
You can set a filter in the properties of your template to include only Activity elements
This definitely works as I use that all the time, so if something goes wrong with this there must be something else playing.
I need to add the send button twice to my form build using Orbeon Form builder; the first one should display 'Submit' and the other one should display 'Print and Submit'. But I see that the first label is getting replaced by the last one. Can some one please tell me how to add two different labels for the same button when when adding it twice to the form. This for a requirement where the form need to have two buttons. First one should submit the form to a rest service( I am using send button for this) and the second one should print and submit the form to rest service. Please help.Thank you.
As you have found out, you cannot put the same button twice. They have to be different buttons, which means that they have a different name. If a button is called send then the other one must have another name like send-and-print.
So create one button called send, the other one must be called something else. So you simply create a new button following Button and processes.
The open-rendered-format action is new in Orbeon Forms 2017.1. You don't say which version you are using though.
I would also properly format the process so that you can easily take out and add parts, and see which part(s) fail:
<property as="xs:string" name="oxf.fr.detail.process.send-and-print.*.*">
require-uploads
then require-valid
then save
then open-rendered-format(format = "pdf")
then save-final
then send(uri="http://192.168.25.18:8080/RestService/rest/xml", content="xml", replace="instance") then
navigate("http://192.168.25.18:8080/email-sent-virgin-ausi.html")
recover navigate("http://192.168.25.18:8080/email-fail-virgin-ausi.html")
</property>
I'm new to Adobe DTM so please be gentle with me! What I'm trying to do is to have a Data element hold the value of the ID of a clicked button of class "b1".
<button type="button" class="b1" id="value 1">button 1</button>
<button type="button" class="b1" id="value 2">button 2</button>
How should my Data Element be set-up since I don't want any initial value in it?
How do I structure the Event rule to capture the value of the clicked button?
I do know that I have to set the tag/selector to .b1 with event type of "click" in the condition but how do I source the "ID" value of the clicked button and assign to the Data Element.
Thanks,
Bill
Example...
Create an Event Based Rule, name it whatever you want.
Within Conditions, for the Event Type select "click".
For Element Tag or Selector put "button.b1" (no quotes). This is basically the equivalent of a css (or e.g. jQuery) selector you'd use for targeting button elements that have class "b1".
Note: You may or may not need to checkmark the Apply event handler directly to element option, depending on how your site is setup and what all is already hooked to the elements.
Now, under Rule Conditions Criteria, choose "Data > Custom" and click the "Add Criteria" button, which will then show a Custom codebox section.
Within that codebox, enter the following:
var id=this.id||'';
_satellite.setVar('b1_button_id',id);
return true;
So the way this works is that within a condition, this should be a reference to the button that was clicked. So we use that, along with DTM's _satellite.setVar() method to set a data element called "b1_button_id" to the value of the button's id attribute. Then we return true to ensure that the condition is always true, so that this condition will not prevent the rule from triggering.
From there, in any of the sections of the rule, you can reference the data element with either %b1_button_id% syntax (like in one of the form fields for setting a var through DTM) or you can use _satellite.getVar('b1_button_id') within any of the custom code blocks in the rule.
Note: data elements created on-the-fly with the .setVar() method only persist for the duration/scope of the rule being evaluated. DTM does not have an officially documented way of creating or updating persistent data elements or setting any other features that you have available from the actual Rules > Data Elements section, but there are some workarounds depending on what you want to do.
Another Note: You didn't specifically mention a need for this, but since it may be a next step that might come up.. as mentioned, within the context of a condition, this is a reference to the element for the event (in this case, the "click" event). If for some reason you need to reference this within a codebox in the Javascript / Third Pary Tags section, be aware that this will remain in context if you do NOT check the Execute Globally option, but if you DO check that option, then this will no longer be a reference to the event element.
If you need a reference to this AND you need the code to be executed globally, then you can create a data element following the instructions above, except just use this as the value, e.g.
_satellite.setVar("this_reference",this)
Then, within the codeblock you can use _satellite.getVar("this_reference") to get it.
I'm very new to Seam and am just getting used to the different components available. I'm wondering which one I should use for this situation.
The answer to this question explains the difference between <h:outputLink> and <h:commandLink>, that <h:outputLink> produces just a basic HTML link tag with GET request and <h:commandLink> submits a POST via a click event.
I just want to attach a simple jQuery click event to a link. I don't want the link to redirect to anywhere or submit a form. I basically want the equivalent of href="#" (I understand that commandLink generates href="#" but it seems heavy-handed for a simple link with no form submission). But <h:outputLink> implicitly adds an href value unless I put value="#" (which seems hacky).
What component do I want to use here? I seem to be missing some very basic element.
(First: <h:outputLink> and <h:commandLink> are standard JSF components, not part of the Seam framework.) In this case, you can just use the standard HTML tag <a>, because you appear not to be using anything special to JSF.
I have a form that is written in MXML that allows a user to create/add a User.
I need to add a form that allows a user to modify SOME but NOT ALL of the fields for this user.
The forms are so similar, I don't want to have to create two separate forms, one for Add and one for Modify.
For example, in the Add form, the user specifies a user id. In the Modify form, the "user id" field is not editable.
I'm wondering how I can initialize the MXML form (i.e. pass in a parameter?) so that it knows whether it is in the Add state or the Modif state.
I know I can't do the following but this is what I would like to do (pseudocode):
if (ADD_FORM) {
mx:TextInput id="txtUserID"
}
else {
mx:Label id="lblUserID"
}
This kind of thing is handled well with states. In Flex 3 you define your states like view, add, and edit. Then you can add the components that are common to all states to the document. Within each state declaration, you can then add the components that are specific to only some states. You can have the edit state dependent on add state since edit is add plus a few more fields.
In Flex 4 this is even easier. You declare your states, and then inline in the single document have all content for all states, with includeIn attributes for which states each element should be included in (or excludeIn).