2011-03-18 53 views
1

我是Scala和Lift的新手,我一直在爲此工作了2個月,所以我在某些方面遇到了很多麻煩。我一直在閱讀簡單的電梯和權威指南來解除,但我試圖按下按鈕時沒有成功的方法重定向到另一個頁面。如何將電子郵件重定向到電梯的新頁面

這裏是我的代碼至今:

類BL_LOG001S {

object Log extends Logger 

var lang_id = 1//English 
var ido = IDO_LOG001 
var odo = ODO_LOG001 
var usr = new User 
var input_usr = DAO_LOGIN_USER_001.create 

def init = { 

    Log.info("INIT 1: LANG_ID: "+lang_id) 
    lang_id = usr.lang_id 
    Log.info("INIT 2: LANG_ID: "+ lang_id) 

} 

def title = { 
    Log.info("TITLE: INIT END:") 
    <h2>{odo.body("title").toLabel(lang_id)}</h2> 
    <span>{usr.login_nm.toString}</span> 
} 

def login() = { 

    <table> 
     {odo.body("organization_nm").toTableElement(lang_id)} 
     {odo.body("login_nm").toTableElement(lang_id)} 
     {odo.body("password").toTableElement(lang_id)} 
    </table> 
} 

def transaction() = { 
    <table> 
     <tr> 
      <td><LOG001_1:submit><button>Login</button></LOG001_1:submit> 
      </td> 
     </tr> 
    </table> 
} 

def display(form: NodeSeq) = { 
    <lift:BL_LOG001.execute form="post" multipart="true"> 
     {login} 
     {transaction} 
    </lift:BL_LOG001.execute> 

} 

def execute(form: NodeSeq) = { 
    doBind(form) 

} 
def checkAndLogin(): Unit = { 

     Log.info("Check: init: organization_nm = "+input_usr.organization_nm) 
     ido.body("organization_nm").setValue(input_usr.organization_nm) 
     ido.body("login_nm").setValue(input_usr.login_nm) 
     ido.body("password").setValue(input_usr.password) 
     usr.login(ido.body("organization_nm").getValue.toString, 
       ido.body("login_nm").getValue.toString, 
       ido.body("password").getValue.toString) 
     S.redirectTo("/AdminPage/ADM001") 
} 

def doBind(form: NodeSeq) = { 
    bind("LOG001_1", form, 
      "organization_nm" -> input_usr.organization_nm.toForm, 
      "login_nm" -> input_usr.login_nm.toForm, 
      "password" -> input_usr.password.toForm, 
      "submit" -> SHtml.submit("Login", checkAndLogin)) 

} 

}

的方法checkAndLogin有S.redirectTo,但它不會重定向到我需要的頁面。我需要的是捕獲組織和登錄名,並在下一頁中顯示它們。

對不起,如果我問一些愚蠢的東西。我真的很感激任何幫助。 感謝

回答

1

你嘗試過的方法RedirectTo對象的JsCmds[doc of this here]

也許它可以幫助你。

對於未來 - 對嚴格連接問題提起框架,我建議要問上Lift forum,哪裏都是電梯的專家,他們是每個電梯開發非常有幫助的,尤其是對於新手:)

好運

相關問題