You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by sj...@stradefi.com on 2006/07/07 15:01:36 UTC

refreshing..

Hello!

I am working with jsp pages. In my pages I would like to use some
selectOneMenu tags.
- the first one is a list of functions (each function is associated with one
dimension)
- the second should display the dimension associated to the selected
function

Please could you tell me what can I do to change the second selectOneMenu
when I change the selected function?


<h:selectOneMenu id="fn" style="width:150px" value="#{
jspFormEPFService.functionLabel}" >
<f:selectItems value="#{jspFormEPFService.functionsToDisplay}" />
</h:selectOneMenu>

<h:selectOneMenu id="dimStructure" style="width:150px" value="#{
jspFormEPFService.dimStructLabel}" >
<f:selectItems value="#{jspFormEPFService.dimsStructToDisplay}" />
</h:selectOneMenu> 

Thanks for your help.
Sophie


UserTransaction

Posted by sj...@stradefi.com.
Hi!

I got into troubles and got some error messages such as:

A system error happened during the operation: The transaction has already
been marked for rollback

I guess I have these problems because I did not really understand correctly
when to use or not these UserTransaction. I need to use them when I want to
read or modifiy my database mySQL? 
If I have a method calling another method which one should use
UserTransaction, both?

UserTransaction tx = null;
try{
	tx = Repository.getUserTransaction(context, true);
	tx.begin();
	...method() -> using UserTransaction?
	tx.commit();
}
catch(Exception e){
	// rollback the transaction
	try { if (tx != null) {tx.rollback();} } catch (Exception tex) {}
	logger.error("Exception method " + e.getMessage());
}

Could someone explain me how that is working exactly?
Thanks in advance
Sophie


RE: refreshing..

Posted by sj...@stradefi.com.
Thanks a lot for your answer.

Please would you mind telling me if I well understood:

-First case: 
I have this in my jsp page:

<h:selectOneMenu id="fn" style="width:150px" value="#{
jspFormEPFService.functionLabel}" onchange="submit();" >
<f:selectItems
value="#{EthicFlow_JspWizard.jspFormEPFService.functionsToDisplay}" /> 
</h:selectOneMenu>


<h:selectOneMenu id="dimStructure" style="width:150px"
value="#{jspFormEPFService.dimStructLabel}" >
<f:selectItems
value="#{EthicFlow_JspWizard.jspFormEPFService.dimsStructToDisplay}" />
</h:selectOneMenu>

But then I need to recalculate the structure in a method submit() in my
bean?

-Second case:
I added this url to my jsp page:
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j" %>
But apparently I need to add as well some filters to my web.xml:

<!-- Ajax4JSF Initial parameters -->
     <filter>
        <display-name>Ajax4jsf Filter</display-name>
        <filter-name>ajax4jsf</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
     </filter>
     <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <url-pattern>/*</url-pattern>
     </filter-mapping>
    <!-- Ajax4JSF Initial parameters -->

But that doesn’t seem to work, what do I miss?

Thanks for your help
Sophie

-----Message d'origine-----
De : holger.schimanski@bayerbbs.com [mailto:holger.schimanski@bayerbbs.com] 
Envoyé : vendredi 7 juillet 2006 15:34
À : MyFaces Discussion
Objet : Re: refreshing..

You can do that on server side by adding onchange="submit();" to
<h:selectOneMenu id="fn" ...> and in getDimsStructToDisplay() create the
proper
values for <f:selectItems value="#{jspFormEPFService.dimsStructToDisplay}"
/> in
<h:selectOneMenu id="dimStructure"... >

If you want to do that without reload of the page, use ajax4jsf instead of
onchange="submit();" with
<h:selectOneMenu id="fn" style="width:150px" value="#{
  jspFormEPFService.functionLabel}" >
    <a4j:support event="onchange" reRender="dimStructure" />
    <f:selectItems value="#{jspFormEPFService.functionsToDisplay}" />
</h:selectOneMenu>

Holger



__________ NOD32 1.1649 (20060707) Information __________

This message was checked by NOD32 antivirus system.
http://www.eset.com



Re: Cron..

Posted by Marco Mistroni <mm...@gmail.com>.
True, wrong forum :)
but i have seen that error before'
check how are you creatingyour jobs (if they have same identifier etc)
last resort, clear quartz table and start from scratch. one shot after that
will work for sure..
if hte second does not work that means that you are creating all ur jobs
whith same group and same identfier.... check ur code

hth
 marco

On 8/3/06, Dave Brondsema <da...@brondsema.net> wrote:
>
> sjarlier@stradefi.com wrote:
> > Hello!
> >
> > I am not sure sending this question on the accurate forum but I can't
> guess
>
> This is a Quartz question, so
> http://www.opensymphony.com/quartz/userForums.action would be the
> appropriate forum.
>
> --
> Dave Brondsema
> Software Developer
> Cornerstone University
>
>
>
>

Re: Cron..

Posted by Dave Brondsema <da...@brondsema.net>.
sjarlier@stradefi.com wrote:
> Hello!
> 
> I am not sure sending this question on the accurate forum but I can't guess

This is a Quartz question, so
http://www.opensymphony.com/quartz/userForums.action would be the
appropriate forum.

-- 
Dave Brondsema
Software Developer
Cornerstone University


Cron..

Posted by sj...@stradefi.com.
Hello!

I am not sure sending this question on the accurate forum but I can't guess
answer and I am into troubles. Could somebody tell me what I am doing wrong
while creating a cron in order to create a person at a certain date (for
example the 3rd of August at 17pm):

SchedulerFactory sf = new StdSchedulerFactory();
Scheduler sched = sf.getScheduler();
// define the job and tie it to our EthicFlow_CreatePersonJob class
JobDetail job = new JobDetail("EthicFlow_CreatePersonJob",
Scheduler.DEFAULT_GROUP, EthicFlow_CreatePersonJob.class);
CronTrigger trigger = new CronTrigger("trigger1", Scheduler.DEFAULT_GROUP,
"EthicFlow_CreatePersonJob", Scheduler.DEFAULT_GROUP, "0 00 17 3 8 ? 2006");
//3 aout 2006 a 11h30
sched.addJob(job, true);
sched.scheduleJob(job, trigger);
sched.start();
Thread.sleep(300L * 1000L);
sched.shutdown(true);

It fails and I get this error:
Job execution threads will use class loader of thread: http-0.0.0.0-8080-2
2006-08-03 11:06:27,875 INFO  [org.quartz.simpl.RAMJobStore] RAMJobStore
initialized.
2006-08-03 11:06:27,875 INFO  [org.quartz.impl.StdSchedulerFactory] Quartz
scheduler 'DefaultQuartzScheduler' initialized from default resource file in
Quartz package: 'quartz.properties'
2006-08-03 11:06:27,937 INFO  [org.quartz.impl.StdSchedulerFactory] Quartz
scheduler version: 1.4.5
2006-08-03 11:06:27,953 INFO
[org.alfresco.web.bean.EthicFlow_FormServices.EthicFlow_JspWizard] Exception
cron:org.quartz.ObjectAlreadyExistsException: Unable to store Job with name:
'CreatePersonJob' and group: 'DEFAULT', because one already exists with this
identification.

And I have a class EthicFlow_CreatePersonJob as follow:

public class EthicFlow_CreatePersonJob extends QuartzJobBean 
{

	private static Logger logger =
Logger.getLogger(EthicFlow_CreatePersonJob.class);
	
 	private String record;

  

  /**
   * Setter called after the CreateJob is instantiated
   * with the value from the JobDetailBean (5)
   */ 
  public void setRecord(String record) {

    this.record = record;

  }


  protected void executeInternal(JobExecutionContext ctx)

  throws JobExecutionException {

      // do the actual work
	  logger.info("Execution Job");

  }
}

What do I do wrong here?
Thanks for your help
Sophie


Re: refreshing..

Posted by ho...@bayerbbs.com.
You can do that on server side by adding onchange="submit();" to
<h:selectOneMenu id="fn" ...> and in getDimsStructToDisplay() create the proper
values for <f:selectItems value="#{jspFormEPFService.dimsStructToDisplay}" /> in
<h:selectOneMenu id="dimStructure"... >

If you want to do that without reload of the page, use ajax4jsf instead of
onchange="submit();" with
<h:selectOneMenu id="fn" style="width:150px" value="#{
  jspFormEPFService.functionLabel}" >
    <a4j:support event="onchange" reRender="dimStructure" />
    <f:selectItems value="#{jspFormEPFService.functionsToDisplay}" />
</h:selectOneMenu>

Holger